【问题标题】:Matlab - After dithering, RGB image can't divide into R-G-BMatlab - 抖动后,RGB图像不能分成R-G-B
【发布时间】:2014-08-01 11:30:25
【问题描述】:

我是 Matlab 新手..

我有尺寸为 512x512x3 uint8 的图像。我使用这样的“抖动”功能:

[Myimagedither, Myimagedithermap] = rgb2ind(img, 16, 'dither'); 
imwrite(Myimagedither,Myimagedithermap,'step_4_RGB_D_U_16.tiff');

之后,我使用 imread 来读取图像:

new_img = imread('step_4_RGB_D_U_16.tiff');

但是,在该尺寸更改为 512x512 unit8 之后。我需要将该图像划分为 R G B。有人可以帮我解决这个问题吗?

【问题讨论】:

    标签: matlab rgb dithering


    【解决方案1】:

    您需要单独阅读地图。像这样:

    [new_img new_img_map] = imread('step_4_RGB_D_U_16.tiff');
    

    然后使用ind2rgb()将图像转换为rgb并将颜色通道分成3个单独的图像。像这样:

    new_img_RGB = ind2rgb(new_img,new_img_map);
    g1_16 = new_img_RGB(:,:,1);
    g2_16 = new_img_RGB(:,:,2);
    g3_16 = new_img_RGB(:,:,3);
    

    【讨论】:

    • 感谢快速响应,我明白了.. 但在那之后我需要将它分成 R-G-B 像 g1_16 = new_img(:,:,1); g2_16 = new_img(:,:,2); g3_16 = new_img(:,:,3); ,那张地图呢?
    • @stranger 没问题:D
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-06-10
    • 1970-01-01
    • 2015-09-11
    • 1970-01-01
    • 2020-08-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多