0% found this document useful (0 votes)
68 views8 pages

Crowd Monitoring Using HOG

This document summarizes a research paper on crowd monitoring using Histogram of Oriented Gradients (HOG) features and Support Vector Machine (SVM) classifiers. The goal is to develop a system that can more effectively monitor crowds. It discusses challenges with current human-operated visual surveillance systems, including the inability to continuously monitor multiple cameras. It then outlines the methodology used, including image acquisition from digital cameras, and building a graphical user interface in MATLAB to integrate object identification with 3D visualization and provide an easier way to track individuals.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views8 pages

Crowd Monitoring Using HOG

This document summarizes a research paper on crowd monitoring using Histogram of Oriented Gradients (HOG) features and Support Vector Machine (SVM) classifiers. The goal is to develop a system that can more effectively monitor crowds. It discusses challenges with current human-operated visual surveillance systems, including the inability to continuously monitor multiple cameras. It then outlines the methodology used, including image acquisition from digital cameras, and building a graphical user interface in MATLAB to integrate object identification with 3D visualization and provide an easier way to track individuals.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Volume 8, Issue 1, January – 2023 International Journal of Innovative Science and Research Technology

ISSN No:-2456-2165

Crowd Monitoring using HOG


Sri. N. V. Phani Sai Kumar
Assistant Professor
Electronics and Communication Engineering
SRKR Engineering College Bhimavaram

Abstract:- Many security and event management second, changing between cameras causes the overview and
agencies throughout the world are beginning to context to
understand the significance of crowd surveillance as
public safety concerns increase. These organisations can Y.Sriram Kalyan, U Akshaya,
avert any unforeseen mishaps or problems by estimating V LakshmiPravallika,Zayer Sakeena
crowd dynamics. The goal of this research is to develop a Electronics and Communication Engineering
system that can more effectively monitor crowds utilising SRKR Engineering College
Support Vector Machine (SVM) classifiers and Bhimavaram
Histogram of Oriented Gradients (HOG) features.
According to our needs, we can interface two or more to be lost, which is intellectually taxing and wearisome
cameras to count the number of individuals in the input for the security personnel. Operators often aren't able to
video of the cameras and to identify their locations in 3D maintain the appropriate degree of focus for more than 20 to
45 minutes as a consequence, which raises the cost of
space. This provides a sense of the density.
employees.
I. INTRODUCTION
Automated visual surveillance systems are one
Visual surveillance systems now in use often require solution to these issues. However, the difficulties of
human operators to watch video streams from various complicated scenarios as they arise in real-world
cameras, which is impossible when more cameras are applications are beyond the capabilities of current automated
viewed. This monitoring system is also concerned with systems. They can only be used in situations where there is a
identifying suspicious activities and keeping individuals low to medium density of people because to their limited
safe. dependability, which includes low recall and high false
alarm rates. Additionally, the installation and upkeep of such
A growing number of cameras need a growing number systems sometimes still need extensive hand-tuning, which
of displays as well as a growing number of viewers, both of becomes increasingly impractical as the number of cameras
which increase expenditures. Furthermore, human real-time rises.
monitoring is time-consuming and exhausting yet essential
for safety. This is a result of how the data from the camera is To solve these issues, we integrate object identification
shown to the observer as well: one monitor is coupled with with 3D visualisation and provide a graphical user interface
one or more cameras. This presents at least two issues: first, that makes it easier to track for individuals
a small window of time and location may be watched, and

IJISRT23JAN055 www.ijisrt.com 1031


