# [Image processing] normalization and subtracting background noise

19 views (last 30 days)
cristalline1308 on 12 Nov 2016
Answered: Image Analyst on 13 Nov 2016
Hi!
I am trying to normalize two images. Image A is less brighter than Image B.(A:B=0.9:1).
I'd like to correct the intensities of two to be the same,
and then i'd like to control the max and min value of the intensity to subtract the background noise.
So far, I have written the script as below, and I'm having some troubles to do so.
----------------------------------------------------
highthreshold=;
lowthreshold=;
ma1=max(max(imageA));
ma2=max(max(imageB));
me1=median(median(imageA));
me2=median(median(imageB));
ca1=(imageA>me1*lowthreshold).*(imageA<ma1*highthreshold);
ca2=(imageB>me2*lowthreshold).*(imageB<ma2*highthreshold);
Correct=mean(mean(imageA(ca1.*ca2==1)))/mean(mean(imageB(ca1.*ca2==1)));
image_Corr=imageB*Correct;
-------------------------------------
Thanks.

Changoleon on 13 Nov 2016
Hi. I assume you're images are grayscale. How about you try this:
upperlim = 200; % define the maximum intensity
lowerlim = 100; % define the minimum intensity
m = (255-0)/(upperlim-lowerlim); % define the slope of the transfer function
b = 0 - (m*lowerlim); % define the y-intercept of transfer function
B1 = (m*A1)+b; % new image B2 = (m*A2)+b; % new image
You can play with upper and lower limits to find the ideal version of your images.
Sina

Image Analyst on 13 Nov 2016
Try imhistmatch() or mat2gray().