LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading GIF in Labview via MATLAB

Hi

I understand from some earlier posts on NI's website that importing/reading
GIF files directly into Labview is a problem.
As a workaround, I tried using the MATLAB node with a simple matlab script
that reads in the GIF file using "imread" from the Image processing toolbox
and sends the image 2-D array to Labview. Unfortunately, everytime I used
the "imread" MATLAB function in the script node, it gives a error no "1048-
could not read variable "img" from MATLAB server" where img =
imread("test.gif") ;
Definitely, it seems like a problem with teh imread function being accessed
via the MATLAB Activex server from Labview, since I am able to access all
the other variables in the script.
Any help in this regard is appreciated.

Thanks,
Aja
y
0 Kudos
Message 1 of 2
(3,017 Views)
Ajay,

According to the MATLAB help, when imread reads a color image, it returns a 3D matrix with the RGB data. In playing with LabVIEW, we are only passing and getting 2D matricies. What I would suggest is to take the 3D array apart into a bunch of 2D arrays and pass that data back. (What I think you will need to do is have 3 2D arrays to return, one for R, one for G, and one for B.)

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 2
(3,017 Views)