Almost all of us have used CamScanner (or a similar app) in our lives. It is a very effective app which allows users to scan documents from your mobile and share it as an image. The biggest advantage of the application is that it ‘cleans’ (denoising, rotation, sharpened, etc) up a camera-clicked image into a very refined output. But did you know that Computer Vision is the science behind it, and we can create our own CamScanner using the basics of OpenCV in Python.

Importing Library

import numpy as np
import cv2
import re
from matplotlib import pyplot as plt

Image Path

path =…

Open-source software provides users with the freedom of code sharing, modifying, and redistributing. Most open-source software is available for free (this may not always be the case) hence commonly coined as Free and Open Source Software (FOSS).

Open source is a great way to get real-world software development experience from the comfort of your home. The open-source community is very helpful and encourages new developers to take part in their organizations. You gain exposure, test your skills, gain knowledge, and bond with the community to produce quality code that helps people around the world. …

Image by Author (Harshil, 2020)

In this tutorial, we’re going to create and train our own face mask detector using a pre-trained SSD MobileNet V2 model.

First we will create our own image dataset and later we will see how to train a Custom Model for Object Detection (Local and Google Colab!)

1. Installation

1.1 Tensorflow

Install Tensorflow using the following command:

$ pip install tensorflow or pip install tensorflow==1.15

If you have a GPU that you can use with Tensorflow:

$ pip install tensorflow-gpu

1.2 Other dependencies

$ pip install pillow Cython lxml jupyter matplotlib

Install protobuf using Homebrew (you can learn more about Homebrew here)

$ brew install protobuf


This is a question that has haunted me for years, and I could never begin for a long time. Finally, it turned out to be a simple lesson: “start by doing”, and that’s all that is required. The only problem in this statement is what exactly to start with.

Step 1

A. Programming Language

The first step is to choose a programming language (only choosing and not mastering). Once you choose a programming language, you only need to know some basic functionalities and shouldn’t really bother about mastering the language at this point. …

In this tutorial we are going to learn how to perform Facial recognition with OpenCV python in Pycharm. Head on to our Pycharm project. Here we will install the required packages. Below is the list.

  • cmake
  • dlib (try installing lower version)
  • face_recognition
  • numpy
  • opencv-python


First we will import the relevant libraries

import face_recognition

import cv2

import numpy as np

Loading Images and Converting to RGB.

The Face Recognition package consists of a load image function that loads the image. Once imported the image has to be converted to RGB.

imgmain = face_recognition.load_image_file('ImageBasics/Bryan_Cranst.jpg')
imgmain = cv2.cvtColor(imgmain, cv2.COLOR_BGR2RGB)
imgTest = face_recognition.load_image_file('ImageBasics/bryan-cranston-el-camino-aaron-paul-1a.jpg')
imgTest = cv2.cvtColor(imgTest, cv2.COLOR_BGR2RGB)…

Android 11 developer preview came with lots of new and amazing features focusing on 5G integration, scoped storage, improved privacy and security, and more. One of my personal favorite feature is Wireless debugging. It is a new method for deploying and debugging your app wirelessly from your workstation.

Requirements :

  1. Device running with Android 11
  2. SDK platform-tools with version ≥ 30.0.0.
  3. Same Wi-Fi network for Android device and your PC

Wireless debugging

Android 11 supports deploying and debugging your app wirelessly from your workstation via Android Debug Bridge (adb). …

In these tough COVID-19 times, everyone want to make something related COVID-19 and which is also useful for others. So why not to build a very simple and basic OpenCV project to detect if you are wearing a face mask to protect yourself, which also shows you accuracy of it.

For building this model, We will be using the face mask dataset provided by Prajna Bhandary. It consists of about 1,376 images with 690 images containing people with face masks and 686 images containing people without face masks.

Given the trained COVID-19 face mask detector, we’ll proceed to implement two…

I have several friends that have been furloughed from their jobs or some that are no longer working since Covid-19 came along. I wanted to share some tips to earn a few bucks or swag during this time period for them.

We’ve all seen the countless plots, gimmicks, articles, and suggestions on what you can do to make money online — but I’m not going to add most of those jobs in here. No survey taking, or video watching — only legitimate jobs you can do from your computer…

The Blog Itself (Blogging)

Many people start with Blogger or — they are the…

We are going to use Python and OpenCV to play the dinosaur game. Here I’m using Windows, and my webcam for the camera feed, but you can use most of the code for Linux and MacOS as well.

We are basically going to play the Chrome Dinosaur game using hand movements from the camera feed.


A glimpse of what our final code does.

Let’s Start

You need the following libraries

import numpy as np
import cv2
import math
import pyautogui

Pyautogui: PyAutoGUI is a Python module for programmatically controlling the mouse and keyboard without any user interaction.

Opening Camera and setting up the rectangle

# Open Camera

If you are a Harry Potter fan , you would know what an Invisibility Cloak is. Yes! It’s the cloak that makes Harry Potter invisible. We will make this happen with few line of python code in OpenCV.

How it works

This technique is opposite to the Green Screening. In green screening, we remove background but here we will remove the foreground frame.

  1. Capture and store the background frame
  2. Detect the defined color using color detection and segmentation algorithm.
  3. Segment out the defined colored part by generating a mask.
  4. Generate the final augmented output to create a magical effect. [ output.avi ]

Let’s Start

You need the following libraries


Harshil Patel

Tech Lead and Founder at @XenonStudio. #Mobile #AI. Visit :-

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store