1
International Conference on Innovations in Power and Advanced Computing Technologies [i-PACT2017]
obvious edge over ultrasonic and other sensors [11]. For this Numerous feature descriptors have been created for image
purpose a Fresnel lens is placed over the sensor element which processing applications. Detection of human faces using two
additionally provides uniform sensitivity and extends its field of variants of Discriminative Local Binary Pattern (LBP) descriptor
view. PIR sensors are suitable for standalone systems because of has been described by Mu, Yadong et al. in [16]. In yet another
their less power consumption [12]. Human detection and work on Trainable System for object detection, Papageorgiou et
counting is presented as the primary objective in this research al. [17] use intensity differences between adjacent cells in an
paper. image representation efficiently computable as a Haar Wavelet
transform. Use of Haar Classifiers for object detection can be
found in many works such as Reinius, Staffan [18] in which its
II. PREVIOUS WORK AND COMPARISON application has been extended to iOS applications. Major
disadvantage of Haar Wavelet transform is that it is not a
2
International Conference on Innovations in Power and Advanced Computing Technologies [i-PACT2017]
the object in the test image. The SVM feeds on sample images
classified as positive samples and negative
(A) (B)
samples. Positive samples Fig. 1 (C, D) are those that have the
(C) (D)
desired object in them whereas negative samples Fig. 1 (A, B) do
Fig. 1. Samples for HOG feature descriptor (A, B) Negative; (C, D) Positive not contain the object. SVM works on the comparison of two
types of samples. Collected samples should be diverse in
complexity and number of objects present.
the most supreme aspects of OpenCV is that it is platform
independent which enables its usage on a large variety of
hardware like RPi. Using OpenCV in python boosts its abilities
by incorporating numpy (Numerical Python). In image
processing, images are dealt as large 3D arrays and numpy
serves as a robust tool for numerical array computations [23-24].
For human detection, we used HOG algorithm. HOG is used for
feature description in computer vision and image processing for
the purpose of object detection. The principle of the algorithm is
that, it counts presences of gradient orientation in localized zones
of an image. It is computed on an image assumed as a dense grid
and divided into uniformly spaced cells and uses overlapping
local contrast normalization for improved accuracy. In HOG a
shape and its appearance in an image is defined by the
distribution of intensity gradients or edge directions. The image
is divided into small connected regions or zones called cells and
a histogram of intensity gradients is computed for each of the
cells and stored in the form of a matrix. The descriptor is then
defined by summing of these values of the matrix. For better
accuracy, the local histograms can be contrast-normalized by Fig. 3. An Illustration of the Human Counter detecting a Person passing under it.
calculating a measure of the intensity across a connected cluster
Other algorithms also exist for object detection like Haar
of cells, called a block, and then using this value to normalize all
Cascades, background subtraction etc. Haar Cascades is well
cells within the block. Normalization of the cells removes noise
suited to cases where features are well defined and specific like
from the images to some extent. In some cases it may decrease face detection etc. In real time situations, features of a human
the sharpness of the images. It usually results in better invariance figure are not well specified, they tend to vary a lot according to
to changes in illumination and shadowing. After the calculation the pose or exposure of human body to the camera. In such cases
of Histograms of the divided cells, a SVM is trained by the HOG helps best. HOG was applied on top-view (alignment of
histograms prepared. Task of SVM is to test various images for head and shoulders) on human body as shown in Fig. 2.
the presence of the desired object and declare the occurrence of
3
International Conference on Innovations in Power and Advanced Computing Technologies [i-PACT2017]
A s per the process flow, when a person or thing enters the schematic, other pins can be programmed for controlling more
number of relay switches.
field of sensors as in Fig. 3, it triggers the DIP unit programmed
in RPi to take images from a camera mounted on the top of the
door and process them for detecting human presence [25-27]. If
human is detected by the DIP unit, it checks the status of the
other sensor. Triggering of other sensor signifies the
entrance/exit of a person and updates the counter accordingly. If
human is not detected by DSP algorithm or other sensor is not
triggered, then process is directed to the beginning as given in
Fig. 4. All the data of image processing that is ongoing in the
RPi is retrieved on another system using serial communication
and a bluetooth module (HC-05) interfaced with RPi serial port.
This information was very useful for performance assessment of
the python script and DIP algorithm.
Schematic diagram of hardware connections is shown in Fig. 5.
USART pins are connected to the bluetooth module [28-29].
universal synchronous and asynchronous receiver and transmitter
(USART) is used to communicate between devices over serial
communication protocol. Relays can be used in the circuit for
controlling the power supply of the room as per the counter [30].
Status LED denotes the state of the DIP algorithm. If the LED is
glowing, it signifies that DIP algorithm is currently non- Fig. 5. Schematic Diagram of the Pin Connections of RPi
operational. Apart from the pins currently used in the circuit
4
International Conference on Innovations in Power and Advanced Computing Technologies [i-PACT2017]
Fig. 6. Graph of an analysis performed on the no. of people detected while entering the Room.
For expanding the number of relays, some other boards like Face detection imparts a delay and uncertainty to the system as
Arduino Mega 2560 etc. can be used with RPi by I2C person entering the room has to face the camera in-line for
communication protocol in a master–slave association. Mega proper detection. Face detection has a limitation that gate should
2560 has an edge over other available microcontroller boards as be transparent for faces to be visible. Top-view eliminates all
it consists of 52 digital pins that can be directly interfaced with such limitations with ease.
magnetic relays. It also has 3 serial communication ports that can Third major advantage of this project is that this is a cost
be used to further extend the length of master-slave chain. efficient project, as it costs only 6500/- INR along with an NRE
A small setup with a box and two sensors are placed on a cost of 1200/-. Low cost design enables this project to be
gateway. The box contains RPi with RPi camera, bluetooth implemented at a larger scale.
module (HC-05) and a power bank (to power RPi). This box is
mounted approximately at a height of 8-10 feet. Sensors placed
on either sides of the gate must have an optimum distance of 1- VI. EXPERIMENTAL RESULTS
1.5 meter between each other.
V. INNOVATION INVOLVED T he project was implemented on a lab gate and 100 people
were passed through it. Total number of people detected were
The major innovation involved is incorporation of image recorded and plotted against total number of people passed. It
processing in human detection algorithm which is already resulted in a curve slightly lagging than straight line. Straight
discussed in introduction. Second major innovation is use of top- line signifies an ideal system that is fully efficient. This recorded
view in HOG. data was analyzed by linear regression using least square method
Top view gives more accuracy in human detection because to determine the overall efficiency of the system that came to be
possible alignment combinations of head with shoulders are 83% being just a scaled down model. In least square analysis,
lesser when compared to alignment combinations of full body number of people passed (X) and corresponding values of
seen from front or back. However, face detection is far better number of people detected (Y) are tabulated in Fig. 6. An
than human body detection in terms of accuracy, but it poses a approximate linear line is derived from (1) and (3) by the data as:
situational drawback of placement a camera. If face detection is
used, camera module has to be placed in front of the door but ܻ ൌ ܾ ܾଵ ܺ (1)
places for mounting camera are not always available in front of σೣσ
door. For mounting camera in this case, we require a separate σ ௫௬ି
ܾଵ ൌ
ሺσ ೣሻమ
(2)
stand/hanger from roof placed in front side of door but it will σ ௫మି
disrupt the gateway. If camera is placed away from the gate, then
a high power scope has to be used that will incur further cost.
5
International Conference on Innovations in Power and Advanced Computing Technologies [i-PACT2017]
VIII. REFERENCES
Slope (ܾଵ ) as in (2) of the approximated line signifies the overall
efficiency of the system. Fig. 7 shows the efficiency curve which
was plotted from the data obtained experimentally. [1] Hou, Ya-Li, and Grantham KH Pang. "People counting and human detection
in a challenging situation." Systems, Man and Cybernetics, Part A: Systems and
Humans, IEEE Transactions, vol. 41.1, 2011, pp. 24-33.
VII. CONCLUSION AND FUTURE ASPECTS [2] Zhou, Jianpeng, and Jack Hoang. "Real time robust human detection and
tracking system." Computer Vision and Pattern Recognition-Workshops, 2005.
CVPR Workshops. IEEE Computer Society Conference on. IEEE, 2005.
This project is a new approach for human detection and
counting. Involvement of image processing with conventional [2] Dalal, Navneet, Bill Triggs, and Cordelia Schmid. "Human detection using
oriented histograms of flow and appearance." Computer Vision–ECCV 2006.
methods helped in avoiding false detections (non-human Springer Berlin Heidelberg, 2006, pp. 428-441.
detection) and led to an efficiency of 83% as this was just a
scaled down model. This efficiency can be further increased to a [4] Zhu, Qiang, et al. "Fast human detection using a cascade of histo
level of nearly 96%. Using RPi for soft computation averted the grams of oriented gradients." Computer Vision and Pattern Recognition, 2006
IEEE Computer Society Conference, IEEE vol. 2, 2006.
use of desktop CPUs and reduced the power consumption of the
system and cost. A very simple design results in easy installation. [5] Zhang, Junge, et al. "Boosted local structured hog-lbp for object localization."
Internal Processing of the machine is observable through serial Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on.
communication by bluetooth module. Future research directions IEEE, 2011.
involve replacement of PIR sensors by high range LOS (Line of [6] http://docs.opencv.org/3.0.0/d6/d00/tutorial_py_root.html
Sight) sensors, such as IR sensors with lasers, or Proximity
sensors to eliminate solid angle triggering and decreasing [7] Bradski, Gary, and Adrian Kaehler. Learning OpenCV: Computer vision with
triggering area. For boosting up the performance and speed of the OpenCV library. "O'Reilly Media, Inc.", 2008.
the system, more powerful hardware can be used like RPi-3 [8] Rauter, Michael. "Reliable human detection and tracking in top-view depth
(released in February 2016) that has 4×ARM Cortex-A53, images." Proceedings of the IEEE Conference on Computer Vision and Pattern
1.2GHz processor. Further improvement can be done by using a Recognition Workshops. 2013.
higher resolution camera to increase the calibre, lucidness and
[9] Xia, Lu, Chia-Chih Chen, and Jake K. Aggarwal. "Human detection using
quality of the images captured. To increase the efficiency of depth information by kinect." Computer Vision and Pattern Recognition
HOG algorithm, more number of samples can be used to train Workshops (CVPRW), 2011 IEEE Computer Society Conference on. IEEE,
SVM. Alerting systems like message alerts or alarms if someone 2011.
6
International Conference on Innovations in Power and Advanced Computing Technologies [i-PACT2017]
[10] Leslie Hodges, “Ultrasonic and Passive Infrared Sensor integration for dual [21] Rabaud, Vincent, and Serge Belongie. "Counting crowded moving objects."
technology user detection sensors”, unpublished 2006 IEEE Computer Society Conference on Computer Vision and Pattern
Recognition (CVPR'06), IEEE, vol. 1, 2006.
[11] Gearhart, Chris, et al. "Use of ultrasonic sensors in the development of an
Electronic Travel Aid." Sensors Applications Symposium, 2009. SAS 2009. IEEE. [22] Fernandes, Steven Lawrence, and Josemin G. Bala. "Low Power Affordable
IEEE, 2009. and Efficient Face Detection in the Presence of Various Noises and Blurring
Effects on a Single-Board Computer." Emerging ICT for Bridging the Future-
[12] Tsai, Cheng-Hung, et al. "PIR-sensor-based lighting device with ultra-low Proceedings of the 49th Annual Convention of the Computer Society of India
standby power consumption." Consumer Electronics, IEEE Transactions, vol. (CSI), Springer International Publishing vol. 1, 2015.
57.3, 2011, pp. 1157-1164.
[23] Van Der Walt, Stefan, S. Chris Colbert, and Gael Varoquaux. "The NumPy
[13] Viola, Paul, and Michael J. Jones. "Robust real-time face detection." array: a structure for efficient numerical computation." Computing in Science &
International journal of computer vision, vol. 57.2, 2004, pp. 137-154. Engineering, vol. 13.2, 2011, pp. 22-30.
[14] Jesorsky, Oliver, Klaus J. Kirchberg, and Robert W. Frischholz. "Robust [24] Oliphant, Travis E. A guide to NumPy. vol. 1, USA, Trelgol Publishing,
face detection using the hausdorff distance." International Conference on Audio- 2006.
and Video-Based Biometric Person Authentication. Springer Berlin Heidelberg,
2001. [25] Moghavvemi, M., and Lu Chin Seng. "Pyroelectric infrared sensor for
intruder detection." TENCON 2004. 2004 IEEE Region 10 Conference, IEEE,
[15] Mikolajczyk, Krystian, Cordelia Schmid, and Andrew Zisserman. "Human vol. 500, 2004.
detection based on a probabilistic assembly of robust part detectors." European
Conference on Computer Vision. Springer Berlin Heidelberg, 2004. [26] Song, Byunghun, Haksoo Choi, and Hyung Su Lee. "Surveillance tracking
system using passive infrared motion sensors in wireless sensor network."
[16] Mu, Yadong, et al. "Discriminative local binary patterns for human detection Information Networking, 2008. ICOIN 2008. International Conference on. IEEE,
in personal album." Computer Vision and Pattern Recognition, 2008. CVPR 2008.
2008. IEEE Conference on. IEEE, 2008.
[27] Benezeth, Yannick, et al. "Towards a sensor for detecting human presence
[17] Papageorgiou, Constantine, and Tomaso Poggio. "A trainable system for and characterizing activity." Energy and Buildings, vol. 43.2, 2011, pp. 305-314.
object detection." International Journal of Computer Vision, vol. 38.1, 2000, pp.
15-33. [28] Agarwal, Nidhi, and S. R. N. Reddy. "Design & development of daughter
board for Raspberry Pi to support Bluetooth communication using UART."
[18] Reinius, Staffan. "Object recognition using the OpenCV Haar cascade- Computing, Communication & Automation (ICCCA), 2015 International
classifier on the iOS platform", 2013. Conference on. IEEE, 2015.
[19] Cruz, Juliano EC, Elcio H. Shiguemori, and Lamartine NF Guimarães. [29] Dnyanoba, Birajdar Amar, B. Nagajayanthi, and Prakash Ramachandran.
"Concrete and Asphalt Runway Detection in High Resolution Images Using LBP "Development of an Embedded System to Track the Movement of Bluetooth
Cascade Classifier." 2013 BRICS Congress on Computational Intelligence and Devices based on RSSI." Indian Journal of Science and Technology, vol. 8.19,
11th Brazilian Congress on Computational Intelligence. IEEE, 2013. 2015.
[20] Pang, Yanwei, et al. "Efficient HOG human detection." Signal Processing [30] Pott, Vincent, et al. "Mechanical computing redux: relays for integrated
vol. 91.4, 2011, pp. 773-781. circuit applications." Proceedings of the IEEE, vol. 98.12, 2010, pp. 2076-2094