Method and apparatus for determining algorithm model, electronic device, and storage medium

By determining a suitable detection model based on the camera's field of view and the direction of pedestrian movement, the problem of excessive resource consumption for face and body detection by surveillance cameras is solved, achieving efficient resource utilization and improved detection efficiency.

CN115048223BActive Publication Date: 2026-02-10ZHEJIANG UNIVIEW TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210822680.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-12
Publication Date
2026-02-10
Estimated Expiration
2042-07-12

AI Technical Summary

Technical Problem

In existing technologies, surveillance cameras need to perform face detection and human body detection separately, which leads to excessive consumption of computing resources and cannot be optimized when resources are fully loaded.

Method used

By determining the angle between the field of view of the camera device and the direction of pedestrian movement, a face detection model or human body detection model can be selected for each camera device, thus freeing up spare computing resources.

Benefits of technology

The utilization of computing resources has been optimized, avoiding insufficient optimization when resources are fully loaded, and improving detection efficiency and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115048223B_ABST
    Figure CN115048223B_ABST
Patent Text Reader

Abstract

The application provides a kind of algorithm model determination method, device, electronic equipment and storage medium, belong to artificial intelligence field.The method comprises: determining the moving direction of people flow on target line;Based on the visual field direction corresponding to each camera device set on the target line and the moving direction of people flow, determine the target algorithm model corresponding to each camera device for detection respectively;The algorithm model includes face detection model or human body detection model.The application can realize the purpose of releasing spare algorithm resources by determining the face detection model or human body detection model corresponding to each camera device respectively, and the released spare algorithm resources can be used for further optimization.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to a method and device for determining an algorithm model, an electronic device, and a storage medium. BACKGROUND

[0002] At present, intelligent analysis applications have become increasingly popular, and a large number of face and body images need to be analyzed intelligently. For most monitoring cameras installed on both sides of the road, both face detection and body detection need to be performed. However, face detection and body detection cannot be completed in one algorithm model. That is, the same monitoring image needs to be analyzed twice to complete face and body detection. In this way, whether front-end intelligent analysis or background server analysis needs to consume a large amount of computing resources.

[0003] How to optimize computing resources and enable limited computing resources to achieve greater results has always been a popular research direction. At present, intelligent scheduling is mostly used to fully utilize idle computing resources, thereby optimizing computing resources. However, when computing resources are fully loaded, optimization cannot be performed. SUMMARY

[0004] The present application provides a method and device for determining an algorithm model, an electronic device, and a storage medium to solve the problem that idle computing resources are fully utilized in the prior art, but optimization cannot be performed when computing resources are fully loaded. The purpose of releasing spare computing resources can be achieved by determining the face detection model or body detection model corresponding to each camera device, and the released spare computing resources can be used for further optimization.

[0005] The present application provides a method for determining an algorithm model, comprising:

[0006] Determining the moving direction of the crowd on the target line;

[0007] Based on the visual field direction corresponding to each camera device arranged on the target line and the moving direction of the crowd, determining the target algorithm model corresponding to each camera device for detection; the algorithm model includes a face detection model or a body detection model.

[0008] According to the method for determining an algorithm model provided by the present application, the target algorithm model corresponding to each camera device for detection is determined based on the visual field direction corresponding to each camera device arranged on the target line and the moving direction of the crowd, comprising:

[0009] Determining the angle between the visual field direction corresponding to each camera device arranged on the target line and the moving direction of the crowd;

[0010] When the included angle is less than 90 degrees, the target algorithm model corresponding to the camera device is determined to be the human detection model;

[0011] When the included angle is greater than 90 degrees, the target algorithm model corresponding to the camera device is determined to be the face detection model.

[0012] According to a method for determining an algorithm model provided by the present invention, determining the direction of pedestrian movement on a target route includes:

[0013] The first number of people and the second number of people are counted based on historical data; wherein, the first number of people is the number of people moving from the first end to the second end of the target route, and the second number of people is the number of people moving from the second end to the first end of the target route.

[0014] Obtain the ratio between the first number of people and the second number of people;

[0015] When the ratio is greater than the preset ratio, the direction of pedestrian movement on the target route is determined to be from the first end to the second end of the target route;

[0016] If the ratio is less than the preset ratio, the direction of pedestrian movement on the target route is determined to be from the second end to the first end of the target route.

[0017] According to a method for determining an algorithm model provided by the present invention, the method further includes:

[0018] Obtain several routes and pedestrian traffic data for each route from the map's road network data;

[0019] If the passenger flow data of the route exceeds a preset threshold, the route will be identified as the target route.

[0020] According to the method for determining an algorithm model provided by the present invention, for each camera device set on the target line, the direction of pedestrian movement on the target line is the direction of pedestrian movement within the field of view of the camera device;

[0021] Determining the direction of pedestrian movement on the target route includes:

[0022] The third and fourth number of people are counted based on real-time data; wherein, the third number of people is the number of people moving from the first end to the second end within the field of view of the camera device, and the fourth number of people is the number of people moving from the second end to the first end within the field of view of the camera device.

[0023] Obtain the ratio between the third number of people and the fourth number of people;

[0024] When the ratio is greater than a preset ratio, the direction of pedestrian movement within the field of view of the camera device is determined to be from the first end to the second end within the field of view of the camera device;

[0025] If the ratio is less than a preset ratio, the direction of pedestrian movement within the field of view of the camera device is determined to be from the second end to the first end within the field of view of the camera device.

[0026] According to the method for determining an algorithm model provided by the present invention, for each camera device set on the target line, the direction of pedestrian movement on the target line is the direction of pedestrian movement within the field of view of the camera device;

