Saving OpenCV matrices to disc and loading them

Recently I needed to save some matrices I had generated with OpenCV and C++. This snippet of code shows you how you can do this this and then open the files to retrieve the matrices.  You can save the files as either the .yml or .xml format. In the example below, “trainData” and “trainLabels” are the …

Read More
Be careful with FFmpeg metadata

Recently I used the program FFmpeg to automatically extract metadata about the time and date some videos I’ve been using for my research were created. FFmpeg is a really useful tool for manipulating videos and images at the command-line. You can do things like change the format, quality or length of your video files with relative …

Read More
Image processing with scikit-image

I’ve been using OpenCV over the past couple of years for all my image processing work. It’s a really extensive and useful library, and just recently, OpenCV 3.0 was released, which included bindings for Python 3! Finally one of my last reasons to continue using Python 2 has disappeared. However, there is another image processing …

Read More
Review of OpenCV Essentials

Recently PACT sent me a free copy of a book on OpenCV because of my background writing about the topic. First things first, OpenCV Essentials is definitely not a book for an image processing/computer vision novice. If this sounds like you, then I’d recommend you refer to my post on resources for getting started with OpenCV here, and then …

Read More
Best resources for learning OpenCV (Python and C++)

Here’s a list of some of the websites, books and videos (for both Python and C++), that I have found very useful while learning OpenCV. Python Using OpenCV with Python and ROS (Video) – Great introduction to computer vision and OpenCV. PyImageSearch – Website has a lot of great tutorials on many different applications of OpenCV. OpenCV-Python …

Read More
Using C++ or Python for OpenCV Programs

When I first started learning OpenCV, I was working exclusively with Python. While I am still a huge fan of the language, today all of my OpenCV programs are written in C++. Why? Some of the deeper functionality of OpenCV has not been completely ported to Python (although hopefully the release of OpenCV 3.0 will …

Read More
Sublime Text OpenCV C++ Build System

If you want to compile and run a C++ program using OpenCV in Sublime Text, then copy and paste the code below into a build system file. If you’re not interested in explicitly using C++11 you can delete the “-std=c++0x” section.

Read More
Tracking bees using local features

The project I am working on at present is focused on building an automated system for tracking the movement of honeybees in an observation hive, filmed using a grayscale camera and infrared light. My recent attempt at this has involved extracting features (or keypoints) from the frames and then describing them using the SIFT (Scale Invariant …

Read More