LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create a grayscale image using arrays

Hello,

I am totally new to Labview. I am trying to make a grayscale colormap using arrays. Part of my goal is to create an image that gradually changes color from white to black (a smooth transition of the 255 different colors).

Thank you

0 Kudos
Message 1 of 7
(3,755 Views)
The images you've linked refer to your local drive, so that won't help us
much.

If you just want a gray box, use a picture control, and draw a gray box in
it with the picture vi's. It takes a color, that is basically a U32, which
layout is aaBBGGRR (aa or alpha often has no function). So you can construct
your own color by joining U8's with "join numbers" (Numeric>Data
Manipulation), and join the two resulting U16's to one final U32.

Regards,

Wiebe.


0 Kudos
Message 2 of 7
(3,752 Views)
Thank you.

I am still a bit lost, I have the mathscript code (see below), but the image being generated is in color instead of black and white. The code below is
for mathlab...

k = 0:199;
x = (sin(k*2*pi/200 + pi/2) +1)’;
b = 128 * repmat(x, 1, 200);
 image(b), axis image
0 Kudos
Message 3 of 7
(3,750 Views)
Hello,

I have created a script that will generate a grayscale image, i can only get the image to appear in blue instead of white. Would you let me know who to create the image onto grayscale?

Thank you.

Download All
0 Kudos
Message 4 of 7
(3,731 Views)

You're getting blue because you're only using the blue byte. If you used a number higher than 255 you would start seeing other colors as well.

I'm usually one for doing the simple brute force unless there is need for optimization - just use a for loop which will run X times and generate the lines and then build the picture. I don't have an example handy (although I'm fairly sure I uploaded one once), but here's something doing a similar thing.


___________________
Try to take over the world!
0 Kudos
Message 5 of 7
(3,715 Views)

Something like this.

Message Edited by Ravens Fan on 10-06-2007 03:14 PM

0 Kudos
Message 6 of 7
(3,709 Views)
Tst and Ravens fan,

Thank you for the tips and feedback, I am slowly learning to appreciate the innerworks of LabView... I'll probably post more questions as I progress....
0 Kudos
Message 7 of 7
(3,693 Views)