Compressing LMDB files - compression

I am wondering if anyone has tried using compression techniques for their LMDB files? Typically, lmdb files typically do not use any compression. I am wondering if anyone has successfully stored data in an lmdb using jpeg compression on lmdb and then used it for caffe. I need this because I am working on a developer board with very limited storage space. If so, can you please provide steps/code to do this?
thanks

Caffe also supports HDF5 which supports compression. If your dataset is smth like mnist - it may be a good choice.

Related

Saving image without compressing

I know that JPG, BMP, GIF and others formats compress image. But can I get snapshot of display and save it without compressing(in binary file) in programming way (using c/c++ for example or other stuff)?
BMP files aren't compressed by default. See here: https://en.wikipedia.org/wiki/BMP_file_format
http://www.zlib.net is your best solution for loss-less compression in C. It's well-maintained, used in a host of different software and compatible with external archivers such as winzip.
C++ offers wrappers around it such as boost::iostreams::zlib and boost::iostreams::gzip.
Zlib uses the deflate algorithm (RFC1951); here a very good explanation of the algorithm: http://www.zlib.net/feldspar.html
The PAM format is uncompressed and really simple to understand.

c++ video compression library that supports many different compression algorithms?

For a scientific project i need to compress video data. The video however doesn't contain natural video and the quality characteristics of the compression will be different than for natural footage (preservation of hard edges for example is more important than smooth gradients or color correctness).
I'm looking for a library that can be easily integrated in an existing c++ project and that let's me experiment with different video compression algorithms.
Any suggestions?
Look at FFmpeg. It is the the most mature open source tool for video compression and decompression. It comes with a command line tool, and with libraries for codecs and muxers/demuxers that can be statically or dynamically linked.
As satuon already answered, FFmpeg is the go-to solution for all things multimedia. However, I just wanted to suggest an easier path for you than trying to hook your program up to its libraries. It would probably be far easier for you to generate a sequence of raw RGB images within your program, dump each out to disc (perhaps using a ridiculously simple format like PPM), and then use FFmpeg from the command like to compress them into a proper movie.
This workflow might cut down on your prototyping and development time.
As for the specific video codec you will want to use, you have a plethora of options available to you. One of the most important considerations will be: Who needs to be able to play your video and what software will they have available?

Storing and Retrieving Images using C++ Boost or STL and Mysql

I am trying to persist images to my MySQL. Do anyone knows how to perform this using either Boost or STL? any useful links or snippets will be much appreciated.
Thanks.
Though not part of boost you can use the SOCI database library, look at the documentation section on BLOBs.
http://soci.sourceforge.net/
Boost's generic image library will help you read and write images to disc, but cant encode to/decode from memory buffers. It also has methods to allow raw pointer access to image data. It would certainly help you pull the files into memory, and make the raw memory available for exporting. But you will have to find another way to connect them to the DB, or view them.

Doing sophisticated image analysis with python / django

I am working on a django project that analyzes images that contain text and (1) infers if the image needs to be rotated and (2) where text areas are.
I am currently using PIL to do some more simpler processing of these images but I am not quite sure how I can use PIL or other libraries to perform both tasks. I was wondering if anyone has done this before and if there are libraries / api available to help in the development.
OpenCV is probably the post popular open source image processing library. It's C/C++ but there are python bindings:
http://opencv.willowgarage.com/wiki/
and the python docs
http://opencv.willowgarage.com/documentation/python/index.html
I've never done an OCR with it, but I'm sure it's capable
I agree with #pastylegs that OpenCV is your best initial bet. If you need stuff specific to OCR you could also look at ocropus.

JPEG Quality when creating a JPEG in Carbon

I'm writing a Carbon application and we are creating JPEG files. I'm currently doing this by using Quartz CGImageDestinations and kCGImagePropertyJFIFDictionary. However, JFIF doesn't seem to have any entry for compression quality. Does anyone know how to set this?
thanks
This is separate from the JFIF options, since some other formats (including TIFF) support lossy compression. The key you use is kCGImageDestinationLossyCompressionQuality, and you put this option and the JFIF-options dictionary into the same dictionary; you don't put it into the JFIF-options dictionary.