Gun Detection in CCTV Images using HAAR-Like Features

Gun Detection in CCTV Images using HAAR-Like Features


  • Sami Ur Rahman University of Malakand, Pakistan
  • Fakhre Alam University of Malakand, Pakistan
  • Wajid Ali University of Malakand, Pakistan



Gun Detection, CCTV, Security, Video-based Surveillance, Haar-like Features, Support Vector Machine


Automated video-based surveillance is an important area of research to assist the security personnel to detect the incident of any abnormal events in the surroundings. The objective of this paper is to develop a framework for automatic gun detection using closed-circuit television (CCTV) images. The methodology presented in this paper involves the development of a framework for automatic gun detection using closed-circuit television (CCTV) images, with the aim of enhancing the surveillance of crime and improving human security. The proposed approach consists of a dataset of CCTV images containing instances of guns, as well as non-gun images for comparison. These images would be used to train the proposed algorithm to recognize and identify guns in future CCTV images. The proposed framework is designed for an indoor environment and uses Haar-like features for gun detection. The proposed system involves the installation of CCTV cameras in a suitable corner of an indoor environment for surveillance. The CCTV cameras capture the scene and the frames of the scene are compared with a predefined dataset for automatic gun detection. The proposed approach draws a bounding box and raises an alarm if it detects a gun in a frame extracted from a captured scene. This provides a visual indication of the presence of a gun, making it easier for relevant authorities to quickly identify and respond to the threat. The proposed system shows promising results in real-time applications and about 90% accuracy has been achieved.


M.T. Bhatti, M.G. Khan, M. Aslam, and M.J. Fiaz. Weapon detection in real-time cctv videos using deep learning. IEEE Access 9: 34366-34382 (2021).

D. Qi, W. Tan, Z. Liu, Q. Yao, and J. Liu. A Dataset and System for Real-Time Gun Detection in Surveillance Video Using Deep Learning. 2021 IEEE International Conference on Systems, Man, and Cybernetics (SMC) 667-672 (2021).

S. U. Rahman, S. A. Khan, and F. Alam. An Algorithm for Human Pose Estimation from CCTV Images. International Journal of Education (IJE) 3: (2019).

T. R. Kumar, and G. K. Verma. A computer visionbased framework for visual gun detection using harris interest point detector. Procedia Computer Science 54: 703-712 (2015).

G. Arya. Automatic and Accurate Weapons Detection Model Using an Optimal Neural Network Architecture. SSRN 4172293 (2022). (accessed 22 November 2022)

K. Akhila, and K. R. Ahmed. Firearm Detection Using Deep Learning. Intelligent Systems and Applications: Proceedings of the 2022 Intelligent Systems Conference (IntelliSys) 544: 200-218 (2022).

P. K. Yeong, and S.Y. Hwang. An improved Haarlike feature for efficient object detection. Pattern Recognition Letters 42: 148-153 (2014).

I.T. Darker, A.G. Gale, and A. Blechko. CCTV as an automated sensor for firearms detection: Humanderived performance as a precursor to automatic recognition. Unmanned/Unattended Sensors and Sensor Networks V 7112: 12 (2008).

Z. Xue, R.S. Blum, Y.X. Li, R. Zhiyun, S. Blum, and Y. Li. Fusion of visual and IR images for concealed weapon detection. Proceedings of the Fifth International Conference on Information Fusion 2: 1198-1205 (2002).

I. T. Darker, A. Gale, L. Ward, A. Blechko, and K. Purdy. Light camera action and arrest. Contemporary Ergonomics 2007: 171-177 (2007).

B. Prof, K. Samir, B. Datta, and S. Roy. Identifications of concealed weapon in a Human Body. arXiv preprint arXiv 1210.5653 (2012).

M. Roomi, and R. Rajashankarii. Detection of concealed weapons in x-ray images using fuzzy k-nn. International Journal of Computer Science, Engineering and Information Technology 2: 187-196 (2012).

B. Khajone, and V.K. Shandilya. Concealed Weapon Detection Using Image Processing. International Journal of Scientific and Engineering Research 3: 1-4 (2012).

D.M. Sheen, T.E. Hall, D.L. McMakin, A.M. Jones, and J.R. Tedeschi. Three-dimensional radar imaging techniques and systems for near field applications. Radar Sensor Technology, International Society for Optics and Photonics 9829: 98290V (2016).

