Pedestrian trace detection alarm method and system based on image recognition
By using image recognition technology to perform pedestrian identification and trace analysis in the pedestrian detection area, the problem of pedestrian trace detection in the prior art is solved, accurate detection and timely warning of pedestrian traces are achieved, and detection quality and efficiency are improved.
Patent Information
- Application Number
- CN202510208301.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-03-28
AI Technical Summary
The existing pedestrian trace detection and alarm technology cannot intelligently identify whether pedestrians appear in the detection area, and it is difficult to realize dynamic detection and alarm of pedestrian traces, resulting in poor quality of pedestrian trace detection and warning operations.
Using an image recognition method, the real-time image data of the pedestrian detection area is collected and the personnel feature image data are used to match the process to generate personnel identification data. When a pedestrian is detected, the pedestrian's real-time image feature data is collected, position coordinate analysis is performed, data is matched with safe activity range, track detection alarm data is constructed, and the alarm platform is pushed through the Internet of Things communication network.
It realizes accurate detection of pedestrian traces and timely warning of abnormal situations, improves detection quality and efficiency, and ensures the safety and reliability of pedestrian traces.
Smart Images

Figure CN119723461A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pedestrian trace alarm, and in particular to a pedestrian trace detection alarm method and system based on image recognition. Background Art
[0002] With the continuous development of computer vision technology, pedestrian trace detection and alarm technology has been widely used in various fields of public safety. The existing pedestrian trace detection and alarm technology cannot intelligently identify whether there are pedestrians in the detection area, and it is difficult to realize dynamic detection and alarm of pedestrian traces, resulting in poor quality of pedestrian trace detection and warning operations.
[0003] The Chinese invention patent with announcement number CN110599736B introduces an early warning control method and system for personnel care. By giving priority to the position of the video detection device as the real-time position of the personnel, when the video detection device cannot locate the position of the personnel, the position of the access control detection device is used as the real-time position of the personnel. If the access control detection device still cannot locate the position of the personnel, the real-time position of the personnel is obtained through the personnel positioning detection device, and a corresponding alarm is issued. The automatic positioning logic and early warning control logic of nursing homes can be optimized, the accuracy and convenience are improved, and the efficient and intelligent operation of nursing home personnel positioning can be realized. However, when analyzing the real-time position of the personnel, it is impossible to determine whether the real-time position of the personnel is in a safe area, and it is difficult to ensure the quality of completion of the early warning operation. Summary of the invention
[0004] 1. Technical issues to be resolved In order to solve the deficiencies in the background technology, the present invention provides a pedestrian trace detection alarm method and system based on image recognition, which can realize accurate detection of pedestrian traces and timely warning when abnormalities occur.
[0005] (II) Technical solution A pedestrian tracking detection and alarm method based on image recognition comprises the following steps: S1, collect real-time image data of pedestrian detection area; S2, performing image data matching processing on the real-time image data of the pedestrian detection area and the characteristic image data of the person in the pedestrian detection area to generate the person identification data of the pedestrian detection area. If the person identification data of the pedestrian detection area indicates that there is no pedestrian, then the pedestrian trace detection alarm operation is terminated; S3. If the pedestrian detection area person identification data indicates that there is a pedestrian, real-time image feature data of the person in the pedestrian detection area is collected; S4, performing pedestrian position coordinate analysis and processing according to the real-time image feature data of the person in the pedestrian detection area to generate real-time position coordinate data of the person in the pedestrian detection area; S5, establish pedestrian detection area safety activity range data, perform pedestrian real-time position matching processing on the real-time position coordinate data of the pedestrian detection area personnel and the pedestrian detection area safety activity range data, generate pedestrian detection area personnel real-time position analysis data, if the pedestrian detection area personnel real-time position analysis data shows that the pedestrian position is normal, return to S1; S6. If the real-time position analysis data of the personnel in the pedestrian detection area shows that the pedestrian position is abnormal, pedestrian trace detection alarm data is constructed based on the real-time position coordinate data of the personnel in the pedestrian detection area and the real-time position analysis data of the personnel in the pedestrian detection area, and is pushed to the pedestrian trace detection alarm Internet of Things platform through the Internet of Things communication network.
[0006] The present invention performs image data matching processing on the collected real-time image data of the pedestrian detection area and the characteristic image data of the personnel in the pedestrian detection area to generate the personnel identification data of the pedestrian detection area; when the personnel identification data of the pedestrian detection area indicates that there are pedestrians, the real-time image characteristic data of the personnel in the pedestrian detection area is collected, and the pedestrian position coordinate analysis processing is performed to generate the real-time position coordinate data of the personnel in the pedestrian detection area; the real-time position coordinate data of the personnel in the pedestrian detection area is matched with the established safe activity range data of the pedestrian detection area to generate the real-time position analysis data of the personnel in the pedestrian detection area; if the real-time position analysis data of the personnel in the pedestrian detection area indicates that the pedestrian position is abnormal, the pedestrian trace detection alarm data is constructed and pushed to the pedestrian trace detection alarm Internet of Things platform through the Internet of Things communication network, so as to realize the accurate detection of pedestrian traces and the timely warning when abnormalities occur.
[0007] Preferably, the specific steps of collecting real-time image data of the pedestrian detection area are as follows: S11, collect image data of the pedestrian detection area in real time through the main camera, and obtain real-time image data of the pedestrian detection area The main camera is installed at a position where it can capture the pedestrian detection area in all directions and without blind spots. The main camera refers to any one of a hemispherical camera, an infrared thermal imaging camera, and a panoramic camera.
[0008] Preferably, the real-time image data of the pedestrian detection area is matched with the characteristic image data of the person in the pedestrian detection area to generate the person identification data of the pedestrian detection area. If the person identification data of the pedestrian detection area indicates that there is no pedestrian, the specific steps of ending the pedestrian trace detection alarm operation are as follows: S21. Establishing a pedestrian detection area personnel feature image dataset ,in, Indicates Personnel feature image data in pedestrian detection areas, Indicates the total number of characteristic image data of people in the pedestrian detection area, wherein the characteristic image data of people in the pedestrian detection area represents image data of different types of people in different postures in the pedestrian detection area; S22, using the cosine similarity formula to sequentially calculate the similarity values of the real-time image data of the pedestrian detection area and the pedestrian detection area personnel feature image data set, and set a similarity threshold. If the similarity values of the real-time image data of the pedestrian detection area and all the pedestrian detection area personnel feature image data in the pedestrian detection area personnel feature image data set are less than the similarity threshold, then output the pedestrian detection area personnel recognition data. If there is no pedestrian, the pedestrian trace detection alarm operation is terminated; if the similarity value between the real-time image data of the pedestrian detection area and any one of the pedestrian detection area personnel feature image data in the pedestrian detection area personnel feature image data set is greater than or equal to the similarity threshold, the pedestrian detection area personnel recognition data is output. If there is a pedestrian, go to S3; the cosine similarity formula is as follows: , in, represents the similarity value between the real-time image data of the pedestrian detection area and any one of the pedestrian detection area personnel feature image data in the pedestrian detection area personnel feature image data set, and The feature vectors respectively represent the real-time image data of the pedestrian detection area and the feature image data of a person in any pedestrian detection area.
[0009] The real-time image data of the pedestrian detection area and the person feature image data of the pedestrian detection area are matched with each other through the cosine similarity algorithm, thereby ensuring the speed and accuracy of the image data matching process. At the same time, it is determined whether there are pedestrians in the pedestrian detection area, and the pedestrian traces in the target area are preliminarily analyzed to avoid additional resource consumption.
[0010] Preferably, if the pedestrian detection area personnel identification data indicates that there are pedestrians, the specific steps of collecting the real-time image feature data of the pedestrian detection area personnel are as follows: S31, by installing several auxiliary cameras in the pedestrian detection area, collecting image data of pedestrians in real time when the pedestrians appear in the pedestrian detection area, to obtain a real-time image data set of people in the pedestrian detection area ,in, Indicates The image data of pedestrians appearing in the pedestrian detection area collected by the auxiliary camera in real time, represents the total number of auxiliary cameras, where the auxiliary camera represents any one of a micro camera, a pan-tilt zoom camera, a depth camera, and a hemispherical camera; S32, using an adaptive median filtering method to perform data noise reduction processing on the real-time image data of pedestrian detection area personnel in the real-time image data set of pedestrian detection area personnel, to generate a real-time image feature data set of pedestrian detection area personnel ,in, Indicates The image data of pedestrians appearing in the pedestrian detection area collected by the auxiliary camera in real time is subjected to data denoising to obtain the real-time image feature data of people in the pedestrian detection area; the data denoising process is as follows: S321, randomly selecting any one of the real-time image data of a person in the pedestrian detection area in the real-time image data set of a person in the pedestrian detection area as sample image data; S322, setting a sliding filter window, and aligning the center point of the sliding filter window with each pixel point in the sample image data in sequence; S323, judging whether the pixel value of the center point of the sliding filter window is the maximum value in the neighborhood of the sliding filter window. If the pixel value of the center point of the sliding filter window is not the maximum value in the neighborhood of the sliding filter window, no operation is performed; otherwise, increasing the size of the sliding filter window, and re-judging whether the pixel value of the center point of the sliding filter window is the maximum value in the neighborhood of the sliding filter window, until the size of the sliding filter window is equal to the set size threshold. If the pixel value of the center point of the sliding filter window is still the maximum value in the neighborhood of the sliding filter window, then calculating the pixel median of all the pixel points of the sliding filter window, and replacing the pixel value of the center point of the sliding filter window with the pixel median; The calculation formula for the pixel median of all pixels in the sliding filter window is as follows: , in, represents the pixel median value of all pixels in the sliding filter window, represents the function of taking the median value, Indicates the first The pixel value corresponding to the pixel point is Indicates the total number of pixels in the sliding filter window.
[0011] Multiple auxiliary cameras are used to collect images of the pedestrian detection area when pedestrians appear to ensure the comprehensiveness and reliability of the collected data. The adaptive median filtering method is used to perform data denoising on the acquired image data to accurately remove noise data in the acquired image data and effectively avoid the impact of noise in the acquired image data.
[0012] Preferably, the specific steps of performing pedestrian position coordinate analysis and processing based on the real-time image feature data of the person in the pedestrian detection area to generate the real-time position coordinate data of the person in the pedestrian detection area are as follows: S41, converting the two-dimensional pixel coordinates of pedestrians in each real-time image feature data of pedestrian detection area personnel in the real-time image feature data set of pedestrian detection area personnel into two-dimensional real coordinates through a coordinate conversion formula, and generating a real coordinate data set of pedestrian detection area personnel ,in, Indicates The two-dimensional real coordinates of pedestrians in the real-time image feature data of pedestrian detection areas; the coordinate conversion formula is as follows: , in, represents the scale factor, and Respectively represent the external parameter matrix and internal parameter matrix of the auxiliary camera, Indicates The two-dimensional pixel coordinates of pedestrians in the real-time image feature data of pedestrian detection areas; S42, coordinate fusion processing is performed on the real coordinate data of the pedestrian detection area personnel in the real coordinate data set of the pedestrian detection area personnel, the overlapping parts of the real coordinate data of the pedestrian detection area personnel are extracted and data are marked, and the real-time position coordinate data of the pedestrian detection area personnel are generated. .
[0013] Preferably, pedestrian detection area safety activity range data is established, the real-time position coordinate data of the pedestrian detection area personnel and the pedestrian detection area safety activity range data are matched with the real-time position of the pedestrian to generate real-time position analysis data of the pedestrian detection area personnel. If the real-time position analysis data of the pedestrian detection area personnel is that the pedestrian position is normal, the specific steps of returning to S1 are as follows: S51. Collect the safe activity range of pedestrians in the detection area online through the pedestrian trace detection alarm IoT platform, and establish a safe activity range data set for pedestrian detection areas ,in, Indicates the pedestrian detection area The coordinate data corresponding to the safe activity range, Indicates the total number of safe activity range data of pedestrian detection area; S52: Using the locust optimization algorithm to analyze the real-time position coordinate data of the personnel in the pedestrian detection area The pedestrian detection area safety activity range data in the pedestrian detection area safety activity range data set are matched with the pedestrian real-time position, and the pedestrian detection area personnel real-time position analysis data is generated according to the matching result. ; S521. Construct a safe activity range to search for locust populations, and set the population size to , the current number of iterations is The maximum number of iterations is And the search space dimension of pedestrian detection area safety activity range data is ; The pedestrian detection area safety activity range data set is used as the pedestrian detection area safety activity range data search space, and a random number is generated in the pedestrian detection area safety activity range data search space. pedestrian detection area safety activity range data, each pedestrian detection area safety activity range data corresponds to a safety activity range search locust individual in the safety activity range search locust population; S522, calculating the fitness value of each individual safe activity range searching locust in the safe activity range searching locust population, arranging each individual safe activity range searching locust in the safe activity range searching locust population from large to small according to the fitness value, and selecting the individual safe activity range searching locust with the highest fitness value as the current optimal individual; the fitness value formula is as follows: , in, Indicates the safe activity range to search for locust populations. The fitness value of locust individuals searching in the safe activity range, Indicates Search the coordinate data of the pedestrian detection area safety activity range corresponding to the locust individual in the safety activity range, Indicates the correction value; S523, update reduction coefficient ; The update formula is as follows: , in, and Respectively represent the maximum and minimum values of the reduction coefficient; S524, when each individual in the safe activity range search locust population searches for food in the pedestrian detection area safe activity range data search space, it will be affected by the interaction force between the individual safe activity range search locusts and update its position; the position update formula is as follows: , in, Indicates the safe activity range to search for locust populations. Search for locust individuals within a safe activity range. Maintain the location after the location is updated in the search space of the safe activity range data of the pedestrian detection area, and Respectively represent Maintain the search upper and lower limits of the pedestrian detection area safety activity range data search space, Indicates the safe activity range to search for locust populations. Search for locust individuals within a safe activity range and The distance between individual locusts in the safe activity range is and Respectively represent In the first iteration process, the safe activity range searches for the first Search for locust individuals within a safe activity range and A safe activity range to search for the current location of individual locusts, represents the position of the current optimal individual, Indicates the safe activity range to search for locust populations. Search for locust individuals within a safe activity range and The function of the interaction force between locust individuals searching for a safe activity range is as follows: , in, and They represent the attraction intensity and attraction range between individual locusts searching for safe activity range respectively; S525, calculating the fitness value of each individual safe activity range searching locust in the safe activity range searching locust population after the position is updated, if the fitness value of the individual safe activity range searching locust after the position is updated is greater than the original fitness value, then the original position is replaced by the position obtained after the position of the individual safe activity range searching locust is updated; otherwise, the original position is retained; Rearranging the safe activity range searching locust individuals in the safe activity range searching locust population from large to small according to fitness values, and selecting the safe activity range searching locust individual with the highest fitness value as the new current optimal individual; S526, determine the current number of iterations Is it less than the maximum number of iterations? , if the current number of iterations Less than the maximum number of iterations , then the current number of iterations Add 1 and return to S523; otherwise, take the current optimal individual as the global optimal solution; S527, set a fitness threshold. If the fitness value of the global optimal solution is greater than or equal to the fitness threshold, it means that the real-time position coordinate data of the person in the pedestrian detection area is The pedestrian detection area safety activity range data corresponding to the global optimal solution is successfully matched, and the real-time location analysis data of the pedestrian detection area personnel is output If the pedestrian position is normal, the real-time position coordinate data of the person in the pedestrian detection area is retained, and S1 is returned; if the fitness value of the global optimal solution is less than the fitness threshold, it means that the real-time position coordinate data of the person in the pedestrian detection area is If the pedestrian detection area safety activity range data matching with the global optimal solution fails, the real-time location analysis data of the pedestrian detection area personnel is output. The pedestrian position is abnormal.
[0014] The locust optimization algorithm is used to perform pedestrian real-time position matching processing on the real-time position coordinate data of the personnel in the pedestrian detection area and the safe activity range data of the pedestrian detection area, and accurately identify whether the real-time position coordinate data of the personnel in the pedestrian detection area is not in the safe area, thereby realizing real-time detection of pedestrian traces, and at the same time improving the speed and efficiency of the matching process, ensuring the accuracy of the matching results.
[0015] Preferably, if the real-time position analysis data of the pedestrian detection area personnel is abnormal, the specific steps of constructing pedestrian trace detection alarm data based on the real-time position coordinate data of the pedestrian detection area personnel and the real-time position analysis data of the pedestrian detection area personnel, and pushing it to the pedestrian trace detection alarm Internet of Things platform through the Internet of Things communication network are as follows: S61: If the real-time location analysis data of the person in the pedestrian detection area If the pedestrian position is abnormal, the real-time position coordinate data of the person in the pedestrian detection area is and real-time location analysis data of personnel in the pedestrian detection area Combine data to construct pedestrian trace detection alarm data ; S62: transmitting the pedestrian trace detection alarm data through the Internet of Things communication network The information is pushed to the pedestrian tracking detection and alarm IoT platform, and an abnormal pedestrian tracking alarm is issued.
[0016] When the real-time location of a pedestrian is not within the safe area, it is promptly fed back to the pedestrian trace detection alarm platform and an alarm is issued, thus realizing timely alarm of abnormal pedestrian traces.
[0017] The present invention also discloses a pedestrian trace detection alarm system based on image recognition, comprising a pedestrian detection area real-time image data acquisition module, a pedestrian detection area personnel recognition module, a pedestrian detection area personnel real-time image feature data acquisition module, a pedestrian detection area personnel real-time position coordinate positioning module, a pedestrian detection area personnel real-time position analysis module and a pedestrian trace detection alarm data construction module; The pedestrian detection area real-time image data acquisition module acquires image data of the pedestrian detection area in real time through the main camera to obtain real-time image data of the pedestrian detection area; The pedestrian detection area personnel recognition module uses a cosine similarity formula to calculate a similarity value between the pedestrian detection area real-time image data and the established pedestrian detection area personnel feature image data, and generates pedestrian detection area personnel recognition data according to the similarity value; The pedestrian detection area personnel real-time image feature data acquisition module acquires image data of pedestrians appearing in the pedestrian detection area in real time through a plurality of auxiliary cameras installed in the pedestrian detection area, obtains real-time image data of pedestrians in the pedestrian detection area, and uses an adaptive median filtering method to perform data noise reduction processing to generate real-time image feature data of pedestrians in the pedestrian detection area; The real-time position coordinate positioning module of the pedestrian detection area converts the two-dimensional pixel coordinates of the pedestrian in the real-time image feature data of the pedestrian detection area into two-dimensional real coordinates through a coordinate conversion formula and performs coordinate fusion processing, extracts the overlapping parts of each two-dimensional real coordinate and performs data identification, and generates the real-time position coordinate data of the pedestrian detection area; The pedestrian detection area personnel real-time position analysis module performs pedestrian real-time position matching processing on the pedestrian detection area personnel real-time position coordinate data and the established pedestrian detection area safe activity range data through the locust optimization algorithm, and generates pedestrian detection area personnel real-time position analysis data according to the matching results; When the real-time position analysis data of personnel in the pedestrian detection area indicates that the pedestrian position is abnormal, the pedestrian trace detection alarm data construction module combines the real-time position coordinate data of personnel in the pedestrian detection area and the real-time position analysis data of personnel in the pedestrian detection area to construct pedestrian trace detection alarm data, pushes the data to the pedestrian trace detection alarm IoT platform through the IoT communication network, and issues a pedestrian trace abnormality alarm.
[0018] (III) Beneficial effects 1. The present invention performs image data matching processing on the collected real-time image data of pedestrian detection area and the characteristic image data of personnel in pedestrian detection area to generate personnel identification data of pedestrian detection area. When the personnel identification data of pedestrian detection area indicates that there are pedestrians, the real-time image characteristic data of personnel in pedestrian detection area is collected, and the pedestrian position coordinate analysis processing is performed to generate the real-time position coordinate data of personnel in pedestrian detection area. The real-time position coordinate data of personnel in pedestrian detection area is matched with the established safe activity range data of pedestrian detection area to generate the real-time position analysis data of personnel in pedestrian detection area. If the real-time position analysis data of personnel in pedestrian detection area indicates that the position of pedestrian is abnormal, pedestrian trace detection alarm data is constructed and pushed to the pedestrian trace detection alarm Internet of Things platform through the Internet of Things communication network, so as to realize the accurate detection of pedestrian traces and timely warning when abnormalities occur. 2. The real-time image data of the pedestrian detection area and the characteristic image data of the pedestrian detection area are matched by the cosine similarity algorithm to ensure the speed and accuracy of the image data matching process. At the same time, it is determined whether there are pedestrians in the pedestrian detection area, and the traces of pedestrians in the target area are preliminarily analyzed to avoid additional resource consumption; 3. Use multiple auxiliary cameras to collect images of the pedestrian detection area when pedestrians appear to ensure the comprehensiveness and reliability of the collected data. Use the adaptive median filter method to perform data noise reduction on the acquired image data to accurately remove the noise data in the acquired image data and effectively avoid the impact of noise in the acquired image data; 4. The real-time position coordinate data of the personnel in the pedestrian detection area and the safe activity range data of the pedestrian detection area are matched with each other through the locust optimization algorithm to accurately identify whether the real-time position coordinate data of the personnel in the pedestrian detection area is not in the safe area, thereby realizing real-time detection of pedestrian traces and improving the speed and efficiency of the matching process to ensure the accuracy of the matching results. When the real-time position of the pedestrian is not in the safe area, it is promptly fed back to the pedestrian trace detection alarm IoT platform and an alarm is issued, thereby realizing timely alarm of abnormal pedestrian traces. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the invention, the drawings required for describing the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, they can also obtain drawings based on these drawings without paying creative work.
[0020] Figure 1 A flowchart of a pedestrian trace detection and alarm method based on image recognition provided by the present invention; Figure 2A module schematic diagram of a pedestrian tracking detection and alarm system based on image recognition provided by the present invention. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] In the description of the present invention, it is necessary to understand that the terms "opening", "upper", "lower", "top", "middle", "inside" and the like indicating orientation or positional relationship are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the components or elements referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the invention.
[0023] Embodiment 1 is as follows: See also Figure 1 , a pedestrian trace detection and alarm method based on image recognition, comprising the following steps: S1, collect real-time image data of pedestrian detection area; S11, collect image data of the pedestrian detection area in real time through the main camera, and obtain real-time image data of the pedestrian detection area The main camera is installed at a position where it can capture the pedestrian detection area in all directions and without blind spots. The main camera refers to any one of a hemispherical camera, an infrared thermal imaging camera, and a panoramic camera.
[0024] S2, performing image data matching processing on the real-time image data of the pedestrian detection area and the characteristic image data of the person in the pedestrian detection area to generate the person identification data of the pedestrian detection area. If the person identification data of the pedestrian detection area indicates that there is no pedestrian, then the pedestrian trace detection alarm operation is terminated; S21. Establishing a pedestrian detection area personnel feature image dataset ,in, Indicates Personnel feature image data in pedestrian detection areas, Indicates the total number of characteristic image data of people in the pedestrian detection area, wherein the characteristic image data of people in the pedestrian detection area represents image data of different types of people in different postures in the pedestrian detection area; S22, using the cosine similarity formula to sequentially calculate the similarity values of the real-time image data of the pedestrian detection area and the pedestrian detection area personnel feature image data set, and set a similarity threshold. If the similarity values of the real-time image data of the pedestrian detection area and all the pedestrian detection area personnel feature image data in the pedestrian detection area personnel feature image data set are less than the similarity threshold, then output the pedestrian detection area personnel recognition data. If there is no pedestrian, the pedestrian trace detection alarm operation is terminated; if the similarity value between the real-time image data of the pedestrian detection area and any one of the pedestrian detection area personnel feature image data in the pedestrian detection area personnel feature image data set is greater than or equal to the similarity threshold, the pedestrian detection area personnel recognition data is output. If there is a pedestrian, go to S3; the cosine similarity formula is as follows: , in, represents the similarity value between the real-time image data of the pedestrian detection area and any one of the pedestrian detection area personnel feature image data in the pedestrian detection area personnel feature image data set, and The feature vectors respectively represent the real-time image data of the pedestrian detection area and the feature image data of a person in any pedestrian detection area.
[0025] S3. If the pedestrian detection area person identification data indicates that there is a pedestrian, real-time image feature data of the person in the pedestrian detection area is collected; S31, by installing several auxiliary cameras in the pedestrian detection area, collecting image data of pedestrians in real time when the pedestrians appear in the pedestrian detection area, to obtain a real-time image data set of people in the pedestrian detection area ,in, Indicates The image data of pedestrians appearing in the pedestrian detection area collected by the auxiliary camera in real time, represents the total number of auxiliary cameras, where the auxiliary camera represents any one of a micro camera, a pan-tilt zoom camera, a depth camera, and a hemispherical camera; S32, using an adaptive median filtering method to perform data noise reduction processing on the real-time image data of pedestrian detection area personnel in the real-time image data set of pedestrian detection area personnel, to generate a real-time image feature data set of pedestrian detection area personnel ,in, Indicates The image data of pedestrians appearing in the pedestrian detection area collected by the auxiliary camera in real time is subjected to data denoising to obtain the real-time image feature data of people in the pedestrian detection area; the data denoising process is as follows: S321, randomly selecting any one of the real-time image data of a person in the pedestrian detection area in the real-time image data set of a person in the pedestrian detection area as sample image data; S322, setting a sliding filter window, and aligning the center point of the sliding filter window with each pixel point in the sample image data in sequence; S323, judging whether the pixel value of the center point of the sliding filter window is the maximum value in the neighborhood of the sliding filter window. If the pixel value of the center point of the sliding filter window is not the maximum value in the neighborhood of the sliding filter window, no operation is performed; otherwise, increasing the size of the sliding filter window, and re-judging whether the pixel value of the center point of the sliding filter window is the maximum value in the neighborhood of the sliding filter window, until the size of the sliding filter window is equal to the set size threshold. If the pixel value of the center point of the sliding filter window is still the maximum value in the neighborhood of the sliding filter window, then calculating the pixel median of all the pixel points of the sliding filter window, and replacing the pixel value of the center point of the sliding filter window with the pixel median; The calculation formula for the pixel median of all pixels in the sliding filter window is as follows: , in, represents the pixel median value of all pixels in the sliding filter window, represents the function of taking the median value, Indicates the first The pixel value corresponding to the pixel point is Indicates the total number of pixels in the sliding filter window.
[0026] S4, performing pedestrian position coordinate analysis and processing according to the real-time image feature data of the person in the pedestrian detection area to generate real-time position coordinate data of the person in the pedestrian detection area; S41, converting the two-dimensional pixel coordinates of pedestrians in each real-time image feature data of pedestrian detection area personnel in the real-time image feature data set of pedestrian detection area personnel into two-dimensional real coordinates through a coordinate conversion formula, and generating a real coordinate data set of pedestrian detection area personnel ,in, Indicates The two-dimensional real coordinates of pedestrians in the real-time image feature data of pedestrian detection areas; the coordinate conversion formula is as follows: , in, represents the scale factor, and Respectively represent the external parameter matrix and internal parameter matrix of the auxiliary camera, Indicates The two-dimensional pixel coordinates of pedestrians in the real-time image feature data of pedestrian detection areas; S42, coordinate fusion processing is performed on the real coordinate data of the pedestrian detection area personnel in the real coordinate data set of the pedestrian detection area personnel, the overlapping parts of the real coordinate data of the pedestrian detection area personnel are extracted and data are marked, and the real-time position coordinate data of the pedestrian detection area personnel are generated. .
[0027] S5, establish pedestrian detection area safety activity range data, perform pedestrian real-time position matching processing on the real-time position coordinate data of the pedestrian detection area personnel and the pedestrian detection area safety activity range data, generate pedestrian detection area personnel real-time position analysis data, if the pedestrian detection area personnel real-time position analysis data shows that the pedestrian position is normal, return to S1; S51. Collect the safe activity range of pedestrians in the detection area online through the pedestrian trace detection alarm IoT platform, and establish a safe activity range data set for pedestrian detection areas ,in, Indicates the pedestrian detection area The coordinate data corresponding to the safe activity range, Indicates the total number of safe activity range data of pedestrian detection area; S52: Using the locust optimization algorithm to analyze the real-time position coordinate data of the personnel in the pedestrian detection area The pedestrian detection area safety activity range data in the pedestrian detection area safety activity range data set are matched with the pedestrian real-time position, and the pedestrian detection area personnel real-time position analysis data is generated according to the matching result. ; S521. Construct a safe activity range to search for locust populations, and set the population size to , the current number of iterations is The maximum number of iterations is And the search space dimension of pedestrian detection area safety activity range data is ; The pedestrian detection area safety activity range data set is used as the pedestrian detection area safety activity range data search space, and a random number is generated in the pedestrian detection area safety activity range data search space. pedestrian detection area safety activity range data, each pedestrian detection area safety activity range data corresponds to a safety activity range search locust individual in the safety activity range search locust population; S522, calculating the fitness value of each individual safe activity range searching locust in the safe activity range searching locust population, arranging each individual safe activity range searching locust in the safe activity range searching locust population from large to small according to the fitness value, and selecting the individual safe activity range searching locust with the highest fitness value as the current optimal individual; the fitness value formula is as follows: , in, Indicates the safe activity range to search for locust populations. The fitness value of locust individuals searching in the safe activity range, Indicates Search the coordinate data of the pedestrian detection area safety activity range corresponding to the locust individual in the safety activity range, Indicates the correction value; S523, update reduction coefficient ; The update formula is as follows: , in, and Respectively represent the maximum and minimum values of the reduction coefficient; S524, when each individual in the safe activity range search locust population searches for food in the pedestrian detection area safe activity range data search space, it will be affected by the interaction force between the individual safe activity range search locusts and update its position; the position update formula is as follows: , in, Indicates the safe activity range to search for locust populations. Search for locust individuals within a safe activity range. Maintain the location after the location is updated in the search space of the safe activity range data of the pedestrian detection area, and Respectively represent Maintain the search upper and lower limits of the pedestrian detection area safety activity range data search space, Indicates the safe activity range to search for locust populations. Search for locust individuals within a safe activity range and The distance between individual locusts in the safe activity range is and Respectively represent In the first iteration process, the safe activity range searches for the first Search for locust individuals within a safe activity range and A safe activity range to search for the current location of individual locusts, represents the position of the current optimal individual, Indicates the safe activity range to search for locust populations. Search for locust individuals within a safe activity range and The function of the interaction force between locust individuals searching for a safe activity range is as follows: , in, and They represent the attraction intensity and attraction range between individual locusts searching for safe activity range respectively; S525, calculating the fitness value of each individual safe activity range searching locust in the safe activity range searching locust population after the position is updated, if the fitness value of the individual safe activity range searching locust after the position is updated is greater than the original fitness value, then the original position is replaced by the position obtained after the position of the individual safe activity range searching locust is updated; otherwise, the original position is retained; Rearranging the safe activity range searching locust individuals in the safe activity range searching locust population from large to small according to fitness values, and selecting the safe activity range searching locust individual with the highest fitness value as the new current optimal individual; S526, determine the current number of iterations Is it less than the maximum number of iterations? , if the current number of iterations Less than the maximum number of iterations , then the current number of iterations Add 1 and return to S523; otherwise, take the current optimal individual as the global optimal solution; S527, set a fitness threshold. If the fitness value of the global optimal solution is greater than or equal to the fitness threshold, it means that the real-time position coordinate data of the person in the pedestrian detection area is The pedestrian detection area safety activity range data corresponding to the global optimal solution is successfully matched, and the real-time location analysis data of the pedestrian detection area personnel is output If the pedestrian position is normal, the real-time position coordinate data of the person in the pedestrian detection area is retained, and S1 is returned; if the fitness value of the global optimal solution is less than the fitness threshold, it means that the real-time position coordinate data of the person in the pedestrian detection area is If the pedestrian detection area safety activity range data matching with the global optimal solution fails, the real-time location analysis data of the pedestrian detection area personnel is output. The pedestrian position is abnormal.
[0028] S6. If the real-time position analysis data of the person in the pedestrian detection area indicates that the pedestrian position is abnormal, construct pedestrian trace detection alarm data based on the real-time position coordinate data of the person in the pedestrian detection area and the real-time position analysis data of the person in the pedestrian detection area, and push the data to the pedestrian trace detection alarm IoT platform through the IoT communication network; S61: If the real-time location analysis data of the person in the pedestrian detection area If the pedestrian position is abnormal, the real-time position coordinate data of the person in the pedestrian detection area is and real-time location analysis data of personnel in the pedestrian detection area Combine data to construct pedestrian trace detection alarm data ; S62: transmitting the pedestrian trace detection alarm data through the Internet of Things communication network The information is pushed to the pedestrian tracking detection and alarm IoT platform, and an abnormal pedestrian tracking alarm is issued.
[0029] Embodiment 2 is as follows: See also Figure 2 , a pedestrian trace detection alarm system based on image recognition, including a pedestrian detection area real-time image data acquisition module, a pedestrian detection area personnel recognition module, a pedestrian detection area personnel real-time image feature data acquisition module, a pedestrian detection area personnel real-time position coordinate positioning module, a pedestrian detection area personnel real-time position analysis module and a pedestrian trace detection alarm data construction module; The pedestrian detection area real-time image data acquisition module acquires image data of the pedestrian detection area in real time through the main camera to obtain real-time image data of the pedestrian detection area; The pedestrian detection area personnel recognition module uses a cosine similarity formula to calculate a similarity value between the pedestrian detection area real-time image data and the established pedestrian detection area personnel feature image data, and generates pedestrian detection area personnel recognition data according to the similarity value; The pedestrian detection area personnel real-time image feature data acquisition module acquires image data of pedestrians appearing in the pedestrian detection area in real time through a plurality of auxiliary cameras installed in the pedestrian detection area, obtains real-time image data of pedestrians in the pedestrian detection area, and uses an adaptive median filtering method to perform data noise reduction processing to generate real-time image feature data of pedestrians in the pedestrian detection area; The real-time position coordinate positioning module of the pedestrian detection area converts the two-dimensional pixel coordinates of the pedestrian in the real-time image feature data of the pedestrian detection area into two-dimensional real coordinates through a coordinate conversion formula and performs coordinate fusion processing, extracts the overlapping parts of each two-dimensional real coordinate and performs data identification, and generates the real-time position coordinate data of the pedestrian detection area; The pedestrian detection area personnel real-time position analysis module performs pedestrian real-time position matching processing on the pedestrian detection area personnel real-time position coordinate data and the established pedestrian detection area safe activity range data through the locust optimization algorithm, and generates pedestrian detection area personnel real-time position analysis data according to the matching results; When the real-time position analysis data of personnel in the pedestrian detection area indicates that the pedestrian position is abnormal, the pedestrian trace detection alarm data construction module combines the real-time position coordinate data of personnel in the pedestrian detection area and the real-time position analysis data of personnel in the pedestrian detection area to construct pedestrian trace detection alarm data, pushes the data to the pedestrian trace detection alarm IoT platform through the IoT communication network, and issues a pedestrian trace abnormality alarm.
[0030] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0031] The preferred embodiments of the invention disclosed above are only used to help explain the invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the invention, so that those skilled in the art can understand and use the invention well.
Claims
1. A pedestrian trace detection and alarm method based on image recognition, characterized in that: The steps include: S1, collect real-time image data of pedestrian detection area; S2, performing image data matching processing on the real-time image data of the pedestrian detection area and the characteristic image data of the person in the pedestrian detection area to generate the person identification data of the pedestrian detection area. If the person identification data of the pedestrian detection area indicates that there is no pedestrian, then the pedestrian trace detection alarm operation is terminated; S3. If the pedestrian detection area person identification data indicates that there is a pedestrian, real-time image feature data of the person in the pedestrian detection area is collected; S4, performing pedestrian position coordinate analysis and processing according to the real-time image feature data of the person in the pedestrian detection area to generate real-time position coordinate data of the person in the pedestrian detection area; S5, establish pedestrian detection area safety activity range data, perform pedestrian real-time position matching processing on the real-time position coordinate data of the pedestrian detection area personnel and the pedestrian detection area safety activity range data, generate pedestrian detection area personnel real-time position analysis data, if the pedestrian detection area personnel real-time position analysis data shows that the pedestrian position is normal, return to S1; S6. If the real-time position analysis data of the personnel in the pedestrian detection area shows that the pedestrian position is abnormal, pedestrian trace detection alarm data is constructed based on the real-time position coordinate data of the personnel in the pedestrian detection area and the real-time position analysis data of the personnel in the pedestrian detection area, and is pushed to the pedestrian trace detection alarm Internet of Things platform through the Internet of Things communication network.
2. The pedestrian trace detection and alarm method based on image recognition according to claim 1 is characterized in that: The S1 comprises the following steps: S11, collect image data of the pedestrian detection area in real time through the main camera, and obtain real-time image data of the pedestrian detection area The main camera is installed in a position where it can capture the pedestrian detection area in all directions and without blind spots.
3. The pedestrian trace detection and alarm method based on image recognition according to claim 2 is characterized in that: The S2 comprises the following steps: S21. Establishing a pedestrian detection area personnel feature image dataset ,in, Indicates Personnel feature image data in pedestrian detection areas, Indicates the total number of characteristic image data of people in the pedestrian detection area, wherein the characteristic image data of people in the pedestrian detection area represents image data of different types of people in different postures in the pedestrian detection area; S22, using the cosine similarity formula to calculate the and stated The similarity value of the characteristic image data of each pedestrian detection area in the pedestrian detection area is set to a similarity threshold. If the and stated If the similarity values of the personnel feature image data of all pedestrian detection areas in the image are less than the similarity threshold, the personnel recognition data of the pedestrian detection area is output. If there is no pedestrian, end the pedestrian trace detection alarm operation; otherwise, output the pedestrian detection area personnel identification data For pedestrians, enter S3.
4. The pedestrian trace detection and alarm method based on image recognition according to claim 3 is characterized in that: The S3 comprises the following steps: S31, by installing several auxiliary cameras in the pedestrian detection area, collecting image data of pedestrians in real time when the pedestrians appear in the pedestrian detection area, to obtain a real-time image data set of people in the pedestrian detection area ,in, Indicates The image data of pedestrians appearing in the pedestrian detection area collected by the auxiliary camera in real time, Indicates the total number of auxiliary cameras; S32, using adaptive median filtering method to The real-time image data of pedestrian detection area in the data is processed to reduce the noise, and the real-time image feature data set of pedestrian detection area is generated. ,in, Indicates The image data of pedestrians appearing in the pedestrian detection area collected by the auxiliary cameras in real time is subjected to data noise reduction processing to obtain the real-time image feature data of people in the pedestrian detection area.
5. The pedestrian trace detection and alarm method based on image recognition according to claim 4 is characterized in that: The S32 comprises the following steps: S321, randomly select the The real-time image data of a person in any pedestrian detection area in the image is used as sample image data; S322, setting a sliding filter window, and aligning the center point of the sliding filter window with each pixel point in the sample image data in sequence; S323, determine whether the pixel value of the center point of the sliding filter window is the maximum value in the neighborhood of the sliding filter window. If the pixel value of the center point of the sliding filter window is not the maximum value in the neighborhood of the sliding filter window, no operation is performed; otherwise, increase the size of the sliding filter window, and re-determine whether the pixel value of the center point of the sliding filter window is the maximum value in the neighborhood of the sliding filter window until the size of the sliding filter window is equal to the set size threshold. If the pixel value of the center point of the sliding filter window is still the maximum value in the neighborhood of the sliding filter window, calculate the pixel median of all pixel points of the sliding filter window, and replace the pixel value of the center point of the sliding filter window with the pixel median.
6. The pedestrian trace detection and alarm method based on image recognition according to claim 5 is characterized in that: The S4 comprises the following steps: S41, transform the coordinates into The two-dimensional pixel coordinates of pedestrians in the real-time image feature data of each pedestrian detection area are converted into two-dimensional real coordinates to generate the real coordinate data set of pedestrian detection area personnel ,in, Indicates The two-dimensional real coordinates of pedestrians in the real-time image feature data of pedestrian detection areas; S42, the The real coordinate data of the pedestrian detection area personnel in the pedestrian detection area are processed by coordinate fusion, the overlapping parts of the real coordinate data of the pedestrian detection area personnel are extracted and the data is marked, and the real-time position coordinate data of the pedestrian detection area personnel is generated. .
7. The pedestrian trace detection and alarm method based on image recognition according to claim 6 is characterized in that: The S5 comprises the following steps: S51. Collect the safe activity range of pedestrians in the detection area online through the pedestrian trace detection alarm IoT platform, and establish a safe activity range data set for pedestrian detection areas ,in, Indicates the pedestrian detection area The coordinate data corresponding to the safe activity range, Indicates the total number of safe activity range data of pedestrian detection area; S52: Using the locust optimization algorithm to analyze the real-time position coordinate data of the personnel in the pedestrian detection area and stated The pedestrian detection area safety activity range data in the pedestrian detection area is used for real-time pedestrian position matching processing, and the real-time position analysis data of the pedestrian detection area is generated according to the matching results. .
8. The pedestrian trace detection and alarm method based on image recognition according to claim 7 is characterized in that: The S52 comprises the following steps: S521. Construct a safe activity range to search for locust populations, and set the population size to , the current number of iterations is The maximum number of iterations is And the search space dimension of pedestrian detection area safety activity range data is ; The pedestrian detection area safety activity range data set is used as the pedestrian detection area safety activity range data search space, and a random number is generated in the pedestrian detection area safety activity range data search space. pedestrian detection area safety activity range data, each pedestrian detection area safety activity range data corresponds to a safe activity range search locust individual; S522, calculating the fitness value of each safe activity range search locust individual, arranging each safe activity range search locust individual from large to small according to the fitness value, and selecting the safe activity range search locust individual with the highest fitness value as the current optimal individual; S523, updating the reduction coefficient; S524, when each individual safe activity range search locust searches for food in the pedestrian detection area safe activity range data search space, it will be affected by the interaction force between the individual safe activity range search locusts and update its position; S525, calculating the fitness value of each safe activity range search locust individual after the position is updated, if the fitness value of the safe activity range search locust individual after the position is updated is greater than the original fitness value, then the original position is replaced by the position obtained after the safe activity range search locust individual is updated; otherwise, the original position is retained; Rearrange the individual safe activity range search locusts according to their fitness values from large to small, and select the safe activity range search locust individual with the highest fitness value as the new current optimal individual; S526, Judgment Is it less than ,like Less than ,but Add 1 and return to S523; otherwise, take the current optimal individual as the global optimal solution; S527, set a fitness threshold. If the fitness value of the global optimal solution is greater than or equal to the fitness threshold, it means that the The pedestrian detection area safety activity range data corresponding to the global optimal solution is matched successfully, and the If the pedestrian position is normal, the real-time position coordinate data of the person in the pedestrian detection area is retained, and S1 is returned; if the fitness value of the global optimal solution is less than the fitness threshold, it means that The pedestrian detection area safety activity range data matching with the global optimal solution fails, and the output is The pedestrian position is abnormal.
9. The pedestrian trace detection and alarm method based on image recognition according to claim 8, characterized in that: The S6 comprises the following steps: S61, if the If the pedestrian position is abnormal, the and stated Combine data to construct pedestrian trace detection alarm data ; S62, through the Internet of Things communication network The information is pushed to the pedestrian tracking detection and alarm IoT platform, and an abnormal pedestrian tracking alarm is issued.
10. A system for implementing the pedestrian trace detection and alarm method based on image recognition as described in any one of claims 1 to 9, characterized in that: It includes a pedestrian detection area real-time image data acquisition module, a pedestrian detection area personnel recognition module, a pedestrian detection area personnel real-time image feature data acquisition module, a pedestrian detection area personnel real-time position coordinate positioning module, a pedestrian detection area personnel real-time position analysis module and a pedestrian trace detection alarm data construction module.
Citation Information
Patent Citations
A method and system for early warning and control of personnel care
CN110599736B
Dangerous area safety monitoring method based on motion trajectory prediction
CN116129340A
Cross-modal pedestrian re-identification method and system
CN117789251A
Chemical industrial park production environment supervision method and system
CN117952440A
Real-time monitoring safety early warning system based on digital twin manufacturing production line
CN118426424A
Cited By
Pedestrian behavior prediction method for autonomous vehicle
CN121583001A