Question

Why is that whenever I try to use detectSURFFeatures(img) with a binary image in matlab gives me proper points but whenever I use detectMSERFeatures(img) with the same binary image
gives me error instead of pointing some valid regions?

ERROR:

Error using detectMSERFeatures
Expected input number 1, I, to be one of these types:

uint8, int16, uint16, single, double
Instead its type was logical.

Error in detectMSERFeatures>parseInputs (line 75)
validateattributes(I,{'uint8', 'int16', 'uint16', ...

Error in detectMSERFeatures (line 64)
[Iu8, params] = parseInputs(I,varargin{:});
Was it helpful?

Solution

Try this: make image 2 double first by using img=im2double(img); then feed it to MSER detectMSERFeatures(img)

OTHER TIPS

detectMSERFeatures does not accept logical inputs, as stated in the documentation and in the error you are receiving. detectSURFFeatures does. I don't know if there's a specific reason why, as I'm not familiar with the limitations of the different algorithms.

You could simply convert your binary image to one of the types listed, and run MSER on it: detectMSERFeatures(double(img));

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top