From: uny gg on 3 Feb 2010 15:14 Hello, I have an image to see using imagesc function. However, since many of my images has different background color, I tried to put as a same background color such as gray or black. When I look at the scale bar, it shows that lowest value appears as dark blue, the highest value appears as dark red. However, I would like to put the background color with the one not in the scale bar (e.g. black, gray, white.. etc). Does anyone know how to do it? Please help me.
From: Alan B on 3 Feb 2010 15:32 "uny gg" <illinois.ks(a)gmail.com> wrote in message <hkcleu$gk9$1(a)fred.mathworks.com>... > Hello, > > I have an image to see using imagesc function. > However, since many of my images has different background color, I tried to put as a same background color such as gray or black. > > When I look at the scale bar, it shows that lowest value appears as dark blue, the highest value appears as dark red. However, I would like to put the background color with the one not in the scale bar (e.g. black, gray, white.. etc). > > Does anyone know how to do it? > Please help me. This code will add a single new black entry to the "bottom" of the current figure's colormap: currentMap = colormap; newMap = [0 0 0; currentMap]; colormap(newMap) This may not have the exact desired effect, depending on the data range and the colormap length.
From: uny gg on 3 Feb 2010 15:53 Thanks Alan, However, I am still have a problem. My data matrix(actually representing the image) has narrow scale range. That was the reason I have to use "imagesc" function which helps to expand the original small range into the large range. So, I would like to change the background color as black or gray or white which were not in the scale bar in "imagesc " function result. Does it make sense?
From: uny gg on 3 Feb 2010 16:25 > However, I am still have a problem. > My data matrix(actually representing the image) has narrow scale range. > That was the reason I have to use "imagesc" function which helps to expand the original small range into the large range. For example, one of my image has range of -0.0298 to 0.0254. So, in this case, only "imagesc" function can clearly shows that the relative expression in image (bright to dark)
From: Alan B on 3 Feb 2010 18:17
"uny gg" <illinois.ks(a)gmail.com> wrote in message <hkcpk3$ahq$1(a)fred.mathworks.com>... > > > However, I am still have a problem. > > My data matrix(actually representing the image) has narrow scale range. > > That was the reason I have to use "imagesc" function which helps to expand the original small range into the large range. > > For example, one of my image has range of -0.0298 to 0.0254. > So, in this case, only "imagesc" function can clearly shows that the relative expression in image (bright to dark) I don't quite follow. If you have a specific background value, or a background threshold, then use that to ensure that all background pixels have a value lower than any other value in the matrix. |