07-20-2013 05:39 PM
Hi,
Can anyone please provide me a source code for histrogram matching.
Thank you
07-24-2013 03:08 AM
Hello john1188,
the code i am attaching uses four different metrics to perform histogram matching. It is based on openCV and called as a DLL in labview. You would need to install openCV (i have 2.4.5 version).
I hope it helps you.
Best regards,
K
07-24-2013 05:59 PM - edited 07-24-2013 06:01 PM
The OpenCV solution is a good one, but may be more complex than you need for a simple greyscale image. It is pretty simple to write your own:
1) Compute the cumulative histogram H0 (or histogram integral) of the histogram that you want to use and normalise
2) Compute the cumulative histogram H1 of the image you want to match
3) For each value in H1, threshold H0 to find the matching index
4) Compute new image values from the matching indices
You could of course compute the histogram of a second image if that's what you want to match to. I've used this technique to "equalize" the histograms of a large number of images to the mean cumulative histogram of all of the images.
07-25-2013 04:15 AM
Hi Klemen,
i am using only 2011 version,can you convert it to lower version from 2012.
and also whether it works for color image histogram matching.
Thank you
07-25-2013 04:17 AM
Hi,
I am using 2011 version,can you please convert it into lower version from 2012.
and also whether it works for color image histogram matching?. if not can you provide me for color image histogram matching.
Thank you
07-25-2013 07:59 AM
Hello,
please see the attachment, saved for lv2011.
The input is indeed a color image.
Best regards,
K
07-31-2013 01:44 AM
Hello,
please use the attached DLL and labview vi, since i have made some mistakes in the previous code. This code should now be ok!
Sorry for the inconvenience.
Best regards,
K
08-03-2013 09:22 AM
Hi Klemen,
Things which you have given works fine.
What i want is, in the ouput image there must be overlay(higlight) the identical objects when comparing the given input images(similar input image in both the base image and test image) using histogram intersection method.can you help in creating the source for this.
Thank you
08-06-2013 10:24 AM
08-07-2013 07:32 AM
Hi Klemen,
Histogram matching
Many similarity measures between two histograms, such as
the quadratic distance, Chi-square distance and histogram
intersection can be used [1]. In the experiments, we used
histogram intersection due to its computational
inexpensiveness. The histogram intersection between two
histograms can be calculated as follows:
where H 1 and H2 represent two histograms and K is the
number of bins in the histogram.
During this coarse target object detection step, a small
number of target object candidates with high histogram
matching scores were generated. These target object candidates
represent the input of the precise target object detection step.