T
T
Timebird2018-05-04 05:39:20
Image processing
Timebird, 2018-05-04 05:39:20

What is the essence of the Back Projection method?

I don't understand what the BackProjection method does.
Reading the OpenCV documentation: back projection - is a way of recording how well the pixels of a given image fit the distribution of pixels in a histogram model.
It is understood that the pixels of a given image are mapped to a distribution in a histogram. But what kind of histogram are we talking about?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Skusnov, 2018-05-04
@Timebird

Briefly read (not parsing thoroughly). Here's what I think: select areas with the desired color. (there is an example of a football player, a rectangle with green grass is selected, as a result all green areas are selected).
It is solved as follows: we pass from the RGB model to HSV. In the first model, the intensity depends on three parameters, so it is difficult to build a two-dimensional picture. Often RGB is converted to gray levels. In HSV, it was possible to take one "hue" coordinate (hue), but for a two-dimensional picture, saturation (saturation) was added.
In Matlab there is an example of the RGB -> Lab transition, where the color is two coordinates (a, b).

M
medleonid, 2020-07-17
@medleonid

Task: to find areas in the studied drawing that are similar in color to the reference drawing.
Quite simplifying: we choose one color and select those areas in the studied figure that are similar to the selected color. Histogram backprojection does exactly that, but takes not just one color, but a set of characteristic colors from the reference image.
Now about the algorithm itself, based on the documentation .
1. We build a histogram of colors in the reference picture (i.e. remember how often each color occurs).
2. Next, for each point in the studied figure, we answer the question: how likely is it that its color is from the reference pattern (based on the histogram from paragraph 1)
3. Smooth the resulting similarity pattern and select the most similar areas according to a certain threshold.
As a result, we get a "mask", the size of the studied image, where 0 means that this area is not similar to the reference, and 1, which is similar.
From the description of the algorithm, it turns out that the structure of the reference pattern is not used at all. You can shuffle all the pixels - this will not affect the result in any way (because the color histogram will be exactly the same). Also, if all colors are uniformly found in the reference pattern, then in any studied pattern, all points will fit such a reference. It makes sense to use histogram backprojection when you have an object of some color that stands out and you want to find it in the picture.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question