Still not in love with OpenCV

This article is inspired by Adrian’s blog at PyImageSearch. In one of his articles he asked about what drives me, what makes me want to be an “OpenCV Ninja” and perhaps recount the days about finding magic in coding.

I started out in computer programming in the faithful year of 1999 during my 9th grade when I wanted to make html webpages using Notepad to display my vector art. It was the year where “blue chip companies” were the hottest thing and the tech bubble was just about to burst. “Lets party like it is 1999” highly resonates with me. But everything before that period for me was just about being a mindless consumer of computer games. The first time I had used TelNet to send an email was in 1992 and after using it once, I decided that I would contend myself with TV and playing football and never used TelNet ever again. By 2001, in high school, I still wasn’t doing any computer programing but was preparing for engineering college entrance exams and managed to get good training in basic mathematics and physics. My agenda in joining engineering was to build the things I desired which, weren’t available in the world or weren’t within my financial reach.

Perhaps, what really got me into programming was the anime – Ghost in The Shell which I came across in 2003.

My undergrad was in mechanical engineering. I worked on computer aided design, rapid prototyping, propulsion systems and industrial robotics because what I desired required extreme automation. In mechanical engineering I learned how it moves or resists movement, where it could be any physical thing.

I needed to learn many more things in control engineering and how human beings deal with the world. More particularly I had become interested in what makes a human a human while I was working on military drones during my masters in industrial engineering at University of Iowa. I studied human factors, human computer interaction, human performance modeling, ecological design and automated systems engineering. By this time I was definitely a techno otaku :P This was also the period when I started learning and using computer programming in a more serious way for analyzing large data sets streaming from driving or airplane simulators and from instruments recording human physiology while the human performed tasks. The tasks ranged from driving to hand washing and a rather important fad of that era dealt with the ergonomics of navigating a website on a mobile device while walking up and down the hall and hopefully not bumping into people. It was a time where many people on the buses and in the streets had started to pretend to be deaf mutes, not talking to each other, with earphones from their digital device firmly plugged into their ear and their eyes and fingers frantically grazing their gizmo.

At that time, a large part of my work was categorized as signal processing and most of that was subcategorized as visual signal processing. I naturally dealt with all other domains of signal transduction and that is when I obtained the conviction that “not signal” is not defined.

I came to learn how it senses.

And what makes a human a human has to do with a myriad of ecological factors that yield a “persona”. These factors cannot be throughly controlled and in many cases not even observed by a human or a collection of humans. Strangely, many of these personas are veering towards becoming a commercial-of-the-shelf-automaton. Towards the end of my masters I was working on “belief modification”. This involved dealing with an it that has a preconceived belief and the process of “learning” modifies this belief. Well, it is also possible that “learning” may not modify but rather make the belief even more resistant to change. This may or may not lead to good consequences.

What remained a puzzle for me at the time was to figure out how it understands and how a belief comes to exist within it in the first place. That is the work I’m doing now for my PhD. The current conviction I have via my research is that it need not be a carbon based life form for it to have an understanding of understanding, an understanding of self vs non-self and even in the case where it may have an understanding of the divine, it need not have an anthropomorphic form. All that is necessary is “information transfer” which is caused merely due to a change within it. And this change happens due to degrees of freedom that exist by default in every portion of the universe.

I now regard every articulation i.e. movement made by a system as “encoding”. Any change is defined as “process”. Also, any change within the system is, coincidentally, defined as “computation”. Actually, encoding, process, computation and cognition are identical. So it’s not possible anymore for me to not consider myself a programmer or deny my capacity of being programmed or get rid of the capacity to store a program within my construct. This is because every physical thing is simultaneously a program, a programmer and is programable.

The only challenge is that not every so called it i.e. thing or system or symbol, is endowed with the same degrees of freedom. It is never in isolation of an environment. None of the parts of it are independent of other constituent parts. And to modify the degrees of freedom of an it in order to rig a particular configuration of its parts requires a cascade of recurrent changes within its ecology. Fortunately or unfortunately the trend (rate of change) within these recurrent changes cannot be guaranteed to be constant nor sustainable. The changes may, in fact, come to destroy and erase every trace of it. All of this jazz happens in a fractal manner where things repeatedly tend towards nothingness and from nothingness to infinity.

