[Image processing] normalization and subtracting background noise

5 次查看(过去 30 天)
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.
I appreciate your help!
----------------------------------------------------
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.

回答(2 个)

Changoleon
Changoleon 2016-11-13
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
A1 = double(imread('')); %read first image
B2 = double(imread('')); %read second image
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
Image Analyst 2016-11-13
Try imhistmatch() or mat2gray().

类别

Help CenterFile Exchange 中查找有关 Modify Image Colors 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by