CN113516024A - Multi-region people counting method and device - Google Patents

Multi-region people counting method and device Download PDF

Info

Publication number
CN113516024A
CN113516024A CN202110451775.0A CN202110451775A CN113516024A CN 113516024 A CN113516024 A CN 113516024A CN 202110451775 A CN202110451775 A CN 202110451775A CN 113516024 A CN113516024 A CN 113516024A
Authority
CN
China
Prior art keywords
video stream
picture
people
region
detection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110451775.0A
Other languages
Chinese (zh)
Inventor
钟春彬
施好健
高伟
郑广斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110451775.0A priority Critical patent/CN113516024A/en
Publication of CN113516024A publication Critical patent/CN113516024A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/78Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/783Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • G06F16/7837Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using objects detected or recognised in the video content
    • G06F16/784Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using objects detected or recognised in the video content the detected or recognised objects being people
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/78Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/7867Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, title and artist information, manually generated time, location and usage information, user ratings

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Library & Information Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Closed-Circuit Television Systems (AREA)

Abstract

The invention provides a method and a device for counting the number of people in multiple regions, which relate to the field of artificial intelligence, and comprise the following steps: acquiring video stream data of monitoring equipment; the video stream data includes: a video stream timestamp; extracting a detection picture from the video stream data according to preset picture extraction parameters; identifying the number of people in the detected picture to generate detection data; wherein, the detection data comprises: region information, video stream timestamps, and the number of people in each picture; and generating a multi-region people counting result according to the region information, the timestamp information and the people number of each picture. The invention provides a multi-region people counting method, which adopts a plurality of monitoring cameras to realize the acquisition of video streams and achieves the function of multi-camera real-time region people counting.

Description

