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

조회 수: 2 (최근 30일)
sandy sorathiya
sandy sorathiya 2014년 3월 31일
댓글: sandy sorathiya 2014년 4월 1일
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