j**u 发帖数: 6059 | 1 【 以下文字转载自 Computation 讨论区 】
发信人: jzxu (自然), 信区: Computation
标 题: 问个matlab问题,50伪币酬谢
发信站: BBS 未名空间站 (Fri Mar 14 22:53:28 2008), 转信
有一个二位矩阵,用imagesc和colormap(jet)可以显示一个彩色的图像IM1,如果选择c
olormap(gray)就生成黑白图像IM2。现在想只在一个选的区域里面(ROI)里面保留IM1
,其他的区域里面都是IM2,请问如果在matlab里面做到? | b*****e 发帖数: 1193 | | j**u 发帖数: 6059 | 3 I have one idea that generates a pseudo-gray image to a show gray-scale
image.
I only know how to highlight a ROI with a solid color. For example,
ROI is a logic matrix consisting 0's and 1's
im_r = im.*ROI.*3 ; % 3 can be any number much larger than 1
im_rgb = cat(3, im_r, im, im) ;
imagesc(im_rgb) % this will show a pseudo-gray scale image with ROI highligh
ted with red color
Now my question is how to pot ROI just like using a colormap(jet), not a sol
id color shown above.
【在 b*****e 的大作中提到】 : 你的问题我在computation答完了
| j**u 发帖数: 6059 | 4 My question can be expressed in another way. When imagesc(im) is used, a 3D
rgb matrix may be generated to plot a color image. How to get this 3D matrix
? I was thinking of setting up a color mapping table to generate it by mysel
f, but it is tedious. Is there any easier way?
highligh
sol
【在 j**u 的大作中提到】 : I have one idea that generates a pseudo-gray image to a show gray-scale : image. : I only know how to highlight a ROI with a solid color. For example, : ROI is a logic matrix consisting 0's and 1's : im_r = im.*ROI.*3 ; % 3 can be any number much larger than 1 : im_rgb = cat(3, im_r, im, im) ; : imagesc(im_rgb) % this will show a pseudo-gray scale image with ROI highligh : ted with red color : Now my question is how to pot ROI just like using a colormap(jet), not a sol : id color shown above.
|
|