How I can divide a color image in to blocks and access the RGB of each individual block?
1 次查看(过去 30 天)
显示 更早的评论
回答(2 个)
Image Analyst
2013-6-7
3 个评论
Image Analyst
2013-6-11
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Threshold
redBlobs = redChannel > 200 & greenChannel < 40 & blueChannel < 70; % or whatever.
labeledImage = bwlabel(redBlobs);
measurements = regionprops(labeledImage, 'all');
allAreas = [measurements.Area];
allPerimeters = [measurements.Perimeter];
allECD = [measurements.EquivDiameter];
allCircularities = allPerimeters.^2 ./ (4 * pi * allAreas);
yagnesh
2013-6-11
y=imread('colorimage.jpg');
R=y(:,:,1);
G=y(:,:,2);
B=y(:,:,3);
in this way you can saperate
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!