対象物のみからRGB値のヒストグラムの作成
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
yoshiki
am 28 Feb. 2024
Kommentiert: yoshiki
am 29 Feb. 2024
以下の画像において、黒い部分の影響を排除し、コインのみからRGB値のヒストグラムを作成したいです。ご教授よろしくお願いいたします。
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1630471/image.jpeg)
0 Kommentare
Akzeptierte Antwort
Atsushi Ueno
am 28 Feb. 2024
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))
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Histograms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!