In computer vision, there is always a need to track the motion of an object or blob across frames in a moving sequence. Various methods have been investigated in literature for this purpose. One very interesting method for motion estimation and tracking is optical flow. In simple terms, optical flow gives the measure of movement of a pixel or a block in two consecutive frame. This measure of movement is given in the form of a vector where the magnitude of the vector signifies the amount of motion and the angle of the vector specifies the direction of the motion. This vector is called motion vector.
In Computer Vision applications, one very important factor to cater for is the capability of the system to work in real-time. The tasks of object tracking and recognition are computationally expensive and thus they are need to be implemented in a platform that can execute them in a more optimized manner.
Why OpenCV? Why not MATLAB?
We are usually trained well to work in MATLAB. MATLAB is a very good platform for basic testing of the system, for running simulations and for applications that are not computationally expensive. However, in reality most of the computer vision applications are real-time and thus MATLAB is not a good option. In these cases, experts recommend to use OpenCV where we need real-time processing. Starting a new language could be intimidating for a beginner. That is why here we will demonstrate that OpenCV is not difficult at all. In fact it has so many built-in functions and Computer Vision libraries that can decrease the length of our code dramatically.
OpenCV can be used with either Python or C++. Both p...