I want to obtain RGB histogram from mutiple image.Find the mean histogram for each of the 3 channel,Red, Green and Blue and store in 3 different histogram.I have created some code but it only work on ONE image..How do I proceed from this?
2 views (last 30 days)
Show older comments
clc; clear all; a = imread('01_test.tif'); h = fspecial('average', 6); a = imfilter(a, h); imtool(a);
% breakpoint
r = cropped(:,:,1); g = cropped(:,:,2); b = cropped(:,:,3);
[counts1, ~] = imhist(r); [counts2, ~] = imhist(g); [counts3, ~] = imhist(b);
save('templateData', 'counts1', 'counts2', 'counts3')
1 Comment
hawkar kheder
on 23 Mar 2018
Edited: hawkar kheder
on 23 Mar 2018
Change your code as follows:
counts1 = imhist(r);
counts2 = imhist(g);
counts3 = imhist(b);
save('templateData', 'counts1', 'counts2', 'counts3')
Answers (1)
Image Analyst
on 23 Mar 2018
My attached demo plots RGB histograms for all images in a folder. Adapt as needed.
0 Comments
See Also
Categories
Find more on Histograms in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!