Saturday , December 21 2024

Computer Vision

OpenCV Python Project for Bus Detection from an Image

2 OpenCV Python Project for Bus Detection from an Image OpenCV Python Project for Bus Detection From an Image¶In this tutorial, we’ll code a system for counting and detecting vehicles. It will be sufficient to function for both still images and moving pictures. For the same, we’ll be using OpenCV …

Read More »

OpenCV Python Project for Vehicle Detection From an Image

1 OpenCV Python Project for Vehicle Detection From an Image OpenCV Python Project for Vehicle Detection From an Image¶In this tutorial, we’ll code a system for counting and detecting vehicles. It will be sufficient to function for both still images and moving pictures. For the same, we’ll be using OpenCV …

Read More »

Face Detection with Name in Python using OpenCV

15 Face Detection with Name Face Detection with Name in Python using OpenCV¶ python -m pip install opencv-contrib-python pip install pillow Step 1: Collect 20 Samples of a Face¶ In [11]: import cv2 cam = cv2.VideoCapture(0) detector=cv2.CascadeClassifier('haarcascade_frontalface_default.xml') Id=input('Enter Your Id:') sampleNum=0 while(True): ret, img = cam.read() gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) faces …

Read More »

Face Detection From an Image in Python using OpenCV

13 Face Detection from Image Face Detection From an Image in Python using OpenCV¶ https://github.com/opencv/opencv/tree/master/data/haarcascades You need to download the trained classifier XML file (haarcascade_frontalface_default.xml), which is available in OpenCv’s GitHub repository. Save it to your working location. The detection works only on grayscale images. So it is important to …

Read More »

Record Video From a Webcam using OpenCV

12 Record Video using OpenCV Record Video From a Webcam using OpenCV¶ cv2.VideoWriter( filename, fourcc, fps, frameSize ) The parameters are : filename: Specifies the name of the output video file. fourcc: (for recording) Defining the codec fps: Defined frame rate of the output video stream frameSize: Size of the …

Read More »

Access Camera Using OpenCV with Python

11 Open Webcam Access Camera Using OpenCV with Python¶ first, we Import libraries OpenCV. Then we use VideoCapture(0) function to capture the feed of the webcam, here 0 indicates the default value of webcam. If you have secondary webcam use 1 instead of 0 Now read the frame of the …

Read More »

Arithmetic Operations on Images using OpenCV

10 Arithmetic Operations on Images using OpenCV Arithmetic Operations on Images using OpenCV¶Arithmetic Operations like Addition, Subtraction, and Bitwise Operations(AND, OR, NOT, XOR) can be applied to the input images Addition Subtraction Bitwise operations are used in image manipulation and used for extracting essential parts in the image. In this …

Read More »

Visualizing the Different Color Channels of an RGB Image in Python using OpenCV

9 Visualizing the different color channels of an RGB image. Visualizing the Different Color Channels of an RGB Image in Python using OpenCV¶ In [2]: import cv2 img = cv2.imread('ocv2.png',1) cv2.imshow('Machine Learning',img) cv2.waitKey(0) cv2.destroyAllWindows() In [3]: import cv2 img=cv2.imread("ocv2.png",1) B, G, R = cv2.split(img) print(B) print(G) print(R) [[255 255 255 ... 255 …

Read More »