[0027] Determining the direction of pedestrian movement on the target route includes:

[0028] Obtain the first visible field of view of the camera device in the image coordinate system and the second visible field of view in the world coordinate system;

[0029] For each pedestrian within the field of view of the camera device, the first real-time human movement direction of the pedestrian in the image coordinate system is obtained;

[0030] Based on the angle between the first visible field direction and the first real-time human movement direction, the angle between the second visible field direction and the second real-time human movement direction is determined; the second real-time human movement direction is the real-time human movement direction of the pedestrian in the world coordinate system.

[0031] The second real-time human movement direction is determined based on the angle between the second visible field direction and the second real-time human movement direction, as well as the second visible field direction.

[0032] When the real-time human movement direction of more than a preset number of pedestrians is consistent, the second real-time human movement direction is determined as the human movement direction within the field of view of the camera device.

[0033] According to the method for determining an algorithm model provided by the present invention, determining the direction of pedestrian movement on the target route further includes:

[0034] When the first camera device is the preceding camera device of the target camera device on the target route, the direction of pedestrian movement within the field of view of the first camera device is predicted based on the direction of pedestrian movement within the field of view of the target camera device, wherein the target camera device is any one of the camera devices installed on the target route, and the first camera device is the next camera device of the target camera device along the direction of pedestrian movement within the field of view of the target camera device;

[0035] The algorithm model for determining the target corresponding to each camera device based on the visible field of view of each camera device installed on the target route and the direction of pedestrian movement includes:

[0036] Based on the visible field of view of the first camera device set on the target route and the predicted direction of pedestrian movement within the visible field of view of the first camera device, the target algorithm model corresponding to the first camera device is determined.

[0037] The present invention also provides an apparatus for determining an algorithm model, comprising:

[0038] The direction determination module is used to determine the direction of pedestrian movement on the target route;

[0039] The model determination module is used to determine the target algorithm model for detection corresponding to each of the camera devices based on the visible field direction of each camera device set on the target line and the direction of pedestrian movement; the algorithm model includes a face detection model or a human body detection model.

[0040] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for determining the algorithm model as described above.

[0041] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for determining the algorithm model as described above.

[0042] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the method for determining the algorithm model as described above.

[0043] This invention provides a method, apparatus, electronic device, and storage medium for determining an algorithm model. Based on the visible field of view of each camera device set on the target line and the direction of pedestrian movement, a face detection model or a human body detection model is specifically determined for each camera device. This eliminates the need to use both face detection models and human body detection models for face detection, thereby freeing up spare computing resources for further optimization. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0045] Figure 1 This is a flowchart illustrating the method for determining the algorithm model provided by the present invention;

[0046] Figure 2 This is a schematic diagram of the target line and the camera device on the target line provided by the present invention;

[0047] Figure 3 This is a schematic diagram of the first visible field of view of the camera device provided by the present invention and the first real-time human movement direction of the pedestrian in the image coordinate system.

[0048] Figure 4 This is a schematic diagram of the second visible field of view of the camera device provided by the present invention in the world coordinate system and the second real-time human movement direction of the pedestrian in the world coordinate system;

[0049] Figure 5 This is a schematic diagram provided by the present invention showing that more than a preset number of pedestrians are moving in one direction;

[0050] Figure 6 This is a schematic diagram of the visible field of view of the camera device on the target line and the direction of pedestrian movement provided by the present invention.

[0051] Figure 7 This is a schematic diagram of the structure of the device for determining the algorithm model provided by the present invention;

[0052] Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0054] The following is combined with Figures 1-6 The method for determining the algorithm model of the present invention is described.

[0055] Please refer to Figure 1 , Figure 1This is a flowchart illustrating the method for determining the algorithm model provided by this invention. For example... Figure 1 As shown, the method for determining the algorithm model provided by this invention may include the following steps:

[0056] Step 101: Determine the direction of pedestrian movement along the target route;

[0057] Step 102: Based on the visible field of view of each camera device set on the target route and the direction of pedestrian movement, determine the target algorithm model for detection corresponding to each camera device; the algorithm model includes a face detection model or a human body detection model.

[0058] In step 101, the target route can be a route with relatively high passenger flow, such as a route from a residential area to a subway station or bus station during the morning rush hour, or a route from a school to a subway station or bus station during the after-school period, etc.

[0059] Optionally, the target route can be determined by: acquiring several routes and pedestrian traffic data for each route from the map road network data; for each route, if the pedestrian traffic data for that route is greater than a preset threshold, then that route is determined as the target route.

[0060] In this implementation, target routes with relatively concentrated pedestrian traffic can be selected based on several routes and pedestrian traffic data in the map road network data.

[0061] Optionally, the following methods can be used to obtain several routes and pedestrian flow data for each route from the map road network data: Obtain multiple location pairs where pedestrian flow is greater than a preset threshold, where two locations with pedestrian flow exceeding the preset threshold form a location pair, such as (a residential area, a subway station), (a school, a bus stop), etc.; for each location pair, determine the routes between that location pair based on the map road network data, such as... Figure 2 The two routes shown are: the route from the entrance / exit of Community A to the subway station (this route is determined based on the location pair (Community A, a certain subway station)) and the route from the entrance / exit of Community B to the subway station (this route is determined based on the location pair (Community B, a certain subway station)); based on historical passenger flow data, the passenger flow data for each route is filtered out.

[0062] In this implementation, routes between locations with concentrated pedestrian traffic can be selected based on map road network data and locations with concentrated pedestrian traffic, avoiding the need to judge pedestrian traffic data for all routes and reducing the amount of calculation.

[0063] In this step, for target routes with relatively concentrated pedestrian traffic, the direction of pedestrian movement on the target route can be determined.

