I\'m trying to use the Mean Shift Function from OpenCV inside a program called Processing, which is a language based on Java. So far, I know that the function requires two m
The problem is that you are using rows where the columns should be and columns where the rows should be. Check the Mat documentation for more information.
so, whenever you have this:
new Mat( width, height, CvType.CV_8UC3);
invert the order
new Mat( height, width, CvType.CV_8UC3);
Also, I notice that you have a 4 channel images (ARGB) and the toMat function also have 4 channels, but you create a Mat with only 3 CV_8UC3
, you should use 4 CV_8UC4
(not sure in java), and beware, normally opencv uses is BGRA
!! so you may need to mix the channels correctly.
I hope this helps you