M. Grega, A. Matiolański, P. Guzik, and M. Leszczuk. Automated detection of firearms and knives in a CCTV image. Sensors 16: 47 (2016).

J. Dever, N. V. Lobo, and M. Shah. Automatic visual recognition of armed robbery. Pattern Recognition, 2002. Proceedings. 16th International Conference on 1: 451-455 (2002).

G. Andrzej, M. Kmieć, and A. Dziech. Visual detection of knives in security applications using Active Appearance Models. Multimedia Tools and Applications 74: 4253-4267 (2015).

G. Richard, C. Saritac, and C. C. Hung. Automatic image analysis process for the detection of concealed weapons. Proceedings of the 5th Annual Workshop on Cyber Security and Information Intelligence Research: Cyber Security and Information Intelligence Challenges and Strategies 20: 1-4 (2009).

D. G. Lowe. Distinctive image features from scale-invariant keypoints. International journal of computer vision 60: 91-110 (2004).

G.L. Foresti, C. Micheloni, L. Snidaro, P. Remagnino, T. Ellis. Active video-based surveillance system: the low-level image and video processing techniques needed for implementation. IEEE Signal Processing Magazine 22: 25-37 (2005).

K. Veena, K. Kasemsan, and C. Srisa-an. 2D Gun’s type classification using edge detection algorithm and SUSAN low level image processing. 2012 International Conference for Internet Technology and Secured Transactions, London, UK 2012: 521-523 (2012).

G. Michał, S. Łach, and R, Sieradzki. Automated recognition of firearms in surveillance video. 2013 IEEE International Multi-Disciplinary Conference on Cognitive Methods in Situation Awareness and Decision Support (CogSIMA), San Diego, CA, USA 2013: 45-50 (2013).

H.M. Dee, and S.A. Velastin. How close are we to solving the problem of automated visual surveillance? Machine Vision and Applications 19: 329-343, (2008).

M. Spirito, C.S. Regazzoni, and L. Marcenaro. Automatic detection of dangerous events for underground surveillance. IEEE Conference on Advanced Video and Signal Based Surveillance, 2005., Como, Italy 2005: 195-200 (2005).

C.K. Lee, M.F. Ho, W.S. Wen, and C.L. Huang. Abnormal event detection in video using n-cut clustering. Second International Conference on Intelligent Information Hiding and Multimedia Signal Processing (IIH-MSP 2006), Pasadena, California, USA, December 2006: 18-20 (2006).

C. C. Hung, J. W. Hsieh, and K.C. Fan. Suspicious object detection and robbery event analysis. Computer Communications and Networks 2007. ICCCN 2007.Proceedings of 16th International Conference 2007: 1189-1192 (2007).

H. Ismail, D. Harwood, and L. S. Davis. W4: Realtime surveillance of people and their activities. IEEE Transactions on Pattern Analysis & Machine Intelligence 8: 809-830 (2000).

C. P. Papageorgiou, M. Oren and T. Poggio. A general framework for object detection. Sixth International Conference on Computer Vision (IEEE Cat. No.98CH36271), Bombay, India 1998: 555-562, (1998).

P. Viola, and M. Jones. Rapid object detection using a boosted cascade of simple features. Proceedings of the 2001 IEEE Computer Society Conference on Computer Vision and Pattern Recognition. CVPR 2001, Kauai, HI, USA 2001: I-I, (2001).

S.Z. Li, L. Zhu, Z. Zhang, A. Blake, H. Zhang, and H. Shum. Statistical learning of multiview face detection. Proceedings of the European Conference on Computer Vision London, UK 2353: 67-81 (2002).

M. Jones, and P. Viola. Fast multi-view face detection. CTIT technical reports series (2003).

P. Sri-Kaushik, D. Delgado, and A. F. Frangi. Haarlike features with optimally weighted rectangles for rapid object detection. Pattern Recognition 43: 160-172 (2010).

S. Asnani, A. Ahmed, and A. A. Manjotho. Bank Security System based on Weapon Detection using HOG Features. Asian Journal of Engineering, Sciences & Technology 4: (2014).




How to Cite

Sami Ur Rahman, Fakhre Alam, & Wajid Ali. (2022). Gun Detection in CCTV Images using HAAR-Like Features: Gun Detection in CCTV Images using HAAR-Like Features. Proceedings of the Pakistan Academy of Sciences: A. Physical and Computational Sciences, 59(4), 1–11.



Research Articles