Multi-region people counting method and device
Technical Field
The invention relates to a data processing technology, in particular to a method and a device for counting people in multiple regions.
Background
With the development of intelligent security and smart cities, the deployment scale of monitoring equipment is larger and larger, a large amount of video data brings more opportunities, and various applications based on monitoring video streams are continuously expanded.
Traditional video stream-based personnel retrieval and people counting and other functions need huge manpower and material resources, almost all off-line forms are presented, timeliness is lacked, efficiency is low, along with gradual development of artificial intelligence, more and more industries gradually become more intelligent, more and more machines replace manpower, and huge advantages are reflected. The regional people counting is a functional implementation with high requirement on effectiveness, a manual counting method increasingly shows the problems of low efficiency and low accuracy of the regional people counting, the problem of video stream synchronization is difficult to get down, one range of division may not be simply covered by one single camera, multiple monitoring can be performed in a matched mode, and the problems of loss of partial data packets, delay of video streams and the like are gradually highlighted due to certain fluctuation of a network.
Through the analysis, the existing manual method is gradually difficult to solve the problem of regional people counting, and mainly reflects the unknown performance of the regional range, the time synchronization under different monitoring cameras and the random interference of network fluctuation, so that more automatic and more intelligent methods emerge. For example, by performing image input and image preprocessing operations on a single camera, the detection of specific positions in a picture is realized by a target detection and target regression method, and a region judgment method is adopted to calculate the number of people in each region. The method only considers the situation of a single camera, a demand range is not necessarily covered by exactly one monitoring camera, so the applicability is poor, and the single camera problem does not consider the synchronization of videos, which is a more common problem in real life, so the method can not meet the demand in more complex scenes. And calculate minimum unmanned frame number through overlapping region between statistics regional information and unmanned aerial vehicle, according to unmanned aerial vehicle built-in parameter and all unmanned aerial vehicles of manual control to assigned position make cover required statistics scope, calculate the number of people that obtains in every region according to the overlapping region and the non-overlapping region of testing result and mark at last, owing to adopted unmanned aerial vehicle and artificial control factor is too much for the statistics number needs very big manpower and materials.
Disclosure of Invention
In order to overcome at least one defect in the prior art, the invention provides a multi-region people counting method, which comprises the following steps:
acquiring video stream data of monitoring equipment; the video stream data includes: a video stream timestamp;
extracting a detection picture from the video stream data according to preset picture extraction parameters;
identifying the number of people in the detection picture to generate detection data; wherein, the detection data comprises: region information, video stream timestamps, and the number of people in each picture;
and generating a multi-region people counting result according to the region information, the timestamp information and the people number of each picture.
In this embodiment of the present invention, after acquiring the video stream data of the monitoring device, the method further includes:
and buffering the acquired video stream data of the monitoring equipment.
In the embodiment of the present invention, the picture extraction parameters include: selecting ranges of target statistical regions and region pictures;
the extracting the detection picture from the video stream data according to the preset picture extraction parameters comprises the following steps:
extracting target video stream data from the video stream data according to the target statistical region;
and extracting a detection picture from the target video stream data according to the area picture selection range.
In the embodiment of the present invention, after the identifying the number of people in the detection picture to generate the detection data, the method includes:
and sending the detection data to a message queue middleware.
In the embodiment of the present invention, the generating a multi-region people counting result according to the region information, the timestamp information, and the number of people in the picture includes:
acquiring detection data from the message queue middleware;
determining the detection data of the current statistical time period according to the timestamp and the timestamp flag bit of the detection data;
and generating a multi-region people counting result according to the region information of the current counting time period and the number of people in the picture.
Meanwhile, the invention also provides a multi-region people counting device, which comprises:
the video stream acquisition module is used for acquiring video stream data of the monitoring equipment; the video stream data includes: a video stream timestamp;
the picture extraction module is used for extracting a detection picture from the video stream data according to preset picture extraction parameters;
the identification module is used for identifying the number of people in the detection picture to generate detection data; wherein, the detection data comprises: region information, video stream timestamps, and the number of people in each picture;
and the counting module is used for generating a multi-region people counting result according to the region information, the timestamp information and the number of people of each picture.
In the embodiment of the present invention, the apparatus further includes:
and the buffer module is used for buffering the acquired video stream data of the monitoring equipment.
In the embodiment of the present invention, the picture extraction parameters include: selecting ranges of target statistical regions and region pictures;
the picture extraction module comprises:
a target video stream extracting unit for extracting target video stream data from the video stream data according to a target statistical region;
and the picture extracting unit is used for extracting a detection picture from the target video stream data according to the area picture selecting range.
In the embodiment of the present invention, the apparatus further includes:
and the message queue middleware is used for receiving the detection data after the detection picture is subjected to people number identification to generate the detection data.
In the embodiment of the present invention, the statistical module includes:
the subscription unit is used for acquiring detection data from the message queue middleware;
the screening unit is used for determining the detection data of the current statistical time period according to the timestamp and the timestamp flag bit of the detection data;
and the counting unit is used for generating a multi-region people counting result according to the region information of the current counting time period and the number of people in the pictures.
Meanwhile, the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the method when executing the computer program.
Meanwhile, the invention also provides a computer readable storage medium, and a computer program for executing the method is stored in the computer readable storage medium.
The method for counting the number of people in multiple regions provided by the invention comprises the steps of acquiring video stream data of monitoring equipment; the video stream data includes: a video stream timestamp; extracting a detection picture from the video stream data according to preset picture extraction parameters; identifying the number of people in the detected picture to generate detection data; and generating a multi-region people counting result according to the region information, the timestamp information and the people number of each picture. The utility model provides an artifical intelligent regional people number statistics adopts multichannel monitoring camera to realize the collection of video stream, reaches the function of the real-time regional people number statistics of multicamera.
In order to make the aforementioned and other objects, features and advantages of the invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method for multi-region people counting according to the present invention;
FIG. 2 is a diagram illustrating an artificial intelligence system for counting people in an area according to an embodiment of the present invention;
FIG. 3 is a diagram of the main steps of the system provided by the embodiment of the present invention;
fig. 4 is a method for dividing regions according to an embodiment of the present invention;
fig. 5 is a message queue-based information aggregation synchronization algorithm according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a flag bit provided in an embodiment of the present invention;
FIG. 7 is a block diagram of a multi-region people counting device according to the present invention;
fig. 8 is a schematic diagram of an embodiment of an electronic device in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Aiming at the problems of regional people counting in the prior art, the embodiment of the invention provides a multi-region people counting system and method based on artificial intelligence, which have key functions on video monitoring and people counting function realization and promote the application of artificial intelligence in all aspects of life.
As shown in fig. 1, the method for counting people in multiple regions provided by the present invention comprises:
step S101, acquiring video stream data of monitoring equipment; the video stream data includes: a video stream timestamp;
step S102, extracting a detection picture from the video stream data according to preset picture extraction parameters;
step S103, identifying the number of people in the detection picture to generate detection data; wherein, the detection data comprises: region information, video stream timestamps, and the number of people in each picture;
and step S104, generating a multi-region people counting result according to the region information, the timestamp information and the number of people of each picture.
The method for counting the number of the multiple regions provided by the invention establishes communication with the video stream through the local area network, the video stream is mainly based on an RTSP protocol, the coding format is H.265, an FFMPEG third party library is adopted for carrying out video real-time decoding operation in the processing process, and the computing equipment is ensured to be capable of normally communicating each video stream in the processing process, so that subsequent content is carried out on the basis. The invention provides artificial intelligence regional people counting, which adopts a plurality of monitoring cameras to realize the acquisition of video streams and achieves the function of multi-camera real-time regional people counting.
In this embodiment of the present invention, after acquiring the video stream data of the monitoring device, the method further includes:
and buffering the acquired video stream data of the monitoring equipment.
In the embodiment of the invention, the buffer area is set to control the video streams which are too fast or too slow to achieve synchronization, the problem of inconsistent timestamps in the video stream acquisition process is mainly solved, one computing device is responsible for the analysis work of one or more video streams, and a plurality of computing devices can be ensured to cover all operations aiming at the video streams.
In the embodiment of the present invention, the picture extraction parameters include: selecting ranges of target statistical regions and region pictures;
the extracting the detection picture from the video stream data according to the preset picture extraction parameters comprises the following steps:
extracting target video stream data from the video stream data according to the target statistical region;
and extracting a detection picture from the target video stream data according to the area picture selection range.
In one embodiment of the invention, the specified area is finely divided by using the opencv third-party library, and the overlapped parts under different camera pictures are cut for carrying out people counting aiming at different ranges subsequently.
In one embodiment, the coverage content of a plurality of camera pictures is manually selected, cameras with coverage areas not including statistical areas are deleted, pictures shot by other cameras are stored in the same folder, each picture is named independently according to the shooting range, the pictures are sequentially displayed according to the file sequence of the folder, the specified range is manually selected, the boundary point of the range is clicked clockwise or anticlockwise, the corresponding identification of the keying-in area is automatically stored in the configuration file after the selection of the selected area is completed, the keying-in specified key position is switched to the next picture after all different ranges in one picture are selected, and the operation is repeated.
Further preferably, in an embodiment of the present invention, the area to be divided may be more efficiently divided by monitoring a corresponding relationship between the camera picture and the actual plan view with reference to the overall plan view of the area to be divided.
Further preferably, in an embodiment of the present invention, for the overlapped portions under different cameras, the boundaries of the regions should be corresponded when manually dividing the regions, so as to avoid the situation of repeated calculation of the number of people during statistics.
In the embodiment of the present invention, after the identifying the number of people in the detection picture to generate the detection data, the method includes:
and sending the detection data to a message queue middleware.
In the embodiment of the present invention, the generating a multi-region people counting result according to the region information, the timestamp information, and the number of people in the picture includes:
acquiring detection data from the message queue middleware;
determining the detection data of the current statistical time period according to the timestamp and the timestamp flag bit of the detection data;
and generating a multi-region people counting result according to the region information of the current counting time period and the number of people in the picture.
In the embodiment of the invention, the detection data is in a json format, the message is read through the message queue middleware, the json format target detection data is analyzed, information such as time stamps in data packets is read, the synchronization of the message is realized, after the data packets of all computing equipment at a certain time point are collected, the regional population number computing operation is carried out according to the pre-divided regions, and the statistical population number is obtained through computing. The message queue middleware is used as a bridge, the server subscribes the message queue, the message synchronization is realized through an information aggregation synchronization algorithm, the final people counting result is finally obtained according to the synchronized message, the highest accuracy of people counting can be up to 90%, the accuracy of target detection can be up to more than 95%, the people counting system can meet the requirement of real-time performance, and the updating frequency can be up to 20 fps.
The embodiment of the invention provides a system and a method for counting the number of people in a multi-region by aiming at the problems of single application range, synchronization among multiple cameras, network fluctuation and the like in the prior art.
In this embodiment, the edge device is an edge all-in-one machine or an edge server with ultra-strong computing performance, which meets the requirement of model inference real-time performance, and the server-side machine only needs a general machine.
The embodiment of the invention mainly aims at the complex characteristics of multiple regions, multiple cameras and personnel in an indoor scene, and realizes a high-performance artificial intelligent regional people counting system with multiple camera synchronization through a real-time video stream processing module, a video stream synchronization module, a region division module, an information aggregation module and an edge calculation module.
As shown in fig. 2, an artificial intelligence area people counting system according to an embodiment of the present invention includes:
the system comprises a real-time video stream processing module 1, a video stream synchronization module 2, an area division module 3, an information aggregation module 4 and an edge calculation module 5.
In this embodiment, the real-time video stream processing module 1 is deployed on a high-performance computing edge device, and establishes communication with a video stream through a local area network, the video stream is mainly based on an RTSP protocol, the encoding format is h.265, an FFMPEG third-party library is used for performing video real-time decoding operation in the processing process, and it is necessary to ensure that the computing device can normally communicate with each video stream in the processing process.
The video stream synchronization module 2 controls the video stream which is too fast or too slow to achieve synchronization by setting a buffer area, is mainly used for solving the problem of inconsistent timestamps in the video stream acquisition process, synchronously checks the timestamps and delays of different streams by adopting a multithread programming method, sets a standard timestamp, accelerates playing by simplifying the decoding operation of video frames for the video stream which is too long in delay, and realizes synchronization of a plurality of video streams.
In this embodiment, one computing device is used to perform parsing on one or more video streams, so that a plurality of computing devices can cover all operations on the video streams.
And the region division module 3 is used for finely dividing the formulated region by using an opencv third-party library, cutting out overlapped parts under different camera pictures and carrying out people counting aiming at different ranges subsequently.
And the information aggregation module 4 is used for analyzing the target detection data packet acquired by the computing equipment and realizing the synchronization of the data packet according to information such as a time stamp in the data packet.
The edge calculation module 5 is used for deploying a deep learning model, detecting the target in the picture in an accelerated manner by utilizing a high-performance calculation chip so as to achieve a real-time effect, and each calculation device processes multiple paths of video streams through multiple threads and fully utilizes the acceleration performance of the video streams.
In this embodiment, the correspondence between the monitoring devices and the edge devices may be many-to-many or many-to-one, and may be manually configured by a configuration file, and the number of the edge devices may be determined according to the number of the required monitoring devices.
Specifically, the embodiment provides an artificial intelligence area people counting method based on the system, and as shown in fig. 3, the flow chart for realizing area people counting provided by the embodiment of the present invention includes the following steps:
and S1, deploying appropriate edge computing equipment and server-side machines, ensuring that a plurality of machines are in a uniform network segment and being capable of normally reading the data of each video stream.
And S2, dividing the area needing counting the number of people, firstly deleting the video stream of which the coverage area does not contain the counting area, and then handing the rest video stream to the computing equipment to require each computing equipment to utilize the performance as much as possible so as to avoid the excess performance.
And S3, running the corresponding program of the information aggregation module at the server, entering a monitoring state, and performing corresponding processing every time the subscription content is updated through the subscription message queue middleware.
And S4, running programs corresponding to the edge computing modules of the computing equipment, starting to acquire the video stream in real time by the computing equipment at the moment, carrying out target detection, packaging the detection content into a data packet with a specified format after each detection result, and sending the data packet to a TOPIC specified in the message queue middleware activeMQ.
And S5, the server side reads the message through the message queue middleware, analyzes the json format target detection data packet, reads information such as time stamps in the data packet, achieves message synchronization, and calculates the number of people in the region according to the pre-divided region after collecting the data packets of all the computing devices at a certain time point to obtain the number of the people in the region.
And S6, the server side continuously receives and processes the data packet information, discards the expired data packet, maintains the data after the current marking time, detects the completion degree of information acquisition, and indicates that a certain problem occurs in the connectivity with the edge device if the loss occurs for a long time.
And S7, when the data packet at a certain moment is completely collected, the server side packs the data of the number of the counted people into a JSON file in a specified format, and sends the JSON file to the front end for presentation through the message queue middleware.
Specifically, before the system operates, the area is divided first, as shown in fig. 4, which is a flowchart for dividing the area provided in this embodiment, and the flowchart includes the following steps:
and S21, manually selecting the coverage contents of the pictures of the plurality of cameras, deleting the cameras with coverage areas not including the statistical area, capturing pictures shot by other cameras and storing the pictures into the same folder, wherein each picture is named independently according to the shooting range.
S22, operating the region dividing program, displaying in sequence according to the order of the folder, in this embodiment, selecting the designated range manually, clicking the boundary point of the range clockwise or counterclockwise, entering the corresponding mark of the region after the selection is completed, automatically storing the region boundary information into the configuration file, entering the designated key position to switch to the next picture after all different ranges in one picture are selected, and repeating the above operations.
And S23, when the last picture is operated, ending the program, closing the related window, and automatically storing the configuration file for the subsequent people counting program.
Further preferably, in the calculation of the number of people in the region, the region is represented as a point set on a two-dimensional plane, the information of people obtained through target detection is the coordinates of the upper left corner and the lower right corner corresponding to a rectangle on the two-dimensional plane, the middle point of the bottom side of the rectangle is selected as the position of the people, and whether the people are in the region or not is judged by calculating the number of intersection points of the ray and the region, which are obtained by the target coordinates to the right along the horizontal direction.
In an embodiment of the present invention, the divided area is represented as a convex polygon in the picture coordinate system, and is formed by each vertex of the polygon, such as:
[(xpt(1),ypt(1)),(xpt(2),ypt(2)),(xpt(3),ypt(3)),(xpt(4),ypt(4))]
wherein x ispt(i),ypt(i)Is the coordinates of each vertex.
Pedestrian information can be obtained through target detection and corresponds to the coordinates (x) of the upper left corner and the lower right corner of the rectangle in the picture coordinate system1,y1),(x2,y2) Selecting the middle point of the bottom edge as the position of the pedestrian in the image coordinate system ((x)1+x2)/2,y2) When a point is in the region, any ray emitted by the point has odd number of intersection points with the region boundary, and when a point is not in the region, any ray emitted by the point has even number of nodes with the region boundary, so that whether a pedestrian is in the region of interest can be judged according to the number of nodes.
Specifically, step S5 implements synchronization of messages by using a message aggregation synchronization algorithm based on a message queue, and as shown in fig. 5, after receiving a target detection data packet, a server maintains a cyclic array with a fixed constant length according to information in the data packet by subscribing to a message queue middleware, thereby implementing outdated data packet processing, real-time synchronization, and timeout control. Mainly comprises the following steps:
and S51, the server side adopts the asynchronous mode subscription message queue to designate TOPIC.
And S52, when the data packet is detected to be received, analyzing the data packet to obtain the data with the specified format.
S53, comparing the time stamp information obtained by the data packet with the flag bit in the structured ring container, if the time stamp information is located in the overdue area, discarding the time stamp information, if the time stamp information is located in the working area, processing the content contained in the time stamp information, and if the time stamp information is located in the overtime area, resetting the related data and restarting statistics.
And S54, if the overtime information is received for a plurality of times continuously and the people counting is not complete for a long time, the fact that a certain communication problem exists in the edge equipment is indicated, and the server side gives an alarm.
And S55, if all data packets corresponding to a certain timestamp are completely counted, packing the people number information obtained through counting into a Json file, and sending the Json file to a specified theme of the message queue for front-end display.
In an embodiment of the present invention, the data packet includes the following parts:
time stamping: and an increasing integer, and continuously increasing from 0 after the boundary is reached, so as to realize message synchronization at the server.
Area information: and the character string is used for identifying the regional characteristic information and distinguishing other regions and calculating the number of people in different regions.
The information of the number of people: an integer, one-to-one for each zone, represents the number of people in a zone.
The structured ring container in S53 includes a sliding flag bit for identifying the corresponding position of the timestamp where the last people count was successful, and the length of the sliding flag bit is generally dynamically adjusted according to the actual network environment status and the number of video streams, and the length of the sliding flag bit is generally configured by default 60, as shown in fig. 6. In other words, in this embodiment, the detection data of the current statistical time period is screened by the flag bit of the structured annular container, and the detection data of the current statistical time period is determined according to the timestamp of the detection data and the flag bit of the timestamp.
Dividing the cyclic array into three regions with equal length according to the zone bit, wherein the previous region of the zone bit is an overdue region, and discarding the received data packet of the region; the next zone behind the zone bit is a working zone, and when a data packet of the working zone is received, the array information is updated; the last zone is a timeout zone, and when a data packet in the timeout zone is received, that is, complete data packet information is not received from all edge devices for a long time, which indicates that some problems occur in the network.
The artificial intelligence regional people counting system provided by the embodiment of the invention acquires multi-channel video streams from a plurality of high-performance edge computing devices, achieves video stream synchronization and real-time video stream processing, performs target detection on the synchronous pictures acquired by each device to obtain the positions of people in the pictures, uses a message queue middleware as a bridge, and realizes message synchronization through a message aggregation synchronization algorithm by a server through subscribing a message queue and finally obtains a final people counting result according to the synchronized messages, so that the highest accuracy of people counting can reach 90 percent, the accuracy of target detection reaches more than 95 percent, the people counting system can meet the requirement of real-time performance, and the updating frequency can reach 20 fps.
The embodiment of the invention provides an artificial intelligence regional people counting system, which adopts a plurality of paths of monitoring cameras to realize the acquisition of video streams, improves the speed of realizing target detection by deploying edge equipment, ensures that the system meets the real-time requirement, completes the standardization of transmission data by means of message queue middleware, and finally realizes the synchronization of data packets by a message queue-based aggregation synchronization algorithm of a server so as to achieve the function of multi-camera real-time regional people counting.
The embodiment of the invention provides an information aggregation synchronization algorithm based on a message queue, which is characterized in that a high-level data structure and a standard format data packet are designed, a target detection data packet is obtained by subscribing a message queue middleware, a flag bit in a structured annular container and contents such as an overdue area, a working area, a super time area and the like are set, the timestamp synchronization of the data packet is realized through the algorithm, and the accurate statistics of the number of people crossing cameras is realized.
The embodiment of the invention provides a method for dividing the number of people in a cross-camera area.
As shown in fig. 7, the present invention further provides a multi-region people counting device, comprising:
a video stream obtaining module 701, configured to obtain video stream data of a monitoring device; the video stream data includes: a video stream timestamp;
a picture extracting module 702, configured to extract a detection picture from the video stream data according to preset picture extracting parameters;
the identification module 703 is configured to identify the number of people in the detection picture to generate detection data; wherein, the detection data comprises: region information, video stream timestamps, and the number of people in each picture;
and the counting module 704 is used for generating a multi-region people counting result according to the region information, the timestamp information and the number of people in each picture.
In the embodiment of the present invention, the apparatus further includes:
and the buffer module is used for buffering the acquired video stream data of the monitoring equipment.
In the embodiment of the present invention, the picture extraction parameters include: selecting ranges of target statistical regions and region pictures;
the picture extraction module comprises:
a target video stream extracting unit for extracting target video stream data from the video stream data according to a target statistical region;
and the picture extracting unit is used for extracting a detection picture from the target video stream data according to the area picture selecting range.
In the embodiment of the present invention, the apparatus further includes:
and the message queue middleware is used for receiving the detection data after the detection picture is subjected to people number identification to generate the detection data.
In the embodiment of the present invention, the statistical module includes:
the subscription unit is used for acquiring detection data from the message queue middleware;
the screening unit is used for determining the detection data of the current statistical time period according to the timestamp and the timestamp flag bit of the detection data;
and the counting unit is used for generating a multi-region people counting result according to the region information of the current counting time period and the number of people in the pictures.
For those skilled in the art, the implementation of the multi-region people counting device provided by the present invention can be clearly understood through the foregoing description of the embodiments, and will not be repeated herein.
It should be noted that the method and the device for counting the number of people in multiple regions disclosed by the present disclosure can be used for counting the number of people in a monitoring region in the financial field, and can also be used for counting the number of people in the monitoring region in any field except the financial field.
The present embodiment also provides an electronic device, which may be a desktop computer, a tablet computer, a mobile terminal, and the like, but is not limited thereto. In this embodiment, the electronic device may refer to the embodiments of the method and the apparatus, and the contents thereof are incorporated herein, and repeated descriptions are omitted.
Fig. 8 is a schematic block diagram of a system configuration of an electronic apparatus 600 according to an embodiment of the present invention. As shown in fig. 8, the electronic device 600 may include a central processor 100 and a memory 140; the memory 140 is coupled to the central processor 100. Notably, this diagram is exemplary; other types of structures may also be used in addition to or in place of the structure to implement telecommunications or other functions.
In one embodiment, the multi-region people counting function may be integrated into the central processor 100. The central processor 100 may be configured to control as follows:
acquiring video stream data of monitoring equipment; the video stream data includes: a video stream timestamp;
extracting a detection picture from the video stream data according to preset picture extraction parameters;
identifying the number of people in the detection picture to generate detection data; wherein, the detection data comprises: region information, video stream timestamps, and the number of people in each picture;
as shown in fig. 8, the electronic device 600 may further include: communication module 110, input unit 120, audio processing unit 130, display 160, power supply 170. It is noted that the electronic device 600 does not necessarily include all of the components shown in FIG. 8; furthermore, the electronic device 600 may also comprise components not shown in fig. 8, which may be referred to in the prior art.
As shown in fig. 8, the central processor 100, sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, the central processor 100 receiving input and controlling the operation of the various components of the electronic device 600.
The memory 140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 100 may execute the program stored in the memory 140 to realize information storage or processing, etc.
The input unit 120 provides input to the cpu 100. The input unit 120 is, for example, a key or a touch input device. The power supply 170 is used to provide power to the electronic device 600. The display 160 is used to display an object to be displayed, such as an image or a character. The display may be, for example, an LCD display, but is not limited thereto.
The memory 140 may be a solid state memory such as Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 140 may also be some other type of device. Memory 140 includes buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application/function storage section 142, and the application/function storage section 142 is used to store application programs and function programs or a flow for executing the operation of the electronic device 600 by the central processing unit 100.
The memory 140 may also include a data store 143, the data store 143 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by the electronic device. The driver storage portion 144 of the memory 140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging application, address book application, etc.).
The communication module 110 is a transmitter/receiver 110 that transmits and receives signals via an antenna 111. The communication module (transmitter/receiver) 110 is coupled to the central processor 100 to provide an input signal and receive an output signal, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide audio output via the speaker 131 and receive audio input from the microphone 132 to implement general telecommunications functions. Audio processor 130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, an audio processor 130 is also coupled to the central processor 100, so that recording on the local can be enabled through a microphone 132, and so that sound stored on the local can be played through a speaker 131.
Embodiments of the present invention further provide a computer-readable program, where when the program is executed in an electronic device, the program causes a computer to execute the method for counting people in multiple regions in the electronic device according to the above embodiments.
The embodiment of the invention also provides a storage medium storing a computer readable program, wherein the computer readable program enables a computer to execute the multi-region people counting in the electronic device.
The preferred embodiments of the present invention have been described above with reference to the accompanying drawings. The many features and advantages of the embodiments are apparent from the detailed specification, and thus, it is intended by the appended claims to cover all such features and advantages of the embodiments that fall within the true spirit and scope thereof. Further, since numerous modifications and changes will readily occur to those skilled in the art, it is not desired to limit the embodiments of the invention to the exact construction and operation illustrated and described, and accordingly, all suitable modifications and equivalents may be resorted to, falling within the scope thereof.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (12)

