Code Snippet: Create mosaic from images
Quite a long time since last update - mostly due to lots of work (and to be honest, Mass Effect :) ). This time I will show you a little and handy fragment of code for merging a few pictures into one. This way there is no need to create a lot of windows, which in my opinion are not exactly a very convienient way to look up, let's say about 16 pictures at once.
Here you can see the effect that we achieve. Now let's see the code!
Tutorial: Background detection with OpenCV
UPDATE: This tutorial is written for OpenCV 2.3 and as one of the commenters pointed out, from OpenCV 2.4 the nmixtures are protected instead of public, so you might have to set the values for nmixtures and bShadowDetection using the constructor.
This is a first post from what hopefully will become series of tutorials so stay tuned. Those tutorials aren't exactly intended for complete beginners, although I try to explain as much things as possible. I presume that you have at least basic grasp of C++ and have already configured OpenCV. Some knowledge about image processing also would help.
Lately, as a part of bigger project, I needed to detect a background in quite precise way. I didn't have time to write my own background estimation algorithm or reimplement existent, so I decided to use functions from OpenCV - the results are very good with very little effort (the code is about 35 lines long). The program itself does background, foreground segmentation and draws nice contours around detected foreground objects.
Qt + OpenCV + OpenGL – Image overlay v2
Here is a little app that (again) overlays the (same) image over the chessboard, but this time I used a QT/OpenGL interface to show and overlay image. The OpenCV still takes care about image acquisition and checkboard detection. Using OpenGL textures made overlaying really easy.
The project could come handy as a tutorial how to integrate QT, OpenGL and OpenCV. Also it is a nice demonstration that algebra has some real life applications (displaying cat images on chessboards obviously).
Some time later I will write a decent tutorial how to do integrate mentioned libraries, because googling it really does not give simple answer, so stay put. In the meantime have a look at the source code.
The next step is true augmented reality with 3D objects and other cool things :)
Overlaying an image using OpenCV
A little app written using OpenCV. It uses OpenCV camera callibration module to find a chessboard and then overlays a custom image.
As a reference I based on a project from this page, although loosely, because that program has been written for OpenCV 1.X. I rewrote it to use newer version and now it works using OpenCV 2.3. Nevertheless the page is worth visiting. I omitted the bitwise operations in my app, because the effect wasn't what I imagined and I wrote my own function which does image merging. It needs to be improved, but that's an early version of an app that was written for fun :)
See for yourself how it works:
Here's the project source (I used QT Creator - quite convenient once configured).


