Pedestrian Detection using OpenCV from Videos

Krish Naik · Beginner ·📐 ML Fundamentals ·7y ago

Key Takeaways

Pedestrian detection using OpenCV from videos, utilizing the Haar cascade classifier for full-body detection

Full Transcript

hello on another pretty cool tutorial that I'm going to show with respect to open CV that is we are I'm going to plan to show to you that how to detect industry thank you so I have two use cases one is car detection in a particular video and British situation British steel detection from a particular video now what I'm going to do is that for this we need an another classifier which is called as our cascade full underscore full-body dot XML and this particular XML file you can you know definitely get it from this particular URL anyhow in my github I will be uploading this you can download it from there too now this full-body dot XML actually helps you to see it will try to find out the features and a person is trying to move the whole body it will be able to detect it so here I'm having and video which is called as walking dot a Evi if I if I just show you the video right now and then once I play this video what I should be able to do is that by using hard casket I'll be and using these features I will be able to detect the person walking in that particular video and we can draw a rectangular or a square or a rectangular box on the top of the person that the person is trying to walk right when the person is walking will draw a rectangle box to indicate that the person is moving so all the concepts are same we'll be using video capture we'll be uploading that to videos ok whichever path we do is actually present and gap is the variable that actually you know that has the context of the whole variable so I'm just going to put a condition which says file cap is open so unless until this cap video this gap variable is you know having that particular video I'm going to capture the frames by using cap dot rate and then I'm going to convert each and every frames into gray color you know converted need to pray because it really definitely need a time if I have all the frames in RGB formats so because of that I am converting into great then by using this body classifier that I had created this casket classifier from the features of har cascade from disco full-body dot XML what I am doing is that I am trying to detect the features frog from this particular gray image refrain basically so whenever I detect I'll be getting four coordinates at his X Y WH and from this bodies I will be actually getting I'll be drawing a rectangular rectangle shape by considering my x and y coordinates and my end coordinates will be by X plus W and y plus h and this is basically to determine some colors we will see what color the rectangle box will be displaying it and finally I am going to I am show that I am showing this particular beam and the frame and the frame name or the window name will basically be pedi streets so let us see how though I mean from this video how how this particular frames get out how does the rectangle gets created whenever the person are walking and here you can see clearly that it is detecting many faces many many persons who are walking we are able to get a lot of information from this so I hope you know this is a very good use case with respect to hard casket on this whole body so if you can integrate this code in any cameras in any IP cameras you should be able to detect the person I hope you like this video guys and if you are not sure if you're not subscribed to channel please do subscribe it and the my next tutorial will be coming with a use case where I can where I'll be able to detect cars in the particular videos I hope you like this videos keep learning have a great day thank you

Original Description

Here is a use case to show how we can detect pedestrians walking in the street from videos. Please subscribe and support the content. Github url: https://github.com/krishnaik06/Computer-Vision-Tutorial Follow me on facebook: https://www.facebook.com/Machine-Learning-And-AI-1044537319033065 Below are the other playlist Machine learning: https://goo.gl/XhHdCd Deep Learning : https://goo.gl/iwek57 Statistics in ML :https://goo.gl/x7mkUH Feature Engineering:https://goo.gl/6wiaGt Data Preprocessing Techniques: https://goo.gl/YfC9Kc
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Krish Naik · Krish Naik · 12 of 60

