Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upimgWatershedCustomMarkers #2423
Conversation
TravisBuddy
commented
Sep 13, 2020
|
Hey @santoshrajkumar, TravisCI finished with status TravisBuddy Request Identifier: 66852cc0-f603-11ea-b8b5-77c9400cce29 |
TravisBuddy
commented
Sep 13, 2020
|
Hey @santoshrajkumar, TravisCI finished with status TravisBuddy Request Identifier: 55a0ffc0-f607-11ea-b8b5-77c9400cce29 |
TravisBuddy
commented
Sep 13, 2020
|
Hey @santoshrajkumar, TravisCI finished with status TravisBuddy Request Identifier: d7365e90-f607-11ea-b8b5-77c9400cce29 |
TravisBuddy
commented
Sep 13, 2020
Travis tests have failedHey @santoshrajkumar, TravisBuddy Request Identifier: 2a899660-f609-11ea-b8b5-77c9400cce29 |
TravisBuddy
commented
Sep 13, 2020
Travis tests have failedHey @santoshrajkumar, TravisBuddy Request Identifier: a9b022a0-f60a-11ea-b8b5-77c9400cce29 |
| """ | ||
|
|
||
|
|
||
| def create_rgb(i): |
This comment has been minimized.
This comment has been minimized.
cclauss
Sep 14, 2020
Member
Please avoid single-letter variable names especially for function parameters. They make your code look old fashioned. Please use a self-documenting name and add Python type hints for function parameters and return types.
| colors = [] | ||
| for i in range(10): | ||
| colors.append(create_rgb(i)) |
This comment has been minimized.
This comment has been minimized.
cclauss
Sep 14, 2020
Member
| colors = [] | |
| for i in range(10): | |
| colors.append(create_rgb(i)) | |
| colors = [create_rgb(i) for i in range(10)] |
A list comprehension.
| # callback function | ||
|
|
||
|
|
This comment has been minimized.
This comment has been minimized.
cclauss
Sep 14, 2020
Member
| # callback function |
The function name already tells us that this is a callback function so it only slows down the reader to have a comment that says the same thing.
| cv2.setMouseCallback("Image", mouse_callback) | ||
|
|
||
|
|
||
| while True: |
This comment has been minimized.
This comment has been minimized.
cclauss
Sep 14, 2020
Member
Please indent all code at global scope (i.e. not already in a function) under if __name__ == "__main__": so that Travis CI and pytest does not run it each time we test our code.
| segments = np.zeros(img.shape, dtype=np.uint8) | ||
|
|
||
| for color_ind in range(n_markers): | ||
| segments[marker_image_copy == (color_ind)] = colors[color_ind] |
This comment has been minimized.
This comment has been minimized.
cclauss
Sep 14, 2020
•
Member
This line confuses me. Perhaps a comment about what is going on.
Please run this code thru psf/black as discussed in CONTRIBUTING.md.
| @@ -0,0 +1,89 @@ | |||
| import cv2 | |||
This comment has been minimized.
This comment has been minimized.
cclauss
Sep 14, 2020
Member
Please add a URL to a site that discusses what watersheding and custom markers are and where/when/why we would want to use this algrithm.
This comment has been minimized.
This comment has been minimized.
santoshrajkumar
Sep 14, 2020
Author
Contributor
https://www.pyimagesearch.com/2015/11/02/watershed-opencv/
Here it is. Will include this.
|
Build log says:
This means that on line 6 img = cv2.imread('/image_data/scenery.jpg')it is unable to read the file, so |
santoshrajkumar commentedSep 13, 2020
•
edited
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.