[0064] In step 102, the algorithm model includes a face detection model or a human body detection model. The face detection model is used to detect facial features, and the human body detection model is used to detect human body features, thereby achieving the purpose of monitoring pedestrians on the road. Optionally, the camera device can use the face detection model or the human body detection model for detection, or the camera device can upload the acquired monitoring images to a server, and the server can use the face detection model or the human body detection model for detection.

[0065] Optionally, the camera equipment installed on the target route may include camera equipment installed along the middle of the target route, that is, it may exclude camera equipment installed at both ends of the target route. For example... Figure 2 As shown, assuming the target route is from the entrance / exit of residential area A to the subway station, the cameras installed along the route include CAM2, CAM4, and CAM5, and the cameras installed at both ends of the target route include CAM1 and CAM7. Similarly, assuming the target route is from the entrance / exit of residential area B to the subway station, the cameras installed along the route include CAM4, and the cameras installed at both ends of the target route include CAM6 and CAM7.

[0066] It should be noted that, in order to avoid the problem of missed detection caused by all camera devices set up on the target line using only one algorithm model, this embodiment does not adjust the algorithm model of the camera devices set up at both ends of the target line. That is, for the captured images, the camera devices set up at both ends of the target line still retain the original function of using both face detection model for face recognition and human body detection model for human body detection.

[0067] In this step, based on the field of view of each camera device set up along the target route and the direction of pedestrian movement, a face detection model or a human body detection model can be determined for each camera device, without having to use both a face detection model and a human body detection model for human body detection.

[0068] Assuming the target algorithm model determined for this camera device is a face detection model, the camera device can use the face detection model to perform face detection, or the camera device can upload the captured monitoring images to the server, and the server can use the face detection model to perform face detection.

[0069] Assuming the target algorithm model determined for this camera device is a human detection model, the camera device can use the human detection model to perform human detection, or the camera device can upload the collected monitoring images to the server, and the server can use the human detection model to perform human detection.

[0070] In this embodiment, based on the visible field of view of each camera device set on the target line and the direction of pedestrian movement, a face detection model or a human body detection model is specifically determined for each camera device. This eliminates the need to use both face detection models and human body detection models for face detection, thereby freeing up spare computing resources for further optimization.

[0071] In some embodiments, step 101 may include the following sub-steps:

[0072] Step 1: Calculate the first and second number of people based on historical data; where the first number of people is the number of people moving from the first end to the second end of the target route, and the second number of people is the number of people moving from the second end to the first end of the target route.

[0073] Step 2: Obtain the ratio between the first and second number of people;

[0074] Step 3: If the ratio is greater than the preset ratio, determine the direction of pedestrian movement on the target route as from the first end to the second end of the target route;

[0075] Step 4: If the ratio is less than the preset ratio, determine the direction of pedestrian movement on the target route as from the second end to the first end of the target route.

[0076] For example, assuming the target route is between an entrance / exit and a subway station, historical data is used to count the number of people flowing from the entrance / exit to the subway station (i.e., the first number) and the number of people flowing from the subway station to the entrance / exit (i.e., the second number). The ratio between the number of people flowing from the entrance / exit to the subway station and the number of people flowing from the subway station to the entrance / exit is calculated. If this ratio is greater than a preset ratio, the direction of pedestrian flow on the route between the entrance / exit and the subway station is determined to be: from the entrance / exit to the subway station, meaning that during peak hours, pedestrian flow generally moves towards the subway station. If this ratio is less than a preset ratio, the direction of pedestrian flow on the route between the entrance / exit and the subway station is determined to be: from the subway station to the entrance / exit, meaning that during peak hours, pedestrian flow generally moves towards the entrance / exit.

[0077] In this embodiment, the historical direction of pedestrian flow with a larger proportion can be determined as the direction of pedestrian flow on the target route based on the historical proportion of different pedestrian flow directions on the target route.

[0078] It should be noted that, when the ratio is equal to the preset ratio, the direction of pedestrian movement on the target route can be determined as any of the following: from the first end to the second end of the target route, or from the second end to the first end of the target route.

[0079] In some embodiments, the real-time human movement direction of each pedestrian within the field of view of the camera device can be determined by: acquiring a first field of view direction of the camera device in the image coordinate system and a second field of view direction in the world coordinate system; for each pedestrian within the field of view of the camera device, acquiring the first real-time human movement direction of the pedestrian in the image coordinate system; determining the angle between the second field of view direction and the first real-time human movement direction based on the angle between the first field of view direction and the first real-time human movement direction; the second real-time human movement direction is the real-time human movement direction of the pedestrian in the world coordinate system; and determining the second real-time human movement direction based on the angle between the second field of view direction and the second real-time human movement direction, and the second field of view direction.

[0080] The field of view of a camera is the area that the camera can see and cover. For example, Figure 2 The field of view of the camera device (CAM5) shown can be Figure 2 The triangular region is shown. The field of view of the camera device extends from the first end to the second end within the field of view of the camera device. As shown in Figure 2, the first end within the field of view of the camera device (CAM5) can be the vertex of the triangular region closest to the camera device (CAM5), and the second end within the field of view of the camera device (CAM5) can be the midpoint of the side opposite the first end.

