What is the fastest way of ignoring MSER responses within a mask ?
3 visualizzazioni (ultimi 30 giorni)
For a given image IM, the MSER regions can be obtained by using detectMSERFeatures function. Now Suppose, there is a masked region in IM, and I would like to ignore all those MSER regions whose elliptical supports intersect with that masked region. Suppose I have a mask M of that region.
My question is : What is the fastest way to ignore all such MSER regions whose elliptical supports intersect with M(M>0) ?
My attempt : My attempt has been very basic but I could not think of a faster way.
I iterate through all MSER regions in the MSERregions object and for each object, I construct its elliptical mask and check if that mask overlaps with M(M>0). If it does, I reject that MSER region.
It is a very inefficient method because, if 2000 MSER regions are detected in a single image (with many of them having concentric elliptical supports), I end up doing iteration over all the regions, creating their corresponding elliptical masks, and doing intersect operation with M(M>0).
My apprehension : Suppose instead of checking intersection through elliptical masks, I simply check using PixelList field of each MSER region. But I am not sure if that is the right approach, since I am suspecting that it might happen that PixelList field does not overlap with M(M>0), but the corresponding ellipse (with the same second order moments as the PixelList members does. However I did not find any mathematical work which could justify or reject this apprehension.
Could anyone tell me of a better way ?