piximi / annotator

https://piximi.github.io/annotator/
4 stars 2 forks source link

Show a contour mask so that the difference instances are shown #239

Closed alicelucas closed 3 years ago

alicelucas commented 3 years ago

@DavidStirling brought up that it will not be difficult to obtain a contour mask that can be displayed on top of the instance. This will be helpful to visually discriminate between the different instances. To be clear -- we are not talking about the coordinates of the contour (which we found can be costly), but a mask where contour is 1 and the rest is 0.

DavidStirling commented 3 years ago

Just to outline this. We take the image mask, binary erode by 1 then subtract the result from the original mask. We could then display this on top as a semi-transparent image to give a bit of a 'glow' at the borders of each object.

Alternatively we might be able to build this into the mask itself, seeing as the displayed overlay is just an image. In which case we'd just recolour the border pixels before display.

alicelucas commented 3 years ago

This is so great, thank you @DavidStirling ! This is indeed a much more efficient way to get the contours.