[0081] Specifically, such as Figure 3 As shown, since the camera equipment is generally installed horizontally with a slight downward tilt, for ease of judgment, the top of the image can be considered the direction of the camera equipment's field of view. Among these, This indicates the visible field of view direction of the camera device in the monitoring screen (i.e., the first visible field of view direction of the camera device in the image coordinate system). This indicates the real-time direction of human movement in the surveillance footage (i.e., the first real-time direction of human movement in the image coordinate system). For example... Figure 4 As shown, This indicates the second visible field of view of the camera device in the world coordinate system. This represents the pedestrian's second real-time human movement direction in the world coordinate system. Ignoring the influence of the top-down angle, and The included angle is the one shown on the map. and The included angle. Add to this included angle. You can get The direction. In order to... The direction can be standardized based on the road network data on the map. The direction is to be regulated along the road network, which is about to The direction is regularized to be consistent with the direction of the current route in the map road network data.

[0082] In this embodiment, the first real-time human movement direction of each pedestrian in the field of view of the camera device in the image coordinate system can be converted into the second real-time human movement direction in the world coordinate system, thereby obtaining the second real-time human movement direction of each pedestrian in the field of view of the camera device in the world coordinate system.

[0083] In some embodiments, for each camera device installed on the target line, the direction of pedestrian movement on the target line is the direction of pedestrian movement within the field of view of that camera device; step 101 may include the following sub-steps:

[0084] Step 11: Count the third and fourth number of people based on real-time data; where the third number of people is the number of people moving from the first end to the second end within the field of view of the camera device, and the fourth number of people is the number of people moving from the second end to the first end within the field of view of the camera device.

[0085] Step 12: Obtain the ratio between the third and fourth number of people;

[0086] Step 13: When the ratio is greater than the preset ratio, determine the direction of pedestrian movement within the field of view of the camera as from the first end to the second end within the field of view of the camera.

[0087] Step 14: If the ratio is less than the preset ratio, determine the direction of pedestrian movement within the field of view of the camera as from the second end to the first end within the field of view of the camera.

[0088] In step 11, based on the real-time data collected by the camera device, the number of people moving from the first end to the second end within the field of view of the camera device (i.e., the third number of people) and the number of people moving from the second end to the first end within the field of view of the camera device (i.e., the fourth number of people) are counted.

[0089] In steps 12-14, the ratio between the number of people flowing from the first end to the second end of the camera's field of view and the number of people flowing from the second end to the first end of the camera's field of view is calculated. If this ratio is greater than a preset ratio, the direction of people's movement within the camera's field of view is determined to be from the first end to the second end; if this ratio is less than a preset ratio, the direction of people's movement within the camera's field of view is determined to be from the second end to the first end.

[0090] It should be noted that, when the ratio is equal to the preset ratio, the direction of pedestrian movement within the field of view of the camera device is determined to be any one of the following directions: from the first end to the second end within the field of view of the camera device, or from the second end to the first end within the field of view of the camera device.

[0091] In this embodiment, the direction of real-time pedestrian movement with a larger proportion can be determined as the direction of pedestrian movement within the field of view of the camera device, based on the real-time proportion of pedestrian movement in different directions within the field of view of the camera device.

[0092] In some embodiments, for each camera device installed on the target line, the direction of pedestrian movement on the target line is the direction of pedestrian movement within the field of view of that camera device; step 101 may include the following sub-steps:

[0093] Step 111: Obtain the real-time human movement direction of each pedestrian within the field of view of the camera device;

[0094] Step 112: When the real-time human movement direction of more than a preset number of pedestrians is consistent, the real-time human movement direction is determined as the movement direction of the flow of people within the field of view of the camera device.

[0095] In this embodiment, as Figure 5 As shown, the real-time human movement direction of more than a preset number of pedestrians is consistent, that is, more than a preset number of pedestrians are moving in one direction. In this case, the real-time human movement direction is determined as the human flow movement direction within the field of view of the camera device.

[0096] In some embodiments, step 102 may include the following sub-steps:

[0097] Step 1021: Determine the angle between the visible field of view of each camera device installed on the target route and the direction of pedestrian movement;

[0098] Step 1022: When the included angle is less than 90 degrees, determine that the target algorithm model corresponding to the camera device is a human detection model;

[0099] Step 1023: When the included angle is greater than 90 degrees, determine that the target algorithm model corresponding to the camera device is a face detection model.

[0100] Specifically, if the angle between the visible field of view of each camera device set up on the target route and the direction of pedestrian movement is greater than 90 degrees, it is assumed that the visible field of view of the camera device is the reference, and the direction of pedestrian movement is the opposite direction. When the direction is reversed, the camera device is more likely to detect faces. Therefore, the target algorithm model corresponding to the camera device is determined to be a face detection model.

[0101] If the angle between the visible field of view of each camera device set up on the target route and the direction of pedestrian movement is less than 90 degrees, it is assumed that the visible field of view of the camera device is the reference and the direction of pedestrian movement is the same, and the target algorithm model corresponding to the camera device is determined as the human body detection model.

[0102] likeFigure 2 As shown, during the morning rush hour (e.g., 7 AM to 9 AM), the majority of pedestrian traffic originates from residential areas and heads towards the subway station. Assuming the target route is from the entrance / exit of residential area A to the subway station, the target algorithm model for all reverse-direction cameras (CAM3 and CAM5) is determined to be a face detection model, and the target algorithm model for all unidirectional cameras (CAM2 and CAM4) is determined to be a human detection model. The cameras at both ends of the target route remain unchanged, thus avoiding the problem of missed detections caused by using only one algorithm model for all cameras along the target route.

[0103] like Figure 6 As shown, during the evening rush hour (e.g., from 5 PM to 7 PM), the flow of people is mainly from the subway station back to the residential area (the direction of pedestrian movement is shown by the arrows). Assuming the target route is the line between the entrance / exit of residential area A and the subway station, the target algorithm model corresponding to all reverse-direction camera devices (CAM2 and CAM4) is determined to be a face detection model, and the target algorithm model corresponding to all unidirectional camera devices (CAM3 and CAM5) is determined to be a human body detection model. The camera devices set at both ends of the target route are not modified.

