LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting an array of XYZ values to an RGB image

Solved!
Go to solution

Hello!

 

I have a 2D array of XYZ values.  I want to create a 2D image where the color of a pixel is a mapped value from the Z coordinate (a contour plot).  Right now, I just have the Base Labview version, so I don't have any of the contour plot VI's.  I do, however, have the intensity plot, but it's usually pretty blocky.  The values I'm working with are as follows:

X: 0 to 20

Y: 0 to 100

Z: 0 to 1

 

Is it possible to either:

  • Map out an image using the array to make a set of pixels to, then, create a bitmap?
  • Space out the data better so the intensity graph isn't so blocky?
  • Something else to create a 2D Contour plot from a list of XYZ coordinates?

Thanks,

Joe

0 Kudos
Message 1 of 4
(4,548 Views)

Hi Joe,

 

Is it possible to either:

  • Map out an image using the array to make a set of pixels to, then, create a bitmap?
  • Space out the data better so the intensity graph isn't so blocky?
  • Something else to create a 2D Contour plot from a list of XYZ coordinates?

Yes.

Yes.

Yes.

All your questions answered…

 

Spoiler
- you can interpolate your pixels to a finer resolution
- you can read the image of the intensity graph using it's property or method nodes
- you could try to draw your "2d contour plot" using a 2DPictureIndicator and all those draing functions
- there are toolkits found in VIPM, that allow for fine looking graph indicators!

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(4,518 Views)

Ha!  Thanks GerdW!

 

To clarify, my input array looks like this:

[ X, Y, Z
x1, y1, z1
x2, y2, z2,
..., ..., ...
xn, yn, zn]

(n rows, 3 columns).  I want the X and Y values to correspond to pixels, and the Z values to signify a color at the (X, Y) point.

 

I'll work with the intensity graph a bit more, but I'm not sure if you understood what my input data was.

 

Thanks,

Joe

0 Kudos
Message 3 of 4
(4,480 Views)
Solution
Accepted by topic author JoeKellyATI

Hi Joe,

 

The values I'm working with are as follows:

X: 0 to 20

Y: 0 to 100

Z: 0 to 1

- Initialize a 2D array of 21 columns (X=0…20) and 101 rows (Y=0…100).

- Autoindex your data array row by row: use the XY coordinates to put the Z value into your 2D array using ArraySubset

- wire the resulting 2D array to an intensity graph…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 4
(4,472 Views)