LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hex data to file jpg

Hello, I have an image as a hexadecimal representation in a text file ( which was extracted from the serial port).

I need to convert this hex respresentation to jpeg files.. How I can do it using Labview?

 

Here is the file txt:

0 Kudos
Message 1 of 27
(5,787 Views)

Hi WSalas,

what have you done so far? Do you have your data as byte array or as text data as in your file?

Attached you will find a part of an example which shows how you can solve it with the data from the given file. The black parts are to make it more interesting for you.

 

Hope it helps.

Mike

0 Kudos
Message 2 of 27
(5,768 Views)

If its in byte array how do we convert to image? Thank you in advance

0 Kudos
Message 3 of 27
(4,546 Views)

Hi praveen,

 

what is in your "byte array"?

Any example data or VI?

(Why did you wake up this old thread instead of creating your own one?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 27
(4,542 Views)

what is in your "byte array"?

 

The byte array consists of equivalent decimal value. attached.PNG file

 

The VI just read the data from the serial port.

 

I am using Grove serial camera.

0 Kudos
Message 5 of 27
(4,539 Views)

Save the data to a file and give it a filename with a JPG suffix (or whatever fits to your files)…

 

I guess the algorithm is described in the manual of your camera!?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 27
(4,537 Views)

Dear GerdW,

 

Save the data to a file and give it a filename with a JPG suffix (or whatever fits to your files)…

Is it? Do i need to change to binary or not?

 

I guess the algorithm is described in the manual of your camera!?

Not really. (The data sheet is attached) I am using sec 4.1 to get the data. (4.1 JPEG Snapshot Picture)

 

Thank you.

 

-praveen

0 Kudos
Message 7 of 27
(4,531 Views)

Dear GerdW,

 

Save the data to a file and give it a filename with a JPG suffix (or whatever fits to your files)…

Is it? Do i need to change to binary or not?

 

I guess the algorithm is described in the manual of your camera!?

Not really. (The data sheet is attached) I am using sec 4.1 to get the data. (4.1 JPEG Snapshot Picture)

 

Thank you.

 

-praveen

Download All
0 Kudos
Message 8 of 27
(4,530 Views)

Save the data to a file and give it a filename with a JPG suffix (or whatever fits to your files)…

Do i need to save in hex or binary while saving the data? Anyway i will the both.

 

I guess the algorithm is described in the manual of your camera!?

Not really. I attached the camera user manual for your reference. I am using section 4.1 to get the data. (data size 512 byte).

 

I am confused that how do i arrange the 512 byte to get an image.

 

0 Kudos
Message 9 of 27
(4,527 Views)

Hi praveen,

 

Is it? Do i need to change to binary or not?

When you request JPEG data you will get JPEG data!

No need to convert to "binary" or something else - just save the data to a file!

 

I am using sec 4.1 to get the data

I am confused that how do i arrange the 512 byte to get an image.

Then just follow the descriptions: set the block/packet size and request as many packets as needed. Save their content to a file…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 27
(4,525 Views)