1 Natural Language Processing|Stemming
Natural Language Processing|Stemming
Krish Naik
2 Natural Language Processing|BagofWords
Natural Language Processing|BagofWords
Krish Naik
3 Gaussian distribution or Normal Distribution in statisctics
Gaussian distribution or Normal Distribution in statisctics
Krish Naik
4 Natural Language Processing|TF-IDF for Machine Learning| Text Prerocessing
Natural Language Processing|TF-IDF for Machine Learning| Text Prerocessing
Krish Naik
5 Log Normal Distribution in Statistics
Log Normal Distribution in Statistics
Krish Naik
6 Covariance in Statistics
Covariance in Statistics
Krish Naik
7 Confusion matrix, Precision, Recall| Data Science Interview questions
Confusion matrix, Precision, Recall| Data Science Interview questions
Krish Naik
8 Tutorial 44-Balanced vs Imbalanced Dataset and how to handle Imbalanced Dataset
Tutorial 44-Balanced vs Imbalanced Dataset and how to handle Imbalanced Dataset
Krish Naik
9 Implementing a Spam classifier in python| Natural Language Processing
Implementing a Spam classifier in python| Natural Language Processing
Krish Naik
10 Tutorial 11-Exploratory Data Analysis(EDA) of Titanic dataset
Tutorial 11-Exploratory Data Analysis(EDA) of Titanic dataset
Krish Naik
11 Face Recognition using open CV and VGG 16 Transfer Learning
Face Recognition using open CV and VGG 16 Transfer Learning
Krish Naik
Pedestrian Detection using OpenCV from Videos
Pedestrian Detection using OpenCV from Videos
Krish Naik
13 Face and Eye Detection from Videos using HAAR Cascade Classifier
Face and Eye Detection from Videos using HAAR Cascade Classifier
Krish Naik
14 Reading, Writing and Displaying images with Opencv| OpenCV Tutorial
Reading, Writing and Displaying images with Opencv| OpenCV Tutorial
Krish Naik
15 OpenCV Installation | OpenCV tutorial
OpenCV Installation | OpenCV tutorial
Krish Naik
16 Face and Eye Detection from Images using HAAR Cascade Classifier
Face and Eye Detection from Images using HAAR Cascade Classifier
Krish Naik
17 Car Detection using HAAR Cascade and Opencv from Videos.
Car Detection using HAAR Cascade and Opencv from Videos.
Krish Naik
18 Using OpenFace for Face recognition in Keras
Using OpenFace for Face recognition in Keras
Krish Naik
19 OpenPose Tutorial with Tensorflow
OpenPose Tutorial with Tensorflow
Krish Naik
20 Multiple Linear Regression using python and sklearn
Multiple Linear Regression using python and sklearn
Krish Naik
21 Dimensional Reduction| Principal Component Analysis
Dimensional Reduction| Principal Component Analysis
Krish Naik
22 Movie Recommender System using Python
Movie Recommender System using Python
Krish Naik
23 TPR,FPR,FNR,TNR, Confusion Matrix
TPR,FPR,FNR,TNR, Confusion Matrix
Krish Naik
24 Precision, Recall and F1-Score
Precision, Recall and F1-Score
Krish Naik
25 Artificial Neural Network for Customer's Exit Prediction from Bank
Artificial Neural Network for Customer's Exit Prediction from Bank
Krish Naik
26 GridSearchCV- Select the best hyperparameter for any Classification Model
GridSearchCV- Select the best hyperparameter for any Classification Model
Krish Naik
27 RandomizedSearchCV- Select the best hyperparameter for any Classification Model
RandomizedSearchCV- Select the best hyperparameter for any Classification Model
Krish Naik
28 K Nearest Neighbor classification with Intuition and practical solution
K Nearest Neighbor classification with Intuition and practical solution
Krish Naik
29 K Means Clustering Intuition
K Means Clustering Intuition
Krish Naik
30 Create custom Alexa Skill- Lambda function- Part2
Create custom Alexa Skill- Lambda function- Part2
Krish Naik
31 Hierarchical Clustering intuition
Hierarchical Clustering intuition
Krish Naik
32 Implement Transfer Learning with a generic Code Template
Implement Transfer Learning with a generic Code Template
Krish Naik
33 Gender Classifier and Age Estimator using Resnet Convolution Neural Network
Gender Classifier and Age Estimator using Resnet Convolution Neural Network
Krish Naik
34 Unlock Your Application With Your Face using OpenCV
Unlock Your Application With Your Face using OpenCV
Krish Naik
35 Draw rectangle from webcam and sketch process it on a live feed
Draw rectangle from webcam and sketch process it on a live feed
Krish Naik
36 Complete Life Cycle of a Data Science Project
Complete Life Cycle of a Data Science Project
Krish Naik
37 How we can apply Machine Learning in Finance
How we can apply Machine Learning in Finance
Krish Naik
38 Deep Learning in Medical Science
Deep Learning in Medical Science
Krish Naik
39 How to switch your career to Data Science.
How to switch your career to Data Science.
Krish Naik
40 Linear Regression Mathematical Intuition
Linear Regression Mathematical Intuition
Krish Naik
41 Handle Categorical features using Python
Handle Categorical features using Python
Krish Naik
42 Machine Learning Algorithm- Which one to choose for your Problem?
Machine Learning Algorithm- Which one to choose for your Problem?
Krish Naik
43 DBSCAN Clustering Easily Explained with Implementation
DBSCAN Clustering Easily Explained with Implementation
Krish Naik
44 Curse of Dimensionality Easily explained| Machine Learning
Curse of Dimensionality Easily explained| Machine Learning
Krish Naik
45 Feature Selection Techniques Easily Explained | Machine Learning
Feature Selection Techniques Easily Explained | Machine Learning
Krish Naik
46 Tutorial 29-R square and Adjusted R square Clearly Explained| Machine Learning
Tutorial 29-R square and Adjusted R square Clearly Explained| Machine Learning
Krish Naik
47 Cross Validation using sklearn and python | Machine Learning
Cross Validation using sklearn and python | Machine Learning
Krish Naik
48 Handling Missing Data Easily Explained| Machine Learning
Handling Missing Data Easily Explained| Machine Learning
Krish Naik
49 Deploy Machine Learning Model using Flask
Deploy Machine Learning Model using Flask
Krish Naik
50 Deployment of Deep Learning Model using Flask
Deployment of Deep Learning Model using Flask
Krish Naik
51 How to Visualize Multiple Linear Regression in python
How to Visualize Multiple Linear Regression in python
Krish Naik
52 K Nearest Neighbour Easily Explained with Implementation
K Nearest Neighbour Easily Explained with Implementation
Krish Naik
53 Predicting Heart Disease using Machine Learning
Predicting Heart Disease using Machine Learning
Krish Naik
54 Predicting Lungs Disease using Deep Learning
Predicting Lungs Disease using Deep Learning
Krish Naik
55 Stock Sentiment Analysis using News Headlines
Stock Sentiment Analysis using News Headlines
Krish Naik
56 Random Forest(Bootstrap Aggregation) Easily Explained
Random Forest(Bootstrap Aggregation) Easily Explained
Krish Naik
57 Voting Classifier(Hard Voting and Soft Voting Classifier)
Voting Classifier(Hard Voting and Soft Voting Classifier)
Krish Naik
58 Credit Card Fraud Detection using Machine Learning from Kaggle
Credit Card Fraud Detection using Machine Learning from Kaggle
Krish Naik
59 Hyperparameter Optimization for Xgboost
Hyperparameter Optimization for Xgboost
Krish Naik
60 Tutorial 45-Handling imbalanced Dataset  using python- Part 1
Tutorial 45-Handling imbalanced Dataset using python- Part 1
Krish Naik

