Python Opencv - Realtime Object Detection

by jijov3 in Circuits > Software

2791 Views, 4 Favorites, 0 Comments

Python Opencv - Realtime Object Detection

pythonHD_instructables.png

This document created for explaining the steps of Python - opencv based Realtime Object Detection.

Lets Welcome.

Here I'm using Linux mint latest Operating System and following are installation and basic setups for Python - opencv Real-time Object detection Project.


Here I'm trying to do experimental project and explained it as a tutorial for interested people. I tried to cover all basic to advanced level of python coding scenarios.

In this Epic I tried to cover following areas of development.

Project Included with :-

  1. Python Installation and Basic Setups
  2. Basics of Images and dimensions Calculations
  3. Capture Images, Videos and Web cam
  4. Basic Functions
  5. Resizing and Cropping
  6. Shapes and Texts
  7. Warp Perspective
  8. Joining Images
  9. Colour Detection, Contours / Shape Detection
  10. Face Detection
  11. Virtual Pain
  12. Document Scanner
  13. Number Plate Detection

Above mentioned items will get uploaded on sequence of chapters.

You can go through the Intro part of the Python - opencv Real-time Object Detection below,

Python Openv - Real-time Object Detection - INTRO

Python - opencv Real-time Object Detection - INTRO

Chapter 1 - Python Installation and Basic Setups

Here I'm covering Python3 installation, PyCharm IDE installtion and Other setup for running our Project.

Python 3 Installation (python 3.8.2)

For python installation , it will take only few minutes for installation and basic verification of installed version. Checkout python official Site for getting the latest version details (here I'm installing 3.8.2 version)

1. Change user to Super User mode

 sudo su
 Password *********

2. update and upgrade the packages

 apt-get update
apt-get upgrade

3. python version installation

apt-get install python3.8.2

4. After installation Check Version

 python3 -V

Installation of following Package would be beneficial for further proceeding of our project


1. install pip3 Package

Repeat Step 2 of Above Installation, then execute the following command

 apt-get install python3-pip

2. Check Installed version

 pip3 --version


Installation of open-cv package for Object detection.


1. install opencv using pip command

 pip3 install opencv-python

You can see downloading of data and installation of packages

2. Verifying opencv package

  • open terminal and enter "pyhton3" to activate the terminal as python editor
  • enter import statement, print statements
import cv2 as cv 
print("Hello World!...") 
print(cv.__version__) 
ctrl + z to exit editor.


PyCharm Installation (Community Version)

PyCharm IDE selected for development of this project, following will explain how to install PyCharm in your beast.

1. Get the Latest PyCharm installation from official download site (PyCharm Download) and download Community version

2. Extract the download and get into pycharm-community-2020.2.1/bin/ and run pycharm.sh

3. Install the plugins, which mentioned in the PyCharm IDE.


Create a short cut for PyCharm IDE


1. Open Terminal and switch to Super User mode

2. Change directory to /usr/share/applications (check the available files by using ls command )

3. Create a file named pycharm.desktop

[Desktop Entry]<br>Type=Application
Name=PyCharm IDE
GenericName=For Specifically for Python
Exec="your directory path"/pycharm-community-2020.2.1/bin/pycharm.sh
Icon="your directory path"/pycharm-community-2020.2.1/bin/pycharm.png
Terminal=false
Categories=Development;

4. Check application menu, you can find pycharm application list there

Python Installation and Basic Setup - Video Presentation

Chapter 1 - Python Installation and Basic Setup

Basics of Images and Dimensions

Chapter 2 - Basics of Images and Dimensions

Capture Images, Videos and Webcam

Chapter 3 - Capture Images, Videos and Webcam

Sample Code included in the git hub repo, you can refer below url . In future repository will update with real-time object detection codes.

https://github.com/JijovarghesePunalur/pythonOpenC...

Chapter 4 - Basic Functions of Images

chapter4.png