【发布时间】:2021-07-10 21:48:12
【问题描述】:
亲爱的,
我想请求您的支持。我的目标是找到 RGB 图像中最亮的区域并在不使用其他工具的情况下突出显示它。请参阅下面的示例。
rgbImage = imread( 'Zoom1_WhiteImage.png' );
imshow(rgbImage);
[rows, columns, numberOfColorChannels] = size(rgbImage)
[x, y] = meshgrid(1:columns, 1:rows);
% Extract the individual red, green, and blue color channels.
% Need to cast to double or else x and y will be clipped to 255 when we concatenate them.
if numberOfColorChannels == 1
% Leave as gray scale.
% Get array listing [r, g, b, x, y]. Using (:) will turn all the 2-D arrays into column vectors.
output = [rgbImage(:), x(:), y(:)];
else
redChannel = double(rgbImage(:, :, 1));
greenChannel = double(rgbImage(:, :, 2));
blueChannel = double(rgbImage(:, :, 3));
% Get array listing [r, g, b, x, y]. Using (:) will turn all the 2-D arrays into column vectors.
output = [redChannel(:), greenChannel(:), blueChannel(:), x(:), y(:)];
end
[rows, columns] = find(rgbImage == 155);
imshow(rgbImage);
hold on
不幸的是,我正在为如何继续绘制应该覆盖灰色图像的点而苦苦挣扎。
请您帮我完成代码好吗?
【问题讨论】:
标签: matlab image-processing rgb grayscale roi