Convert to the histogram, but the histogram values ​​can be saved?

Hi, everyone. I want to convert to the histogram, but the histogram values can be saved to data_l l. can you help me?
data = guidata(gcbo);
for i = 1:5
citra3{i} = imread(['D:\,,TA,,\Skripsi Saya\Minggu, 6 Mei 2012\Tugas_Akhir1\Pelatihan\temulawak\' num2str(i) '.jpg']);
graylawak{i}=rgb2gray(citra3{i});
citra3{i} = imresize(graylawak{i}, [20 15]);
Qlawak{i} = reshape(citra3{i}, [300 1]);
Q3{i} = Qlawak{i} - mean(Qlawak{i})
end
V{i} = reshape(Q3{i}, [300 1]);
l = ([V{1} V{2} V{3} V{4} V{5}])
save data_l l;
save(fullfile(pwd, 'data_l l'));
guidata(hObject,handles);
Thanks for reading.

5 Comments

Convert what to a histogram? And with which bin edges?
"Cannot be saved" is a vague description of the problem. Please explain, what exactly happens and how this differs from your expectations. While this forum is good for solving problems, it is bad for guessing them.
of this code:
data = guidata(gcbo);
for i = 1:5
citra3{i} = imread(['D:\,,TA,,\Skripsi Saya\Minggu, 6 Mei 2012\Tugas_Akhir1\Pelatihan\temulawak\' num2str(i) '.jpg']);
graylawak{i}=rgb2gray(citra3{i});
citra3{i} = imresize(graylawak{i}, [20 15]);
I have made a mistake in the previous code. what I mean is, how do I make the image histogram, while the image is composed of 5 images (imagery training) would I calculate the distance functions method. extraction feature that I use is the extraction of characteristics using a histogram. so that the distance function method can be calculated based on the histogram. Can you assist me in determining the histogram in matlab GUI code?
thank you,
What is "the distance functions method"?
to calculate the degree of similarity

Sign in to comment.

 Accepted Answer

Change:
save(fullfile(pwd, 'data_l l'));
to:
save(fullfile(pwd, 'data_l'), 'l');

3 Comments

Thank you sir, you mean function is to store data "l" I've done before. but i found a problem that should be made into the image histogram shape (but not in the form of plot) to get the value histogram which will then be used for counting the distance function method (using a histogram). Can you help me in finding value in the image histogram? thank you sir.
I do not understand the question. Could you please rephrase it?
find the value of the histogram image, then save it in the "data_l l". histogram is used to compute the image similarity.

Sign in to comment.

More Answers (1)

I don't know what all that resizing and reshaping is for. If you want the histogram just use imhist():
% Let's compute and display the histogram.
[pixelCount grayLevels] = imhist(grayImage);
bar(pixelCount);
grid on;
title('Histogram of original image', 'FontSize', fontSize);
xlim([0 grayLevels(end)]); % Scale x axis manually.
Then if you want to save it, use save() or fprintf().

Community Treasure Hunt

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

Start Hunting!