1. A method for providing multi-region demographics, said method comprising:
acquiring video stream data of monitoring equipment; the video stream data includes: a video stream timestamp;
extracting a detection picture from the video stream data according to preset picture extraction parameters;
identifying the number of people in the detection picture to generate detection data; wherein, the detection data comprises: region information, video stream timestamps, and the number of people in each picture;
and generating a multi-region people counting result according to the region information, the timestamp information and the people number of each picture.
2. The method of claim 1, wherein the obtaining video stream data of the monitoring device further comprises:
and buffering the acquired video stream data of the monitoring equipment.
3. The method of claim 1, wherein the picture extraction parameters comprise: selecting ranges of target statistical regions and region pictures;
the extracting the detection picture from the video stream data according to the preset picture extraction parameters comprises the following steps:
extracting target video stream data from the video stream data according to the target statistical region;
and extracting a detection picture from the target video stream data according to the area picture selection range.
4. The method for counting people in multiple regions according to claim 1, wherein the step of generating the detection data by identifying the number of people in the detection picture comprises the following steps:
and sending the detection data to a message queue middleware.
5. The method of claim 4, wherein generating the multi-region demographic based on the region information, the timestamp information, and the number of people in the picture comprises:
acquiring detection data from the message queue middleware;
determining the detection data of the current statistical time period according to the timestamp and the timestamp flag bit of the detection data;
and generating a multi-region people counting result according to the region information of the current counting time period and the number of people in the picture.
6. A multi-region people counting device, the device comprising:
the video stream acquisition module is used for acquiring video stream data of the monitoring equipment; the video stream data includes: a video stream timestamp;
the picture extraction module is used for extracting a detection picture from the video stream data according to preset picture extraction parameters;
the identification module is used for identifying the number of people in the detection picture to generate detection data; wherein, the detection data comprises: region information, video stream timestamps, and the number of people in each picture;
and the counting module is used for generating a multi-region people counting result according to the region information, the timestamp information and the number of people of each picture.
7. The multi-region people counting device of claim 6, further comprising:
and the buffer module is used for buffering the acquired video stream data of the monitoring equipment.
8. The multi-region people counting device of claim 6, wherein the picture extraction parameters comprise: selecting ranges of target statistical regions and region pictures;
the picture extraction module comprises:
a target video stream extracting unit for extracting target video stream data from the video stream data according to a target statistical region;
and the picture extracting unit is used for extracting a detection picture from the target video stream data according to the area picture selecting range.
9. The multi-region people counting device of claim 6, further comprising:
and the message queue middleware is used for receiving the detection data after the detection picture is subjected to people number identification to generate the detection data.
10. The multi-region people counting device of claim 9, wherein the counting module comprises:
the subscription unit is used for acquiring detection data from the message queue middleware;
the screening unit is used for determining the detection data of the current statistical time period according to the timestamp and the timestamp flag bit of the detection data;
and the counting unit is used for generating a multi-region people counting result according to the region information of the current counting time period and the number of people in the pictures.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 5 when executing the computer program.
12. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the method of any one of claims 1 to 5.
CN202110451775.0A 2021-04-26 2021-04-26 Multi-region people counting method and device Pending CN113516024A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110451775.0A CN113516024A (en) 2021-04-26 2021-04-26 Multi-region people counting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110451775.0A CN113516024A (en) 2021-04-26 2021-04-26 Multi-region people counting method and device

