is it possible to convert binary image to rgb image or i want to replace all pixel values 0 by some red or green color in new image?

3 Ansichten (letzte 30 Tage)
is it possible to convert binary image to rgb image or i want to replace all pixel values 0 by some red or green color in new image using matlab code?

Akzeptierte Antwort

Christoph
Christoph am 20 Jul. 2011
How about
image=repmat(double(image),[1,1,3]);
this way you have a matrix with 3 dimensions. image(:,:,1)is the red channel, image(:,:,2) the green one and image(:,:,3) is blue. Now you could set the channels according to your needs.
Hope this helps
  4 Kommentare
Jan
Jan am 20 Jul. 2011
@Somasekar: Please post the complete error message. It seems like all important information is missing.
Christoph
Christoph am 20 Jul. 2011
@Somasekar: Also it would be nice if you wouldn't post multiple questions with the same or nearly the same content. Thanks

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by