Difference between meanShiftFiltering and meanShiftSegmentation in OpenCV

Can anyone explain to me the difference between gpu :: meanhiftFiltering and GPU :: meanShiftSegmentation ?

The documentation doesn't really help.

Maybe this is a different question, but my goal is to extract the boundaries of the objects, if someone can help me with that, it would be great.

+3


source to share


1 answer


TL; DR

average filtration designed to reduce noise and improve image quality, it returns a "cleaner" image.
On the other hand, an average segmentation shift will segment the image in areas of approximately the same color. It returns a map of each pixel to the corresponding segment.
If you want object boundaries, you should use the average segmentation offset .


Please see the original work by Comaniciu and Meer Average Offset: A Robust Approach to Spatial Space Analysis (PAMI 2002) describing the "average offset".



"Average bias" is a numerical procedure for finding modes ("concentration points") of a distribution determined through samples. Put simpler words in the context of image processing: you can treat all of the pixels in an image as samples in RGB-XY space. The "red" area of ​​the image can be considered a "high probability" of pixels being red in the XY coordinates of that area. Thus, you can think of an image as a collection of RGB-XY samples defining the distribution in that space.
The "mean shift" procedure is designed to find areas in RGB-XY space with high probability ( "mode" = local maximum points distribution).

Why is this perspective useful? you may ask yourself. Well, consider a noisy image, the noise pulls pixels away from the source distribution modes in RGB-XY space. If you can "shift" each pixel from its current (noisy) color to propagation mode, you will probably reduce the noise.

Thus, the average filtration changes the colors of pixels to resemble the most dominant color in their vicinity.

Taking it one step further, you may be asking yourself "which mode does each pixel belong to?" Thus, if you have modes m

(in RGB-XY space), you can assign each pixel to one of these modes m

, effectively segmenting the image into segments m

. This procedure is called the mean segmentation shift .

+4


source







All Articles