Publications (1)

Publication Number Publication Date
CN113516024A true CN113516024A (en) 2021-10-19

Family

ID=78063557

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110451775.0A Pending CN113516024A (en) 2021-04-26 2021-04-26 Multi-region people counting method and device

Country Status (1)

Country Link
CN (1) CN113516024A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115223102A (en) * 2022-09-08 2022-10-21 枫树谷(成都)科技有限责任公司 Real-time crowd density fusion sensing method and model based on camera cluster
CN116167705A (en) * 2022-12-01 2023-05-26 上海山源电子科技股份有限公司 Restricted area personnel statistics method and device, electronic equipment and medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115223102A (en) * 2022-09-08 2022-10-21 枫树谷(成都)科技有限责任公司 Real-time crowd density fusion sensing method and model based on camera cluster
CN115223102B (en) * 2022-09-08 2022-12-16 枫树谷(成都)科技有限责任公司 Real-time crowd density fusion sensing method and model based on camera cluster
CN116167705A (en) * 2022-12-01 2023-05-26 上海山源电子科技股份有限公司 Restricted area personnel statistics method and device, electronic equipment and medium
CN116167705B (en) * 2022-12-01 2023-09-12 上海山源电子科技股份有限公司 Restricted area personnel statistics method and device, electronic equipment and medium