[0104] In this embodiment, the most suitable target algorithm model for a camera can be determined by the angle between the visible field of view of the camera device installed on the target route and the direction of pedestrian movement. For example, if the angle is greater than 90 degrees, it is easier to detect faces, and the most suitable target algorithm model for the camera device is a face detection model; if the angle is less than 90 degrees, it is not easy to detect faces, and the most suitable target algorithm model for the camera device is a human detection model. This embodiment can improve detection efficiency and make detection more effective.

[0105] In some embodiments, when the first camera device is the preceding adjacent camera device of the target camera device on the target line, the direction of pedestrian movement within the field of view of the first camera device is predicted based on the direction of pedestrian movement within the field of view of the target camera device. Here, the target camera device is any one of the camera devices installed on the target line, and the first camera device is the next camera device after the target camera device along the direction of pedestrian movement within the field of view of the target camera device. Based on the direction of the field of view corresponding to the first camera device installed on the target line and the predicted direction of pedestrian movement within the field of view of the first camera device, a target algorithm model corresponding to the first camera device is determined.

[0106] Specifically, such as Figure 6As shown, assuming the target route is from the entrance / exit of residential area A to the subway station, when a large flow of people emerges at the subway entrance (CAM7 location), the target algorithm model corresponding to the first camera device (CAM4 and CAM5) adjacent to the target camera device CAM7 needs to be adjusted. Specifically, regarding the direction of pedestrian movement within the field of view of CAM7 (as shown by the arrows), CAM4 is the next camera device to the left of CAM7 along the direction of pedestrian movement indicated by the arrows, and CAM5 is the next camera device to the right of CAM7 along the direction of pedestrian movement indicated by the arrows.

[0107] Specifically, the visible field of view corresponding to CAM4 is Figure 6 The direction of pedestrian movement within the visible area of ​​CAM4, as shown in the gray triangle, points from CAM4 towards the subway station. Figure 6 The arrows indicate a direction from the subway station horizontally to the left. Since the angle between the visible field of view corresponding to CAM4 and the predicted direction of pedestrian movement within CAM4's visible field of view is greater than 90 degrees, the predicted direction of pedestrian movement within CAM4's visible field of view is the reverse direction, using the visible field of view corresponding to CAM4 as a reference. This determines the most suitable target algorithm model for CAM4, namely the face detection model. The visible field of view corresponding to CAM5 is... Figure 6 The direction from CAM5 to CAM2 within the gray triangular area shown represents the predicted direction of pedestrian movement within the visible field of view of CAM5. Figure 6 The arrows shown point in the direction from the subway station horizontally to the left. Since the angle between the visible field direction corresponding to CAM5 and the predicted direction of pedestrian movement within the visible field of CAM5 is less than 90 degrees, the predicted direction of pedestrian movement within the visible field of CAM5 is the same as the visible field direction corresponding to CAM5. Therefore, the most suitable target algorithm model, namely the human body detection model, is determined for CAM5.

[0108] In this embodiment, when a large number of people appear in the field of view of a certain camera device, the direction of the next flow of people is predicted, and the target algorithm model corresponding to the camera device adjacent to the camera device in front of the camera device is adjusted. This can pre-adjust the corresponding target algorithm model for the camera device adjacent to the camera device in front of the camera device, thereby improving the detection efficiency.

[0109] In some embodiments, when the first camera device is the preceding adjacent camera device of the target camera device on the first target line, and the first camera device is the preceding adjacent camera device of the second camera device on the second target line, the first pedestrian movement direction within the field of view of the first camera device is predicted based on the pedestrian movement direction within the field of view of the target camera device, and the second pedestrian movement direction within the field of view of the first camera device is predicted based on the pedestrian movement direction within the field of view of the second camera device; based on the field of view direction corresponding to the first camera device set on the target line and the predicted first pedestrian movement direction within the field of view of the first camera device, a first target algorithm model corresponding to the first camera device is determined; based on the field of view direction corresponding to the first camera device set on the target line and the predicted first pedestrian movement direction within the field of view of the first camera device, a first target algorithm model corresponding to the first camera device is determined; based on the first camera device set on the target line... Based on the field of view of the first camera and the predicted direction of pedestrian movement within its field of view, a second target algorithm model is determined for the first camera. If the first and second target algorithm models are inconsistent, the target algorithm model for the first camera is determined to be a face detection model. If the first and second target algorithm models are consistent, assuming both are face detection models, the target algorithm model for the first camera is determined to be a face detection model. Alternatively, assuming both are human detection models, the target algorithm model for the first camera is determined to be a human detection model. Specifically, for the first target route, the first camera is the next camera following the target camera along the pedestrian movement direction of the first target route; for the second target route, the first camera is the next camera following the second camera along the pedestrian movement direction of the second target route.

