OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Fri, 03 Apr 2015 01:26:13 -0500What mathematically is back projection?http://answers.opencv.org/question/59021/what-mathematically-is-back-projection/I'm able to use openCV backprojection and I'm also able to implement it myself. However, I don't really understand why it works.
On the obvious side it is just building up a histogram of a target image, creating a probability distribution with it and then applying that pdf to a new image. I believe this is done in the hope that the new back projected image will only show the target information with high probability in the backprojected image.
However, in the docs page ([http://docs.opencv.org/doc/tutorials/imgproc/histograms/back_projection/back_projection.html]) it says:
"In terms of statistics, the values stored in BackProjection represent the probability that a pixel in Test Image belongs to a skin area, based on the model histogram that we use."
I'm really struggling to interpret this and in particular the "represent the probability". There must be some formula that specifies it like:
prob("Pixel is from test image" | "New image pixel") = ?????
I just can't get my head around it though. Does anybody have any links or a good explanation of what the terms in the equation are?
Many thanksThu, 02 Apr 2015 13:42:04 -0500http://answers.opencv.org/question/59021/what-mathematically-is-back-projection/Answer by FooBar for <p>I'm able to use openCV backprojection and I'm also able to implement it myself. However, I don't really understand why it works.</p>
<p>On the obvious side it is just building up a histogram of a target image, creating a probability distribution with it and then applying that pdf to a new image. I believe this is done in the hope that the new back projected image will only show the target information with high probability in the backprojected image.</p>
<p>However, in the docs page ([<a href="http://docs.opencv.org/doc/tutorials/imgproc/histograms/back_projection/back_projection.html">http://docs.opencv.org/doc/tutorials/...</a>]) it says:</p>
<p>"In terms of statistics, the values stored in BackProjection represent the probability that a pixel in Test Image belongs to a skin area, based on the model histogram that we use."</p>
<p>I'm really struggling to interpret this and in particular the "represent the probability". There must be some formula that specifies it like:</p>
<p>prob("Pixel is from test image" | "New image pixel") = ?????</p>
<p>I just can't get my head around it though. Does anybody have any links or a good explanation of what the terms in the equation are?</p>
<p>Many thanks</p>
http://answers.opencv.org/question/59021/what-mathematically-is-back-projection/?answer=59044#post-id-59044I think the model histogram can be interpreted as a look up table of the distribution prob("pixel with color h,s shows skin") (if you normalize the histogram). Using this look up table allows you to have arbitrarily shaped distributions. In the case of skin colour, you probably could also fit a gaussian to the model histogram (using the number of pixels that fall into one hs-bin as weight) and then use this to compute the skin-probability. Fri, 03 Apr 2015 01:26:13 -0500http://answers.opencv.org/question/59021/what-mathematically-is-back-projection/?answer=59044#post-id-59044