Categories
code Mapping opencv Tracking video vision

Simplest 20-lines OpenCV video stabilizer [w/ code]

Just sharing a simple recipe for a video stabilizer in OpenCV based on goodFeaturesToTrack() and calcOpticalFlowPyrLK().
Well… it’s a bit more than 20 lines, but it is short. And it doesn’t work for every kind of video (although the results are funny anyway! :).

Categories
code Music opencv programming vision

Using Hidden Markov Models for staff line removal (in OMR) [w/code]

Screen Shot 2015-01-24 at 10.11.00 PM

So lately I’m into Optical Music Recognition (OMR), and a central part of that is doing staff line removal. That is when you get rid of the staff lines that obscure the musical symbols to make recognition much easier. There are a lot of ways to do it, but I’m going to share with you how I did it (fairly easily) with Hidden Markov Models (HMMs), which will also teach us a good lesson on this wonderfully useful approach.

OMR has been around for ages, and if you’re interested in learning about it [Fornes 2014] and [Rebelo 2012] are good summary articles.
The matter of Staff Line Removal has occupied dozens of researchers for as long as OMR exists; [Dalitz 2008] give a good overview. Basically the goal is to remove the staff lines that obscure the musical symbols, so they would be easier to recognize.

But, the staff lines are connected to the symbols, so simply removing them will cut up the symbols and make them hardly recognizable.
So let’s see how we could do this with HMMs.

Categories
code graphics opencv vision

Run length encoding in OpenCV [w/code]

RLE exampleSharing a simple code snippet for run-length encoding with OpenCV…

Categories
code graphics opencv programming

Simple NURBS renderer [w/ code]

Screen Shot 2013-12-18 at 11.01.23 AMDon’t you just love scouring the web for a piece of simple code, come up short and then just write it yourself? Well that was the case with NURBS for me. These simple curvy lines, why doesn’t anyone just dish out a straightforward implementation of them? Well, now you have it. I wrote a simple renderer that reads a DXF file with NURBS (from Rhino3D) using DXFLIB, although the DXF file format is super easy to parse, and renders them to an image with OpenCV.

Categories
code graphics opencv programming school

Resampling, Smoothing and Interest points of curves (via CSS) in OpenCV [w/ code]


I’m so glad to be back to work on a graphics project (of which you will probably hear later), because it takes me back to reading papers and implementing work by talented people. I want share a little bit of utilities I’ve developed for working with 2D curves in OpenCV.