matlabmatlab-cvstmser

MSER to binary image in Matlab


How to store the mser regions find out from an image as a binary image variable? I tried to get MSER regions by detectMSERFeatures function and it returns corresponding object. I could plot it, but don't know how to convert it as a binary image. I need all the regions in same binary image.


Solution

  • The MSERRegions objects that you get back from detectMSERFeatures, includes the PixelList property. It contains the coordinates of pixels that belong to the regions, and you can use them to set pixels in the binary image.