LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

JPEG to image without files

I have an application that has been running for some time now and a lot of acquisitions have been done with it. During one acquisition, I get roughly 1000 images that I save on disk in a JPG format. We are now moving the data storage to a centralized location in a database and I want to do the following:

 

1 - Insert the raw bytes of the JPG file in the DB

2 - Insert new LabVIEW images in the DB, compressed in a JPG format

3 - Load and display images saved in the JPG compressed format in the DB 

 

Element 1 is really easy to do and I am already doing it. For elements 2 and 3 though, I can't seem to find a way to skip writing/reading to disk. I know how to use the "Write to JPG" VI for example but that slows down the process a lot because of disk access. It would be much faster if the data could be uncompressed directly to/from the memory.

 

Is there a way to use LabVIEW VIs to compress the image into a JPEG format and return a byte array instead of writing a JPG file on disk? Also, I would need to be able to do the opposite as well (i.e. pass an array of raw bytes representing the content of a regular JPG file and get a LabVIEW image out of it)

 

Thanx!

 

Olivier 

0 Kudos
Message 1 of 4
(2,706 Views)
could you just store the new data into the DB without making it a JPG and when you want to actually pull the data out to look at it just generate the JPGs then?  that might make it faster for you.
0 Kudos
Message 2 of 4
(2,703 Views)

It is an option, but the compression factor of the JPG file format makes it a more suitable solution in the long run. The imaegs could be compressed differently since I'm saving binary data anyways but because I already have all those JPG file, I would like to stick with that.

 

Also, I know that the compression algorythm exist somewhere, it's just a matter of whether we can access it or not.

0 Kudos
Message 3 of 4
(2,698 Views)
LabVIEW's function that does the jpg compression also stores it to file. The
data is not accessible.

I'd try http://gnuwin32.sourceforge.net/packages/jpeg.htm or another
external jpg compression library.

Regards,

Wiebe.


0 Kudos
Message 4 of 4
(2,657 Views)