Real Time Image Processing Using Python & OpenCV

OpenCV is a library of cross platform programming functions aimed at real time Computer Vision. IT was designed for computational efficiency and with a strong focus on real-time applications, video and image processing. Python is a widely used general-purpose, high-level  programming  language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in languages such as C.

The  language  provides  constructs  intended  to enable  clear programs on both a small and large scale. The growing demand of integrating OpenCV with python promises clear cut solutions to image processing problems. Since the tools are open source, researchers can exploit the freedom and possibilities of expansion.  Wide  spread applications in the field of robotics underlines the scope of OpenCV for image processing. Image classification, segmentation, feature extraction etc are made with suitable libraries and it can be invoked through many of the programming languages.

Here in Raspberry Pi Opencv is invoked through Python. So we need the updated version of both Python and Opencv.

Click here to get the detailed instructions to install Opencv and Python in Raspberry Pi 2.

For an example let us move on to a python program that runs a real time video from webcam using Opencv interface. After the installation of opencv a new folder will be created in the home. In this folder there are some python sample codes based on image processing.

By running this code we can see the continuous capturing of frames from the webcam. The Opencv should be imported using the import cv2 command at the beginning of the program. at the end of the program there are four options interfaced with the keyboard commands. if ‘1’ is pressed the corresponding frame is saved and by pressing continuously alternate images will be saved. For ‘2’, ‘3’ and  ‘4’ keys the resolution of the frame will be changed.

Opencv and RPi Camera

A sample code is given to access continuous frames from the RPi camera based on Python and Opencv.

 Color, face edge detection processes are there in the Opencv library and it could be easily interfaced with the python to perform heavy applications.

Shop With Us

  • Click here to buy Raspberry Pi 2 from RhydoLabz.
  • Click here to buy Raspberry Pi 2 Starter Kit from RhydoLabz.
  • Click here to buy Raspberry Accessories from RhydoLabz.

Resources

  • An open source website by Raspberry Pi foundation.
  • Get started with Python programming.
  • Opencv

 

Leave a Reply