First time here? Check out the FAQ!
answered 2015-08-09 06:24:42 -0600
There is a nice tutorial that covers that problem:
http://docs.opencv.org/doc/tutorials/imgproc/histograms/back_projection/back_projection.html