Hello,
I have 20 images in a directory. I want to plot histogram for each image in a for loop and then store the histogram (each in a seperate figure) in a folder. This is the code that I wrote but it does not generate histogram.Could you guide me how to do that?
Thanks
srcFile = dir('./Registered_to_1_Metastatic8 copy 2/*.jpg');for k = 1 :length(srcFile) nextFilename = strcat('./Registered_to_1_Metastatic8 copy 2/',srcFile(k).name); next_An_Img = imread(nextFilename); An_gray_Img = rgb2gray(next_An_Img); figure imshow(An_gray_Img ) figure h = imhist(An_gray_Img ); imwrite(h,['histo' num2str(k) '.jpg'],'jpg');end
Best Answer