Tuesday, March 13, 2012

Welcome to OpenCV-Python !!!

Welcome to OpenCV-Python !!!
This site provides some tutorials and examples on OpenCV-Python for absolute beginners.

Why this blog?

I started learning OpenCV a few months back. Before that, I used MATLAB for all my image processing purposes. The experience of shifting from MATLAB to OpenCV was amazing. Since i am a Python fan, I decided to use Python-bindings of OpenCV.

But as a beginner, I found a main problem in front of me. There are plenty of OpenCV tutorials available online for beginners, but most of them uses C++ for example codes. I couldn't find a single tutorial in Python for OpenCV. I could find a lot of OpenCV code in Python scattered online, but none of them was good for a beginner to start with. The best one I could find was none other than OpenCV-Python documentation. But it only lists the functions, not the examples using them.

Finally, I decided to start with C++ tutorials itself. I started to convert those codes from C++ to Python with the help of OpenCV-Python documentation. I decided to start a site or blog which shows the route i travelled to learn OpenCV so that it could be really helpful to the beginners. And here is the result.

Remember, I am also a beginner in OpenCV and I am still learning its basics. Here, what I am doing is, to give you only the outline ideas for a beginner to start with. For in-depth understanding, surely, I am not the right person to explain. But I know some good places where you can find them and I will share it with you as far as possible.

Some basic assumptions...

Here, I have made some assumptions...

1. You already know Python very well.
                Remember, this site only provides tutorial on OpenCV only, not on Python. So make sure, you have studied Python before beginning this site.
                Also, if you are good in C++, I would recommend you to use OpenCV in C++ itself. OpenCV can be used in C also.

2. You are using Python 2.7, OpenCV 2.4 and its python-bindings.
               
               I would recommend you to use Linux. It may be a little difficult at the beginning. But as time passes, you will enjoy it. You will feel the freedom of open-source.

I am always waiting for your suggestions and comments...

Feel free to talk for a better output...

You can contact me at: [email protected]

Hope you will enjoy here...


Regards,
Abid K.

Saturday, April 30, 2011

Python - A Powerful Friend

"Remarkable power with very clear syntax"" - That is Python if explained in simple words.

Are you bored of writing lots of lines and another large number of symbols used in C++  and C? Go to Python. Everything is fine there.

Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability. Its standard library is large and comprehensive.

Guido Van Rossum is Python's principal author, and his continuing central role in deciding the direction of Python is reflected in the title given to him by the Python community, Benevolent Dictator for Life (BDFL).

The Python implementation is under an open source license that makes it freely usable and distributable, even for commercial use. The Python license is administered by the Python Software Foundation.

Some of its key distinguishing features include:
  • very clear, readable syntax
  • strong introspection capabilities
  • intuitive object orientation
  • natural expression of procedural code
  • full modularity, supporting hierarchical packages
  • exception-based error handling
  • very high level dynamic data types
  • extensive standard libraries and third party modules for virtually every task
  • extensions and modules easily written in C, C++
  • embeddable within applications as a scripting interface
Large organizations that make use of Python include Youtube, BitTorrent, Google, Yahoo!, CERN, NASA and ITA. Most of the Sugar software for the One Laptop per Child XO, now developed at Sugar Labs, is written in Python.

Presently, Python 3.2 has been released. But Linux distributions like Fedora, Ubuntu still uses Python 2.7.
(NB:- In this tutorial we will be using Python 2.7)

References:

Official Website:    http://www.python.org/
Documentation for Python 2.7:    http://docs.python.org/tutorial/

Recommended Books:


" A Byte of Python" by Swaroop C. H.
       Simplest tutorial on Python. A good location to start, if you are new to Python. Read the book here, http://www.ibiblio.org/swaroopch/byteofpython/read/

" Dive into Python" by Mark Pilgrim.
        Next step after "A byte of Python". Read the book here, http://www.diveintopython.net/toc/index.html

" Learning Python" by Mark Lutz.
       A really big book with more than 1000 pages. Have a look at the book here: "Learning Python"

Or even better, just Google "Python Tutorials". You will get 1000s of books. But I think above three will be more than enough.

Support:

For instant help, use IRC channel : #python
Ask your doubts there. You will get answers in seconds.
( For those who haven't use IRC before:      visit http://webchat.freenode.net/,     give a nickname you like, enter #python in channel field, type the captcha in captcha field, skip all other fields, then click on connect. You will be led to a chat room where you can ask your doubts. Someone will reply)



OpenCV - A Library with Eyes

OpenCV (Open Source Computer Vision Library) is a library of programming functions mainly aimed at real time computer vision, developed by Intel and now supported by Willow Garage. It is free for use under the open source BSD license. The library is cross-platform. It focuses mainly on real-time image processing. The library has more than 2000 optimized algorithms.

History:

OpenCV was started at Intel in 1999 by Gary Bradski for the purposes of accelerating research in and commercial applications of computer vision in the world and, for Intel, creating a demand for ever more powerful computers by such applications. Vadim Pisarevsky joined Gary to manage Intel's Russian software OpenCV team. Over time the OpenCV team moved on to other companies and other Research. Several of the original team eventually ended up working in robotics and found their way to Willow Garage. In 2008, Willow Garage saw the need to rapidly advance robotic perception capabilities in an open way that leverages the entire research and commercial community and began actively supporting OpenCV, with Gary and Vadim once again leading the effort.

OpenCV's application areas include:
  • 2D and 3D feature toolkits
  • Egomotion estimation
  • Facial recognition system
  • Gesture recognition
  • Human–computer interaction (HCI)
  • Mobile robotics
  • Motion understanding
  • Object Identification
  • Segmentation and Recognition
  • Stereopsis Stereo vision: depth perception from 2 cameras
  • Structure from motion (SFM)
  • Motion tracking
To support some of the above areas, OpenCV includes a statistical machine learning library that contains:

  • Boosting
  • Decision tree learning
  • Gradient boosting trees
  • Expectation-maximization algorithm
  • k-nearest neighbor algorithm
  • Naive Bayes classifier
  • Artificial neural networks
  • Random forest
  • Support vector machine (SVM)
( All details extracted from Wikipedia)

References:

OpenCV official page:     http://opencv.org/
OpenCV Documentation:    http://docs.opencv.org/
OpenCV Q&A Forum : http://answers.opencv.org/questions/
OpenCV Developer Zone : http://code.opencv.org/


Community Support

OpenCV Q&A Forum and StackOverFlow.com are the best two places where you can find answers to your problems.

mailing list:    http://tech.groups.yahoo.com/group/OpenCV/
IRC channel:    #opencv
        Core developers of OpenCV won't be present at IRC channels. So it is difficult to find an answer at IRC.
( For those who haven't use IRC before:      visit http://webchat.freenode.net/,     give a nickname you like, enter #opencv in channel field, type the captcha in captcha field, skip all other fields, then click on connect. You will be led to a chat room where you can ask your doubts. Someone may reply)

Recommended Books


"Learning OpenCV: Computer Vision with the OpenCV Library" by Gary Bradski and Adrian Kaehler.
        This is considered to be the best book on OpenCV written by founder of OpenCV himself. Everything is explained in great detail and nice examples, but in C++. Whatever language do you use, whether it is Python,C++ or C, this book is a must read book, if you want to understand OpenCV.
See a look inside the book here:    "Learning OpenCV"