Volume 8, Issue 1, January – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
II. METHODOLOGY The three methods listed below can be used in any
combination to develop an app in MATLAB:
A. Image acquisition  Convert a script into a simple app: When you wish to
The act of obtaining an image from sources is known as share a script with students or coworkers and let them
image acquisition. Hardware systems like cameras, change variables using interactive controls, use this
encoders, sensors, etc. can be used to do this. It is without a option.
doubt the most important phase in the MV workflow since a
bad picture would make the workflow ineffective as a Utilize the Live Editor to turn a script into a
whole. Gaining a picture with the proper quality and contrast straightforward app with interactive controls so that users
is crucial since machine vision systems only evaluate the can play around with the variables in your code. Without
digital image of the thing that has been captured, not the writing any code, add sliders, dropdowns, edit fields, and
actual object. buttons. Indicate which sections of the script should be
executed when a value is updated. To design
A set of photo-sensitive sensors turn an object's straightforward applications and dashboards, hide the
incoming light wave into an electrical signal during the coding. Others can utilise your live script in MATLAB or
picture capture process. These little components provide the MATLAB Online by sharing it with them. Interactive
function of accurately describing the item to your machine controls are useful for making a live script easier to use. If
vision algorithms. you wish to create a user interface with a more complex
layout or want greater control over theapp's behavior, you
It's a frequent fallacy that with an MV system,
should consider building a standalone app using App
choosing the correct colours is crucial. Though it's not
Designer.
always the case. Colors frequently increase noise and make
detection more challenging. The main objective of an image  Create an app interactively: Pick this option if you want
capture system is to increase contrast for the important to design a more complex user interface for your app
features. The appropriate image is one in which the camera utilising a drag-and-drop environment.
can see the object of interest. The components of an image
capture system will now be covered. Laying out the aesthetic components and scripting
the app's functionality are the two main duties of creating
There are four key components in the picture capture
an app, and App Designer is an interactive environment
system. While the efficacy of the sensors and cameras may
that merges both of these processes. It enables swift
vary depending on the technology available, the lighting
transitions between writing code in the MATLAB editor
systems are completely within the users' control. The
and visual design on the canvas. By utilising MATLAB
following list includes the principal image acquisition
Online or MATLAB Desktop, you may distribute your
components:
software for usage by others. The MATLAB Software tab
 Trigger
may also be used to bundle App Designer apps for
 Camera installation.
 Optics
 Illumination You may use MATLAB to build applications into
independent desktop and online apps to share with non-
Here we use the digital camera for image acquisition for our MATLAB users. You may interactively create your layout
convenience. and programme its functionality in one environment using
Compiler App Designer. You may programme the entire
B. Building GUI with a guide
software yourself if you'd like, including the user
Apps, or graphical user interfaces (GUIs), provide you
interface.
point-and-click control over your software programmes,
removing the need for others to learn a language or input  Create an app programmatically: If you wish to write
commands in order to utilise the programme. Apps can be the code for the user interface of an app, select this option.
shared for usage inside of MATLAB as well as outside of it You may also describe the structure and functionality of
as independent desktop or online applications. your app using MATLAB functions for more flexibility in
design and development. In this method, you build a
figure to act as the user interface's container and
programmatically add components to it. By utilising
MATLAB Online or MATLAB Desktop, you may
distribute your software for usage by others. Additionally,
applications may be packed and installed into the
MATLAB Apps page. You may utilise the MATLAB
Compiler to convert your applications into independent
desktop programmes to distribute to non-MATLAB users.

IJISRT23JAN055 www.ijisrt.com 1032


Volume 8, Issue 1, January – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165

Fig. 1: GUI formed using guide

III. HISTOGRAM OF ORIENTED GRADIENTS These vectors have magnitude√(𝑓𝑥2 + 𝑓𝑦2 ) and
(HOG) 𝑓
direction tan−1 ( 𝑥 )
𝑓𝑦
The gradient vector for the function f (x, y) (fx, fy).
Since an image is a discrete function of (x, y), the gradient Gradients values are mapped in the range of 0 to
of an image may also be determined. The horizontal and
vertical directions are determined for each pixel in a picture 255. Pixels with large negative change will be black,
gradient. Pixels with large positive change will be white and Pixels
with no change or little change will be grey

Fig. 2: Gradient behaviour

The first image is observed in both horizontal gradient


and vertical gradient

In the horizontal gradient image, there is a transition


from black to white (i.e., a 0 to 1 positive transition), which
is shown with a grey colour, and then a swift transition from
white to black (i.e., a 1 to 0 negative transition), which is
shown with a black colour.

In the vertical gradient image, there is a transition from


black to white (i.e., a 0 to 1 positive transition), which is
shown with a grey colour, and then a swift transition from
white to black (i.e., a 1 to 0 negative transition), which is Fig. 3: Pixels of a patch
shown with a black colour.
The gradient value in the x direction is 100-50=50
Let’s study an example here
The gradient value in the x direction is 120-70=50
Together we will have a feature vector (50,50)

Magnitude and direction are calculated as follows:

Gradient magnitude: √502 + 502 = 70.1

Gradient direction:tan−1(50⁄50) = 1

Steps to be followed to get the histogram

IJISRT23JAN055 www.ijisrt.com 1033


