kyamagu / js-segment-annotator

Javascript image annotation tool based on image segmentation.
BSD 3-Clause "New" or "Revised" License
523 stars 159 forks source link

Allow contiguous pixels only in superpixel tool #26

Open rytido opened 7 years ago

rytido commented 7 years ago

Is there a way to prevent the superpixel tool from associating non-contiguous pixels (aside from reducing the size)? For example, the red shapes below should be kept separate instead of associated as they currently are.

image

kyamagu commented 7 years ago

@doodnayr Currently there is no algorithm is implemented to force separating connected components, though some piece of code is relevant.

Temporarily you can try a different segmentation algorithm (e.g., slico) or set different minRegionSize to mitigate the issue.

rytido commented 6 years ago

Ok, I'm using slico, thank you. For anyone that might stumble on this, it can be set in js/app/edit.js:

superpixelOptions: { method: "slico", regionSize: 25 }

Also, making shapes finer or coarser (boundary -+ buttons) does not work unless you use "FixedK" method.