OpenCV Python Tutorials

Here Comes Official OpenCV-Python Tutorials


First of all, our blog visitor count is about to cross 4 lakhs. Thanks to all for your support !!!

So a small gift on this occasion ...

A couple of months ago, I had told you about a new OpenCV-Python tutorial was under development.

Here Comes Official OpenCV-Python Tutorials

So it is the time to unveil it. You can visit the new official tutorial at OpenCV website.

Link :

Remember, it is based on the not-yet-released OpenCV 3.x version. To get it, you have to compile OpenCV from source available in Github. (Because, I always get mail saying some there are some errors in tutorial, it doesn't work. Actually they use OpenCV 2.x version. That is the problem)

Here Comes Official OpenCV-Python Tutorials

It was a great pleasure to work on this project. I thank my mentor, Mr. Alexander Mordvintsev for his help on this project. I also thank many OpenCV developers like Gary Bradsky, Vadim Pisarevsky, Vincent Rabaud etc. for their help.

So friends, please read it, enjoy it, and don't forget to send me your comments, thoughts, feedbacks, bug reports, feature requests etc. I know it is still incomplete. We will together make it complete !!!

Thank you all,


Abid Rahman K.

Grabcut Algorithm in OpenCV

Hi friends,

Grabcut algorithm is a nice tool for foreground-background extraction with minimal user interface. It is developed by Microsoft research labs.

See one result below:

You start by drawing a rectangle around the foreground image. Algorithm then segments the image. There can be some misclassifications. There you provide some nice touchups specifying this area is background, this area is foreground etc. Again segment the image to get very nice results.

You can find a python sample at OpenCV source at this link. Watch a video demo of the same code below: