Prev: optimising a section of the ert generated code for execution on a Ti DM6437
Next: Luminance Level Edge Detection in Image
From: Tim Perkins on 22 Jun 2010 13:46 Hello, I'm writing a Matlab driver for a 3D LIDAR, which spits out images as requested. I'm trying to plot images, with a custom colormap. Each pixel is a single, and ranges from 0 to 200, or is -1 if "too close", or -2 for "too distant". I've tried creating a colormap as follows: colormap([0,0,0; 1,1,1; hsv(200)]); caxis([-2, 200]); But this doesn't work. Anything below 2 is black, 2 is white, 3 and above is HSV. Am I doing something wrong? I've been searching for awhile, but I haven't made any progress. Thanks in advance for any help.
From: us on 22 Jun 2010 14:51 "Tim Perkins" <tprk77(a)gmail.com> wrote in message <hvqste$k94$1(a)fred.mathworks.com>... > Hello, > > I'm writing a Matlab driver for a 3D LIDAR, which spits out images as requested. > > I'm trying to plot images, with a custom colormap. Each pixel is a single, and ranges from 0 to 200, or is -1 if "too close", or -2 for "too distant". > > I've tried creating a colormap as follows: > > colormap([0,0,0; 1,1,1; hsv(200)]); > caxis([-2, 200]); > > But this doesn't work. Anything below 2 is black, 2 is white, 3 and above is HSV. Am I doing something wrong? I've been searching for awhile, but I haven't made any progress. > > Thanks in advance for any help. which function do you use to plot the images(?)... help image; % or help imagesc; us
From: Tim Perkins on 23 Jun 2010 10:21
"us " <us(a)neurol.unizh.ch> wrote in message <hvr0mt$1sq$1(a)fred.mathworks.com>... > "Tim Perkins" <tprk77(a)gmail.com> wrote in message <hvqste$k94$1(a)fred.mathworks.com>... > > Hello, > > > > I'm writing a Matlab driver for a 3D LIDAR, which spits out images as requested. > > > > I'm trying to plot images, with a custom colormap. Each pixel is a single, and ranges from 0 to 200, or is -1 if "too close", or -2 for "too distant". > > > > I've tried creating a colormap as follows: > > > > colormap([0,0,0; 1,1,1; hsv(200)]); > > caxis([-2, 200]); > > > > But this doesn't work. Anything below 2 is black, 2 is white, 3 and above is HSV. Am I doing something wrong? I've been searching for awhile, but I haven't made any progress. > > > > Thanks in advance for any help. > > which function do you use to plot the images(?)... > > help image; > % or > help imagesc; > > us I was able to solve my problem. I was using image, but I got things to work using imagesc. Here's what I did: colormap([0, 0, 0; 1, 1, 1; hsv(200)]); ih = imagesc(i, [-2, 200]); axis image; colorbar; |