How do I compare two images?
Show older comments
Hi,
I am beginner in image analysis. I am doing my studies in physics and I have a task of comparing two images where they appear to be similar but have differences in Dose(gray) and gamma. How can I read these images in matlab and compare the results?
Please help me by guiding me on which functions that would be useful to my given task.
Thank you
Answers (3)
Matt J
on 16 May 2013
0 votes
IMREAD might be applicable, depending on the format the data is in.
Image Analyst
on 17 May 2013
If the only thing different is the dose and gamma, then you would notice that the histograms are different.
% Display the original gray scale image.
subplot(2, 2, 1);
imshow(grayImage, []);
title('Original Grayscale Image', 'FontSize', fontSize);
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
% Give a name to the title bar.
set(gcf,'name','Demo by ImageAnalyst','numbertitle','off')
% Let's compute and display the histogram.
[pixelCount, grayLevels] = imhist(grayImage);
subplot(2, 2, 2);
bar(pixelCount);
grid on;
title('Histogram of original image', 'FontSize', fontSize);
xlim([0 grayLevels(end)]); % Scale x axis manually.
Then repeat in subplots 3 and 4 for image #2. But they can be similar in lots of ways and different in lots of ways. Which ways do you care about and which do you not care about? What action or decisions would you make if you knew that the shape, or mean, of the histograms were different from each other? Anything? Or are you interested in something entirely different?
1 Comment
Image Analyst
on 17 May 2013
P.S. See my File Exchange for a few tutorials. http://www.mathworks.com/matlabcentral/answers/contributors/1343420-image-analyst/answers
prashant khati
on 6 Jul 2015
0 votes
how to compare two image in face recognization system
Categories
Find more on Contrast Adjustment in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!