How to convert binary image into rgb image using matlab code?

조회 수: 4 (최근 30일)
somasekar jalari
somasekar jalari 2011년 7월 20일
hai i m doing academic project in that i want to convert binary image to rgb image. please help me how to write matlab code for this work
waiting for your reply.
thanks in advance.

답변 (1개)

Jan
Jan 2011년 7월 20일
BinImg = rand(100, 100) > 0.7; % LOGICAL type
% Example 1: TRUE pixels are white, FALSE pixels are black:
RGB = double(cat(3, BinImg, BinImg, BinImg));
% Example 2: TRUE pixels are red, FALSE pixels are black:
RGB = double(BinImg);
RGB(end, end, 3) = 0;
% Example 3: TRUE pixels get green:
RGB = zeros(100, 100, 3);
RGB(:, :, 2) = BinImg;

카테고리

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