[0110] like Figure 6As shown, for the route from the entrance / exit of Community C to the subway station, CAM5 is the next camera device after CAM3 along the direction of pedestrian movement (vertically downwards from the entrance / exit of Community C), i.e., the preceding adjacent camera device. For the route from the subway station to any entrance / exit, CAM5 is the next camera device after CAM7 along the direction of pedestrian movement (horizontally to the left from the subway station), i.e., the preceding adjacent camera device. When a large number of people are present at the locations of CAM3 and CAM7 simultaneously, the direction of pedestrian movement within the field of view of CAM3 is downwards from the entrance / exit of Community C. Based on the direction of pedestrian movement within the field of view of CAM3, the first direction of pedestrian movement within the field of view of CAM5 is predicted, i.e., the first direction of pedestrian movement within the field of view of CAM5 is vertically downwards from the entrance / exit of Community C. The direction of pedestrian movement within the visible field of view of CAM7 is horizontally to the left from the subway station. Based on the direction of pedestrian movement within the visible field of view of CAM7, the direction of the second pedestrian movement within the visible field of view of CAM5 is predicted; that is, the direction of the second pedestrian movement within the visible field of view of CAM5 is horizontally to the left from the subway station. The visible field direction corresponding to CAM5 is... Figure 6 In the gray triangular area shown, the direction from CAM5 to CAM2 indicates that the predicted direction of the first pedestrian movement within the visual field of CAM5 is a vertical downward direction from the entrance / exit of area C. Since the angle between the visual field direction corresponding to CAM5 and the predicted direction of the first pedestrian movement within the visual field of CAM5 is greater than 90 degrees, the visual field direction corresponding to CAM5 is used as the reference, and the predicted direction of the first pedestrian movement within the visual field of CAM5 is the reverse direction. This determines the first target algorithm model corresponding to CAM5, i.e., the face detection model. The visual field direction corresponding to CAM5 is... Figure 6 In the gray triangular area shown, the direction from CAM5 to CAM2 predicts the second pedestrian movement direction within CAM5's field of view as a horizontal direction from the subway station to the left. Since the angle between the field of view direction corresponding to CAM5 and the predicted second pedestrian movement direction within CAM5's field of view is less than 90 degrees, the field of view direction corresponding to CAM5 is used as the reference, and the predicted second pedestrian movement direction within CAM5's field of view is in the same direction. Therefore, the second target algorithm model corresponding to CAM5 is determined to be the human detection model. Because the pedestrian movement direction at the location of CAM7 determines that the most suitable target algorithm model for CAM5 is the human detection model, and the pedestrian movement direction at the location of CAM3 determines that the most suitable target algorithm model for CAM5 is the face detection model, in the event of a conflict, the face detection model takes priority; that is, the target algorithm model corresponding to CAM5 is the face detection model.

[0111] In this embodiment, if there is a conflict between the target algorithm models corresponding to a certain camera device, the face detection model takes priority. That is, the target algorithm model corresponding to the first camera device is the face detection model, which can capture more faces while reducing detection and improve the effectiveness of face detection.

[0112] In some embodiments, if the number of people in the field of view of the camera device is less than the preset number of people, the algorithm model corresponding to the camera device is restored from the target algorithm model to the initially configured algorithm model.

[0113] like Figure 6 As shown, when the number of people in the field of view of CAM7 is less than the preset number of people, after a certain time interval, the number of people in the field of view of CAM4 and CAM5 is also less than the preset number of people. The algorithm models corresponding to CAM4 and CAM5 are restored from the target algorithm model to the initial configuration algorithm model, while the algorithm models corresponding to the camera devices set at both ends of the target line remain unchanged.

[0114] In this embodiment, when the number of people in the field of view of the camera device drops to less than the preset number of people, the algorithm model corresponding to the camera device is restored to the initially configured algorithm model.

[0115] The apparatus for determining the algorithm model provided by the present invention will be described below. The apparatus for determining the algorithm model described below can be referred to in correspondence with the method for determining the algorithm model described above.

[0116] Please refer to Figure 7 , Figure 7 This is a schematic diagram of the structure of the device for determining the algorithm model provided by the present invention. For example... Figure 7 As shown, the device for determining the algorithm model provided by the present invention may include:

[0117] The direction determination module 10 is used to determine the direction of pedestrian movement on the target route;

[0118] The model determination module 20 is used to determine the target algorithm model for detection corresponding to each of the camera devices based on the visible field direction of each camera device set on the target line and the direction of pedestrian movement; the algorithm model includes a face detection model or a human body detection model.

[0119] Optionally, the model determination module 20 is specifically used for:

[0120] Determine the angle between the visible field of view of each camera device installed on the target route and the direction of pedestrian movement;

[0121] When the included angle is less than 90 degrees, the target algorithm model corresponding to the camera device is determined to be the human detection model;

[0122] When the included angle is greater than 90 degrees, the target algorithm model corresponding to the camera device is determined to be the face detection model.

[0123] Optionally, the direction determination module 10 is specifically used for:

[0124] The first number of people and the second number of people are counted based on historical data; wherein, the first number of people is the number of people moving from the first end to the second end of the target route, and the second number of people is the number of people moving from the second end to the first end of the target route.

[0125] Obtain the ratio between the first number of people and the second number of people;

[0126] When the ratio is greater than the preset ratio, the direction of pedestrian movement on the target route is determined to be from the first end to the second end of the target route;

[0127] If the ratio is less than the preset ratio, the direction of pedestrian movement on the target route is determined to be from the second end to the first end of the target route.

[0128] Optionally, the camera devices installed on the target route include: camera devices installed in the middle of the target route.

[0129] Optionally, the direction determination module 10 is also used for:

[0130] Obtain several routes and pedestrian traffic data for each route from the map's road network data;

[0131] If the passenger flow data of the route exceeds a preset threshold, the route will be identified as the target route.

[0132] Optionally, for each camera device installed on the target route, the direction of pedestrian movement on the target route is the direction of pedestrian movement within the field of view of the camera device;

[0133] Direction determination module 10 is specifically used for:

[0134] The third and fourth number of people are counted based on real-time data; wherein, the third number of people is the number of people moving from the first end to the second end within the field of view of the camera device, and the fourth number of people is the number of people moving from the second end to the first end within the field of view of the camera device.

[0135] Obtain the ratio between the third number of people and the fourth number of people;

[0136] When the ratio is greater than a preset ratio, the direction of pedestrian movement within the field of view of the camera device is determined to be from the first end to the second end within the field of view of the camera device;

