LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I convert a 3D array (output from matlab) to a picture?

Hi

I have a Labview 6.1 program that calls a matlab (6.5) function to perform some image analysis. The output from the matlab script is a 3d matrix where the third dimension corresponds to the RGB components of an image (first and second dimension are the rows and colummns of the image).

My question is how can I display this image as a picture? I guess i first need to convert the 3d array to a special format (such as pixmap or rgb etc...) but aren't sure what format i need or the easiest way to do it!

Thank yous.
sam
0 Kudos
Message 1 of 5
(5,820 Views)
Greetings!

If you go to the "3D Graph Properties" under "Graphics and Sound" you will find that you can do just about anything you can do in labview...including animated rotations, etc.
Peruse the graphics Examples thoroughly...there's lots of good stuff in there!

Eric
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 2 of 5
(5,821 Views)
Hi, thanks for the answer, but i think i didn't explain things clearly. i have a 3d array and wish to convert it to a picture (where each of the 3rd dimensions corresponds to the RGB components). I'm not trying to plot a 3d graph, but plot a 2d colour picture from '3d' data.
0 Kudos
Message 3 of 5
(5,820 Views)
Hi Sam,
your 3D array should consist of 3 2D arrays of identical dimensions of the RGB pixmaps.
First you have calculate the RGB color value for each pixel: use the RGB to color.vi you find in the palette Numeric-Conversion and build a 2D array with the calculated values, this will be the RGB pixmap.
To display it in a LV picture use the Draw True Color Pixmap.vi.
Hope it was helpful,
Alberto
0 Kudos
Message 4 of 5
(5,822 Views)

Hi

 I have a similar question. I am using Matlab7.0 and Labview 7.0. I have a snapshot of the image from the webcam using the following command

vid=videoinput('winvideo',1,'RGB24_640x480')

image=getsnapshot(vid) ==>3D image

If I want to process this image in LabVIEW what should I do? I want to use the IMAQ ColorThreshold vi on this image. I cannot even preview the videoinput using LabVIEW. Please helpp...

 

Rani

0 Kudos
Message 5 of 5
(5,601 Views)