How To Read An Image From A URL In OpenCV-Python

1 mainReading an image from a file is fairly straightforward in OpenCV-Python. But a lot of times, we would like to read an image from a URL and process it in OpenCV. One way to do it is to download the image, save it as a jpeg file, and then read it in OpenCV. But that’s too tedious! Who wants to do manual labor? Not me! Another way would be to automatically download the image as a jpeg file using wget and then reading it in OpenCV. This is slightly better, but it’s again a roundabout way of doing it because there is an intermediate step of saving the image on disk. How do we circumvent this and directly load an image from a URL into OpenCV-Python?   Continue reading

Installing OpenCV 3 With Python On Mac OS X

1 mainOpenCV is the world’s most popular computer vision library and it’s used extensively by researchers and developers around the world. OpenCV has been around for a while now and they add something new and interesting with every new release. One of the main additions of OpenCV 3 is “opencv_contrib” which contains a lot of cutting edge algorithms for feature descriptors, text detection, object tracking, shape matching, and so on. They have greatly improved Python support in this release as well. Since OpenCV is available on almost all the popular platforms, this version looks very promising. Let’s see how to install OpenCV 3 with Python support on Mac OS X.   Continue reading

Package OpenCV not found? Let’s Find It.

mainOpenCV has been refined over the years and installing it has become way more user-friendly now. If has been ported to many platforms and you don’t need an IDE to use it. There are many different ways in which you can install it and use it in your existing code. But sometimes, when people try to do different things with it, they run into problems. This post deals with one such problem. When you write code that uses OpenCV, you need to tell your compiler where it is. The reason for this is that this location will contains all the libraries and binaries necessary for the header files to work in your code. If you don’t specify this, you will encounter the following error:   Continue reading

How To Build A Face Detector?

3D faceEver wondered if you can build a working face detector quickly? If you are in computer vision, you would have built a face detector one time or the other. If not, then you will be able to build one by the end of this post. This blog post is not about the concept or the algorithm behind real time face detection. We will only deal with building one. If you are not willing to get your hands dirty, then this post wouldn’t be very useful to you. Continue reading

OpenCV On Mac: How To Get It Up And Running?

opencvOpenCV is a computer vision library used extensively by people in the computer vision field. Until a couple of years ago, OpenCV was a bit hacky and the usage was not very straightforward. But determined efforts by multiple companies finally standardized the process and now it is nice and clean. Computer vision algorithms are computationally intensive, requiring lot of processing power to run in real time. Before OpenCV came along, the efforts were very fragmented and repetitive, and there was no standard library as such. Hence Intel decided to do something about it and came up with OpenCV. The advantage of OpenCV is that the algorithms are highly optimized and the library is available on almost all the popular platforms. I have outlined the procedure below to get OpenCV up and running on your Mac.   Continue reading