[0137] If the ratio is less than a preset ratio, the direction of pedestrian movement within the field of view of the camera device is determined to be from the second end to the first end within the field of view of the camera device.

[0138] Optionally, for each camera device installed on the target route, the direction of pedestrian movement on the target route is the direction of pedestrian movement within the field of view of the camera device;

[0139] Direction determination module 10 is specifically used for:

[0140] Acquire the real-time human movement direction of each pedestrian within the field of view of the camera device;

[0141] When more than a preset number of pedestrians move in the same direction in real time, the real-time human movement direction is determined as the direction of pedestrian movement within the field of view of the camera device.

[0142] Optionally, the direction determination module 10 is specifically used for:

[0143] Obtain the first visible field of view of the camera device in the image coordinate system and the second visible field of view in the world coordinate system;

[0144] For each pedestrian within the field of view of the camera device, the first real-time human movement direction of the pedestrian in the image coordinate system is obtained;

[0145] Based on the angle between the first visible field direction and the first real-time human movement direction, the angle between the second visible field direction and the second real-time human movement direction is determined; the second real-time human movement direction is the real-time human movement direction of the pedestrian in the world coordinate system.

[0146] The second real-time human movement direction is determined based on the angle between the second visible field direction and the second real-time human movement direction, as well as the second visible field direction.

[0147] Optionally, the direction determination module 10 is specifically used for:

[0148] When the first camera device is the preceding camera device of the target camera device on the target route, the direction of pedestrian movement within the field of view of the first camera device is predicted based on the direction of pedestrian movement within the field of view of the target camera device, wherein the target camera device is any one of the camera devices installed on the target route, and the first camera device is the next camera device of the target camera device along the direction of pedestrian movement within the field of view of the target camera device;

[0149] The algorithm model for determining the target corresponding to each camera device based on the visible field of view of each camera device installed on the target route and the direction of pedestrian movement includes:

[0150] Based on the visible field of view of the first camera device set on the target route and the predicted direction of pedestrian movement within the visible field of view of the first camera device, the target algorithm model corresponding to the first camera device is determined.

[0151] Optionally, the device further includes:

[0152] The model restoration module is used to restore the algorithm model corresponding to the camera device from the target algorithm model to the initially configured algorithm model when the number of people in the field of view of the camera device is less than the preset number of people.

[0153] Optionally, the direction determination module 10 is specifically used for:

[0154] In the case where the first camera device is the preceding camera device of the target camera device on the first target route, and the first camera device is the preceding camera device of the second camera device on the second target route, a first pedestrian movement direction within the field of view of the first camera device is predicted based on the pedestrian movement direction within the field of view of the first camera device, and a second pedestrian movement direction within the field of view of the second camera device is predicted based on the pedestrian movement direction within the field of view of the second camera device; wherein, for the first target route, the first camera device is the next camera device of the target camera device along the pedestrian movement direction of the first target route; and for the second target route, the first camera device is the next camera device of the second camera device along the pedestrian movement direction of the second target route.

[0155] Model determination module 20 is also used for:

[0156] Based on the visible field direction of the first camera device set on the target route and the predicted first pedestrian movement direction within the visible field of view of the first camera device, the first target algorithm model corresponding to the first camera device is determined.

[0157] Based on the visible field direction of the first camera device set on the target route and the predicted second pedestrian movement direction within the visible field of view of the first camera device, the second target algorithm model corresponding to the first camera device is determined.

[0158] If the first target algorithm model and the second target algorithm model are inconsistent, the target algorithm model corresponding to the first camera device is determined to be a face detection model.

[0159] Optionally, the direction determination module 10 is specifically used for:

[0160] Get multiple locations where the foot traffic exceeds the preset foot traffic.

[0161] For each location pair, the route between the location pairs is determined based on map road network data;

[0162] Based on historical pedestrian traffic data, pedestrian traffic data for each of the aforementioned routes is filtered out.

[0163] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute a method for determining an algorithm model, the method including:

[0164] Determine the direction of pedestrian movement along the target route;

[0165] Based on the visible field of view of each camera device set on the target route and the direction of pedestrian movement, a target algorithm model for detection is determined for each camera device; the algorithm model includes a face detection model or a human body detection model.

[0166] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0167] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is capable of executing the method for determining the algorithm model provided by the above methods, the method comprising:

[0168] Determine the direction of pedestrian movement along the target route;

[0169] Based on the visible field of view of each camera device set on the target route and the direction of pedestrian movement, a target algorithm model for detection is determined for each camera device; the algorithm model includes a face detection model or a human body detection model.

[0170] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for determining the algorithm model provided by the methods described above, the method comprising:

[0171] Determine the direction of pedestrian movement along the target route;

[0172] Based on the visible field of view of each camera device set on the target route and the direction of pedestrian movement, a target algorithm model for detection is determined for each camera device; the algorithm model includes a face detection model or a human body detection model.