Similar Documents

Publication Publication Date Title
CN109819179B (en) Video editing method and device
US9966084B2 (en) Method and device for achieving object audio recording and electronic apparatus
CN113516024A (en) Multi-region people counting method and device
CN108010037B (en) Image processing method, device and storage medium
US10574933B2 (en) System and method for converting live action alpha-numeric text to re-rendered and embedded pixel information for video overlay
US20130141456A1 (en) Automatic modification of image content for display on a different device
US11863801B2 (en) Method and device for generating live streaming video data and method and device for playing live streaming video
WO2020228418A1 (en) Video processing method and device, electronic apparatus, and storage medium
US8548255B2 (en) Method and apparatus for visual search stability
EP3461136B1 (en) Video playing method and device
CN108848389B (en) Panoramic video processing method and playing system
WO2020093164A1 (en) Methods and systems for detection of anomalous motion in a video stream and for creating a video summary
CN105578248B (en) Fancy splicing playing method, device and system
CN105338564B (en) A kind of client adaptation method, client, server and system
CN114357216A (en) Portrait gathering method and device, electronic equipment and storage medium
CN111310727A (en) Object detection method and device, storage medium and electronic device
CN112330371A (en) AI-based intelligent advertisement pushing method, device, system and storage medium
CN111897510A (en) Volume adjusting method and device of multimedia equipment and computer readable storage medium
CN103929607A (en) Communication method based on screen recording, and application client-side
CN111741247A (en) Video playback method and device and computer equipment
CN104093069A (en) Video playing method and player device
CN105791964B (en) cross-platform media file playing method and system
CN111897506A (en) Screen projection method, control device, terminal and storage medium
CN113542909A (en) Video processing method and device, electronic equipment and computer storage medium
US11743444B2 (en) Electronic device and method for temporal synchronization of videos

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination