Escolar Documentos
Profissional Documentos
Cultura Documentos
grayImage2=rgb2gray(im2);
figure, subplot(1, 2, 1);
imshow(grayImage2, []);
title('Original Grayscale Image');
set(gcf, 'Position', get(0,'Screensize')); % Enlarge figure to full
%screen.
% Let's get its histogram.
[pixelCount2 grayLevels2] = imhist(grayImage2);
subplot(1, 2, 2);
bar(pixelCount2);
title('Histogram of original image');
xlim([0 grayLevels2(end)]); % Scale x axis manually.
yRange2 = ylim;
% Calculate the mean gray level
meanGL2 = sum(pixelCount2 .* grayLevels2) / sum(pixelCount2)
%% Calculating standard deviation
st_d1=std(double(im1));
st_d2=std(double(im2));
%% Calculating Skewness
sk1=skewness(double(im1));
sk2=skewness(double(im2));
%% Calculating RMS
rms1=rms(im1);
rms2=rms(im2);
%% Calculating median absolute
md1=mad(double(im1));
md2=mad(double(im2));
%% Contruct a feature vector
fv1=[ meanGL, st_d1, sk1, rms1, md1 ]
But it seems like I have not created feature vectors correctly because of reasons:
1. dimensions of meanGL, st_d1, sk1, rms1 and md1 are different. 2. after evaluating above code in MATLAB editor, I am getting error
But it
2 Comments
Walter Roberson on 7 Oct 2013
http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup
Also, When you put a breakpoint in at the line and run the program, what is size() of each of those variables ?
Image Analyst on 7 Oct 2013
Complete duplicate of http://www.mathworks.com/matlabcentral/answers/89252#comment_172673
Comment on this Question