From: Alexandru on 3 Jul 2010 15:45 I need an example in Matlab code ! ...like i said , i don't use matlab for this kind of things ... The only thing i used from matlab was simulink (Automatic faculty my spaciality) !
From: ImageAnalyst on 3 Jul 2010 16:17 OK, here's some demo code, but I'm going to deny you the opportunity to learn it better by trying it yourself. You're welcome. clc; % Clear the command window. close all; % Close all figures (except those of imtool.) imtool close all; % Close all imtool figures. clear; % Erase all existing variables. workspace; % Make sure the workspace panel is showing. fontSize = 20; % Read in a standard MATLAB gray scale demo image. folder = 'C:\Program Files\MATLAB\R2010a\toolbox\images\imdemos'; baseFileName = 'cameraman.tif'; fullFileName = fullfile(folder, baseFileName); grayImage = imread(fullFileName); % Get the dimensions of the image. numberOfColorBands should be = 1. [rows columns numberOfColorBands] = size(grayImage); % Display the original gray scale image. subplot(2, 2, 1); imshow(grayImage, []); title('Original Grayscale Image', 'FontSize', fontSize); set(gcf, 'Position', get(0,'Screensize')); % Enlarge figure to full screen. % Make a second image with a black block on it. image2 = grayImage; image2(100:160, 170:230) = 0; % Display it. subplot(2, 2, 2); imshow(image2, []); title('Second Image', 'FontSize', fontSize); % Calculate difference: differenceImage = grayImage - image2; % Display it. subplot(2, 2, 3); imshow(differenceImage, []); title('Difference Image', 'FontSize', fontSize); % Threshold the difference. thresholdedImage = differenceImage > 4; % Sum up the image. sumOfAllPixels = sum(sum(thresholdedImage)); minAllowableDifference = 1000; % Choose something that works for you. if sumOfAllPixels > minAllowableDifference uiwait(msgbox('The images are different.')); else uiwait(msgbox('The images are the same.')); end
From: Alexandru on 3 Jul 2010 17:13 Thank you very much ! I will learn eventualy , but now i don't stay very well with the time ! I will take my License degree (i think that is called "bachelor") in 4 weeks! Thanks again ! have a nice day!
First
|
Prev
|
Pages: 1 2 Prev: Locating indices of more than one of the maximum values of anarray Next: R2009b and Windows 7 |