Volume 8, Issue 1, January – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
Step1: Use an 8 x 8pixel cell to compute gradient magnitude and direction

Fig. 4: Calculation of gradient

Step 2: Create a histogram of generated 64(8 x 8) gradient vectors

Each cell is split into angular bins each bin corresponds to a gradient direction (9 bins 0-1800) (200 each bin)

This reduces 64 vectors into 9 values

Fig. 5: HOG features

IV. FLOWCHART

Fig. 6: Flow chart of calculating HOG

IJISRT23JAN055 www.ijisrt.com 1034


Volume 8, Issue 1, January – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
V. STEPS TO CALCULATE HOG FEATURES are combined to create a new block (2x2). With an 8-pixel
stride, this clubbing is done in an overlapping fashion. We
 Start by taking the input picture for the HOG feature combine the nine-point histograms for each of the four
calculation. The picture should be resized to 128 by 64 cells in a block to create a 36-feature vector.
pixels (128 pixels in height and 64 widths). The authors'  The L2 norm is used to standardise the fb values for each
main goal with this form of detection was to get better block:
results, thus they utilised and recommended this
dimension in the study.
 The image's gradient is computed. Combining the image's
magnitude and angle yields the gradient. Gx and Gy are Where ε is a small value added to the square of fb to avoid
initially computed for each pixel in a block of 3x3 pixels. zero division error.
Making use of the formulas for each pixel value, Gx and
Gy are first computed.  Prior to normalisation, the following formulas are used to
 After determining the gradient of each pixel, a block is determine the value of k:
created by dividing the gradient matrices (the magnitude
and angle matrix) into 8x8 cells. A 9-point histogram is
computed for each block. A 9-point histogram creates a
histogram with 9 bins, each with a 20-degree angle range.
A 9-bin histogram with values assigned following
computations is shown in Figure 8. These 9-point
histograms may all be shown as histograms with bins that
output the gradient's strength for that bin. A block can  By normalising the data, the impact of variations in
have 64 distinct values, hence the following computation contrast between photographs of the same item is
is done for all 64 magnitude and gradient values. lessened. out of every brick. A feature vector with 36
points is gathered.In the horizontal direction, there are 7
 We will determine the jth bin for each cell in a block
blocks and in the vertical direction, there are 15 blocks so
before determining the value that will be given to the jth
the total length of HOG features will be: 7 x 15 x 36 =
and (j+1)th bins, respectively.
3780. HOG features of the selected image are obtained.
 Values of Vj and Vj+1 are appended in an array at the
index of the jth and (j+1)th bins calculated for each pixel. A. Support vector machine (SVM)
An array is used as a bin for a block. A feature vector exists for each pixel. Whether the
 The 16x8x9 form of the resulting matrix from the feature vector is a face or not must be determined. This
computations above. decision boundary method is the most effective. SVM
 After the histogram computation for each block is determines the optimal decision bounds.
complete, four blocks from the 9-point histogram matrix

B. Linear Decision Boundary


The linear decision boundary in n-D space is (n-1)-D line

Fig. 7: Decision boundary

IJISRT23JAN055 www.ijisrt.com 1035


Volume 8, Issue 1, January – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
C. Optimal decision boundary

Fig. 8: Many decision boundaries

We are seeking a decision boundary for our training data, and after finding many, we mustassess which decision boundary is
the best.

Before reaching a feature point, the breadth of that border might be increased.

D. Evaluating a decision boundary

Fig. 9: Margin or safety zone

Marginor safe Zone: The width of that boundary can be increased before hitting a feature point

The thickness around the decision boundary is known as the margin and the region around the boundary is known as the
safety zone SVM classifies based on the given equations:

compute 𝑑 = 𝜔𝑇 + 𝑏
here

d=distance
𝜌 = 𝑤𝑖𝑑𝑡ℎ 𝑜𝑓 𝑠𝑎𝑓𝑒𝑡𝑦 𝑚𝑎𝑟𝑔𝑖𝑛
𝜌
𝑑 ≥ ⁄2 face
ⅈ𝑓: 𝑑 > 0 𝑎𝑛𝑑 𝑑 < 𝜌 ∕ 2 probably face
𝑑 < 0 𝑎𝑛𝑑 𝑑 > −𝜌 ∕ 2 probably not a face
𝑑 ≤ −𝜌 ⁄ 2 not a face

IJISRT23JAN055 www.ijisrt.com 1036


Volume 8, Issue 1, January – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
VI. RESULT

