blImageSerialization — Simple functions to serialize/unserialize an IplImage using opencv

Introduction Whenever working with any type of data, especially images or videos, we usually run into the need of having to save the data to then load it back up for later use. The images can either be saved in binary format or text format.  The process of saving/loading data…

Continue reading

blEncodeAndDecode — Simple functions to encode and decode images in memory using OpenCV without having to save/read to disk

Introduction I have seen many of these questions pop up everywhere on the web, like this stackoverflow.com question. But as it turns out, there are two very easy to use functions in opencv that allow us to encode/decode to/from several formats such as jpeg, png, pxm and many more. In…

Continue reading

Using OpenCV 2.2 within QTCreator in Windows

UPDATE:  If you’re trying to compile opencv look at this article. This is an update to my “Using OpenCV within QTCreator in Windows” post, that will show you how to quickly setup OpenCV 2.2 for QTCreator in Windows. (This of course will work for any IDE, not just QTCreator). So, let’s get down…

Continue reading

blMemStorage — A simple data structure to wrap OpenCV’s CvMemStorage with shared_ptr

Introduction As part of the blImageAPI series that we’re running, in this short article, we present a simple data structure used to wrap OpenCV’s CvMemStorage with boost::shared_ptr. The use of boost::shared_ptr allows for automatic garbage collection and lets us check the validity of pointers, which will save us from those horrific opencv…

Continue reading

blImageOperators — Overloaded operators and functions to use blImage as a generic matrix in c++

Introduction blImage makes working with images in OpenCV a snap.  Automatic garbage collection, automatic type conversion and 100% compatibility with opencv algorithms, all that accomplished with the help of boost::shared_ptr and template meta-programming. Now, to expand its usefulness and applicability, in this post I present a collection of overloaded operators…

Continue reading

blCaptureDevice — A simple data structure to handle video sources in OpenCV

Introduction When it comes to OpenCV, dealing with images and videos means dealing with finicky pointers.  This, as could be attested by all who have played with OpenCV before, can quickly lead to “out of memory” and other obscure error messages that the library loves so much to spit at you.…

Continue reading

blImage — An image data structure based on shared_ptr and IplImage*

Introduction Back in the good old days of OpenCV 1.1 and earlier, the main image structure used throughout their algorithms was IplImage. Playing with IplImage requires skillful manipulation of data in memory, and thus makes it very difficult for beginners to play.  Even experts run into the dreaded memory leaks caused by…

Continue reading