# How to perform canny edge detection to detect the head portion and to count the people who are entering into a room?

3 visualizzazioni (ultimi 30 giorni)
AVINASH il 24 Gen 2015
Risposto: Rahul punk il 15 Feb 2019
Very firstly I would like to thank you for your help and support you did for my last questions.
And now for a project I took a video from webcam (or any video recorder) which is mounted at the top of door in such a way that it is capturing the top view of head of a person. By performing the image subtraction of a reference image (which is taken when there is no person in the first frame) with the subsequent frames(5 frames/sec) I was able to get the head portion of a single person.
I need to perform the canny edge detection, there by I can get the head portion. Consider the case, when more than one person entering into the room and I need to detect the head portion, Once I performed the detection of head, there is a need to count the number of people who are entering into the room, the thing is that it should count when more than one person entering into the room at a time.
Overall It will leads to project of "Real time people counting using Image Processing". I am in the need of MATLAB code related to the case I told. The code should detect and count the number of people based on detecting the top view of head portion of person/persons entering into a room. If you are knowing the code or related one or any web links related to this project, please send the reply to me. I will greatly appreciate your job.
With regards,
Avinash P
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
Andy Chou il 14 Set 2016
I have the same question with you. Do you find the solution? Thanks

Accedi per commentare.

### Risposte (2)

Mohammad Haghighat il 5 Ott 2016
You said you have already done the background subtraction, and now, you have the foreground image (FG). What you need to do is to make the foreground image binary and then count the connected components in the binary image:
% Get the binary image using Otsu's thresholding
level = graythresh(FG);
BW = im2bw(FG,level);
% Get the number of connected components
CC = bwconncomp(BW);
N = CC.NumObjects;
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

Rahul punk il 15 Feb 2019
https://www.mathworks.com/matlabcentral/fileexchange/70220-rahulpunk?s_tid=prof_contriblnk
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Video Formats and Interfaces in Help Center e File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by