open-mmlab / labelbee-client

Out-of-the-box Annotation Toolbox
Apache License 2.0
382 stars 51 forks source link

Border pixel and its color #33

Closed waqarsqureshi closed 10 months ago

waqarsqureshi commented 2 years ago

What is the color of the border pixels and size? can we keep the border pixel color the same as the label color?

waqarsqureshi commented 2 years ago

It is quite interesting. I was looking very closely at the masking label in the Idx images saved as 32bit images. I have 4 classes, background, road, sky, and sidewalk. 1,2,3, and 4. There were some border pixels between 1 and 3 that are marked as two. It could be some kind of interpolation or what? anyhow if this is a bug it has ruined the labeling i have done.

waqarsqureshi commented 2 years ago

I further investigated the segmentation json file I see the polygon are saved as follows: {"x":720,"y":113.5} i.e. the y axis is saved in as a sub-pixel value. how is it handled while conversion to labels. Is it possible that while exporting to trainlabelIdx.png. it takes an interpolated value and that is why it took the value to 2 for border between 1 and 3 in my case. It is not noticeable unless you try to force change the label to other index values through a script and you realized that there are some border pixels that have a different label value. I think this issue needs to be addressed.

Kerwin-L commented 2 years ago

It is quite interesting. I think it's the html - canvas doing the trick. Maybe it isn't a good way to export by js. I will test for it. Thanks for your comment~

waqarsqureshi commented 2 years ago

image See the above image. Where we have a boundary between two classes of white(sky) and black (background), it interpolates some pixel of gray class (road).

Kerwin-L commented 2 years ago

image See the above image. Where we have a boundary between two classes of white(sky) and black (background), it interpolates some pixel of gray class (road).

Yeah, I get it too. I need time to solve it.

https://stackoverflow.com/questions/29371695/does-canvas-support-floating-point-numbers-when-drawing-line-or-arc

waqarsqureshi commented 2 years ago

@Kerwin-L Thank you. I tried looking into the util functions. As you said, it is the problem mentioned above. I suggest. For export, try calling a python script and convert Json to png using mmcv library function, OpenCV, PIL or ski. nodejs is new for me. 👯

Kerwin-L commented 2 years ago

Yeah, I still haven't found way to solve it by js. If you have finished coding it by Python, welcome to give us PR~