LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a 3-d graph from 3 1-D arrays containing x ,y cartesian coordinates and intensity values

Can anybody please offer some help with this. I have 3 1-D arrays of data containing the X and Y cartesian coordinates which are derived after calibration of an image taken with a CCD camera. The third array contains the intensity value of each pair of X,Y.

I need to create a 3-d surface plot where the height will rapresent the intensity/brightness.

 

many thanks

 

0 Kudos
Message 1 of 19
(3,906 Views)

Check out the 3D Surface VI under the Graphics and Sound > 3D Graph Properties pallette. The help for this VI is here: http://zone.ni.com/reference/en-XX/help/371361L-01/lvpict/3d_surface/

 

Your 3rd intensity array will need to be reshaped in to a 2D array with the same dimensions as the X and Y arrays, and fed into the Z matrix input of the VI.




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 2 of 19
(3,891 Views)

Thanks a lot for the reply . I have trouble in reshaping the intensity array . My X and Y data are signed floating numbers , the dimension of both these arrays is 4096.

 

0 Kudos
Message 3 of 19
(3,889 Views)

How big is the intensity array? I'm guessing 16777216 (4096 x 4096)? The code below should help in reshaping the array.

 

3d_surface.png

 

This assumes all the data in the intensity array is stored as multiple consecutive rows. E.g. Element 0 is intensity at X[0],Y[0], element 1 is intensity at X[0],Y[1], element 4095 is intensity at X[0], Y[4095], and element 4096 is intensity at X[1],Y[0].




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 4 of 19
(3,878 Views)

Thanks a lot for the help.

The intensity array as is now it has 4096 elements. One intensity values coresponds to a X,Y pair.

With the code you have proposed i get the attached image.

0 Kudos
Message 5 of 19
(3,874 Views)

Sorry if I don't quite understand how the intensity array contains an intensity for each X,Y pair. Surely it must be larger than 4096 points? Otherwise there's only enough information there to construct a line in 3D space, not a surface (which is what your picture shows).




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 6 of 19
(3,864 Views)

maybe i should explain  it a bit better. So here is the original image

points.png

 

The X axis ranges from -20 to 18 and the Y axis from -17 to 22. The values of the 3rd array correspond to the intensity of a point at X,Y coordinates. So for 4096 points i have 4096 intensity values. The picture is from a stem graph as it can accept 3 1-D arrays for X,Y,Z. What i want to do now is to plot it in a surface graph .

I hope this will make it more clear.

 

What my previous picture shows is what i get after plugging the 3 arrays in the code you have proposed earlier.

 

Thanks a lot

YWikipedia: Y is the twenty-fifth letter in the ISO basic Latin alphabet and represents either a vowel or a consonant in English.

0 Kudos
Message 7 of 19
(3,858 Views)

OK, thanks for that. I think I understand everything now. So each individual X,Y pair has a single intensity (which is what you've been saying all along), but I has assumed the X and Y values were continuous and represented a grid of sorts.

 

Given that's the case, you'll need to interpolate your data to produce a surface. Check out the Scattered 2D Interpolation example VI in the LabVIEW help.




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 8 of 19
(3,840 Views)

Yes you got it right. Thats exactly the case.

Thanks for the suggestion. I m gonna try it now

 

 

0 Kudos
Message 9 of 19
(3,836 Views)

Hi avsvas, 

 

Thanks for your post. I have found a very similar forum post that was an issue someone was having in the past. Could you possibly take a look at the solution vi. as I reckon its the same problem you are having.

 

http://forums.ni.com/t5/LabVIEW/How-to-plot-3D-surface-graph-from-X-Y-Z-points/m-p/1863585#M632594

 

Also, the suggestion given above seems right. Could you please let us know if it has sovled the problem or not.

 

Thanks,

 

Shazil M.
CLAD
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 10 of 19
(3,783 Views)