Watershed not working like expected [closed]
Hey,
I'm using Matlab to use OpenCV functions, I succesfully used the watershed function from Matlab, but OpenCV variant is not working.
I'm using following int8 depth image:
because openCV using RGB image format, I replicated these values in a MxNx3-matrix. As marker I have an int32 matrix where I pointed every local minimum (5 in total),
By using following function
resultOpenCV= cv.watershed(rgbImage,marker);
The segmented matrix looks like this:
In Matlab using following function (even without markers)
resultMatlab= watershed(rgbImage(:,:,1));
This is the correct result:
Where am I wrong?
Thank you
please show your opencv code.
(btw, opencv uses bgr, not rgb)
I'm using https://github.com/kyamagu/mexopencv Matlab MEX functions that interface OpenCV 3.0.1 APIs
here is the matlab code: https://gist.github.com/amroamroamro/...