We imagine a room or building with a population count.

Along with the individual, the dot that represents them moves.

It is possible to improve this outcome by integrating tracking.

Fig. 10: Crowd Monitoring result

Fig. 11: Crowd Monitoring result

REFERENCES [7.] P. Felzenszwalb, R. Girshick, D. McAllester, and D.


Ramanan. Object detection with discriminatively
[1.] M. Werlberger, W. Trobin, T. Pock, A. Wedel, D. trained part based models. In IEEE Trans. on Pattern
Cremers, and H. Bischof. Anisotropic Huber-L1 Analysis and Machine Intelligence, volume 32, pages
Optical Flow. In Proc. British Machine Vision Conf., 1627–1645, 2010.
2009. [8.] B. Fritzke. A growing neural gas network learns
[2.] P. Widhalm and N. Brandle. Learning Major topologies. In Advances in Neural Information
Pedestrian ¨ Flows in Crowded Scenes. In Proc. Int’l Processing Systems, 1995.
Conf. on Pattern Recognition, 2010. [9.] A. Girgensohn, D. Kimber, J. Vaughan, T. Yang, F.
[3.] B. Wu and R. Nevatia. Improving part based object Shipman, T. Turner, E. Rieffel, L. Wilcox, F. Chen,
detection by unsupervised, online boosting. In Proc. and T. Dunnigan. DOTS: Support for effective video
IEEE Conf. on Computer Vision and Pattern surveillance. In Proc. Int’l Multimedia Conference,
Recognition, 2007. 2007.
[4.] S. Wu, B. E. Moore, and M. Shah. Chaotic invariants [10.] S. Havemann. Generative Mesh Modeling. PhD
of Lagrangian particle trajectories for anomaly thesis, Institute of Computer Graphics, Faculty of
detection in crowded scenes. In Proc. IEEE Conf. on Computer Science, Braunschweig Technical
Computer Vision and Pattern Recognition, 2010 University, Germany, 2005.
[5.] N. Dalal and B. Triggs. Histograms of oriented [11.] S. Havemann and D. W. Fellner. Seven Research
gradients for human detection. In Proc. IEEE Conf. Challenges of Generalized 3D Documents. IEEE
on Computer Vision and Pattern Recognition, 2005. Computer Graphics and Applications, 27(3):70–76,
[6.] P. Decamp, G. Shaw, R. Kubat, and D. Roy. An 2007. (special issue on 3D documents).
immersive system for browsing and visualizing [12.] S. Havemann, V. Settgast, M. Lancelle, and D.
surveillance video. In Proc. ACM Multimedia, 2010. Fellner. 3DPowerpoint - Towards a design tool for

IJISRT23JAN055 www.ijisrt.com 1037


Volume 8, Issue 1, January – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
digital exhibitions of cultural artifacts. In Proc. Int’l.
Symp. on Virtual Reality, Archaeology and Cultural
Heritage, 2007.
[13.] V. Nair and J. J. Clark. An unsupervised, online
learning framework for moving object detection. In
Proc. IEEE Conf. on Computer Vision and Pattern
Recognition, 2004. [10] P. M. Roth, S. Sternig, H.
Grabner, and H. Bischof. Classifier grids for robust
adaptive object detection. In Proc. IEEE Conf. on
Computer Vision and Pattern Recognition, 2009.
[14.] I. O. Sebe, J. Hu, S. You, and U. Neumann. 3D video
surveillance with augmented virtual enviroments. In
Proc. ACM SIGMM Int’l Workshop on Video
Surveillance, 2003.
[15.] V. Settgast, M. Lancelle, S. Havemann, and D. W.
Fellner. Spatially Coherent Visualization of Image
Detection Results using Video Textures. Proc.
Workshop of the AAPR, 2009.
[16.] T. Tekusova, T. Schreck, J. Behr, J. Kohlhammer,
and D. Stricker. The IGD-HEyeWall for Visual
Analytics – Concepts and Applications. Proc. of Int’l
Workshop on GigaPixel Displays & Visual Analytics,
(Laboratory Overview), 2008.
[17.] Y. Wang, D. M. Krum, E. M. Coelho, and D. A.
Bowman. Contextualized videos: Combining videos
with environment models to support situational
understanding. IEEE Trans. Visualization and
Computer Graphics, 13(6):1568– 1575, 2007.

IJISRT23JAN055 www.ijisrt.com 1038

You might also like