In light of all this, the thing that I have always desired and, still do, is to explore other planets. In my endeavor to do so I’m working on incremental steps and utilizing my small solutions in different work domains. My work in

  • generic signal acquisition and archival is being implemented for long range telecommunications and remote operation,
  • signal classification is being used for collision detection, augmented reality and navigation
  • all the OpenCV related stuff is going directly into paying for my sustenance ;)

However, in all these years I haven’t fallen in love with OpenCV, I don’t even consider it the most important library that a coder ought to learn. OpenCV is an atrocious beast of a library that was terribly organized in its early days and even today it is a pain to install or use properly. Much of OpenCV is poorly documented and the python bindings have been a half baked afterthought. Due to such issues I came to appreciate python virtualenvirontment, SWIG, scikit-learn, ROSPy and various general aspects of scripting and design. Indeed, I’m truly invested in OpenCV and in its future. Relative to its humble beginnings in Intel IPP the library has come a long way and has become an important part of my repository. I know that it is my responsibility, like that of others in the community, to improve it. So in the coming months one of my top priority is to get more involved with the OpenCV community and make actual contributions to its Github repo. This will require me to get more accustomed to git workflow and that will certainly be for my betterment.

A year after graduating from University of Iowa, in March of 2011, I discovered Python and felt lucky as well as relieved for being liberated from Matlab, C, TCL and Java. In September of 2012, I was introduced to the word “opencv” by Thomas Hansen, one of the early developers involved with Kivy. After seeing just a few youtube videos I immediately felt that OpenCV had promise and that I ought to choose it over a javascript based language called Processing which had become popular amongst those involved in generative art. I felt so because OpenCV seemed generic enough for addressing a much larger set of concerns in signal detection and signal processing. I moved to India in November 2012 and it took me more than six months, with weekly breaks due to frustration, to figure out how to install OpenCV 2.4 on a Mac OS X with python bindings while accessing internet from behind a firewall. Merely seeing “import cv2” work for the first time was like experiencing a miracle! By February 2014 I was earning a decent salary in a company focused on crowd analysis using computer vision because of my small strides in using OpenCV. I am now pushing my own venture in developing automated systems with augmented reality but even now, I don’t feel like an all powerful designer or architect when my codes seem to produce a desired outcome. I merely feel a sense of relief that I am heading in the right direction and yes, all of coding is magic.


3 thoughts on “Still not in love with OpenCV

  1. I remember stumbling on your blog when I was trying to get OpenCV to work on my Mac. As a matter of fact, your blog is still on my list of bookmarks! Though I never got OpenCV to work on my Mac, I have subconsciously followed your blog.

    I did install OpenCV on Windows and experimented with it. It certainly is very useful for image processing, but I don’t know why it is so poorly documented.

    1. hello Hassan, thank you for following this blog. Indeed the python documentation for opencv hasn’t improved, specially the tutorials need lot more work. And the ones who are supposed to do that work are all of us. The last time there was a push for python documentation and tutorials was from Abid K Rahman when he was at Google Summer of Code in 2013. Since then no new python tutorials have come up though the new opencv3.0.0 has lots of interesting additions.

      Btw, the easiest approach to installing opencv on a mac is to use macports or homebrew. But even with those you have to be careful to get the python bindings correct.

  2. I’m very new to OpenCV, and have found the subject a bit overwhelming..

    While there is lots of examples, each with different ways of doing the same thing, it’s hard to know when to apply one over the other, or even if a technique is now considered obsolete.

    For example, to do face or any other object recognition, are Haar Cascades no longer used? I assume the general procedure of collecting images is the same, but would you still run opencv_createsamples in order to generate positive images superimposed on negative ones? And if not Haar, how are xml cascades created for non-face objects?

    I haven’t purchased the book/video from PyImageSearch yet… do you recommend it? I found some tutorials here, but sadly it’s all in italian:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s