[0173] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0174] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0175] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for determining an algorithm model, characterized in that, include: Determine the direction of pedestrian movement along the target route; Based on the visible field of view of each camera device installed on the target route and the direction of pedestrian movement, a target algorithm model for detection is determined for each camera device; the algorithm model includes a face detection model or a human body detection model; the camera devices installed on the target route include those installed in the middle of the target route, but do not include those installed at both ends of the target route; The step of determining the target algorithm model for detection for each camera device based on the visible field of view of each camera device installed on the target route and the direction of pedestrian movement includes: Determine the angle between the visible field of view of each camera device installed on the target route and the direction of pedestrian movement; For each of the camera devices, if the included angle is less than 90 degrees, the target algorithm model corresponding to the camera device is determined to be the human body detection model; if the included angle is greater than 90 degrees, the target algorithm model corresponding to the camera device is determined to be the face detection model. For each camera device installed on the target route, the direction of pedestrian movement on the target route is the direction of pedestrian movement within the field of view of the camera device; Determining the direction of pedestrian movement on the target route includes: Obtain the first visible field of view of the camera device in the image coordinate system and the second visible field of view in the world coordinate system; For each pedestrian within the field of view of the camera device, the first real-time human movement direction of the pedestrian in the image coordinate system is obtained; Based on the angle between the first visible field direction and the first real-time human movement direction, the angle between the second visible field direction and the second real-time human movement direction is determined; the second real-time human movement direction is the real-time human movement direction of the pedestrian in the world coordinate system. The angle between the second visible field direction and the second real-time human movement direction is summed with the second visible field direction, and the summed real-time human movement direction is normalized according to the map road network data to determine the second real-time human movement direction. When the real-time human movement direction of more than a preset number of pedestrians is consistent, the second real-time human movement direction is determined as the human movement direction within the field of view of the camera device.

2. The method for determining the algorithm model according to claim 1, characterized in that, Determining the direction of pedestrian movement on the target route includes: The first number of people and the second number of people are counted based on historical data; wherein, the first number of people is the number of people moving from the first end to the second end of the target route, and the second number of people is the number of people moving from the second end to the first end of the target route. Obtain the ratio between the first number of people and the second number of people; When the ratio is greater than the preset ratio, the direction of pedestrian movement on the target route is determined to be from the first end to the second end of the target route; If the ratio is less than the preset ratio, the direction of pedestrian movement on the target route is determined to be from the second end to the first end of the target route.

3. The method for determining the algorithm model according to claim 1, characterized in that, The method further includes: Obtain several routes and pedestrian traffic data for each route from the map's road network data; If the passenger flow data of the route exceeds a preset threshold, the route will be identified as the target route.

4. The method for determining the algorithm model according to claim 1, characterized in that, For each camera device installed on the target route, the direction of pedestrian movement on the target route is the direction of pedestrian movement within the field of view of the camera device; Determining the direction of pedestrian movement on the target route includes: The third and fourth number of people are counted based on real-time data; wherein, the third number of people is the number of people moving from the first end to the second end within the field of view of the camera device, and the fourth number of people is the number of people moving from the second end to the first end within the field of view of the camera device. Obtain the ratio between the third number of people and the fourth number of people; When the ratio is greater than a preset ratio, the direction of pedestrian movement within the field of view of the camera device is determined to be from the first end to the second end within the field of view of the camera device; If the ratio is less than a preset ratio, the direction of pedestrian movement within the field of view of the camera device is determined to be from the second end to the first end within the field of view of the camera device.

5. The method for determining the algorithm model according to claim 1 or 4, characterized in that, Determining the direction of pedestrian movement on the target route also includes: When the first camera device is the preceding camera device of the target camera device on the target route, the direction of pedestrian movement within the field of view of the first camera device is predicted based on the direction of pedestrian movement within the field of view of the target camera device, wherein the target camera device is any one of the camera devices installed on the target route, and the first camera device is the next camera device of the target camera device along the direction of pedestrian movement within the field of view of the target camera device; The algorithm model for determining the target corresponding to each camera device based on the visible field of view of each camera device installed on the target route and the direction of pedestrian movement includes: Based on the visible field of view of the first camera device set on the target route and the predicted direction of pedestrian movement within the visible field of view of the first camera device, the target algorithm model corresponding to the first camera device is determined.

6. A device for determining an algorithm model, characterized in that, include: The direction determination module is used to determine the direction of pedestrian movement on the target route; The model determination module is used to determine the target algorithm model for detection corresponding to each of the camera devices set on the target route based on the visible field direction corresponding to each camera device and the direction of pedestrian movement; the algorithm model includes a face detection model or a human body detection model; the camera devices set on the target route include camera devices set in the middle of the target route, but do not include camera devices set at both ends of the target route; The model determination module is specifically used to determine the angle between the visible field direction of each camera device set on the target route and the direction of pedestrian movement; for each camera device, if the angle is less than 90 degrees, the target algorithm model corresponding to the camera device is determined to be the human body detection model; if the angle is greater than 90 degrees, the target algorithm model corresponding to the camera device is determined to be the face detection model. For each camera device installed on the target route, the direction of pedestrian movement on the target route is the direction of pedestrian movement within the field of view of the camera device; The direction determination module is specifically used to obtain the first visible field direction of the camera device in the image coordinate system and the second visible field direction in the world coordinate system; for each pedestrian in the visible field of the camera device, obtain the first real-time human movement direction of the pedestrian in the image coordinate system; and determine the angle between the second visible field direction and the second real-time human movement direction based on the angle between the first visible field direction and the first real-time human movement direction. The second real-time human movement direction is the real-time human movement direction of the pedestrian in the world coordinate system; The angle between the second visible field direction and the second real-time human movement direction is summed with the second visible field direction, and the summed real-time human movement direction is normalized according to the map road network data to determine the second real-time human movement direction. When the real-time human movement direction of more than a preset number of pedestrians is consistent, the second real-time human movement direction is determined as the human movement direction within the field of view of the camera device.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method for determining the algorithm model as described in any one of claims 1 to 5.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method for determining the algorithm model as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Retrograde direction motion direction determination method and device

    CN111611938A

  • Object tracking method and device, electronic equipment and computer readable storage medium

    CN112215037A

  • Inspection method and device based on computer vision and electronic equipment

    CN112906552A

  • Robot and positioning method thereof

    CN114683269A