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?

2 次查看(过去 30 天)
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?

采纳的回答

Christoph
Christoph 2011-7-20
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 个评论
Christoph
Christoph 2011-7-20
@Somasekar: Also it would be nice if you wouldn't post multiple questions with the same or nearly the same content. Thanks

请先登录,再进行评论。

更多回答(0 个)

类别

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