Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1 pixel border around the color_mask #40

Closed
d4n1elchen opened this issue Jul 3, 2019 · 2 comments · Fixed by #53
Closed

1 pixel border around the color_mask #40

d4n1elchen opened this issue Jul 3, 2019 · 2 comments · Fixed by #53

Comments

@d4n1elchen
Copy link

d4n1elchen commented Jul 3, 2019

Hi, I'm using v1.3.2 to annotate the images for a segmentation problem.

An example of my raw image:

The corresponding labeled image by this tool:

There're only two labels: foreground (white) and background (red)

Thanks to the watershed algorithm, I can do the manual labeling quickly. However, the saved result contains an unexpected border around the color_mask with 1-pixel width. If you put the color_mask on a dark background, you will notice the border:

The same problem is shown in the watershed_mask file. This somehow affects the performance of my model. I don't want the border.

Is this designed feature or just a bug? I didn't enable "keep border provide by watershed".

@cusps
Copy link

cusps commented Feb 23, 2020

I am having the same issue, I do not think it should be a feature. The reason your model is likely not performing well with it is it sees the white boundary as an object id (if you don't already have one being white) or sees it as part of another object mask. For example, in your last picture, it is likely combining the object you masked and the boundary, and training on that. This is a very irritating bug.

@cusps
Copy link

cusps commented Feb 23, 2020

Here is a quick solution in python if you need it:

# I am using numpy here FYI, and make sure your mask is converted to greyscale already.

def get_rid_of_white_boundary(mask):
    mask[0] = 0
    mask[-1] = 0
    mask[:, 0] = 0
    mask[:, -1] = 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants