The holidays are coming! How technicians use Python to implement scenic spot security systems

WBOY
Release: 2023-04-11 14:13:03
forward
1558 people have browsed it

​In this design, the YOLO target detection algorithm, Openpose gesture recognition algorithm, deepsort tracking algorithm, and MSCNN crowd density estimation algorithm are used to implement fire monitoring, smoking monitoring, behavioral safety monitoring, crowd density monitoring, mask rate monitoring, and personnel positioning. Monitor six major functions. The system uses intelligent visual interaction technology, and users can operate the system through gestures, making the operation convenient and concise. Assisting the security management of scenic spots from multiple angles and aspects, reducing hidden safety hazards in scenic spots and promoting the intelligent construction of scenic spots. The various functions of this system realize real-time transmission and feedback of data, ensuring the validity of the information. It can run on multiple platforms such as mobile phones, computers and Internet of Things platforms. It also realizes "multi-platform" in the true sense. application".

The holidays are coming! How technicians use Python to implement scenic spot security systems

A multifunctional intelligent security system designed with a variety of algorithms. It is mainly used in fire prevention and monitoring, epidemic prevention and control, tourist safety positioning, etc. in scenic spots. It is very important for the safety of scenic spots. Protection and intelligent construction of scenic spots have important application value. The holidays are coming! How technicians use Python to implement scenic spot security systems

Basic introduction

This system is based on computer multimedia technology, intelligent image analysis technology, data mining technology, etc., to build a comprehensive security management system for tourist attractions. In response to the needs of personal safety, forest fire prevention management, epidemic prevention and control management in public activity areas in scenic spots, it is required to build an all-round, all-weather, high-definition, and intelligent video surveillance system to meet the needs of modern tourist attraction safety management and realize large-scale scenarios Panoramic monitoring detects emergencies such as fires in scenic spots and dangerous behaviors of tourists. It can realize real-time positioning and trajectory query of personnel, and link the map to flash warnings when an emergency occurs, and facilitate emergency command. At the same time, it meets the personnel management and passenger flow analysis system. It is necessary to count and analyze the passenger flow at the entrance and exit. When the scenic spot exceeds a certain passenger flow capacity, it can give a timely warning to stop tourists from entering and carry out appropriate diversion of tourists. Combined with the actual needs and the system architecture planning of smart scenic spots, the comprehensive security system of tourist attractions consists of four modules: intelligent monitoring system, intelligent visual interaction, multi-angle and multi-directional, and multi-platform applications. It integrates fire monitoring, smoking monitoring, behavioral safety monitoring, and crowd monitoring. Density monitoring, mask rate monitoring, and personnel positioning monitoring heterogeneous security subsystems. The overall design architecture of the system is as follows:

The holidays are coming! How technicians use Python to implement scenic spot security systems


#Basic function display

1. System Overview

The holidays are coming! How technicians use Python to implement scenic spot security systems

The holidays are coming! How technicians use Python to implement scenic spot security systems

The development platform of this intelligent monitoring system is Pycharm, using python language, and is divided into six major systems.

2. Fire monitoring system

This module uses real-time video monitoring to analyze whether there is a fire in the video. As shown in the figure, if a fire breaks out in the scenic spot, the system will promptly send out early warning information and feed it back to the dispatching room, so that the fire can be effectively controlled and the efficiency of responding to fires will be greatly improved.

The holidays are coming! How technicians use Python to implement scenic spot security systems

3. Smoking monitoring system

In order to prevent fires in the scenic area, most areas of the scenic area are no-smoking areas. This module uses real-time video monitoring to analyze whether there is smoking behavior in the video. As shown in the figure, if there is a tourist smoking, the system will promptly send out an early warning message and feed it back to the dispatching room, so as to immediately discover the safety hazards of tourists smoking, prevent fires, and ensure the safety of the scenic spot.

The holidays are coming! How technicians use Python to implement scenic spot security systems

4. Behavioral safety monitoring system

During the tour in scenic spots, the personal safety of tourists must be protected. This module uses real-time video monitoring to analyze the body movements of people in the video. If abnormal behavior occurs, such as "falling" and other dangerous behaviors as shown in the picture, early warning information can be issued in a timely manner. It can greatly shorten rescue time, reduce losses caused by emergencies, and protect tourists' lives and property.

The holidays are coming! How technicians use Python to implement scenic spot security systems

5. Crowd density monitoring system

Affected by the new coronavirus epidemic, scenic spots need to reasonably control the population density in the scenic spot. Through this module, the dynamic monitoring of the tourist population density in scenic spots can be realized. Through intelligent analysis, the crowd density can be displayed on the system page in real time to help users manage the scenic spots, effectively protect the health and life safety of tourists and employees, and maintain the scenic spots and overall social stability. The holidays are coming! How technicians use Python to implement scenic spot security systems

6. Mask rate monitoring system

In order to prevent the spread of the new coronavirus, according to the relevant regulations of the scenic spot, passengers need to be identified before entering the scenic spot. This module uses real-time video monitoring to analyze whether tourists in the video are wearing masks, will mark whether each tourist is wearing a mask, display the results on the system, and display the scene mask wearing rate in real time. Used for epidemic prevention work in scenic spots, to protect tourists and scenic spots.

The holidays are coming! How technicians use Python to implement scenic spot security systems

7. Personnel tracking and positioning monitoring

This module conducts real-time video monitoring of the scenic spot, analyzes and identifies tourists in the video, and automatically generates identification tags to The position of the tourist tag in the scene is recorded in real time and displayed on the system page. The number of people in the scene can be monitored and dynamically displayed on the left side of the system page. Assist users to manage scenic spots.

The holidays are coming! How technicians use Python to implement scenic spot security systems

8. Intelligent visual interaction

This system can replace the traditional mouse click module application method, and users do not need to use input devices such as a mouse. Complete information interaction with the system. Users can complete module selection through body movements, making the system operation simpler and more convenient for users to use. (Only the fire detection function is designed here, other functions can be written according to the code reference.)

The holidays are coming! How technicians use Python to implement scenic spot security systems

The holidays are coming! How technicians use Python to implement scenic spot security systems

Involving algorithm

1. Target detection algorithm​

The target detection algorithm used in this project is mainly the YOLO algorithm, which is used in fire monitoring, smoking behavior monitoring, personnel positioning tracking and mask rate monitoring. The YOLO target detection algorithm considers that the detection efficiency of the two-stage target detection algorithm is relatively low, so some scholars have proposed single-stage target detection. Proposed by Joseph Redmon et al. in 2016.

2. Target tracking algorithm

This project uses the deepsort target tracking algorithm in the personnel positioning and tracking system. The tracking process of this system is as follows:

(1) Use convolutional neural network to detect and track pedestrians in the video.

(2) After the video frame is input, it first enters the YOLOv3 target detection network and extracts features through Darknet-53;

(3) Secondly, upsampling and feature fusion are performed, and then regression analysis is performed. ;

(4) Again, input the obtained prediction box information into the SORT algorithm for target feature modeling, matching and tracking;

(5) Finally, output the result. The following figure is the flow chart of the positioning tracking algorithm:

The holidays are coming! How technicians use Python to implement scenic spot security systems

3. Crowd density estimation algorithm

Crowd density counting refers to estimating the number of people in an image or video , density or distribution, it is a key issue and research hotspot in the field of intelligent video surveillance analysis, and is also the basis for advanced video processing tasks such as subsequent behavior analysis, congestion analysis, anomaly detection, and event detection. This project uses deep learning methods to obtain crowd density maps to estimate the number of crowds, and uses python language to build an MSCNN network to generate crowd density maps in real time to estimate the number of crowds.

4. Posture estimation algorithm

This project uses Openpose’s human posture recognition algorithm on the human behavior safety monitoring system. Use Openpose's posture recognition technology to build a classification algorithm for the coordination relationship between different limbs, and compare different classification algorithms to select the optimal model to build a multi-target classification method, which can achieve posture display and target detection of multiple targets. and real-time display of categories.

Part of the interface operation code is as follows:

cap = cv2.VideoCapture(0)
cap.set(3, 1280)
cap.set(4, 720)
detector = HandDetector(detectionCon=0.8)
keys = [["火灾检测", "吸烟检测", "行为安全监测", "人群密度监测", "口罩率检测", "行人定位跟踪"]]
finalText = ""
while True:
success, img = cap.read()
img = detector.findHands(img)
lmList, bboxInfo = detector.findPosition(img)
img = drawAll(img, buttonList)
if lmList:
for button in buttonList:
x, y = button.pos
w, h = button.size
if x < lmList[8][0] < x + w and y < lmList[8][1] < y + h:
cv2.rectangle(img, (x - 5, y - 5), (x + w + 5, y + h + 5), (175, 0, 175), cv2.FILLED)
if l < 30:
if press_state:
cv2.rectangle(img, button.pos, (x + w, y + h), (0, 255, 0), cv2.FILLED)
cv2.putText(img, "start", (x + 20, y + 65),cv2.FONT_HERSHEY_PLAIN, 4, (255, 255, 255), 4)
finalText += button.text
sleep(0.15)
press_state=False
state=True
print(button.text)
text=button.text
else:
press_state=True
if state:
if os.path.exists("img.txt"):
try:
img2 = cv2.imread("img.jpg")
img2 = cv2.resize(img2, (img.shape[1], img.shape[0]))
img = cv2.addWeighted(img, alpha, img2, beta, gamma)
except:
pass
if state:
img = Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
draw = ImageDraw.Draw(img)
myfont0 = ImageFont.truetype(r'./HGDH_CNKI.TTF', 50)
for button in buttonList:
x, y = button.pos
w, h = button.size
draw.text((500, 180), text, font=myfont0, fill=(0, 0, 0))
img = cv2.cvtColor(np.asarray(img), cv2.COLOR_RGB2BGR)
cv2.imshow("Image", img)
cv2.waitKey(1)
Copy after login

The above is the detailed content of The holidays are coming! How technicians use Python to implement scenic spot security systems. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:51cto.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template