Posted in Face Detection

How To capture a video using open cv

Hi there, This is Goutham From DIYblogger. Once again we are back with a interesting post.

In this blog we will going to discussing about How to capture a video using open cv python module

Let’s get start

Step 1: You should be clear whether you have installed python open cv module in your computer or laptop.

Step 2: Open Your Favorite code editor.

Step 3: Source code

import cv2

video = cv2.capture(0)

It means that we are using our laptop camera to capture the video or you can “1” also. In case if you are using your Webcam then you can mention your ID in that brackets.

while(True):

res,cap = cv2.imshow(video)

cv2.WaitKey(5)

If you have any doubts regarding this post you can approach me by simply post a comment.

For more information you can follow me on instagram (goutham_0306).

Posted in Face Detection

Face Detection using Open CV python module

For Every Student or For every programer face detection is enthusiastic. Using Python Open CV module you can detect the faces and shapes of the object.

So. In this blog You will Learn the Basics of face detection First and we will move on to the real world projects

Required Modules for Face Detection

1.Open CV module

2.Numpy module

If You don’t know much about this module please go and search for these modules..

First of all you need to install open cv module in your laptop or desktop.

Open Command prompt and type pip install opencv-python

And for numpy module type pip install numpy

Then open your Favorite IDE for writing the code

Source code :

import cv2

import numpy as np

img = cv2.imread(‘Mention the name of the image’)

// the img variable in the above statement will capture the image that we have specified and be clear that , this file and the image should be in same path. Otherwise you should the exact path of the image

cv2.imshow(‘Basics of Face Detection’,img)

//This statement will pop the window with the title “Basics of Face Detection ” with the image that you have mention in the previous step on the python output console

cv2.waitKey(5000)

cv2.waitKey () this function will shows the output window with the image upto the time which we have given in the brackets