How can i extract color from RGB image section ?
3 次查看(过去 30 天)
显示 更早的评论
I have image of color fabric, then i crop small part of that image, i need to get the rgb color of that part (not individual pixel colors, one color as a whole image part)
1 个评论
Amith Kamath
2015-12-10
Nathash: I'm afraid your question may not be clear enough for anyone to help with. Could you please elaborate on what you mean by 'one color as a whole image part'? I believe you have a three channel image with R, G and B values accessible. I don't quite understand what whole image part means.
回答(1 个)
Image Analyst
2015-12-10
It's very unclear what you want. Try to rephrase your question. Perhaps you want this
rgbImage = imcrop(); % Get a subsection of the current image in the current axes.
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
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!