how to convert the rgb componet of image in 8bit - binary value for matlab?

2 次查看(过去 30 天)
i want to convert the r,g and b componet of image in 8bit-binary format ...

回答(1 个)

Image Analyst
Image Analyst 2014-3-31
What format are they in now? Normally most RGB images are in 8 bits per channel (24 bits total) unsigned 8 bit ("uint8"). What are yours? I'm not sure what you want to convert into what. What are you starting with (a 3D RGB image, or 3 separate gray scale color channels), and what do you want to end up with (a 3D RGB image, or 3 separate gray scale color channels)?
  1 个评论
sandy sorathiya
sandy sorathiya 2014-4-1
i want to hide the text in RGB image so that 1]i take one RGB image. 2]seprate each componet of RGB in r,g and b. 3]now i want to convert each componet into 8unit binary but each componet take the value unit8 becuse my original image size is 50*50 so HOW CAN I CONVERT ALL COMPONET IN ONALY 50*50 8 UNIT?
HERE IS MY CODE clear all; close all; clc; warning('off', 'Images:initSize:adjustingMag') RGB=imread('Untitled.png'); figure(); imshow(RGB); %-------- R=RGB(:,:,1); G=RGB(:,:,2); B=RGB(:,:,3);
disp('r componet'); R=RGB
disp('G componet'); G=RGB
disp('B componet'); B=RGB
R(:,:,2)=0; R(:,:,3)=0;
B(:,:,1)=0; B(:,:,2)=0;
G(:,:,1)=0; G(:,:,3)=0;
figure(2); imshow®; figure(3); imshow(G); figure(4); imshow(B);

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by