opencv / opencv_contrib

Repository for OpenCV's extra modules
Apache License 2.0
9.33k stars 5.75k forks source link

[ximgproc] SLIC superpixels: contour mask contains {-1,1} instead of {-1,0} #481

Closed netw0rkf10w closed 8 years ago

netw0rkf10w commented 8 years ago

The mask returned by getLabelContourMask() contains -1 at the segmentation contours and 1 elsewhere, which is not a valid mask. A valid mask should contains 'a' (where a != 0) at the contours and 0 elsewhere (e.g. in the case of SEEDS: a = 255).

cbalint13 commented 8 years ago

Thanks a lot @ehku !

PR https://github.com/Itseez/opencv_contrib/pull/483 is ongoing to address the issue. I made SLIC & LSC masks just like SEEDS one. Also matrix should be CV_8UC1 type.

netw0rkf10w commented 8 years ago

Thanks, @cbalint13 !!

cbalint13 commented 8 years ago

@ehku ,

Revisitied the patch. Matrix should be 8UC1, so i corrected seeds.cpp too. See here the reason: