cancel
Showing results for 
Search instead for 
Did you mean: 

Histogram matching

timemachine
Member

Histogram matching

hi,

i am beginner for imaq,i want to know the histogram matching algorithm can anyone guide me, i have already referred Gonzalez for histogram equalisation and Specification,i founded the Cumulative distribution for both the images want to match and reference images from the histograph and how can i proceed after that.


eagerly awaiting,
timemachine
8 REPLIES 8
nipun
NI Employee (retired)

Re: Histogram matching

Message contains a hyperlink
Hello timemachine,

Thank you for using our discussion forum. If you are just trying to compare two images for differences, the following discussion forum post describes different procedures you can follow:

Compare Images
http://forums.ni.com/ni/board/message?board.id=200&message.id=2557&requireLogin=False

If you are looking for the presence of a pattern in an image, as a part of our IMAQ Vision Development Module we offer Pattern Match VIs that can be used for this purpose. If you already have IMAQ Vision I would recommend starting of with the Vision Assistant to prototype you system. I hope this helps you out.

Nipun M
Applications Engineer
National Instruments
dnair
NI Employee (retired)

Re: Histogram matching

Message contains an attachment
timemachine,

Do the following to create a lookup table that maps pixels in the match image to a
new image whose histogram will approximately match the histogram of the reference image:

If reference cumulative distribution is denoted by cdf_r and the match cumulative
distribution is denoted by cdf_m

for i = 0 to 255
find j where cdf_r[j] >= cdf_m[i] (j ranges from 0 to 255 for 8-bit images)
lookup_table[i] = j


I've attached a simple histogram matching example that does this.
Hope the example helps.

Dinesh
timemachine
Member

Re: Histogram matching

thanks dnair,

i will try with this and reply u immdly,

with regards,
timemachine
timemachine
Member

Re: Histogram matching

hello dnair,

i have trie with your materials and i found that it has a noise in target matched image histogram(what we are finding)which is not exactly matching the histogram Matrice of Reference Image,the target matched histogram values has goes to zero after 18 intervals and some to next 15th interval and next 11th interval and also it resembles that just only data shift of target histogram,

ok,but for the reference is Bright image of object and target is dark image of same object and same size,the targetmatched image has all the following criteria and but image resembles,but for if the refernce is dark image of object and target image is bright image of same object and same size,the targetmatched image has light resmble but some noise and blurred and i have attached the picture image with this
timemachine
Member

Re: Histogram matching

Message contains no text Message contains an attachment
 
timemachine
Member

Re: Histogram matching

Message contains an attachment
hello dnair,

i have trie with your materials and i found that it has a noise in target matched image histogram(what we are finding)which is not exactly matching the histogram Matrice of Reference Image,the target matched histogram values has goes to zero after 18 intervals and some to next 15th interval and next 11th interval and also it resembles that just only data shift of target histogram,

ok,but for the reference is Bright image of object and target is dark image of same object and same size,the targetmatched image has all the following criteria and but image resembles,but for if the refernce is dark image of object and target image is bright image of same object and same size,the targetmatched image has light resmble but some noise and blurred and i have attached the picture image with this
dnair
NI Employee (retired)

Re: Histogram matching

timemachine,

You will get some rounding of errors when matching histograms.
Can you attach the your images to this posting or email them to me?

dnair
timemachine
Member

Re: Histogram matching

thank u for reply dnair,


i will send it to your mail id please send ur mail id,or my mail is manikarthi.s@rediffmail.com