LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

From hex to jpeg.

Hello.

I'm trying to generate a JPEG picture from a hexadecimal textfile ultimatly directly from a serial port, and I'm alittle stuck on the execution.
After some googeling I think I've understood that you need to arrange the hexadecimals in an array and then generate the picture.

But doing so only generates a almost black picture with som white dots, so something is very wrong.
Could anyone give alittle heads up to what I may be doing wrong?

I've attached the file with the picture in hex.


Thanks in advance,

ASibbern

0 Kudos
Message 1 of 5
(4,772 Views)

Hi,

 

I had the same problem once.

I made a VI that captured a waveform from an oscilloscope. The problem was that during the transmission some extra bits, at the beginning were added.

I did the following:

- changed the capture format to a format that can be easily interpreted (bmp or tiff)

- capture the waveform and compare it to the standard file (from your PC)

- remove extra characters and try it again with jpeg

 

Personally, I prefer TIFF - because it's easy and fast to read the tags. Capture as tiff and compare what you get with a tiff from your PC. I think that the first information from a tiff is little endian or big endian (search on google how exactly starts tiff or bmp files).

 

Paul

0 Kudos
Message 2 of 5
(4,761 Views)

on more thing: write it in binary form not as text.

0 Kudos
Message 3 of 5
(4,757 Views)

Hi ASibbern,

the attached example shows how it could work. It shows how you can create your image from the txt file. If you show us your code, maybe we will find a simpler solution to write the image directly.

 

Mike

0 Kudos
Message 4 of 5
(4,751 Views)

Thank you

I am connected to a JPEG color cam with a serial port,

so the first part is just taking picture.

i wish to stream it like a video

 

 

 

0 Kudos
Message 5 of 5
(4,742 Views)