10-29-2014 12:28 AM
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
10-29-2014 01:00 AM
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.
10-29-2014 01:09 AM
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.
10-29-2014 01:34 AM
How big is the intensity array? I'm guessing 16777216 (4096 x 4096)? The code below should help in reshaping the array.
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].
10-29-2014 01:45 AM
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.
10-29-2014 01:59 AM
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).
10-29-2014 02:08 AM - edited 10-29-2014 02:14 AM
maybe i should explain it a bit better. So here is the original image
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. →
10-29-2014 02:43 AM
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.
10-29-2014 02:51 AM
Yes you got it right. Thats exactly the case.
Thanks for the suggestion. I m gonna try it now
10-31-2014 07:11 AM - edited 10-31-2014 07:11 AM
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,