04-20-2023 08:03 AM
Hello,
i have converted image into *.dat file in matlab , but now i want to convert *.dat file into image format in labview ,
how can i do it.
thanks and regards
Solved! Go to Solution.
04-20-2023 08:44 AM
Why not store the image as jpeg instead of the dat file?
04-20-2023 09:48 AM
What version of LabVIEW are you using?
Does it support MATLAB script?
04-20-2023 11:41 AM - edited 04-20-2023 11:45 AM
A *.dat file can be anything. Unlike e.g. *.png it is not reserved for any specific data structure.
So have a look at your Matlab code to see how the data is saved, then reverse engineer it in LabVIEW. If it is binary, you need to know the # of rows and # of columns, the datatype (# of bytes per pixel, B&W, RGB? RGBA? Palleted?) and the byte order for any multibyte value. I am sure it is all in there somewhere....
04-20-2023 11:45 PM
Hello,
the application is such a way that i have to convert to *.dat then into image
regards
04-21-2023 03:20 AM
@tushar.V wrote:
Hello,
i have converted image into *.dat file in matlab , but now i want to convert *.dat file into image format in labview ,
how can i do it.
thanks and regards
You do the same procedure as you did in Matlab, but in reverse. How's the image saved? Pure data? Any header? 24 bit RGB values?
04-21-2023 03:51 AM - edited 04-21-2023 03:51 AM
If you use IMAQ Vision functions you would basically import the numeric data in whatever binary format you write it in Matlab and then use the IMAQ Array To Image functions.
If you want to use the LabVIEW Pixmap format instead you need to do the same import and then try using one of the Draw Unflattened Pixmap instances.
04-21-2023 06:09 AM
Hello,
I'am able to convert *.dat to *.png image, but i'am getting two images in earth.png
regards
04-21-2023 06:25 AM
Hi V.,
@tushar.V wrote:
I'am able to convert *.dat to *.png image, but i'am getting two images in earth.png
Then your conversion is wrong!
(Are you sure your "dat" data is organized in a 900×900 scheme?)
Btw. why don't you cleanup the code before posting such images?
04-21-2023 06:48 AM
Hello,
the gray scale image is 810000 bytes i'am using reshape array to to convert it into 2d array, how can i get single image instead of two
Regards