This video tutorial demonstrates how to detect pedestrians in videos using OpenCV and the Haar cascade classifier. The code is explained step-by-step, and the output is shown in a video. The tutorial is beginner-friendly and provides a good introduction to object detection in computer vision.

Key Takeaways
  1. Import OpenCV library
  2. Load the video file
  3. Convert frames to grayscale
  4. Use Haar cascade classifier for full-body detection
  5. Draw rectangles around detected pedestrians
  6. Display the output video
💡 The Haar cascade classifier can be used for full-body detection in videos, allowing for pedestrian detection and tracking.

Related Reads

📰
Learning What Matters in Calorimeter Events
Learn to identify key features in calorimeter events using machine learning techniques and improve collision physics analysis
Medium · Machine Learning
📰
What Skills Are Required for an AI Job?
Learn the key skills required to succeed in an AI job and why they matter for a career in this field
Medium · Machine Learning
📰
AI ile Geleceğin Yıldızlarını Keşfetmek: Futbolcu Değer Artışı Tahmini Projesi
Use machine learning to predict football player value increase over time
Medium · Machine Learning
📰
Architecting Low-Latency Real-Time AI Pipelines: Edge Streaming, Vector Indexing, and Concurrency…
Learn to architect low-latency real-time AI pipelines using edge streaming, vector indexing, and concurrency to improve application performance
Medium · Machine Learning
Up next
Generative vs Discriminative Models - Explained
DataMListic
Watch →