how to convert 3d(512x512x3) image into 2d?
45 次查看(过去 30 天)
显示 更早的评论
i want to convert 3d to 2d image.i searched lot.but i am getting correct ans.help me
0 个评论
回答(1 个)
Star Strider
2014-12-10
It actually is 2D. Each pixel is represented by three colour channels, which is where the third dimension arises. To convert it to a 2D matrix, use the rgb2gray function.
2 个评论
Image Analyst
2014-12-10
Or extract just one of the color channels.
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
Each one of those channel images is a grayscale (monochrome) image. Which you do just depends on what you plan on doing with the 2D gray scale image.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Modify Image Colors 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!