Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

lossless avi compression?

Hi all,

what are the options for lossless on-line compression of AVI files?
I am using a ROI to crop the image I want to save to something like 200x150 pixels, but still it would be nice to compress the data to save disk space.

thanks,
AW
0 Kudos
Message 1 of 5
(7,234 Views)
Hi AW,
 
AVI is provided with NI-IMAQ or Vision, but if NI-IMAQ is the only software installed, you will only be able to write uncompressed AVIs. If you have Vision installed, you will be able to read and write compressed or uncompressed AVIs.
 
Regards,
Veikko
 
 
0 Kudos
Message 2 of 5
(7,215 Views)

I also would like to compress the images in my AVIs to reduce AVI file size and to decrease the time required to read AVI frames from the hard drive.  We are using black and white images with 8 bits per pixel.  We don't want any reduction in image quality, so we need a lossless compression.  According the the AVI Compressor Comparison Example.vi, all of the CODECs on my PC create some reduction in image quality - i.e. they are lossy to various degrees - see attached screenshot of the VI.

 

What I'm looking for is a lossless 8 bit image compressor.  For that matter, I could convert the images to/from arrays of bytes and utilize a generic byte array CODEC to implement my own compression/decompression.

 

Does anyone know of a lossless compressor for either 8 bit images or byte arrays?

 

Thanks,

Hans 

0 Kudos
Message 3 of 5
(6,206 Views)

Many years ago I played with PICVideo's lossless codec with fairly good success (though not in LabVIEW). Their page says that their codec works for 8-bit data as well. You could try their evaluation copy and see how well it works out. Be sure to let us know your results.

 

Eric 

0 Kudos
Message 4 of 5
(6,202 Views)

Thanks for the pointer Eric!  I downloaded and installed the evaluation PICVideo Lossless JPEG Codec, then re-ran the AVI Compressor Comparison Example.vi which automatically found the PICVideo Codecs and returned results for them.   See attached screenshot of the results.

 

The Quality for the PICVideo Lossless JPEG Compressor wasn't quite 1000, it was 996.49, which threw me at first, but then I realized that was caused by the PIC Video watermark that is automatically placed on the images by the evaluation version of the Codec.  When I looked at the difference image between the uncompressed and PICVideo Lossless, all the pixels were 0, except for the watermarks.  So it really is lossless.  And for my short test video, it reduced the file size by a factor of 4.

 

There are a couple catches for my application.  One is that the non-evaluation PICVideo Lossless JPEG Codec costs $199 per CPU.  The other is that one reason we want to compress is that we want to read back our AVI frames quickly.  Since hard drive transfer time is a limiting factor when reading AVI frames, we are hoping that a compressed AVI might actually have a quicker AVI frame read time, even considering that the CPU has to decompress the read image.  I need to do some more testing to see how fast the AVI frame read time is when the PICVideo Lossless JPEG Codec is used.

 

Thanks again Eric.

 

Hans

 

0 Kudos
Message 5 of 5
(6,193 Views)