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

Illustration
radha - 2022-08-30T09:36:56+00:00
Question: How can I create a .mat file in which I store the colour images and the corresponding histograms?

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?    

Expert Answer

Profile picture of Kshitij Singh Kshitij Singh answered . 2025-11-20

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];
endM

do for all images, then save output (or whatever you want to call it) to a mat file

save(matFullFileName, 'output');

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!