img = imread("image.jpeg");
ind = all(img,3); % RGB方向にANDをとる(黒は0、黒以外は1)
R = img(:,:,1);
G = img(:,:,2);
B = img(:,:,3);
tiledlayout(3,1)
nexttile
histogram(R(ind))
nexttile
histogram(G(ind))
nexttile
histogram(B(ind))
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!