How can I create a .mat file in which I store the colour images and the corresponding histograms?

조회 수: 4 (최근 30일)
I want to create the .mat file in which I need to store the Colour images and corresponding each colour image I need to store 4 histograms in row form. Can any one help me with code how to store color image and corresponding histogram in row form?

채택된 답변

Image Analyst
Image Analyst 2014년 3월 5일
Make a 2D array of 1024 column by 50 rows
output = zeros(totalNumberOfImages, 1024); % Initialize
for imageNumber = 1 : totalNumberOfImages
% Compute the 4 histograms...
% Now save them
output(imageNumber, :) = [count1, count2, count3, count4];
end
do for all images, then save output (or whatever you want to call it) to a mat file
save(matFullFileName, 'output');
  댓글 수: 57
Image Analyst
Image Analyst 2014년 3월 11일
In out(i,:)=[1 2 3 4]; the right hand side needs to be 1024 elements long, not 4. If you have 4 histograms of 256 elements each, then it will be 1024 elements long.
radha
radha 2014년 3월 11일
Exactly I had not changed that 1024 that is why I was getting error. Because my histograms has only 59 values. So not getting done my .matfile.
Now it's working fine.
Sir I am bit late to share my happiness because I was running my entire project.
It is good news for me that I have completed my project. I am very happy.
I don't know how much to say thanks to you. Without your help of my project would not be completed within deadline.
Sorry I disturbed you lot....
But Thanks a Lottttttttttt Image Analyst!!!!!!!!!!!!!!
Now I am developing GUI.
Thanks again....
You played very important role for my project. I never forget your help. Because only this .matfile work was left and you helped me to do that.
Again Thanks a Loootttt!!!!!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Read and Write Image Data from Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by