Copy histogram of an image to another
Hi all!
Here's my problem: I have two images of the same thing acquired with different illumination condition. I found that is possible to copy the histogram of a reference image to a destination image, and it's called histogram specification or histogram matching. As shown here https://studentathome.wordpress.com/2013/03/27/histogram-specification-matching/, in matlab it's pretty simple. There is a way to do the same thing on OpenCV?
EDIT
The code linked on the page link text gives me error on the lines:
do1ChnHist(chns[i], src_mask, src_hist, src_cdf);
do1ChnHist(chns1[i], dst_mask, dst_hist, dst_cdf);
it says that I can't pass a matrix (src_hist etc) because the function accepts double*.
How can I make it work with Opencv 3.1?
EDIT 2
Now it compiles and run, but i obtain as a matched image a black image. Since I need to match the histogram of the whole image, I created as mask a Mat on ones. Am I doing right? Any suggestion?