WO2023098081A1 - Method and apparatus for acquiring passenger flow data, and electronic device and storage medium - Google Patents

Method and apparatus for acquiring passenger flow data, and electronic device and storage medium Download PDF

Info

Publication number
WO2023098081A1
WO2023098081A1 PCT/CN2022/104256 CN2022104256W WO2023098081A1 WO 2023098081 A1 WO2023098081 A1 WO 2023098081A1 CN 2022104256 W CN2022104256 W CN 2022104256W WO 2023098081 A1 WO2023098081 A1 WO 2023098081A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
information
line
key point
objects
Prior art date
Application number
PCT/CN2022/104256
Other languages
French (fr)
Chinese (zh)
Inventor
孙贺然
Original Assignee
上海商汤智能科技有限公司
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 上海商汤智能科技有限公司 filed Critical 上海商汤智能科技有限公司
Publication of WO2023098081A1 publication Critical patent/WO2023098081A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present disclosure relates to the technical field of image processing, and in particular, to a method, device, electronic device, and storage medium for acquiring passenger flow data.
  • Embodiments of the present disclosure at least provide a method, device, electronic device, and storage medium for acquiring passenger flow data.
  • an embodiment of the present disclosure provides a method for acquiring passenger flow data, including: acquiring a video segment obtained by shooting a target area, and a distinguishing mark; the video segment includes multiple frames of target images; the target image includes The entrance and exit area of the target area; performing object recognition and tracking on each frame of the target image in the multiple frames of the target image, to obtain multiple target objects, key point information and moving speed information respectively corresponding to the multiple target objects ;
  • the key point information is used to characterize the position of the target object in the target image to which the target object belongs;
  • the moving speed information is used to characterize the position of the target object in the target image composed of the target object
  • the moving speed in the target image sequence determining passenger flow data in the target area based on the key point information and the moving speed information respectively corresponding to the plurality of target objects, and the discriminant marks.
  • object recognition, object tracking, and key point detection can be realized more accurately through image recognition, and then the passenger flow data in the target area can be determined more accurately by combining the detected key point information and the moving speed of the target object.
  • using key points for passenger flow statistics can effectively avoid the defect of low detection accuracy caused by occlusion, and combine the movement of target objects on the basis of key point information The speed can further improve the accuracy of passenger flow detection.
  • the key point information includes first position information indicating the position of at least one key point of the target object in the target image to which the target object belongs;
  • the discriminant mark includes a flow rate discriminant line; wherein , the determining the passenger flow data in the target area based on the key point information and the moving speed information respectively corresponding to the multiple target objects, and the discriminant flag includes: for the multiple targets For each target object in the target object, based on the first position information of the at least one key point corresponding to the target object and the second position information of the flow judgment line, determine the line crossing result corresponding to the target object information; the cross-line result information is used to represent whether the target object crosses the flow judgment line; based on the cross-line result information and the moving speed information corresponding to the multiple target objects, determine the target area of the passenger flow data.
  • the passenger flow statistics of the target area can be more accurately counted.
  • the key points of each target object include at least one set of relative key points
  • the key point information includes at least one set of relative key point information corresponding to the at least one set of relative key points
  • the relative key point information includes foot relative key point information composed of left foot key point information and right foot key point information of the target object, left knee key point information and right knee key point information of the target object.
  • the position information of key points such as footstep key points, knee key points or leg key points can more accurately represent the position of the target object, so that it can be more accurately determined whether the target object crosses the flow rate line.
  • the target object is determined based on the first position information of the at least one key point corresponding to the target object and the second position information of the flow discrimination line
  • the corresponding line-crossing result information includes: based on the first position information and the second position information, it is determined that there is at least one set of relative points where a line connecting two corresponding key points intersects the flow discrimination line.
  • determining that the line-crossing result information includes information indicating that the target object crosses the flow judgment line.
  • connection line of a certain group of relative key points intersects the flow discrimination line, it means that the target object has crossed the flow discrimination line.
  • the line crossing result information needs to be set to include the information indicating that the target object has crossed the flow discrimination line , so that the cross-line result information obtained is more accurate.
  • the target object is determined based on the first position information of the at least one key point corresponding to the target object and the second position information of the flow discrimination line
  • the corresponding line-crossing result information includes: determining the line-crossing result information when the first position information of the at least one key point of the target object matches the second position information Include information indicating that the target object crosses the flow discrimination line.
  • the line crossing result information needs to be set to include information indicating that the target object has crossed the flow judgment line. In this way, The obtained cross-line result information is more accurate.
  • the determining the passenger flow data in the target area based on the cross-line result information and the moving speed information corresponding to the multiple target objects includes: based on the video segment, determining the moving direction information of the target object; determining the passenger flow data in the target area based on the cross-line result information, the moving speed information, and the moving direction information corresponding to the multiple target objects .
  • the passenger flow data includes a first number of target objects entering the target area; wherein, the cross-line result information corresponding to the plurality of target objects, the movement The speed information and the moving direction information, determining the passenger flow data in the target area, includes: filtering the line-crossing result information from the multiple target objects to indicate crossing the traffic judging line, the moving direction The information indicates that the moving direction when crossing the flow discrimination line is the first object that enters the target area and the speed indicated by the moving speed information is greater than the first preset speed; the number of first objects is taken as the first number .
  • the target objects entering the target area can be more accurately screened out, that is, the above-mentioned first number can be determined more accurately.
  • the passenger flow data includes a second number of target objects leaving the target area; wherein, the cross-line result information corresponding to the plurality of target objects, the movement The speed information and the moving direction information, determining the passenger flow data in the target area, includes: filtering the line-crossing result information from the multiple target objects to indicate crossing the traffic judging line, the moving direction The information indicates that the moving direction when crossing the flow judgment line is the second object that leaves the target area and the speed indicated by the moving speed information is greater than a second preset speed; the number of the second objects is taken as the second object Two quantities.
  • the target objects leaving the target area can be more accurately screened out, that is, the above-mentioned second quantity can be determined more accurately.
  • the passenger flow data includes a third number of target objects currently staying in the target area; wherein, the cross-line result information corresponding to the plurality of target objects, the determining the passenger flow data in the target area based on the moving speed information and the moving direction information, further comprising: determining the third number based on the first number and the second number; wherein the first number is the The crossing result information in the plurality of target objects indicates crossing the flow judgment line, the moving direction information indicates that the moving direction when crossing the flow judgment line is to enter the target area, and the moving speed information indicates The number of first objects whose speed is greater than the first preset speed; the second number is that the line crossing result information indicates crossing the flow judgment line, and the moving direction information indicates crossing the The moving direction at the time of the flow determination line is the number of second objects leaving the target area whose speed indicated by the moving speed information is greater than a second preset speed.
  • the number of target objects entering the target area that is, the above-mentioned first number
  • the number of target objects that leave the target area that is, the above-mentioned second number
  • the number of target objects currently staying in the target area can be determined more accurately , which is the third quantity mentioned above.
  • the performing object recognition and tracking on each frame of target images in the multiple frames of target images to obtain the multiple target objects includes: respectively performing Object recognition, obtaining a plurality of object detection frames; wherein, each object detection frame corresponds to an object; determining the degree of overlap between the object detection frames respectively belonging to two frames of adjacent target images, and when the degree of overlap is greater than a preset When the value is set, it is determined that the object detection frames belonging to two adjacent frames of the target image correspond to the same object, and the object is used as the target object.
  • the object tracking can be performed more accurately.
  • the method further includes: for each target object in the multiple target objects, the target is not tracked within a preset time In the case of an object, it is determined that tracking of the target object has failed.
  • the discrimination mark includes a flow discrimination line and a preset judgment frame, wherein the flow judgment line is at least partly located within the preset judgment frame; Performing object recognition and tracking on each frame of the target image in the target image to obtain the plurality of target objects, including: based on the third position information of the preset discrimination frame, separately identifying the multiple frames of the target image corresponding to the preset Object recognition is performed on the image area of the judgment frame, and multiple objects appearing in the image area corresponding to the preset judgment frame in the video clip are respectively tracked to obtain the multiple target objects.
  • This embodiment only recognizes and tracks objects within the preset judgment frame, which can effectively reduce the amount of data processing and improve efficiency and accuracy.
  • the method further includes: sending the time when the first object enters the target area, the The time when the second object leaves the target area, the entry identification information of the first object entering the target area, the exit identification information of the second object leaving the target area, and the second position of the traffic determination line at least one of the information, so as to realize passenger flow statistics in the target area through the remote server.
  • information such as the entry time and entry sign of objects entering the target area, and the departure time and exit sign of objects leaving the target area are transmitted to the remote server, which can improve the accuracy of passenger flow statistics through the remote server. sex.
  • the embodiment of the present disclosure also provides a device for acquiring passenger flow data, including: an information acquisition module, configured to acquire a video clip obtained by shooting a target area, and a distinguishing mark; the video clip includes multiple frames of target images
  • the target image includes the entrance and exit area of the target area;
  • the information processing module is used to perform object recognition and tracking on each frame of the target image in the multi-frame target image, and obtain multiple target objects, the multiple Key point information and moving speed information respectively corresponding to the target object; wherein, the key point information is used to characterize the position of the target object in the target image to which the target object belongs;
  • the moving speed information is used to characterize the target The moving speed of the object in the target image sequence composed of the target images to which the target object belongs;
  • the passenger flow statistics module which is used to base on the key point information and the moving speed information respectively corresponding to the multiple target objects, and the The discrimination flag is used to determine the passenger flow data of the target area.
  • an embodiment of the present disclosure further provides an electronic device, including: a processor, a memory, and a bus, the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the The processor communicates with the memory through the bus, and when the machine-readable instructions are executed by the processor, the steps in the above-mentioned first aspect or any possible implementation manner of the first aspect are performed.
  • the embodiments of the present disclosure further provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any one of the above-mentioned first aspect or the first aspect is executed. steps in a possible implementation.
  • FIG. 1 shows a flow chart of a method for acquiring passenger flow data provided by an embodiment of the present disclosure
  • FIG. 2 shows a flow chart of determining passenger flow data in another method for obtaining passenger flow data provided by an embodiment of the present disclosure
  • FIG. 3 shows a schematic diagram of an area for performing passenger flow statistics provided by an embodiment of the present disclosure
  • Fig. 4 shows a schematic diagram of a device for obtaining passenger flow data provided by an embodiment of the present disclosure
  • Fig. 5 shows a schematic diagram of an electronic device provided by an embodiment of the present disclosure.
  • the present disclosure provides a method, device, electronic device and storage medium for acquiring passenger flow data.
  • the present disclosure can more accurately realize object recognition, object tracking, and key point detection through image recognition, and then combine the detected key point information and the moving speed of the target object to more accurately determine the passenger flow data in the target area.
  • using key points for passenger flow statistics can effectively avoid the defect of low detection accuracy caused by occlusion, and combine the movement of target objects on the basis of key point information The speed can further improve the accuracy of passenger flow detection.
  • the method for acquiring passenger flow data provided by the embodiments of the present disclosure will be described below by taking the execution subject as a device with computing capability as an example.
  • the method for acquiring passenger flow data provided by the present disclosure may include steps S110-S130.
  • the aforementioned target area is the area where passenger flow data statistics are to be performed, for example, a shopping mall.
  • the above video clips may be taken by cameras installed in the entrance and exit areas of the target area.
  • the above-mentioned discrimination mark may include a flow judgment line, and only when an object (for example, a customer, passenger, etc.) crosses the flow judgment line, the information of the object may become valid data in passenger flow statistics.
  • the discrimination mark may also include a preset judgment frame, only when the object enters the preset judgment frame, the information of the object may become valid data in passenger flow statistics.
  • the above-mentioned discrimination mark can be set, for example, in the entrance and exit area of the target area.
  • the aforementioned multi-frame target images may refer to all frame images included in the video clip, or may refer to partial frame images selected from the video clip.
  • S120 Perform object recognition and tracking on each frame of target images in the multiple frames of target images to obtain multiple target objects, key point information of the target objects, and moving speed information of the target objects.
  • the key point information represents the position of the target object in the target image to which the target object belongs
  • the moving speed information represents the position of the target object in the target image sequence composed of the target images to which the target object belongs movement speed in .
  • the trained neural network can be used to perform object recognition and tracking on the target image, and to determine key point information of the target object.
  • the object detection frames of each object in the target image can be determined.
  • Object tracking can then be performed according to the Intersection-over-Union (IoU) of the object detection frame. Specifically, in two frames of target images that are adjacent or have a shorter shooting time interval, set the Intersection-over-Union ratio greater than the preset The two objects corresponding to the two object detection frames of the value are regarded as the same object. At this time, the object is considered to be tracked successfully, so the object can be used as the target object.
  • IoU Intersection-over-Union
  • the trained neural network can be used to determine the key point information corresponding to each object.
  • the trained neural network may be used to detect the target object to determine key point information corresponding to the target object.
  • the neural network for object recognition and tracking on the target image and the neural network for determining key point information may be the same neural network or different neural networks.
  • the above key point information may be information capable of characterizing the position of the target object in the target image to which it belongs, and specifically may include first position information indicating the position of at least one key point of the target object in at least one frame of the target image.
  • the key point information may be at least one of information corresponding to key points of the target object's feet, information corresponding to key points of the target object's knees, and information corresponding to key points of the target object's legs.
  • the multi-frame target images to which the target object belongs can be determined, and these images are sorted according to the shooting time to obtain the above target image sequence.
  • the moving distance of the target object within the shooting time interval of any two frames of target images in the target image sequence may be determined.
  • the moving speed of the target object within the shooting time interval can be determined. In this way, any two frames of target images can be selected multiple times from the sequence of target images, and multiple corresponding moving speeds can be obtained.
  • the above-mentioned moving speed information may be determined. Exemplarily, multiple moving speeds may be directly used as the moving speed information.
  • the crossing speed of the target object when crossing the traffic judgment line can be determined according to the moving speed information, and only the crossing speed meets the preset requirements
  • the information of the target object can become effective data in the passenger flow data. Therefore, the passenger flow data in the target area can be determined more accurately according to the key point information, moving speed information, and discriminant signs.
  • the passenger flow data of the target area can be determined through the following steps: first, for each target object, based on the first position information of at least one key point corresponding to the target object and the second position information of the flow discrimination line The position information is used to determine the line-crossing result information corresponding to the target object; the line-crossing result information is used to indicate whether the target object crosses the flow judgment line. Afterwards, passenger flow data in the target area is determined based on the line-crossing result information corresponding to the multiple target objects and the moving speed information.
  • the relative key point information may include the relative key point information of the foot composed of the key point information of the left foot and the key point information of the right foot of the target object, and the key point information of the left knee and the key point information of the right knee of the target object. At least one item of the relative key point information of the leg formed by the relative key point information of the knee, the key point information of the target object's left leg, and the key point information of the right leg.
  • the above relative key point information includes at least the position information of the corresponding key point, for example, the relative key point information of the target object’s foot includes at least the first position information of the target object’s left foot key point and the first position information of the right foot key point;
  • the relative knee key point information of the target object includes at least the first position information of the left knee key point and the first position information of the right knee key point of the target object.
  • the position information of the key points of footsteps, knees, or legs can more accurately represent the position of the target object, so that it can be more accurately determined whether the target object has crossed the flow discrimination line according to these key points.
  • the following method can be used to determine the cross-line result information corresponding to the target object: based on the first position information and the second position information, it is determined that there are two corresponding key points between the line and the flow rate In the case of at least one set of relative key point information intersected by the judgment line, it is determined that the line-crossing result information includes information that the target object crosses the flow judgment line.
  • connection line of a certain group of relative key points intersects the flow discrimination line, which means that the target object has crossed the flow discrimination line.
  • a single key point can also be used to determine the line-crossing result information corresponding to the target object.
  • determining the line crossing result information includes indicating that the target object crosses the flow judgment line information.
  • the above matching can specifically be that the first position information of the key point is the same as the second position information. At this time, it can indicate that a key point of the target object is located on the flow discrimination line, that is, the target object is located on the flow discrimination line. At this time, it is considered The target object crosses the flow discrimination line.
  • the passenger flow data of the target area can be determined in combination with the moving direction information of the target object, so that it can be further accurately determined whether the target object enters the target area or leaves Target area, so as to get more detailed passenger flow data.
  • the above-mentioned moving direction information can be determined according to the above-mentioned video clips, such as determining the target image sequence corresponding to the target object from the video clip, and determining the position of the target object in any two frames of the target image in the target image sequence, and then according to the two frames
  • the shooting time interval of the target image can determine the moving direction of the target object within the shooting time interval of the two frames of the target image.
  • any two frames of target images may be two frames of adjacent images in the target image sequence. In this way, any two frames of target images can be selected multiple times from the sequence of target images, and multiple corresponding moving directions can be obtained.
  • the above-mentioned moving direction information may be determined. Exemplarily, multiple moving directions may be directly used as the moving direction information. It can be seen that, according to the above moving direction information, the moving direction of the target object when it crosses the flow determination line can be determined.
  • the passenger flow data in the target area is determined based on the cross-line result information corresponding to the multiple target objects, the moving speed information, and the moving direction information. Specifically, Use the following steps to achieve:
  • S230 Determine a third quantity based on the first quantity and the second quantity; for example, calculate the difference between the first quantity and the second quantity, and use the difference as the third quantity, here the third The number is the number of target objects currently staying in the target area;
  • the moving speed information and the moving direction information the number of target objects leaving the target area, the number of target objects entering the target area, and the target objects currently staying in the target area can be more accurately screened out
  • the quantity effectively improves the accuracy of the determined passenger flow data.
  • the above object recognition and tracking are performed on each frame of the target image in the multiple frames of the target image to obtain multiple target objects, which can be specifically implemented by the following steps:
  • object recognition is performed on the multi-frame target images respectively to obtain a plurality of object detection frames; wherein, each object detection frame corresponds to an object; after that, it is determined between object detection frames belonging to two adjacent frames of target images respectively degree of overlap, and when the degree of overlap is greater than a preset value, it is determined that the object detection frames belonging to two frames of adjacent target images correspond to the same object, and the object is taken as the target object.
  • Whether the objects corresponding to the two object detection frames are the same object can be determined more accurately according to the degree of overlap between the two object detection frames, that is, object tracking can be performed more accurately.
  • the degree of overlap here is specifically the intersection and union ratio of two object detection frames.
  • a certain target object is not tracked within a preset time, it is determined that the target object has failed to be tracked. For a target object that has not been detected within a certain period of time, there is a high probability that the tracking will fail. At this time, such target objects can be set as tracking failure to improve the accuracy of object tracking.
  • an object identifier will be set for the target object. For a target object that fails to be tracked, the object identifier of the target object will not be assigned to other target objects detected subsequently.
  • the above-mentioned judging signs include not only flow judging lines, but also preset judging boxes.
  • the above-mentioned object recognition and tracking are respectively performed on each frame of the target image in the multi-frame target images to obtain a plurality of target objects, which can be specifically implemented by using the following steps:
  • object recognition is performed on image regions corresponding to the preset judgment frame in multiple frames of target images, and object recognition is performed on the video clips corresponding to the preset judgment frame Multiple objects appearing in the image area of the image area are respectively tracked to obtain multiple target objects; wherein the flow determination line is at least partially located within the preset determination frame.
  • the corresponding sub-image can be intercepted from the target image, and the sub-image sequence formed by sorting the sub-images of multiple frames according to the shooting time is subjected to object recognition and tracking, and the obtained multiple target audiences.
  • Recognizing and tracking only objects within the preset discrimination frame can effectively reduce the amount of data processing and improve efficiency and accuracy.
  • the above-mentioned preset judgment frame and flow judgment line are determined after calibrating the shooting device that shoots the above-mentioned video clip.
  • the preset discrimination frame may be a frame of regular shape such as a rectangle, or a frame of irregular shape, which is not limited in this application.
  • it is necessary to ensure that the upper body of the object entering or leaving the target area is inside the frame, so as to improve the accuracy of object recognition, tracking and passenger flow data statistics.
  • FIG. 3 shows a schematic diagram of an area for performing passenger flow statistics provided by an embodiment of the present disclosure.
  • the entrance and exit area of the target area is marked with 310
  • a preset judgment box 320 is set in the entrance and exit area 310
  • the embodiment of the present disclosure only recognizes and tracks objects appearing in the preset judgment box.
  • the flow judgment line 330 is at least partially located within the preset judgment box 320 .
  • the statistics of passenger flow data need to be carried out according to whether the tracked target object crosses the flow judgment line 330 . Specifically, as shown in FIG.
  • a certain group of relative key points of the target object 350 (for example, if the midpoint of the sole of the sole is used as a key point, then this group of relative key points can be the midpoint of both feet of the target object 350) 370 intersects the flow discrimination line 330, at this time, the target object 350 is considered to cross the flow discrimination line 330; a certain key point of another target object 360 is located on the flow discrimination line 330, and at this time, another target object 360 is also considered to cross the flow discrimination line 330.
  • the moving direction of the target object can be determined according to the time when the image to which the target object 350 belongs and the time when the image to which the target object 360 is captured information. For example, if the time to capture the image of the target object 350 is earlier than the time to capture the image of the target object 360 , it is determined that the moving direction information of the target object indicates that the moving direction of the target object when crossing the flow determination line is to enter the target area.
  • the speed indicated by the moving speed information of the target object determined according to the time when the image to which the target object 350 belongs and the time when the image to which the target object 360 belongs is determined to be greater than the first preset speed, then it is determined that the target object is an object entering the target area (i.e. the first object above).
  • the above-mentioned first quantity that is, the quantity of objects entering the target area, can be determined according to the counted quantity of this type of target objects.
  • the moving direction information of the target object indicates that the moving direction of the target object when it crosses the flow judgment line is to leave the target area . If the speed indicated by the moving speed information of the target object determined according to the time when the image to which the target object 350 belongs and the time when the image to which the target object 360 belongs is determined to be greater than the second preset speed, then it is determined that the target object is an object leaving the target area ( i.e. the second object above).
  • the above-mentioned second quantity that is, the quantity of objects leaving the target area, can be determined according to the counted quantity of this type of target objects.
  • the first direction and the second direction are used to determine the moving direction of the target object when crossing the flow judgment line. area or away from the target area.
  • the time when the first object enters the target area, the time when the second object leaves the target area, and the time when the first object enters the target area can also be calculated.
  • the entry identification information of the target area, the exit identification information of the second object leaving the target area, the second position information of the flow judgment line, the identification of the flow judgment line, video clips, and the corresponding At least one of the target image sequences is sent to the remote server, so as to realize passenger flow counting in the target area through the remote server.
  • the information such as the entry time and entry sign of objects entering the target area, and the departure time and exit sign of objects leaving the target area are transmitted to the remote server, which can improve the accuracy of passenger flow statistics through the remote server.
  • the methods in the above embodiments of the present disclosure may also be executed by a shooting device that shoots video clips, and the present disclosure does not limit the execution subject of the methods in the above embodiments.
  • the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possible
  • the inner logic is OK.
  • the embodiment of the present disclosure also provides a device for obtaining passenger flow data corresponding to the method for obtaining passenger flow data, because the problem-solving principle of the device in the embodiment of the present disclosure is similar to the above-mentioned method for obtaining passenger flow data in the embodiment of the present disclosure , so the implementation of the device can refer to the implementation of the method, and the repetition will not be repeated.
  • FIG. 4 is a schematic structural diagram of a device for obtaining passenger flow data provided by an embodiment of the present disclosure.
  • the device includes an information obtaining module 410 , an information processing module 420 and a passenger flow statistics module 430 .
  • the information acquiring module 410 is used to acquire video clips obtained by shooting the target area and identification marks; the video clips include multiple frames of target images; the target images include the entrance and exit areas of the target area.
  • the information processing module 420 is configured to perform object recognition and tracking on each frame of the target images in the multiple frames of target images, and obtain multiple target objects, key point information and moving speed information respectively corresponding to the multiple target objects.
  • the key point information is used to represent the position of the target object in the target image to which the target object belongs;
  • the moving speed information is used to represent the position of the target object in the target image composed of the target object to which the target object belongs. The speed of movement in the image sequence.
  • the passenger flow counting module 430 is configured to determine passenger flow data in the target area based on the key point information and the moving speed information respectively corresponding to the plurality of target objects, and the discriminant flag.
  • the key point information includes first position information indicating the position of at least one key point of the target object in the target image to which the target object belongs;
  • the discrimination mark includes a flow discrimination line;
  • the passenger flow statistics module 430 determines the passenger flow data in the target area based on the key point information and the moving speed information respectively corresponding to the multiple target objects, and the discrimination flag, At:
  • the target Line-crossing result information For each of the plurality of target objects, based on the first position information of the at least one key point corresponding to the target object and the second position information of the flow discrimination line, determine the target Line-crossing result information corresponding to the object; the line-crossing result information is used to represent whether the target object crosses the flow discrimination line;
  • the passenger flow data in the target area is determined based on the line crossing result information and the moving speed information corresponding to the multiple target objects.
  • the key points of each target object include at least one set of relative key points
  • the key point information includes at least one set of relative key point information corresponding to the at least one set of relative key points, wherein the relative key points
  • the key point information includes the relative key point information of the foot which is composed of the key point information of the left foot and the key point information of the right foot of the target object, the key point information of the left knee and the key point information of the right knee of the target object At least one item of the knee relative key point information, and the leg relative key point information composed of the target object's left leg key point information and right leg key point information.
  • the passenger flow statistics module 430 determines the When the cross-line result information corresponding to the target object is used for:
  • the line result information includes information indicating that the target object crosses the traffic determination line.
  • the passenger flow statistics module 430 determines the When the cross-line result information corresponding to the target object is used for:
  • determining the line crossing result information includes indicating that the target object crosses the flow judgment line Information.
  • the passenger flow statistics module 430 when determining the passenger flow data in the target area based on the cross-line result information and the moving speed information corresponding to the multiple target objects, is configured to:
  • the passenger flow data in the target area is determined based on the line-crossing result information, the moving speed information, and the moving direction information corresponding to the multiple target objects.
  • the traffic data includes a first number of target objects entering the target area
  • the passenger flow statistics module 430 determines the passenger flow data in the target area based on the cross-line result information, the moving speed information, and the moving direction information corresponding to the multiple target objects, it uses At:
  • filtering the line-crossing result information indicates crossing the traffic judging line, and the moving direction information indicates that the moving direction when crossing the traffic judging line is entering the target area, the moving direction a first object whose speed indicated by the speed information is greater than a first preset speed;
  • the quantity of the first object is used as the first quantity.
  • the traffic data includes a second number of target objects leaving the target area
  • the passenger flow statistics module 430 determines the passenger flow data in the target area based on the cross-line result information, the moving speed information, and the moving direction information corresponding to the multiple target objects, it uses At:
  • the quantity of the second object is used as the second quantity.
  • the traffic data includes a third number of target objects currently staying in the target area
  • the passenger flow statistics module 430 determines the passenger flow data in the target area based on the cross-line result information, the moving speed information, and the moving direction information corresponding to the multiple target objects, it uses At:
  • the first quantity is that the line-crossing result information in the plurality of target objects indicates that the flow judgment line is crossed, and the moving direction information indicates that the moving direction when crossing the flow judgment line is to enter the target area, the number of first objects whose speed indicated by the moving speed information is greater than a first preset speed;
  • the second quantity is that the line-crossing result information in the plurality of target objects indicates that the flow judgment line is crossed, the moving direction information indicates that the moving direction when crossing the flow judgment line is to leave the target area,
  • the moving speed information indicates the number of second objects whose speed is greater than a second preset speed.
  • the information processing module 420 when the information processing module 420 performs object recognition and tracking on each frame of target images in the multiple frames of target images to obtain the multiple target objects, it is used to:
  • each object detection frame corresponds to an object
  • the detection boxes correspond to the same object, and the object is used as the target object.
  • the information processing module 420 is further configured to:
  • the target object For each target object among the plurality of target objects, if the target object is not tracked within a preset time, it is determined that the tracking of the target object fails.
  • the judgment mark includes a flow judgment line and a preset judgment box, wherein the flow judgment line is at least partially located within the preset judgment box;
  • the information processing module 420 when the information processing module 420 performs object recognition and tracking on each frame of the target image in the multiple frames of target images to obtain the multiple target objects, it is used to:
  • the passenger flow counting module 430 determines the first object and the second object, it is further configured to:
  • an embodiment of the present disclosure also provides an electronic device.
  • FIG. 5 it is a schematic structural diagram of an electronic device 500 provided by an embodiment of the present disclosure, including a processor 51 , a memory 52 , and a bus 53 .
  • the memory 52 is used to store execution instructions, including a memory 521 and an external memory 522; the memory 521 here is also called an internal memory, and is used to temporarily store the calculation data in the processor 51 and the data exchanged with the external memory 522 such as a hard disk,
  • the processor 51 exchanges data with the external memory 522 through the memory 521 .
  • the processor 51 communicates with the memory 52 through the bus 53, so that the processor 51 performs the following operations when executing the instructions: acquire the video segment obtained by shooting the target area, and identify the mark;
  • the segment includes a multi-frame target image;
  • the target image includes an entrance and exit area of the target area;
  • object recognition and tracking are performed on each frame of the target image in the multi-frame target image, and multiple target objects, the multiple Key point information and moving speed information respectively corresponding to the target object;
  • the key point information is used to characterize the position of the target object in the target image to which the target object belongs;
  • the moving speed information is used to characterize the target The moving speed of the object in the target image sequence composed of the target images to which the target object belongs; based on the key point information and the moving speed information respectively corresponding to the multiple target objects, and the discriminant flag, determine the Passenger flow data in the target area.
  • An embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the steps of the method for obtaining passenger flow data described in the above-mentioned method embodiments are executed .
  • the storage medium may be a volatile or non-volatile computer-readable storage medium.
  • the computer program product of the method for obtaining passenger flow data provided by the embodiments of the present disclosure includes a computer-readable storage medium storing program codes, and the instructions included in the program code can be used to execute the method for obtaining passenger flow data described in the above method embodiments
  • the computer program product can be specifically realized by means of hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) etc. wait.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor.
  • the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present disclosure.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disc and other media that can store program codes. .

Abstract

Provided in the present disclosure are a method and apparatus for acquiring passenger flow data, and an electronic device and a storage medium. The method for acquiring passenger flow data provided in the embodiments of the present disclosure comprises: acquiring a video clip, which is obtained by means of performing video recording on a target area, and acquiring a discrimination mark, wherein the video clip comprises a plurality of frames of target images, and the target images comprise entrance and exit areas of the target area; respectively performing object recognition and tracking on each of the plurality of frames of the target images, so as to obtain a plurality of target objects, and key point information and moving speed information, which respectively correspond to the plurality of target objects; and determining passenger flow data of the target area on the basis of the key point information and the moving speed information, which respectively correspond to the plurality of target objects, and the discrimination mark.

Description

获取客流数据的方法、装置、电子设备以及存储介质Method, device, electronic device and storage medium for obtaining passenger flow data
交叉引用声明cross-reference statement
本申请要求于2021年11月30日提交中国专利局的申请号为202111446732.X的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to a Chinese patent application with application number 202111446732.X filed with the China Patent Office on November 30, 2021, the entire contents of which are incorporated herein by reference.
技术领域technical field
本公开涉及图像处理技术领域,具体而言,涉及获取客流数据的方法、装置、电子设备以及存储介质。The present disclosure relates to the technical field of image processing, and in particular, to a method, device, electronic device, and storage medium for acquiring passenger flow data.
背景技术Background technique
很多场所需要了解客流信息,根据客流信息制定相关的管制策略,以保证对应场所的安全、正常运营等。例如,对于地铁场所,需要了解上下班高峰期的客流信息,以采取相应的客流管制策略;再例如,对于线下实体商业场所,需要了解客流信息,以制定相关的运营策略。但是目前针对某一场所进行的客流统计不够精确。Many places need to understand the passenger flow information, and formulate relevant control strategies based on the passenger flow information to ensure the safety and normal operation of the corresponding places. For example, for subway places, it is necessary to know the passenger flow information during the peak commuting period in order to adopt corresponding passenger flow control strategies; for another example, for offline physical commercial places, it is necessary to understand the passenger flow information in order to formulate relevant operation strategies. However, the current passenger flow statistics for a certain place are not accurate enough.
发明内容Contents of the invention
本公开实施例至少提供一种获取客流数据的方法、装置、电子设备以及存储介质。Embodiments of the present disclosure at least provide a method, device, electronic device, and storage medium for acquiring passenger flow data.
第一方面,本公开实施例提供了一种获取客流数据的方法,包括:获取对目标区域进行拍摄得到的视频片段,以及判别标志;所述视频片段包括多帧目标图像;所述目标图像包括所述目标区域的出入口区域;分别对所述多帧目标图像中的每帧目标图像进行对象识别和追踪,得到多个目标对象、所述多个目标对象分别对应的关键点信息和移动速度信息;其中,所述关键点信息用于表征所述目标对象在所述目标对象所属目标图像中的位置;所述移动速度信息用于表征所述目标对象在由所述目标对象所属目标图像组成的目标图像序列中的移动速度;基于所述多个目标对象分别对应的所述关键点信息和所述移动速度信息,以及所述判别标志,确定所述目标区域的客流数据。In the first aspect, an embodiment of the present disclosure provides a method for acquiring passenger flow data, including: acquiring a video segment obtained by shooting a target area, and a distinguishing mark; the video segment includes multiple frames of target images; the target image includes The entrance and exit area of the target area; performing object recognition and tracking on each frame of the target image in the multiple frames of the target image, to obtain multiple target objects, key point information and moving speed information respectively corresponding to the multiple target objects ; Wherein, the key point information is used to characterize the position of the target object in the target image to which the target object belongs; the moving speed information is used to characterize the position of the target object in the target image composed of the target object The moving speed in the target image sequence: determining passenger flow data in the target area based on the key point information and the moving speed information respectively corresponding to the plurality of target objects, and the discriminant marks.
该方面通过图像识别的方式能够较为准确地实现对象识别、对象追踪以及关键点检测,之后结合检测得到的关键点信息和目标对象的移动速度能够较为准确地确定目标区域内的客流数据。相比于现有技术中利用对象的头肩检测等进行客流统计,利用关键点进行客流统计能够有效避免由于遮挡导致的检测精度低的缺陷,并且在关键点信息的基础上结合目标对象的移动速度,能够进一步提高客流检测的精度。In this aspect, object recognition, object tracking, and key point detection can be realized more accurately through image recognition, and then the passenger flow data in the target area can be determined more accurately by combining the detected key point information and the moving speed of the target object. Compared with the prior art that uses head and shoulder detection of objects for passenger flow statistics, using key points for passenger flow statistics can effectively avoid the defect of low detection accuracy caused by occlusion, and combine the movement of target objects on the basis of key point information The speed can further improve the accuracy of passenger flow detection.
在一种可能的实施方式中,所述关键点信息包括表示目标对象的至少一个关键点在所述目标对象所属目标图像中的位置的第一位置信息;所述判别标志包括流量判别线;其中,所述基于所述多个目标对象分别对应的所述关键点信息和所述移动速度信息,以及所述判别标志,确定所述目标区域的所述客流数据,包括:针对所述多个目标对象中的每个目标对象,基于所述目标对象对应的所述至少一个关键点的所述第一位置信息和所述流量判别线的第二位置信息,确定所述目标对象对应的跨线结果信息;所述跨线结果信息用于表征所述目标对象是否跨越所述流量判别线;基于所述多个目标对象对应的所述跨线结果信息和所述移动速度信息,确定所述目标区域的所述客流数据。In a possible implementation manner, the key point information includes first position information indicating the position of at least one key point of the target object in the target image to which the target object belongs; the discriminant mark includes a flow rate discriminant line; wherein , the determining the passenger flow data in the target area based on the key point information and the moving speed information respectively corresponding to the multiple target objects, and the discriminant flag includes: for the multiple targets For each target object in the target object, based on the first position information of the at least one key point corresponding to the target object and the second position information of the flow judgment line, determine the line crossing result corresponding to the target object information; the cross-line result information is used to represent whether the target object crosses the flow judgment line; based on the cross-line result information and the moving speed information corresponding to the multiple target objects, determine the target area of the passenger flow data.
该实施方式根据目标对象对应的关键点的第一位置信息和流量判别线的第二位置信息,能够较为准确地确定目标对象是否跨越了流量判别线,即能够得到较为准确的跨线结果信息;之后结合跨线结果信息和目标对象的移动速度信息能够较为准确地对目标区 域进行客流统计。In this embodiment, according to the first position information of the key point corresponding to the target object and the second position information of the flow discrimination line, it can be more accurately determined whether the target object has crossed the flow discrimination line, that is, more accurate cross-line result information can be obtained; Afterwards, combined with the cross-line result information and the moving speed information of the target object, the passenger flow statistics of the target area can be more accurately counted.
在一种可能的实施方式中,每个目标对象的关键点包括至少一组相对关键点,所述关键点信息包括所述至少一组相对关键点对应的至少一组相对关键点信息,其中,所述相对关键点信息包括由所述目标对象的左脚关键点信息和右脚关键点信息构成的脚部相对关键点信息、由所述目标对象的左膝部关键点信息和右膝部关键点信息构成的膝部相对关键点信息、由所述目标对象的左腿部关键点信息和右腿部关键点信息构成的腿部相对关键点信息中的至少一项。In a possible implementation manner, the key points of each target object include at least one set of relative key points, and the key point information includes at least one set of relative key point information corresponding to the at least one set of relative key points, wherein, The relative key point information includes foot relative key point information composed of left foot key point information and right foot key point information of the target object, left knee key point information and right knee key point information of the target object. At least one of knee relative key point information composed of point information, leg relative key point information composed of left leg key point information and right leg key point information of the target object.
在该实施方式中,脚步关键点、膝部关键点或者腿部关键点这些关键点的位置信息能够较为准确地表征目标对象的位置,这样,根据这些关键点能够较为准确地确定目标对象是否跨越了流量判别线。In this embodiment, the position information of key points such as footstep key points, knee key points or leg key points can more accurately represent the position of the target object, so that it can be more accurately determined whether the target object crosses the flow rate line.
在一种可能的实施方式中,所述基于所述目标对象对应的所述至少一个关键点的所述第一位置信息和所述流量判别线的所述第二位置信息,确定所述目标对象对应的所述跨线结果信息,包括:在基于所述第一位置信息和所述第二位置信息,确定存在对应的两个关键点的连线与所述流量判别线相交的至少一组相对关键点信息的情况下,确定所述跨线结果信息包括表示所述目标对象跨越所述流量判别线的信息。In a possible implementation manner, the target object is determined based on the first position information of the at least one key point corresponding to the target object and the second position information of the flow discrimination line The corresponding line-crossing result information includes: based on the first position information and the second position information, it is determined that there is at least one set of relative points where a line connecting two corresponding key points intersects the flow discrimination line. In the case of key point information, determining that the line-crossing result information includes information indicating that the target object crosses the flow judgment line.
在该实施方式中,某一组相对关键点的连线与流量判别线相交,表示目标对象跨越了流量判别线,此时需要将跨线结果信息设置为包括表示目标对象跨越流量判别线的信息,这样,得到的跨线结果信息更加准确。In this embodiment, if the connection line of a certain group of relative key points intersects the flow discrimination line, it means that the target object has crossed the flow discrimination line. At this time, the line crossing result information needs to be set to include the information indicating that the target object has crossed the flow discrimination line , so that the cross-line result information obtained is more accurate.
在一种可能的实施方式中,所述基于所述目标对象对应的所述至少一个关键点的所述第一位置信息和所述流量判别线的所述第二位置信息,确定所述目标对象对应的所述跨线结果信息,包括:在所述目标对象的所述至少一个关键点的所述第一位置信息与所述第二位置信息相匹配的情况下,确定所述跨线结果信息包括表示该目标对象跨越所述流量判别线的信息。In a possible implementation manner, the target object is determined based on the first position information of the at least one key point corresponding to the target object and the second position information of the flow discrimination line The corresponding line-crossing result information includes: determining the line-crossing result information when the first position information of the at least one key point of the target object matches the second position information Include information indicating that the target object crosses the flow discrimination line.
在该实施方式中,在某一关键点在流量判别线上时,表示目标对象跨越了流量判别线,此时需要将跨线结果信息设置为包括表示目标对象跨越流量判别线的信息,这样,得到的跨线结果信息更加准确。In this embodiment, when a certain key point is on the flow judgment line, it means that the target object has crossed the flow judgment line. At this time, the line crossing result information needs to be set to include information indicating that the target object has crossed the flow judgment line. In this way, The obtained cross-line result information is more accurate.
在一种可能的实施方式中,所述基于所述多个目标对象对应的所述跨线结果信息和所述移动速度信息,确定所述目标区域的所述客流数据,包括:基于所述视频片段,确定所述目标对象的移动方向信息;基于所述多个目标对象对应的所述跨线结果信息、所述移动速度信息和所述移动方向信息,确定所述目标区域的所述客流数据。In a possible implementation manner, the determining the passenger flow data in the target area based on the cross-line result information and the moving speed information corresponding to the multiple target objects includes: based on the video segment, determining the moving direction information of the target object; determining the passenger flow data in the target area based on the cross-line result information, the moving speed information, and the moving direction information corresponding to the multiple target objects .
在该实施方式中,在跨线结果信息和移动速度信息的基础上,结合目标对象的移动方向信息,能够较为准确地确定目标对象是进入目标区域,还是离开目标区域,从而得到更加细致的客流数据。In this embodiment, on the basis of the cross-line result information and moving speed information, combined with the moving direction information of the target object, it can be determined more accurately whether the target object enters the target area or leaves the target area, so as to obtain a more detailed passenger flow data.
在一种可能的实施方式中,所述客流数据包括进入所述目标区域的目标对象的第一数量;其中,所述基于所述多个目标对象对应的所述跨线结果信息、所述移动速度信息和所述移动方向信息,确定所述目标区域的所述客流数据,包括:从所述多个目标对象中,筛选所述跨线结果信息指示跨越所述流量判别线、所述移动方向信息指示跨越所述流量判别线时的移动方向为进入所述目标区域、所述移动速度信息指示的速度大于第一预设速度的第一对象;将第一对象的数量作为所述第一数量。In a possible implementation manner, the passenger flow data includes a first number of target objects entering the target area; wherein, the cross-line result information corresponding to the plurality of target objects, the movement The speed information and the moving direction information, determining the passenger flow data in the target area, includes: filtering the line-crossing result information from the multiple target objects to indicate crossing the traffic judging line, the moving direction The information indicates that the moving direction when crossing the flow discrimination line is the first object that enters the target area and the speed indicated by the moving speed information is greater than the first preset speed; the number of first objects is taken as the first number .
该实施方式根据所述跨线结果信息、所述移动速度信息和所述移动方向信息,能够较为准确地筛选出进入目标区域的目标对象,即较为准确地确定上述第一数量。In this embodiment, according to the line-crossing result information, the moving speed information and the moving direction information, the target objects entering the target area can be more accurately screened out, that is, the above-mentioned first number can be determined more accurately.
在一种可能的实施方式中,所述客流数据包括离开所述目标区域的目标对象的第二 数量;其中,所述基于所述多个目标对象对应的所述跨线结果信息、所述移动速度信息和所述移动方向信息,确定所述目标区域的所述客流数据,包括:从所述多个目标对象中,筛选所述跨线结果信息指示跨越所述流量判别线、所述移动方向信息指示跨越所述流量判别线时的移动方向为离开所述目标区域、所述移动速度信息指示的速度大于第二预设速度的第二对象;将所述第二对象的数量作为所述第二数量。In a possible implementation manner, the passenger flow data includes a second number of target objects leaving the target area; wherein, the cross-line result information corresponding to the plurality of target objects, the movement The speed information and the moving direction information, determining the passenger flow data in the target area, includes: filtering the line-crossing result information from the multiple target objects to indicate crossing the traffic judging line, the moving direction The information indicates that the moving direction when crossing the flow judgment line is the second object that leaves the target area and the speed indicated by the moving speed information is greater than a second preset speed; the number of the second objects is taken as the second object Two quantities.
该实施方式根据跨线结果信息、所述移动速度信息和所述移动方向信息,能够较为准确地筛选出离开目标区域的目标对象,即较为准确地确定上述第二数量。In this embodiment, according to the line-crossing result information, the moving speed information and the moving direction information, the target objects leaving the target area can be more accurately screened out, that is, the above-mentioned second quantity can be determined more accurately.
在一种可能的实施方式中,所述客流数据包括当前停留在所述目标区域的目标对象的第三数量;其中,所述基于所述多个目标对象对应的所述跨线结果信息、所述移动速度信息和所述移动方向信息,确定所述目标区域的所述客流数据,还包括:基于第一数量和第二数量,确定所述第三数量;其中,所述第一数量为所述多个目标对象中所述跨线结果信息指示跨越所述流量判别线、所述移动方向信息指示跨越所述流量判别线时的移动方向为进入所述目标区域、所述移动速度信息指示的速度大于第一预设速度的第一对象的数量;所述第二数量为所述多个目标对象中所述跨线结果信息指示跨越所述流量判别线、所述移动方向信息指示跨越所述流量判别线时的移动方向为离开所述目标区域、所述移动速度信息指示的速度大于第二预设速度的第二对象的数量。In a possible implementation manner, the passenger flow data includes a third number of target objects currently staying in the target area; wherein, the cross-line result information corresponding to the plurality of target objects, the determining the passenger flow data in the target area based on the moving speed information and the moving direction information, further comprising: determining the third number based on the first number and the second number; wherein the first number is the The crossing result information in the plurality of target objects indicates crossing the flow judgment line, the moving direction information indicates that the moving direction when crossing the flow judgment line is to enter the target area, and the moving speed information indicates The number of first objects whose speed is greater than the first preset speed; the second number is that the line crossing result information indicates crossing the flow judgment line, and the moving direction information indicates crossing the The moving direction at the time of the flow determination line is the number of second objects leaving the target area whose speed indicated by the moving speed information is greater than a second preset speed.
该实施方式根据进入目标区域的目标对象的数量,即上述第一数量和离开目标区域的目标对象的数量,即上述第二数量,能够较为准确地确定当前停留在目标区域内的目标对象的数量,即上述第三数量。In this embodiment, according to the number of target objects entering the target area, that is, the above-mentioned first number, and the number of target objects that leave the target area, that is, the above-mentioned second number, the number of target objects currently staying in the target area can be determined more accurately , which is the third quantity mentioned above.
在一种可能的实施方式中,所述分别对所述多帧目标图像中的每帧目标图像进行对象识别和追踪,得到所述多个目标对象,包括:分别对所述多帧目标图像进行对象识别,得到多个对象检测框;其中,每个对象检测框对应一个对象;确定分别属于两帧相邻的目标图像中的对象检测框之间的重叠度,并在所述重叠度大于预设值的情况下,确定所述分别属于两帧相邻的目标图像中的对象检测框对应同一个对象,并将所述对象作为目标对象。In a possible implementation manner, the performing object recognition and tracking on each frame of target images in the multiple frames of target images to obtain the multiple target objects includes: respectively performing Object recognition, obtaining a plurality of object detection frames; wherein, each object detection frame corresponds to an object; determining the degree of overlap between the object detection frames respectively belonging to two frames of adjacent target images, and when the degree of overlap is greater than a preset When the value is set, it is determined that the object detection frames belonging to two adjacent frames of the target image correspond to the same object, and the object is used as the target object.
该实施方式根据两个对象检测框之间的重叠度能够较为准确地确定两个对象检测框对应的对象是否为同一个对象,即能够较为准确地进行对象追踪。In this embodiment, according to the degree of overlap between the two object detection frames, it can be more accurately determined whether the objects corresponding to the two object detection frames are the same object, that is, the object tracking can be performed more accurately.
在一种可能的实施方式中,在得到所述多个目标对象之后,所述方法还包括:针对所述多个目标对象中的每个目标对象,在预设时间内未追踪到所述目标对象的情况下,确定所述目标对象追踪失败。In a possible implementation manner, after obtaining the multiple target objects, the method further includes: for each target object in the multiple target objects, the target is not tracked within a preset time In the case of an object, it is determined that tracking of the target object has failed.
在该实施方式中,对于一定时间内未检测到的目标对象,大概率追踪失败了,此时可以将这类目标对象设置为追踪失败,以提高对象追踪的准确性。In this embodiment, for a target object that has not been detected within a certain period of time, there is a high probability that the tracking fails. At this time, such target objects can be set as tracking failure to improve the accuracy of object tracking.
在一种可能的实施方式中,所述判别标志包括流量判别线和预设判别框,其中所述流量判别线至少部分位于所述预设判别框内;其中,所述分别对所述多帧目标图像中的每帧目标图像进行对象识别和追踪,得到所述多个目标对象,包括:基于所述预设判别框的第三位置信息,分别对多帧目标图像中对应于所述预设判别框的图像区域进行对象识别,并对所述视频片段中对应于所述预设判别框的所述图像区域中出现的多个对象分别进行追踪,得到所述多个目标对象。In a possible implementation manner, the discrimination mark includes a flow discrimination line and a preset judgment frame, wherein the flow judgment line is at least partly located within the preset judgment frame; Performing object recognition and tracking on each frame of the target image in the target image to obtain the plurality of target objects, including: based on the third position information of the preset discrimination frame, separately identifying the multiple frames of the target image corresponding to the preset Object recognition is performed on the image area of the judgment frame, and multiple objects appearing in the image area corresponding to the preset judgment frame in the video clip are respectively tracked to obtain the multiple target objects.
该实施方式只对预设判别框内的对象进行识别、追踪,能够有效减少数据处理的数量,提高效率和准确性。This embodiment only recognizes and tracks objects within the preset judgment frame, which can effectively reduce the amount of data processing and improve efficiency and accuracy.
在一种可能的实施方式中,在确定所述第一对象、所述第二对象之后,所述方法还包括:向远端服务器发送所述第一对象进入所述目标区域的时间、所述第二对象离开所 述目标区域的时间、所述第一对象进入所述目标区域的进入标识信息、所述第二对象离开所述目标区域的离开标识信息、所述流量判别线的第二位置信息中的至少一种,以通过所述远端服务器实现对所述目标区域进行客流统计。In a possible implementation manner, after the first object and the second object are determined, the method further includes: sending the time when the first object enters the target area, the The time when the second object leaves the target area, the entry identification information of the first object entering the target area, the exit identification information of the second object leaving the target area, and the second position of the traffic determination line at least one of the information, so as to realize passenger flow statistics in the target area through the remote server.
在该实施方式中,将进入目标区域的对象的进入时间、进入标识等信息,离开目标区域的对象的离开时间、离开标识等信息传送给远端服务器,能够通过远端服务器提高客流统计的准确性。In this embodiment, information such as the entry time and entry sign of objects entering the target area, and the departure time and exit sign of objects leaving the target area are transmitted to the remote server, which can improve the accuracy of passenger flow statistics through the remote server. sex.
第二方面,本公开实施例还提供一种获取客流数据的装置,包括:信息获取模块,用于获取对目标区域进行拍摄得到的视频片段,以及判别标志;所述视频片段包括多帧目标图像;所述目标图像包括所述目标区域的出入口区域;信息处理模块,用于分别对所述多帧目标图像中的每帧目标图像进行对象识别和追踪,得到多个目标对象、所述多个目标对象分别对应的关键点信息和移动速度信息;其中,所述关键点信息用于表征所述目标对象在所述目标对象所属目标图像中的位置;所述移动速度信息用于表征所述目标对象在由所述目标对象所属目标图像组成的目标图像序列中的移动速度;客流统计模块,用于基于所述多个目标对象分别对应的所述关键点信息和所述移动速度信息,以及所述判别标志,确定所述目标区域的客流数据。In the second aspect, the embodiment of the present disclosure also provides a device for acquiring passenger flow data, including: an information acquisition module, configured to acquire a video clip obtained by shooting a target area, and a distinguishing mark; the video clip includes multiple frames of target images The target image includes the entrance and exit area of the target area; the information processing module is used to perform object recognition and tracking on each frame of the target image in the multi-frame target image, and obtain multiple target objects, the multiple Key point information and moving speed information respectively corresponding to the target object; wherein, the key point information is used to characterize the position of the target object in the target image to which the target object belongs; the moving speed information is used to characterize the target The moving speed of the object in the target image sequence composed of the target images to which the target object belongs; the passenger flow statistics module, which is used to base on the key point information and the moving speed information respectively corresponding to the multiple target objects, and the The discrimination flag is used to determine the passenger flow data of the target area.
第三方面,本公开实施例还提供一种电子设备,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当所述电子设备运行时,所述处理器与所述存储器之间通过所述总线通信,所述机器可读指令被所述处理器执行时执行上述第一方面或第一方面中任一种可能的实施方式中的步骤。In a third aspect, an embodiment of the present disclosure further provides an electronic device, including: a processor, a memory, and a bus, the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the The processor communicates with the memory through the bus, and when the machine-readable instructions are executed by the processor, the steps in the above-mentioned first aspect or any possible implementation manner of the first aspect are performed.
第四方面,本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述第一方面或第一方面中任一种可能的实施方式中的步骤。In the fourth aspect, the embodiments of the present disclosure further provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any one of the above-mentioned first aspect or the first aspect is executed. steps in a possible implementation.
关于上述获取客流数据的装置、电子设备、及计算机可读存储介质的效果描述参见上述获取客流数据的方法的说明,这里不再赘述。For the effect description of the above device for obtaining passenger flow data, the electronic equipment, and the computer-readable storage medium, please refer to the description of the above method for obtaining passenger flow data, which will not be repeated here.
为使本公开的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。In order to make the above-mentioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments will be described in detail below together with the accompanying drawings.
附图说明Description of drawings
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,此处的附图被并入说明书中并构成本说明书中的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to illustrate the technical solutions of the embodiments of the present disclosure more clearly, the following will briefly introduce the accompanying drawings used in the embodiments. The accompanying drawings here are incorporated into the specification and constitute a part of the specification. The drawings show the embodiments consistent with the present disclosure, and are used together with the description to explain the technical solutions of the present disclosure. It should be understood that the following drawings only show some embodiments of the present disclosure, and therefore should not be regarded as limiting the scope. For those skilled in the art, they can also make From these drawings other related drawings are obtained.
图1示出了本公开实施例所提供的一种获取客流数据的方法的流程图;FIG. 1 shows a flow chart of a method for acquiring passenger flow data provided by an embodiment of the present disclosure;
图2示出了本公开实施例所提供的另一种获取客流数据的方法中确定客流数据的流程图;FIG. 2 shows a flow chart of determining passenger flow data in another method for obtaining passenger flow data provided by an embodiment of the present disclosure;
图3示出了本公开实施例所提供的一种进行客流统计的区域示意图;FIG. 3 shows a schematic diagram of an area for performing passenger flow statistics provided by an embodiment of the present disclosure;
图4示出了本公开实施例所提供的一种获取客流数据的装置的示意图;Fig. 4 shows a schematic diagram of a device for obtaining passenger flow data provided by an embodiment of the present disclosure;
图5示出了本公开实施例所提供的一种电子设备的示意图。Fig. 5 shows a schematic diagram of an electronic device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本公开实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是仅仅表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only It is a part of the embodiments of the present disclosure, but not all of them. The components of the disclosed embodiments generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Accordingly, the following detailed description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative effort shall fall within the protection scope of the present disclosure.
经研究发现,目前很多场所需要进行客流统计,但是目前对于某一场所进行的客流统计不够精确。针对此,本公开提供了一种获取客流数据的方法、装置、电子设备以及存储介质。本公开通过图像识别的方式能够较为准确地实现对象识别、对象追踪以及关键点检测,之后结合检测得到的关键点信息和目标对象的移动速度能够较为准确地确定目标区域内的客流数据。相比于现有技术中利用对象的头肩检测等进行客流统计,利用关键点进行客流统计能够有效避免由于遮挡导致的检测精度低的缺陷,并且在关键点信息的基础上结合目标对象的移动速度,能够进一步提高客流检测的精度。After research, it is found that at present, many places need to carry out passenger flow statistics, but the current passenger flow statistics for a certain place are not accurate enough. Aiming at this, the present disclosure provides a method, device, electronic device and storage medium for acquiring passenger flow data. The present disclosure can more accurately realize object recognition, object tracking, and key point detection through image recognition, and then combine the detected key point information and the moving speed of the target object to more accurately determine the passenger flow data in the target area. Compared with the prior art that uses head and shoulder detection of objects for passenger flow statistics, using key points for passenger flow statistics can effectively avoid the defect of low detection accuracy caused by occlusion, and combine the movement of target objects on the basis of key point information The speed can further improve the accuracy of passenger flow detection.
下面以执行主体为具有计算能力的设备为例对本公开实施例提供的获取客流数据的方法加以说明。The method for acquiring passenger flow data provided by the embodiments of the present disclosure will be described below by taking the execution subject as a device with computing capability as an example.
如图1所示,本公开提供的获取客流数据的方法可以包括步骤S110~S130。As shown in FIG. 1 , the method for acquiring passenger flow data provided by the present disclosure may include steps S110-S130.
S110、获取对目标区域进行拍摄得到的视频片段,以及判别标志;所述视频片段包括多帧目标图像;所述目标图像包括所述目标区域的出入口区域。S110. Acquire a video segment obtained by shooting the target area, and a distinguishing mark; the video segment includes multiple frames of target images; the target image includes an entrance and exit area of the target area.
上述目标区域即为要进行客流数据统计的区域,例如可以是某商场。上述视频片段可以是安装在目标区域的出入口区域的摄像头拍摄的。The aforementioned target area is the area where passenger flow data statistics are to be performed, for example, a shopping mall. The above video clips may be taken by cameras installed in the entrance and exit areas of the target area.
上述判别标志可以包括流量判别线,只有对象(例如,顾客、乘客等)跨越该流量判别线时,该对象的信息才有可能成为客流数据统计中的有效数据。另外,判别标志还可以包括预设判别框,只有对象进入该预设判别框时,该对象的信息才有可能成为客流数据统计中的有效数据。上述判别标志可以设置于例如所述目标区域的出入口区域中。The above-mentioned discrimination mark may include a flow judgment line, and only when an object (for example, a customer, passenger, etc.) crosses the flow judgment line, the information of the object may become valid data in passenger flow statistics. In addition, the discrimination mark may also include a preset judgment frame, only when the object enters the preset judgment frame, the information of the object may become valid data in passenger flow statistics. The above-mentioned discrimination mark can be set, for example, in the entrance and exit area of the target area.
上述多帧目标图像可以指视频片段包括的全部帧图像,也可以指从视频片段中选择的部分帧图像。The aforementioned multi-frame target images may refer to all frame images included in the video clip, or may refer to partial frame images selected from the video clip.
S120、对所述多帧目标图像中的每帧目标图像进行对象识别和追踪,得到多个目标对象、所述目标对象的关键点信息以及所述目标对象的移动速度信息。S120. Perform object recognition and tracking on each frame of target images in the multiple frames of target images to obtain multiple target objects, key point information of the target objects, and moving speed information of the target objects.
其中,所述关键点信息表征所述目标对象在所述目标对象所属的目标图像中的位置;所述移动速度信息表征所述目标对象在由所述目标对象所属的目标图像组成的目标图像序列中的移动速度。Wherein, the key point information represents the position of the target object in the target image to which the target object belongs; the moving speed information represents the position of the target object in the target image sequence composed of the target images to which the target object belongs movement speed in .
示例性地,可以利用训练好的神经网络对目标图像进行对象识别和追踪,以及确定目标对象的关键点信息。Exemplarily, the trained neural network can be used to perform object recognition and tracking on the target image, and to determine key point information of the target object.
在对目标图像进行对象识别时,可以确定该目标图像中各对象的对象检测框。之后可以根据对象检测框的交并比(Intersection-over-Union,IoU)进行对象追踪,具体地,在相邻的或拍摄时间相隔较短的两帧目标图像中,将交并比大于预设值的两个对象检测框对应的两个对象作为同一个对象,此时认为该对象追踪成功,因此可以将该对象作为目标对象。When performing object recognition on a target image, the object detection frames of each object in the target image can be determined. Object tracking can then be performed according to the Intersection-over-Union (IoU) of the object detection frame. Specifically, in two frames of target images that are adjacent or have a shorter shooting time interval, set the Intersection-over-Union ratio greater than the preset The two objects corresponding to the two object detection frames of the value are regarded as the same object. At this time, the object is considered to be tracked successfully, so the object can be used as the target object.
在进行对象识别的同时可以利用训练好的神经网络确定每个对象对应的关键点信息。 也可以在确定了目标对象之后,利用训练好的神经网络对目标对象进行检测,确定目标对象对应的关键点信息。用于对目标图像进行对象识别和追踪的神经网络和用于确定关键点信息的神经网络可以为同一神经网络或不同神经网络。While performing object recognition, the trained neural network can be used to determine the key point information corresponding to each object. Alternatively, after the target object is determined, the trained neural network may be used to detect the target object to determine key point information corresponding to the target object. The neural network for object recognition and tracking on the target image and the neural network for determining key point information may be the same neural network or different neural networks.
上述关键点信息可以是能够表征目标对象在所属目标图像的位置的信息,具体可以包括表示目标对象的至少一个关键点在至少一帧目标图像中的位置的第一位置信息。例如,上述关键点信息可以是目标对象的脚部关键点对应的信息、目标对象的膝部关键点对应的信息、目标对象的腿部关键点对应的信息中的至少一种。The above key point information may be information capable of characterizing the position of the target object in the target image to which it belongs, and specifically may include first position information indicating the position of at least one key point of the target object in at least one frame of the target image. For example, the key point information may be at least one of information corresponding to key points of the target object's feet, information corresponding to key points of the target object's knees, and information corresponding to key points of the target object's legs.
根据目标对象的追踪可以确定目标对象所属的多帧目标图像,这些图像按照拍摄时间进行排序,即可得到上述目标图像序列。According to the tracking of the target object, the multi-frame target images to which the target object belongs can be determined, and these images are sorted according to the shooting time to obtain the above target image sequence.
在确定了某一目标对象的目标图像序列之后,可以确定目标对象在所述目标图像序列中任意两帧目标图像的拍摄时间间隔内的移动距离。之后,根据此两帧目标图像的拍摄时间间隔以及移动距离,可以确定目标对象在此拍摄时间间隔内的移动速度。以这种方式,可以从目标图像序列中多次选择任意两帧目标图像,并获得相对应的多个移动速度。基于多个上述移动速度,可以确定上述移动速度信息。示例性地,可以直接将多个上述移动速度作为上述移动速度信息。After the target image sequence of a certain target object is determined, the moving distance of the target object within the shooting time interval of any two frames of target images in the target image sequence may be determined. Afterwards, according to the shooting time interval and moving distance of the two frames of target images, the moving speed of the target object within the shooting time interval can be determined. In this way, any two frames of target images can be selected multiple times from the sequence of target images, and multiple corresponding moving speeds can be obtained. Based on a plurality of the above-mentioned moving speeds, the above-mentioned moving speed information may be determined. Exemplarily, multiple moving speeds may be directly used as the moving speed information.
S130、基于所述多个目标对象分别对应的所述关键点信息和所述移动速度信息,以及所述判别标志,确定所述目标区域的客流数据。S130. Determine passenger flow data in the target area based on the key point information and the moving speed information respectively corresponding to the multiple target objects, and the discrimination flag.
示例性地,根据关键点信息和判别标志可以确定目标对象是否跨越了流量判别线,根据移动速度信息可以确定目标对象在跨越流量判别线时的跨线速度,只有跨线速度满足预设要求的目标对象的信息可以成为客流数据中的有效数据。因此,根据关键点信息、移动速度信息以及判别标志,可以较为准确地确定所述目标区域的客流数据。Exemplarily, it can be determined whether the target object has crossed the traffic discrimination line according to the key point information and the discrimination mark, and the crossing speed of the target object when crossing the traffic judgment line can be determined according to the moving speed information, and only the crossing speed meets the preset requirements The information of the target object can become effective data in the passenger flow data. Therefore, the passenger flow data in the target area can be determined more accurately according to the key point information, moving speed information, and discriminant signs.
示例性地,可以通过如下步骤确定目标区域的客流数据:首先,针对每个所述目标对象,基于所述目标对象对应的至少一个关键点的第一位置信息和所述流量判别线的第二位置信息,确定所述目标对象对应的跨线结果信息;该跨线结果信息用于表征所述目标对象是否跨越所述流量判别线。之后,基于所述多个目标对象对应的跨线结果信息和所述移动速度信息,确定所述目标区域的客流数据。Exemplarily, the passenger flow data of the target area can be determined through the following steps: first, for each target object, based on the first position information of at least one key point corresponding to the target object and the second position information of the flow discrimination line The position information is used to determine the line-crossing result information corresponding to the target object; the line-crossing result information is used to indicate whether the target object crosses the flow judgment line. Afterwards, passenger flow data in the target area is determined based on the line-crossing result information corresponding to the multiple target objects and the moving speed information.
在一些实施例中,可以利用目标对象的至少一组相对关键点对应的至少一组相对关键点信息来判断目标对象对应的跨线结果信息。例如,相对关键点信息可以包括由目标对象的左脚关键点信息和右脚关键点信息构成的脚部相对关键点信息、目标对象的左膝部关键点信息和右膝部关键点信息构成的膝部相对关键点信息、目标对象的左腿部关键点信息和右腿部关键点信息构成的腿部相对关键点信息中的至少一项。上述相对关键点信息至少包括对应关键点的位置信息,例如,目标对象的脚部相对关键点信息至少包括目标对象的左脚关键点的第一位置信息和右脚关键点的第一位置信息;再例如,目标对象的膝部相对关键点信息至少包括目标对象的左膝盖关键点的第一位置信息和右膝盖关键点的第一位置信息。In some embodiments, at least one set of relative key point information corresponding to at least one set of relative key points of the target object may be used to determine the line-crossing result information corresponding to the target object. For example, the relative key point information may include the relative key point information of the foot composed of the key point information of the left foot and the key point information of the right foot of the target object, and the key point information of the left knee and the key point information of the right knee of the target object. At least one item of the relative key point information of the leg formed by the relative key point information of the knee, the key point information of the target object's left leg, and the key point information of the right leg. The above relative key point information includes at least the position information of the corresponding key point, for example, the relative key point information of the target object’s foot includes at least the first position information of the target object’s left foot key point and the first position information of the right foot key point; For another example, the relative knee key point information of the target object includes at least the first position information of the left knee key point and the first position information of the right knee key point of the target object.
上述脚步关键点、膝部关键点或者腿部关键点这些关键点的位置信息能够较为准确地表征目标对象的位置,这样,根据这些关键点能够较为准确地确定目标对象是否跨越了流量判别线。The position information of the key points of footsteps, knees, or legs can more accurately represent the position of the target object, so that it can be more accurately determined whether the target object has crossed the flow discrimination line according to these key points.
在具体实施时,可以利用如下方法确定目标对象对应的跨线结果信息:在基于所述第一位置信息和所述第二位置信息,确定存在对应的两个关键点的连线与所述流量判别线相交的至少一组相对关键点信息的情况下,确定所述跨线结果信息包括所述目标对象跨越所述流量判别线的信息。During specific implementation, the following method can be used to determine the cross-line result information corresponding to the target object: based on the first position information and the second position information, it is determined that there are two corresponding key points between the line and the flow rate In the case of at least one set of relative key point information intersected by the judgment line, it is determined that the line-crossing result information includes information that the target object crosses the flow judgment line.
某一组相对关键点的连线与流量判别线相交,表示目标对象跨越了流量判别线,此时需要将跨线结果信息设置为包括指示目标对象跨越流量判别线的信息,这样,得到的跨线结果信息更加准确。The connection line of a certain group of relative key points intersects the flow discrimination line, which means that the target object has crossed the flow discrimination line. At this time, it is necessary to set the cross-line result information to include information indicating that the target object crosses the flow discrimination line. Line result information is more accurate.
在一些实施例中,还可以利用单独一个关键点来确定目标对象对应的跨线结果信息。具体地,在所述目标对象的至少一个关键点的第一位置信息与所述第二位置信息相匹配的情况下,确定所述跨线结果信息包括指示该目标对象跨越所述流量判别线的信息。上述相匹配具体可以为关键点的第一位置信息与所述第二位置信息相同,此时可以表示目标对象的一个关键点位于流量判别线上,即目标对象位于流量判别线上,此时认为目标对象跨越流量判别线。In some embodiments, a single key point can also be used to determine the line-crossing result information corresponding to the target object. Specifically, in the case that the first position information of at least one key point of the target object matches the second position information, determining the line crossing result information includes indicating that the target object crosses the flow judgment line information. The above matching can specifically be that the first position information of the key point is the same as the second position information. At this time, it can indicate that a key point of the target object is located on the flow discrimination line, that is, the target object is located on the flow discrimination line. At this time, it is considered The target object crosses the flow discrimination line.
在某一关键点在流量判别线上时,表示目标对象跨越了流量判别线,此时需要将跨线结果信息设置为包括指示目标对象跨越流量判别线的信息,这样,得到的跨线结果信息更加准确。When a certain key point is on the flow discrimination line, it means that the target object has crossed the flow discrimination line. At this time, it is necessary to set the cross-line result information to include information indicating that the target object crosses the flow judgment line. In this way, the obtained cross-line result information more precise.
在上述跨线结果信息和移动速度信息的基础上,还可以进一步结合目标对象的移动方向信息,来确定所述目标区域的客流数据,这样能够进一步准确地确定目标对象是进入目标区域,还是离开目标区域,从而得到更加细致的客流数据。On the basis of the above-mentioned cross-line result information and moving speed information, the passenger flow data of the target area can be determined in combination with the moving direction information of the target object, so that it can be further accurately determined whether the target object enters the target area or leaves Target area, so as to get more detailed passenger flow data.
上述移动方向信息可以根据上述视频片段来确定,例如从视频片段中确定目标对象对应的目标图像序列,并确定目标对象在该目标图像序列的任意两帧目标图像中的位置,之后根据此两帧目标图像的拍摄时间间隔,可以确定目标对象在此两帧目标图像的拍摄时间间隔内的移动方向。这里的任意两帧目标图像可以是目标图像序列中的两帧相邻的图像。以这种方式,可以从目标图像序列中多次选择任意两帧目标图像,并获得相对应的多个移动方向。基于多个移动方向,可以确定上述移动方向信息。示例性地,可以直接将多个移动方向作为上述移动方向信息。可见,根据上述移动方向信息能够确定目标对象在跨越流量判别线时的移动方向。The above-mentioned moving direction information can be determined according to the above-mentioned video clips, such as determining the target image sequence corresponding to the target object from the video clip, and determining the position of the target object in any two frames of the target image in the target image sequence, and then according to the two frames The shooting time interval of the target image can determine the moving direction of the target object within the shooting time interval of the two frames of the target image. Here, any two frames of target images may be two frames of adjacent images in the target image sequence. In this way, any two frames of target images can be selected multiple times from the sequence of target images, and multiple corresponding moving directions can be obtained. Based on a plurality of moving directions, the above-mentioned moving direction information may be determined. Exemplarily, multiple moving directions may be directly used as the moving direction information. It can be seen that, according to the above moving direction information, the moving direction of the target object when it crosses the flow determination line can be determined.
在一些实施例中,如图2所示,上述基于所述多个目标对象对应的跨线结果信息、所述移动速度信息和所述移动方向信息,确定所述目标区域的客流数据,具体可以利用如下步骤实现:In some embodiments, as shown in FIG. 2, the passenger flow data in the target area is determined based on the cross-line result information corresponding to the multiple target objects, the moving speed information, and the moving direction information. Specifically, Use the following steps to achieve:
S210,从多个目标对象中,筛选所述跨线结果信息指示跨越所述流量判别线、所述移动方向信息指示跨越所述流量判别线时的移动方向为进入所述目标区域、所述移动速度信息指示的速度大于第一预设速度的第一对象;将所述第一对象的数量作为进入所述目标区域的目标对象的第一数量;S210. From a plurality of target objects, filter the line-crossing result information indicating crossing the traffic judging line, and the moving direction information indicating that the moving direction when crossing the traffic judging line is entering the target area, the moving direction the first object whose speed indicated by the speed information is greater than the first preset speed; taking the number of the first object as the first number of target objects entering the target area;
S220,从所述多个目标对象中,筛选所述跨线结果信息指示跨越所述流量判别线、所述移动方向信息指示跨越所述流量判别线时的移动方向为离开所述目标区域、所述移动速度信息指示的速度大于第二预设速度的第二对象;将所述第二对象的数量作为离开所述目标区域的目标对象的第二数量;S220. From the plurality of target objects, filter the line-crossing result information indicating crossing the traffic judging line, and the moving direction information indicating that the moving direction when crossing the traffic judging line is to leave the target area, a second object whose speed indicated by the moving speed information is greater than a second preset speed; taking the number of the second object as the second number of target objects leaving the target area;
S230,基于所述第一数量和所述第二数量,确定第三数量;示例性地,计算第一数量和第二数量的差值,并将该差值作为第三数量,这里的第三数量为当前停留在所述目标区域的目标对象的数量;S230. Determine a third quantity based on the first quantity and the second quantity; for example, calculate the difference between the first quantity and the second quantity, and use the difference as the third quantity, here the third The number is the number of target objects currently staying in the target area;
S240,将上述第一数量、第二数量和第三数量作为上述所述目标区域的客流数据。S240, using the first quantity, the second quantity and the third quantity as the passenger flow data of the target area.
根据跨线结果信息、所述移动速度信息和所述移动方向信息,能够较为准确地筛选出离开目标区域的目标对象的数量、进入目标区域的目标对象的数量以及当前停留在目标区域的目标对象的数量,有效提高了确定的客流数据的准确性。According to the line-crossing result information, the moving speed information and the moving direction information, the number of target objects leaving the target area, the number of target objects entering the target area, and the target objects currently staying in the target area can be more accurately screened out The quantity effectively improves the accuracy of the determined passenger flow data.
在一些实施例中,上述对所述多帧目标图像中的每帧目标图像进行对象识别和追踪, 得到多个目标对象,具体可以利用如下步骤实现:In some embodiments, the above object recognition and tracking are performed on each frame of the target image in the multiple frames of the target image to obtain multiple target objects, which can be specifically implemented by the following steps:
首先分别对所述多帧目标图像进行对象识别,得到多个对象检测框;其中,每个对象检测框分别对应一个对象;之后,确定分别属于两帧相邻的目标图像的对象检测框之间的重叠度,并在所述重叠度大于预设值的情况下,确定所述分别属于两帧相邻的目标图像的对象检测框对应同一个对象,并将所述对象作为目标对象。First, object recognition is performed on the multi-frame target images respectively to obtain a plurality of object detection frames; wherein, each object detection frame corresponds to an object; after that, it is determined between object detection frames belonging to two adjacent frames of target images respectively degree of overlap, and when the degree of overlap is greater than a preset value, it is determined that the object detection frames belonging to two frames of adjacent target images correspond to the same object, and the object is taken as the target object.
在具体实施时,还可以确定分别属于任两帧拍摄时间相隔较短的目标图像的两个对象检测框之间的重叠度,并在所述重叠度大于预设值的情况下,确定该两个对象检测框对应的两个对象为同一个对象,并将所述对象作为目标对象。During specific implementation, it is also possible to determine the degree of overlap between two object detection frames that belong to target images with a shorter shooting time interval between any two frames, and if the degree of overlap is greater than a preset value, determine the degree of overlap between the two The two objects corresponding to the object detection frames are the same object, and the object is used as the target object.
根据两个对象检测框之间的重叠度能够较为准确地确定两个对象检测框对应的对象是否为同一个对象,即能够较为准确地进行对象追踪。Whether the objects corresponding to the two object detection frames are the same object can be determined more accurately according to the degree of overlap between the two object detection frames, that is, object tracking can be performed more accurately.
这里的重叠度具体可是两个对象检测框的交并比。The degree of overlap here is specifically the intersection and union ratio of two object detection frames.
在一些实施例中,如果在预设时间内未追踪到某一目标对象,确定该目标对象追踪失败。对于一定时间内未检测到的目标对象,大概率追踪失败了,此时可以将这类目标对象设置为追踪失败,以提高对象追踪的准确性。In some embodiments, if a certain target object is not tracked within a preset time, it is determined that the target object has failed to be tracked. For a target object that has not been detected within a certain period of time, there is a high probability that the tracking will fail. At this time, such target objects can be set as tracking failure to improve the accuracy of object tracking.
在第一次确定某一个目标对象之后,会为该目标对象设置对象标识,对于追踪失败的目标对象,该目标对象的对象标识不会被分配给后续检测到的其他目标对象。After a certain target object is determined for the first time, an object identifier will be set for the target object. For a target object that fails to be tracked, the object identifier of the target object will not be assigned to other target objects detected subsequently.
在一些实施例中,上述判别标志不仅包括流量判别线,还可以包括预设判别框。此时,上述分别对所述多帧目标图像中的每帧目标图像进行对象识别和追踪,得到多个目标对象,具体可以利用如下步骤实现:In some embodiments, the above-mentioned judging signs include not only flow judging lines, but also preset judging boxes. At this time, the above-mentioned object recognition and tracking are respectively performed on each frame of the target image in the multi-frame target images to obtain a plurality of target objects, which can be specifically implemented by using the following steps:
基于所述预设判别框的第三位置信息,分别对多帧目标图像中对应于所述预设判别框的图像区域进行对象识别,并对所述视频片段中对应于所述预设判别框的图像区域中出现的多个对象分别进行追踪,得到多个目标对象;其中所述流量判别线至少部分位于所述预设判别框内。Based on the third position information of the preset judgment frame, object recognition is performed on image regions corresponding to the preset judgment frame in multiple frames of target images, and object recognition is performed on the video clips corresponding to the preset judgment frame Multiple objects appearing in the image area of the image area are respectively tracked to obtain multiple target objects; wherein the flow determination line is at least partially located within the preset determination frame.
在具体实施时,可以根据预设判别框的第三位置信息,从目标图像中截取对应的子图像,对由多帧子图像按照拍摄时间排序所形成的子图像序列进行对象识别和追踪,得到多个目标对象。In specific implementation, according to the third position information of the preset discrimination frame, the corresponding sub-image can be intercepted from the target image, and the sub-image sequence formed by sorting the sub-images of multiple frames according to the shooting time is subjected to object recognition and tracking, and the obtained multiple target audiences.
只对预设判别框内的对象进行识别、追踪,能够有效减少数据处理的数量,提高效率和准确性。Recognizing and tracking only objects within the preset discrimination frame can effectively reduce the amount of data processing and improve efficiency and accuracy.
上述预设判别框和流量判别线是通过对拍摄上述视频片段的拍摄装置进行标定之后确定的。预设判别框可以是矩形等规则形状的框,也可以是不规则形状的框,本申请对此并不进行限定。在设置预设判别框时需要保证进入或离开目标区域的对象的上半身位于框内部,以提高对象识别、追踪以及客流数据统计的准确性。The above-mentioned preset judgment frame and flow judgment line are determined after calibrating the shooting device that shoots the above-mentioned video clip. The preset discrimination frame may be a frame of regular shape such as a rectangle, or a frame of irregular shape, which is not limited in this application. When setting the preset discrimination frame, it is necessary to ensure that the upper body of the object entering or leaving the target area is inside the frame, so as to improve the accuracy of object recognition, tracking and passenger flow data statistics.
示例性地,图3示出了本公开实施例所提供的一种进行客流统计的区域示意图。如图3所示,目标区域的出入口区域用310标识,在出入口区域310中设置了预设判别框320,本公开实施例只对出现在预设判别框内的对象进行识别、追踪。流量判别线330至少部分位于所述预设判别框320内。对客流数据的统计,需要根据追踪到的目标对象是否跨越流量判别线330来进行。具体地,如图3所示,目标对象350的某一组相对关键点(比如,脚掌中点作为关键点,那么这一组相对关键点可以是目标对象350的双脚中点)的连线370与流量判别线330相交,此时认为目标对象350跨越流量判别线330;另一目标对象360的某一个关键点位于流量判别线330上,此时也认为另一目标对象360跨越流量判别线330。Exemplarily, FIG. 3 shows a schematic diagram of an area for performing passenger flow statistics provided by an embodiment of the present disclosure. As shown in FIG. 3 , the entrance and exit area of the target area is marked with 310 , and a preset judgment box 320 is set in the entrance and exit area 310 , and the embodiment of the present disclosure only recognizes and tracks objects appearing in the preset judgment box. The flow judgment line 330 is at least partially located within the preset judgment box 320 . The statistics of passenger flow data need to be carried out according to whether the tracked target object crosses the flow judgment line 330 . Specifically, as shown in FIG. 3 , a certain group of relative key points of the target object 350 (for example, if the midpoint of the sole of the sole is used as a key point, then this group of relative key points can be the midpoint of both feet of the target object 350) 370 intersects the flow discrimination line 330, at this time, the target object 350 is considered to cross the flow discrimination line 330; a certain key point of another target object 360 is located on the flow discrimination line 330, and at this time, another target object 360 is also considered to cross the flow discrimination line 330.
进一步地,若追踪结果显示同一目标对象在不同时刻分别为目标对象350和目标对象360,则可以根据拍摄目标对象350所属图像的时间和拍摄目标对象360所属图像的时间,确定目标对象的移动方向信息。例如,若拍摄目标对象350所属图像的时间早于拍摄目标对象360所属图像的时间,则确定目标对象的移动方向信息指示目标对象跨越所述流量判别线时的移动方向为进入所述目标区域。若进一步根据拍摄目标对象350所属图像的时间和拍摄目标对象360所属图像的时间确定的目标对象的移动速度信息指示的速度大于第一预设速度,则确定目标对象为进入目标区域的对象(即上述第一对象)。根据统计到的该类目标对象的数量即可确定上述第一数量,即进入目标区域的对象的数量。Further, if the tracking results show that the same target object is the target object 350 and the target object 360 at different times, the moving direction of the target object can be determined according to the time when the image to which the target object 350 belongs and the time when the image to which the target object 360 is captured information. For example, if the time to capture the image of the target object 350 is earlier than the time to capture the image of the target object 360 , it is determined that the moving direction information of the target object indicates that the moving direction of the target object when crossing the flow determination line is to enter the target area. If the speed indicated by the moving speed information of the target object determined according to the time when the image to which the target object 350 belongs and the time when the image to which the target object 360 belongs is determined to be greater than the first preset speed, then it is determined that the target object is an object entering the target area (i.e. the first object above). The above-mentioned first quantity, that is, the quantity of objects entering the target area, can be determined according to the counted quantity of this type of target objects.
进一步地,若拍摄目标对象350所属图像的时间晚于拍摄目标对象360所属图像的时间,则确定目标对象的移动方向信息指示目标对象跨越所述流量判别线时的移动方向为离开所述目标区域。若进一步根据拍摄目标对象350所属图像的时间和拍摄目标对象360所属图像的时间确定的目标对象的移动速度信息所指示的速度大于第二预设速度,则确定目标对象为离开目标区域的对象(即上述第二对象)。根据统计到的该类目标对象的数量即可确定上述第二数量,即离开目标区域的对象的数量。Further, if the time of shooting the image to which the target object 350 belongs is later than the time of shooting the image to which the target object 360 belongs, it is determined that the moving direction information of the target object indicates that the moving direction of the target object when it crosses the flow judgment line is to leave the target area . If the speed indicated by the moving speed information of the target object determined according to the time when the image to which the target object 350 belongs and the time when the image to which the target object 360 belongs is determined to be greater than the second preset speed, then it is determined that the target object is an object leaving the target area ( i.e. the second object above). The above-mentioned second quantity, that is, the quantity of objects leaving the target area, can be determined according to the counted quantity of this type of target objects.
在进行客流数据统计之前还需要确定进入目标区域的第一方向和离开目标区域的第二方向,该第一方向与第二方向用于确定目标对象在跨越流量判别线时的移动方向是进入目标区域还是离开目标区域。Before carrying out passenger flow data statistics, it is also necessary to determine the first direction of entering the target area and the second direction of leaving the target area. The first direction and the second direction are used to determine the moving direction of the target object when crossing the flow judgment line. area or away from the target area.
在确定所述第一对象、第二对象之后,还可以将所述第一对象进入所述目标区域的时间、所述第二对象离开所述目标区域的时间、所述第一对象进入所述目标区域的进入标识信息、所述第二对象离开所述目标区域的离开标识信息、所述流量判别线的第二位置信息、所述流量判别线的标识、视频片段、每个目标对象对应的目标图像序列中的至少一种发送给远端服务器,以通过远端服务器实现对目标区域进行客流统计。After determining the first object and the second object, the time when the first object enters the target area, the time when the second object leaves the target area, and the time when the first object enters the target area can also be calculated. The entry identification information of the target area, the exit identification information of the second object leaving the target area, the second position information of the flow judgment line, the identification of the flow judgment line, video clips, and the corresponding At least one of the target image sequences is sent to the remote server, so as to realize passenger flow counting in the target area through the remote server.
将进入目标区域的对象的进入时间、进入标识等信息,离开目标区域的对象的离开时间、离开标识等信息传送给远端服务器,能够通过远端服务器提高客流统计的准确性。The information such as the entry time and entry sign of objects entering the target area, and the departure time and exit sign of objects leaving the target area are transmitted to the remote server, which can improve the accuracy of passenger flow statistics through the remote server.
本公开的上述实施例的方法还可以是由拍摄视频片段的拍摄装置来执行,本公开对上述实施例的方法的执行主体并不进行限定。The methods in the above embodiments of the present disclosure may also be executed by a shooting device that shoots video clips, and the present disclosure does not limit the execution subject of the methods in the above embodiments.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the above method of specific implementation, the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process. The specific execution order of each step should be based on its function and possible The inner logic is OK.
基于同一发明构思,本公开实施例中还提供了获取客流数据的方法对应的获取客流数据的装置,由于本公开实施例中的装置解决问题的原理与本公开实施例上述获取客流数据的方法相似,因此装置的实施可以参见方法的实施,重复之处不再赘述。Based on the same inventive concept, the embodiment of the present disclosure also provides a device for obtaining passenger flow data corresponding to the method for obtaining passenger flow data, because the problem-solving principle of the device in the embodiment of the present disclosure is similar to the above-mentioned method for obtaining passenger flow data in the embodiment of the present disclosure , so the implementation of the device can refer to the implementation of the method, and the repetition will not be repeated.
参照图4,图4所示为本公开实施例提供的一种获取客流数据的装置的结构示意图,所述装置包括信息获取模块410、信息处理模块420和客流统计模块430。Referring to FIG. 4 , FIG. 4 is a schematic structural diagram of a device for obtaining passenger flow data provided by an embodiment of the present disclosure. The device includes an information obtaining module 410 , an information processing module 420 and a passenger flow statistics module 430 .
信息获取模块410用于获取对目标区域进行拍摄得到的视频片段,以及判别标志;所述视频片段包括多帧目标图像;所述目标图像包括所述目标区域的出入口区域。The information acquiring module 410 is used to acquire video clips obtained by shooting the target area and identification marks; the video clips include multiple frames of target images; the target images include the entrance and exit areas of the target area.
信息处理模块420用于分别对所述多帧目标图像中的每帧目标图像进行对象识别和追踪,得到多个目标对象、所述多个目标对象分别对应的关键点信息和移动速度信息。The information processing module 420 is configured to perform object recognition and tracking on each frame of the target images in the multiple frames of target images, and obtain multiple target objects, key point information and moving speed information respectively corresponding to the multiple target objects.
其中,所述关键点信息用于表征所述目标对象在所述目标对象所属目标图像中的位置;所述移动速度信息用于表征所述目标对象在由所述目标对象所属目标图像组成的目标图像序列中的移动速度。Wherein, the key point information is used to represent the position of the target object in the target image to which the target object belongs; the moving speed information is used to represent the position of the target object in the target image composed of the target object to which the target object belongs. The speed of movement in the image sequence.
客流统计模块430用于基于所述多个目标对象分别对应的所述关键点信息和所述移动速度信息,以及所述判别标志,确定所述目标区域的客流数据。The passenger flow counting module 430 is configured to determine passenger flow data in the target area based on the key point information and the moving speed information respectively corresponding to the plurality of target objects, and the discriminant flag.
在一些实施例中,所述关键点信息包括表示目标对象的至少一个关键点在所述目标对象所属目标图像中的位置的第一位置信息;所述判别标志包括流量判别线;In some embodiments, the key point information includes first position information indicating the position of at least one key point of the target object in the target image to which the target object belongs; the discrimination mark includes a flow discrimination line;
其中,所述客流统计模块430在基于所述多个目标对象分别对应的所述关键点信息和所述移动速度信息,以及所述判别标志,确定所述目标区域的所述客流数据时,用于:Wherein, when the passenger flow statistics module 430 determines the passenger flow data in the target area based on the key point information and the moving speed information respectively corresponding to the multiple target objects, and the discrimination flag, At:
针对所述多个目标对象中的每个目标对象,基于所述目标对象对应的所述至少一个关键点的所述第一位置信息和所述流量判别线的第二位置信息,确定所述目标对象对应的跨线结果信息;所述跨线结果信息用于表征所述目标对象是否跨越所述流量判别线;For each of the plurality of target objects, based on the first position information of the at least one key point corresponding to the target object and the second position information of the flow discrimination line, determine the target Line-crossing result information corresponding to the object; the line-crossing result information is used to represent whether the target object crosses the flow discrimination line;
基于所述多个目标对象对应的所述跨线结果信息和所述移动速度信息,确定所述目标区域的所述客流数据。The passenger flow data in the target area is determined based on the line crossing result information and the moving speed information corresponding to the multiple target objects.
在一些实施例中,每个目标对象的关键点包括至少一组相对关键点,所述关键点信息包括所述至少一组相对关键点对应的至少一组相对关键点信息,其中,所述相对关键点信息包括由所述目标对象的左脚关键点信息和右脚关键点信息构成的脚部关相对键点信息、由所述目标对象的左膝部关键点信息和右膝部关键点信息构成的膝部相对关键点信息、由所述目标对象的左腿部关键点信息和右腿部关键点信息构成的腿部相对关键点信息中的至少一项。In some embodiments, the key points of each target object include at least one set of relative key points, and the key point information includes at least one set of relative key point information corresponding to the at least one set of relative key points, wherein the relative key points The key point information includes the relative key point information of the foot which is composed of the key point information of the left foot and the key point information of the right foot of the target object, the key point information of the left knee and the key point information of the right knee of the target object At least one item of the knee relative key point information, and the leg relative key point information composed of the target object's left leg key point information and right leg key point information.
在一些实施例中,所述客流统计模块430在基于所述目标对象对应的所述至少一个关键点的所述第一位置信息和所述流量判别线的所述第二位置信息,确定所述目标对象对应的所述跨线结果信息时,用于:In some embodiments, the passenger flow statistics module 430 determines the When the cross-line result information corresponding to the target object is used for:
在基于所述第一位置信息和所述第二位置信息,确定存在对应的两个关键点的连线与所述流量判别线相交的至少一组相对关键点信息的情况下,确定所述跨线结果信息包括表示所述目标对象跨越所述流量判别线的信息。When it is determined based on the first position information and the second position information that there is at least one set of relative key point information in which a line connecting two corresponding key points intersects the flow discrimination line, determine the cross The line result information includes information indicating that the target object crosses the traffic determination line.
在一些实施例中,所述客流统计模块430在基于所述目标对象对应的所述至少一个关键点的所述第一位置信息和所述流量判别线的所述第二位置信息,确定所述目标对象对应的所述跨线结果信息时,用于:In some embodiments, the passenger flow statistics module 430 determines the When the cross-line result information corresponding to the target object is used for:
在所述目标对象的所述至少一个关键点的所述第一位置信息与所述第二位置信息相匹配的情况下,确定所述跨线结果信息包括表示该目标对象跨越所述流量判别线的信息。If the first position information of the at least one key point of the target object matches the second position information, determining the line crossing result information includes indicating that the target object crosses the flow judgment line Information.
在一些实施例中,所述客流统计模块430在基于所述多个目标对象对应的所述跨线结果信息和所述移动速度信息,确定所述目标区域的所述客流数据时,用于:In some embodiments, when determining the passenger flow data in the target area based on the cross-line result information and the moving speed information corresponding to the multiple target objects, the passenger flow statistics module 430 is configured to:
基于所述视频片段,确定所述目标对象的移动方向信息;determining moving direction information of the target object based on the video clip;
基于所述多个目标对象对应的所述跨线结果信息、所述移动速度信息和所述移动方向信息,确定所述目标区域的所述客流数据。The passenger flow data in the target area is determined based on the line-crossing result information, the moving speed information, and the moving direction information corresponding to the multiple target objects.
在一些实施例中,所述客流数据包括进入所述目标区域的目标对象的第一数量;In some embodiments, the traffic data includes a first number of target objects entering the target area;
其中,所述客流统计模块430在基于所述多个目标对象对应的所述跨线结果信息、所述移动速度信息和所述移动方向信息,确定所述目标区域的所述客流数据时,用于:Wherein, when the passenger flow statistics module 430 determines the passenger flow data in the target area based on the cross-line result information, the moving speed information, and the moving direction information corresponding to the multiple target objects, it uses At:
从所述多个目标对象中,筛选所述跨线结果信息指示跨越所述流量判别线、所述移动方向信息指示跨越所述流量判别线时的移动方向为进入所述目标区域、所述移动速度信息指示的速度大于第一预设速度的第一对象;From the plurality of target objects, filtering the line-crossing result information indicates crossing the traffic judging line, and the moving direction information indicates that the moving direction when crossing the traffic judging line is entering the target area, the moving direction a first object whose speed indicated by the speed information is greater than a first preset speed;
将所述第一对象的数量作为所述第一数量。The quantity of the first object is used as the first quantity.
在一些实施例中,所述客流数据包括离开所述目标区域的目标对象的第二数量;In some embodiments, the traffic data includes a second number of target objects leaving the target area;
其中,所述客流统计模块430在基于所述多个目标对象对应的所述跨线结果信息、所述移动速度信息和所述移动方向信息,确定所述目标区域的所述客流数据时,用于:Wherein, when the passenger flow statistics module 430 determines the passenger flow data in the target area based on the cross-line result information, the moving speed information, and the moving direction information corresponding to the multiple target objects, it uses At:
从所述多个目标对象中,筛选所述跨线结果信息指示跨越所述流量判别线、所述移动方向信息指示跨越所述流量判别线时的移动方向为离开所述目标区域、所述移动速度信息指示的速度大于第二预设速度的第二对象;From the plurality of target objects, filter the line-crossing result information indicating crossing the traffic judging line, and the moving direction information indicating that the moving direction when crossing the traffic judging line is to leave the target area, the moving direction a second object whose speed indicated by the speed information is greater than a second preset speed;
将所述第二对象的数量作为所述第二数量。The quantity of the second object is used as the second quantity.
在一些实施例中,所述客流数据包括当前停留在所述目标区域的目标对象的第三数量;In some embodiments, the traffic data includes a third number of target objects currently staying in the target area;
其中,所述客流统计模块430在基于所述多个目标对象对应的所述跨线结果信息、所述移动速度信息和所述移动方向信息,确定所述目标区域的所述客流数据时,用于:Wherein, when the passenger flow statistics module 430 determines the passenger flow data in the target area based on the cross-line result information, the moving speed information, and the moving direction information corresponding to the multiple target objects, it uses At:
基于第一数量和第二数量,确定所述第三数量;determining the third quantity based on the first quantity and the second quantity;
其中,所述第一数量为所述多个目标对象中所述跨线结果信息指示跨越所述流量判别线、所述移动方向信息指示跨越所述流量判别线时的移动方向为进入所述目标区域、所述移动速度信息指示的速度大于第一预设速度的第一对象的数量;Wherein, the first quantity is that the line-crossing result information in the plurality of target objects indicates that the flow judgment line is crossed, and the moving direction information indicates that the moving direction when crossing the flow judgment line is to enter the target area, the number of first objects whose speed indicated by the moving speed information is greater than a first preset speed;
所述第二数量为所述多个目标对象中所述跨线结果信息指示跨越所述流量判别线、所述移动方向信息指示跨越所述流量判别线时的移动方向为离开所述目标区域、所述移动速度信息指示的速度大于第二预设速度的第二对象的数量。The second quantity is that the line-crossing result information in the plurality of target objects indicates that the flow judgment line is crossed, the moving direction information indicates that the moving direction when crossing the flow judgment line is to leave the target area, The moving speed information indicates the number of second objects whose speed is greater than a second preset speed.
在一些实施例中,所述信息处理模块420在分别对所述多帧目标图像中的每帧目标图像进行对象识别和追踪,得到所述多个目标对象时,用于:In some embodiments, when the information processing module 420 performs object recognition and tracking on each frame of target images in the multiple frames of target images to obtain the multiple target objects, it is used to:
分别对所述多帧目标图像进行对象识别,得到多个对象检测框;其中,每个对象检测框对应一个对象;Respectively performing object recognition on the multi-frame target images to obtain a plurality of object detection frames; wherein, each object detection frame corresponds to an object;
确定分别属于两帧相邻的目标图像中的对象检测框之间的重叠度,并在所述重叠度大于预设值的情况下,确定所述分别属于两帧相邻的目标图像中的对象检测框对应同一个对象,并将所述对象作为目标对象。Determining the degree of overlap between the object detection frames respectively belonging to two adjacent frames of target images, and in the case that the degree of overlap is greater than a preset value, determining the objects respectively belonging to two frames of adjacent target images The detection boxes correspond to the same object, and the object is used as the target object.
在一些实施例中,所述信息处理模块420在得到所述多个目标对象之后,还用于:In some embodiments, after obtaining the multiple target objects, the information processing module 420 is further configured to:
针对所述多个目标对象中的每个目标对象,在预设时间内未追踪到所述目标对象的情况下,确定所述目标对象追踪失败。For each target object among the plurality of target objects, if the target object is not tracked within a preset time, it is determined that the tracking of the target object fails.
在一些实施例中,所述判别标志包括流量判别线和预设判别框,其中所述流量判别线至少部分位于所述预设判别框内;In some embodiments, the judgment mark includes a flow judgment line and a preset judgment box, wherein the flow judgment line is at least partially located within the preset judgment box;
其中,所述信息处理模块420在分别对所述多帧目标图像中的每帧目标图像进行对象识别和追踪,得到所述多个目标对象时,用于:Wherein, when the information processing module 420 performs object recognition and tracking on each frame of the target image in the multiple frames of target images to obtain the multiple target objects, it is used to:
基于所述预设判别框的第三位置信息,分别对所述多帧目标图像中对应于所述预设判别框的图像区域进行对象识别,并对所述视频片段中对应于所述预设判别框的所述图像区域中出现的多个对象分别进行追踪,得到所述多个目标对象。Based on the third position information of the preset judgment frame, perform object recognition on image regions corresponding to the preset judgment frame in the multi-frame target images, and perform object recognition on the video clips corresponding to the preset judgment frame Multiple objects appearing in the image area of the discrimination frame are respectively tracked to obtain the multiple target objects.
在一些实施例中,客流统计模块430在确定所述第一对象、所述第二对象之后,还用于:In some embodiments, after the passenger flow counting module 430 determines the first object and the second object, it is further configured to:
向远端服务器发送所述第一对象进入所述目标区域的时间、所述第二对象离开所 述目标区域的时间、所述第一对象进入所述目标区域的进入标识信息、所述第二对象离开所述目标区域的离开标识信息、所述流量判别线的所述第二位置信息中的至少一种,以通过所述远端服务器实现对所述目标区域进行客流统计。sending the time when the first object enters the target area, the time when the second object leaves the target area, the entry identification information of the first object entering the target area, and the second object to the remote server. At least one of the departure identification information of the object leaving the target area and the second position information of the flow judgment line, so as to implement passenger flow statistics for the target area through the remote server.
基于同一技术构思,本公开实施例还提供了一种电子设备。参照图5所示,为本公开实施例提供的电子设备500的结构示意图,包括处理器51、存储器52、和总线53。其中,存储器52用于存储执行指令,包括内存521和外部存储器522;这里的内存521也称内存储器,用于暂时存放处理器51中的运算数据,以及与硬盘等外部存储器522交换的数据,处理器51通过内存521与外部存储器522进行数据交换。Based on the same technical idea, an embodiment of the present disclosure also provides an electronic device. Referring to FIG. 5 , it is a schematic structural diagram of an electronic device 500 provided by an embodiment of the present disclosure, including a processor 51 , a memory 52 , and a bus 53 . Wherein, the memory 52 is used to store execution instructions, including a memory 521 and an external memory 522; the memory 521 here is also called an internal memory, and is used to temporarily store the calculation data in the processor 51 and the data exchanged with the external memory 522 such as a hard disk, The processor 51 exchanges data with the external memory 522 through the memory 521 .
当电子设备500运行时,处理器51与存储器52之间通过总线53通信,使得处理器51在执行指令时执行以下操作:获取对目标区域进行拍摄得到的视频片段,以及判别标志;所述视频片段包括多帧目标图像;所述目标图像包括所述目标区域的出入口区域;分别对所述多帧目标图像中的每帧目标图像进行对象识别和追踪,得到多个目标对象、所述多个目标对象分别对应的关键点信息和移动速度信息;其中,所述关键点信息用于表征所述目标对象在所述目标对象所属目标图像中的位置;所述移动速度信息用于表征所述目标对象在由所述目标对象所属目标图像组成的目标图像序列中的移动速度;基于所述多个目标对象分别对应的所述关键点信息和所述移动速度信息,以及所述判别标志,确定所述目标区域的客流数据。When the electronic device 500 is running, the processor 51 communicates with the memory 52 through the bus 53, so that the processor 51 performs the following operations when executing the instructions: acquire the video segment obtained by shooting the target area, and identify the mark; The segment includes a multi-frame target image; the target image includes an entrance and exit area of the target area; object recognition and tracking are performed on each frame of the target image in the multi-frame target image, and multiple target objects, the multiple Key point information and moving speed information respectively corresponding to the target object; wherein, the key point information is used to characterize the position of the target object in the target image to which the target object belongs; the moving speed information is used to characterize the target The moving speed of the object in the target image sequence composed of the target images to which the target object belongs; based on the key point information and the moving speed information respectively corresponding to the multiple target objects, and the discriminant flag, determine the Passenger flow data in the target area.
本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述方法实施例中所述的获取客流数据的方法的步骤。其中,该存储介质可以是易失性或非易失的计算机可读取存储介质。An embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the steps of the method for obtaining passenger flow data described in the above-mentioned method embodiments are executed . Wherein, the storage medium may be a volatile or non-volatile computer-readable storage medium.
本公开实施例所提供的获取客流数据的方法的计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令可用于执行上述方法实施例中所述的获取客流数据的方法的步骤,具体可参见上述方法实施例,在此不再赘述。该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。The computer program product of the method for obtaining passenger flow data provided by the embodiments of the present disclosure includes a computer-readable storage medium storing program codes, and the instructions included in the program code can be used to execute the method for obtaining passenger flow data described in the above method embodiments For the steps of the method, refer to the above-mentioned method embodiment for details, and details are not repeated here. The computer program product can be specifically realized by means of hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) etc. wait.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统和装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本公开所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described system and device can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods may be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以 软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present disclosure. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disc and other media that can store program codes. .
最后应说明的是:以上所述实施例,仅为本公开的具体实施方式,用以说明本公开的技术方案,而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应所述以权利要求的保护范围为准。Finally, it should be noted that: the above-mentioned embodiments are only specific implementations of the present disclosure, and are used to illustrate the technical solutions of the present disclosure, rather than limit them, and the protection scope of the present disclosure is not limited thereto, although referring to the aforementioned The embodiments have described the present disclosure in detail, and those skilled in the art should understand that any person familiar with the technical field can still modify the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present disclosure Changes can be easily imagined, or equivalent replacements can be made to some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in this disclosure. within the scope of protection. Therefore, the protection scope of the present disclosure should be defined by the protection scope of the claims.

Claims (15)

  1. 一种获取客流数据的方法,其特征在于,包括:A method for obtaining passenger flow data, comprising:
    获取对目标区域进行拍摄得到的视频片段,以及判别标志;所述视频片段包括多帧目标图像;所述目标图像包括所述目标区域的出入口区域;Obtaining a video clip obtained by shooting the target area, and a distinguishing mark; the video clip includes a multi-frame target image; the target image includes an entrance and exit area of the target area;
    分别对所述多帧目标图像中的每帧目标图像进行对象识别和追踪,得到多个目标对象、所述多个目标对象分别对应的关键点信息和移动速度信息;Respectively performing object recognition and tracking on each frame of the target image in the multiple frames of target images to obtain multiple target objects, key point information and moving speed information respectively corresponding to the multiple target objects;
    其中,所述关键点信息用于表征所述目标对象在所述目标对象所属目标图像中的位置;所述移动速度信息用于表征所述目标对象在由所述目标对象所属目标图像组成的目标图像序列中的移动速度;Wherein, the key point information is used to represent the position of the target object in the target image to which the target object belongs; the moving speed information is used to represent the position of the target object in the target image composed of the target object to which the target object belongs. speed of movement in the image sequence;
    基于所述多个目标对象分别对应的所述关键点信息和所述移动速度信息,以及所述判别标志,确定所述目标区域的客流数据。The passenger flow data of the target area is determined based on the key point information and the moving speed information respectively corresponding to the plurality of target objects, and the discriminant marks.
  2. 根据权利要求1所述的方法,其特征在于,所述关键点信息包括表示目标对象的至少一个关键点在所述目标对象所属目标图像中的位置的第一位置信息;所述判别标志包括流量判别线,The method according to claim 1, wherein the key point information includes first position information indicating the position of at least one key point of the target object in the target image to which the target object belongs; judgment line,
    其中,所述基于所述多个目标对象分别对应的所述关键点信息和所述移动速度信息,以及所述判别标志,确定所述目标区域的所述客流数据,包括:Wherein, the determination of the passenger flow data in the target area based on the key point information and the moving speed information respectively corresponding to the plurality of target objects, and the discrimination mark includes:
    针对所述多个目标对象中的每个目标对象,基于所述目标对象对应的所述至少一个关键点的所述第一位置信息和所述流量判别线的第二位置信息,确定所述目标对象对应的跨线结果信息;所述跨线结果信息用于表征所述目标对象是否跨越所述流量判别线;For each of the plurality of target objects, based on the first position information of the at least one key point corresponding to the target object and the second position information of the flow discrimination line, determine the target Line-crossing result information corresponding to the object; the line-crossing result information is used to represent whether the target object crosses the flow discrimination line;
    基于所述多个目标对象对应的所述跨线结果信息和所述移动速度信息,确定所述目标区域的所述客流数据。The passenger flow data in the target area is determined based on the line crossing result information and the moving speed information corresponding to the multiple target objects.
  3. 根据权利要求2所述的方法,其特征在于,每个目标对象的关键点包括至少一组相对关键点,The method according to claim 2, wherein the keypoints of each target object comprise at least one set of relative keypoints,
    所述关键点信息包括所述至少一组相对关键点对应的至少一组相对关键点信息,The key point information includes at least one set of relative key point information corresponding to the at least one set of relative key points,
    其中,所述相对关键点信息包括由所述目标对象的左脚关键点信息和右脚关键点信息构成的脚部相对关键点信息、由所述目标对象的左膝部关键点信息和右膝部关键点信息构成的膝部相对关键点信息、由所述目标对象的左腿部关键点信息和右腿部关键点信息构成的腿部相对关键点信息中的至少一项。Wherein, the relative key point information includes foot relative key point information composed of left foot key point information and right foot key point information of the target object, left knee key point information and right knee key point information of the target object At least one item of knee relative key point information composed of knee key point information, leg relative key point information composed of left leg key point information and right leg key point information of the target object.
  4. 根据权利要求3所述的方法,其特征在于,所述基于所述目标对象对应的所述至少一个关键点的所述第一位置信息和所述流量判别线的所述第二位置信息,确定所述目标对象对应的所述跨线结果信息,包括如下至少一项:The method according to claim 3, wherein, based on the first position information of the at least one key point corresponding to the target object and the second position information of the flow discrimination line, determine The cross-line result information corresponding to the target object includes at least one of the following:
    在基于所述第一位置信息和所述第二位置信息,确定存在对应的两个关键点的连线与所述流量判别线相交的至少一组相对关键点信息的情况下,确定所述跨线结果信息包括表示所述目标对象跨越所述流量判别线的信息;When it is determined based on the first position information and the second position information that there is at least one set of relative key point information in which a line connecting two corresponding key points intersects the flow discrimination line, determine the cross The line result information includes information indicating that the target object crosses the flow judgment line;
    在所述目标对象的所述至少一个关键点的所述第一位置信息与所述第二位置信息相匹配的情况下,确定所述跨线结果信息包括表示所述目标对象跨越所述流量判别线的信息。In the case where the first position information of the at least one key point of the target object matches the second position information, determining the line crossing result information includes indicating that the target object crosses the flow discrimination line information.
  5. 根据权利要求2至4任一项所述的方法,其特征在于,所述基于所述多个目标对象对应的所述跨线结果信息和所述移动速度信息,确定所述目标区域的所述客流数据,包括:The method according to any one of claims 2 to 4, characterized in that, based on the cross-line result information and the moving speed information corresponding to the multiple target objects, the Traffic data, including:
    基于所述视频片段,确定所述目标对象的移动方向信息;determining moving direction information of the target object based on the video clip;
    基于所述多个目标对象对应的所述跨线结果信息、所述移动速度信息和所述移动方向信息,确定所述目标区域的所述客流数据。The passenger flow data in the target area is determined based on the line-crossing result information, the moving speed information, and the moving direction information corresponding to the multiple target objects.
  6. 根据权利要求5所述的方法,其特征在于,所述客流数据包括进入所述目标区域的目标对象的第一数量,The method of claim 5, wherein the traffic data includes a first number of target objects entering the target area,
    其中,所述基于所述多个目标对象对应的所述跨线结果信息、所述移动速度信息和所述移动方向信息,确定所述目标区域的所述客流数据,包括:Wherein, the determination of the passenger flow data in the target area based on the cross-line result information, the moving speed information, and the moving direction information corresponding to the multiple target objects includes:
    从所述多个目标对象中,筛选所述跨线结果信息指示跨越所述流量判别线、所述移动方向信息指示跨越所述流量判别线时的移动方向为进入所述目标区域、所述移动速度信息指示的速度大于第一预设速度的第一对象;From the plurality of target objects, filtering the line-crossing result information indicates crossing the traffic judging line, and the moving direction information indicates that the moving direction when crossing the traffic judging line is entering the target area, the moving direction a first object whose speed indicated by the speed information is greater than a first preset speed;
    将所述第一对象的数量作为所述第一数量。The quantity of the first object is used as the first quantity.
  7. 根据权利要求5或6所述的方法,其特征在于,所述客流数据包括离开所述目标区域的目标对象的第二数量,The method according to claim 5 or 6, wherein the passenger flow data includes a second number of target objects leaving the target area,
    其中,所述基于所述多个目标对象对应的所述跨线结果信息、所述移动速度信息和所述移动方向信息,确定所述目标区域的所述客流数据,包括:Wherein, the determination of the passenger flow data in the target area based on the cross-line result information, the moving speed information, and the moving direction information corresponding to the multiple target objects includes:
    从所述多个目标对象中,筛选所述跨线结果信息指示跨越所述流量判别线、所述移动方向信息指示跨越所述流量判别线时的移动方向为离开所述目标区域、所述移动速度信息指示的速度大于第二预设速度的第二对象;From the plurality of target objects, filter the line-crossing result information indicating crossing the traffic judging line, and the moving direction information indicating that the moving direction when crossing the traffic judging line is to leave the target area, the moving direction a second object whose speed indicated by the speed information is greater than a second preset speed;
    将所述第二对象的数量作为所述第二数量。The quantity of the second object is used as the second quantity.
  8. 根据权利要求5至7中任意一项所述的方法,其特征在于,所述客流数据包括当前停留在所述目标区域的目标对象的第三数量,The method according to any one of claims 5 to 7, wherein the passenger flow data includes a third number of target objects currently staying in the target area,
    其中,所述基于所述多个目标对象对应的所述跨线结果信息、所述移动速度信息和所述移动方向信息,确定所述目标区域的所述客流数据,还包括:Wherein, the determining the passenger flow data in the target area based on the cross-line result information, the moving speed information, and the moving direction information corresponding to the multiple target objects further includes:
    基于第一数量和第二数量,确定所述第三数量;determining the third quantity based on the first quantity and the second quantity;
    其中,所述第一数量为所述多个目标对象中所述跨线结果信息指示跨越所述流量判别线、所述移动方向信息指示跨越所述流量判别线时的移动方向为进入所述目标区域、所述移动速度信息指示的速度大于第一预设速度的第一对象的数量;Wherein, the first quantity is that the line-crossing result information in the plurality of target objects indicates that the flow judgment line is crossed, and the moving direction information indicates that the moving direction when crossing the flow judgment line is to enter the target area, the number of first objects whose speed indicated by the moving speed information is greater than a first preset speed;
    所述第二数量为所述多个目标对象中所述跨线结果信息指示跨越所述流量判别线、所述移动方向信息指示跨越所述流量判别线时的移动方向为离开所述目标区域、所述移动速度信息指示的速度大于第二预设速度的第二对象的数量。The second quantity is that the line-crossing result information in the plurality of target objects indicates that the flow judgment line is crossed, the moving direction information indicates that the moving direction when crossing the flow judgment line is to leave the target area, The moving speed information indicates the number of second objects whose speed is greater than a second preset speed.
  9. 根据权利要求8所述的方法,其特征在于,在确定所述第一对象、所述第二对象之后,所述方法还包括:The method according to claim 8, wherein after determining the first object and the second object, the method further comprises:
    向远端服务器发送所述第一对象进入所述目标区域的时间、所述第二对象离开所述目标区域的时间、所述第一对象进入所述目标区域的进入标识信息、所述第二对象离开所述目标区域的离开标识信息、所述流量判别线的所述第二位置信息中的至少一种,以通过所述远端服务器实现对所述目标区域进行客流统计。sending the time when the first object enters the target area, the time when the second object leaves the target area, the entry identification information of the first object entering the target area, and the second object to the remote server. At least one of the departure identification information of the object leaving the target area and the second position information of the flow judgment line, so as to implement passenger flow statistics for the target area through the remote server.
  10. 根据权利要求1至9任一项所述的方法,其特征在于,所述判别标志包括流量判别线和预设判别框,其中所述流量判别线至少部分位于所述预设判别框内,The method according to any one of claims 1 to 9, wherein the discrimination mark includes a flow discrimination line and a preset judgment frame, wherein the flow judgment line is at least partly located within the preset judgment frame,
    其中,所述分别对所述多帧目标图像中的每帧目标图像进行对象识别和追踪,得到 所述多个目标对象,包括:Wherein, the object recognition and tracking are carried out to each frame of the target image in the multi-frame target image respectively, and the multiple target objects are obtained, including:
    基于所述预设判别框的第三位置信息,分别对所述多帧目标图像中对应于所述预设判别框的图像区域进行对象识别,并对所述视频片段中对应于所述预设判别框的所述图像区域中出现的多个对象分别进行追踪,得到所述多个目标对象。Based on the third position information of the preset judgment frame, perform object recognition on image regions corresponding to the preset judgment frame in the multi-frame target images, and perform object recognition on the video clips corresponding to the preset judgment frame Multiple objects appearing in the image area of the discrimination frame are respectively tracked to obtain the multiple target objects.
  11. 根据权利要求1至10任一项所述的方法,其特征在于,所述分别对所述多帧目标图像中的每帧目标图像进行对象识别和追踪,得到所述多个目标对象,包括:The method according to any one of claims 1 to 10, wherein the step of performing object recognition and tracking on each frame of target images in the multiple frames of target images to obtain the plurality of target objects includes:
    分别对所述多帧目标图像进行对象识别,得到多个对象检测框;其中,每个对象检测框对应一个对象;Respectively performing object recognition on the multi-frame target images to obtain a plurality of object detection frames; wherein, each object detection frame corresponds to an object;
    确定分别属于两帧相邻的目标图像中的对象检测框之间的重叠度,并在所述重叠度大于预设值的情况下,确定所述分别属于两帧相邻的目标图像中的对象检测框对应同一个对象,并将所述对象作为目标对象。Determining the degree of overlap between the object detection frames respectively belonging to two adjacent frames of target images, and in the case that the degree of overlap is greater than a preset value, determining the objects respectively belonging to two frames of adjacent target images The detection boxes correspond to the same object, and the object is used as the target object.
  12. 根据权利要求11所述的方法,其特征在于,在得到所述多个目标对象之后,所述方法还包括:The method according to claim 11, wherein after obtaining the plurality of target objects, the method further comprises:
    针对所述多个目标对象中的每个目标对象,在预设时间内未追踪到所述目标对象的情况下,确定所述目标对象追踪失败。For each target object among the plurality of target objects, if the target object is not tracked within a preset time, it is determined that the tracking of the target object fails.
  13. 一种获取客流数据的装置,其特征在于,包括:A device for obtaining passenger flow data, characterized in that it comprises:
    信息获取模块,用于获取对目标区域进行拍摄得到的视频片段,以及判别标志;所述视频片段包括多帧目标图像;所述目标图像包括所述目标区域的出入口区域;An information acquisition module, configured to acquire a video clip obtained by shooting the target area, and a distinguishing mark; the video clip includes multiple frames of target images; the target image includes an entrance and exit area of the target area;
    信息处理模块,用于分别对所述多帧目标图像中的每帧目标图像进行对象识别和追踪,得到多个目标对象、所述多个目标对象分别对应的关键点信息和移动速度信息;An information processing module, configured to perform object recognition and tracking on each frame of target images in the multiple frames of target images, to obtain multiple target objects, key point information and moving speed information respectively corresponding to the multiple target objects;
    其中,所述关键点信息用于表征所述目标对象在所述目标对象所属目标图像中的位置;所述移动速度信息用于表征所述目标对象在由所述目标对象所属目标图像组成的目标图像序列中的移动速度;Wherein, the key point information is used to represent the position of the target object in the target image to which the target object belongs; the moving speed information is used to represent the position of the target object in the target image composed of the target object to which the target object belongs. speed of movement in the image sequence;
    客流统计模块,用于基于所述多个目标对象分别对应的所述关键点信息和所述移动速度信息,以及所述判别标志,确定所述目标区域的客流数据。The passenger flow counting module is configured to determine the passenger flow data of the target area based on the key point information and the moving speed information respectively corresponding to the plurality of target objects, and the discrimination marks.
  14. 一种电子设备,其特征在于,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当所述电子设备运行时,所述处理器与所述存储器之间通过所述总线通信,所述机器可读指令被所述处理器执行时执行如权利要求1至12任一项所述的获取客流数据的方法的步骤。An electronic device, characterized in that it includes: a processor, a memory and a bus, the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the The memories communicate through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the method for obtaining passenger flow data according to any one of claims 1 to 12.
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器运行时执行如权利要求1至12任一项所述的获取客流数据的方法的步骤。A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method of obtaining passenger flow data according to any one of claims 1 to 12 is executed. steps of the method.
PCT/CN2022/104256 2021-11-30 2022-07-07 Method and apparatus for acquiring passenger flow data, and electronic device and storage medium WO2023098081A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111446732.XA CN114155488A (en) 2021-11-30 2021-11-30 Method and device for acquiring passenger flow data, electronic equipment and storage medium
CN202111446732.X 2021-11-30

Publications (1)

Publication Number Publication Date
WO2023098081A1 true WO2023098081A1 (en) 2023-06-08

Family

ID=80455499

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/104256 WO2023098081A1 (en) 2021-11-30 2022-07-07 Method and apparatus for acquiring passenger flow data, and electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN114155488A (en)
WO (1) WO2023098081A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114155488A (en) * 2021-11-30 2022-03-08 北京市商汤科技开发有限公司 Method and device for acquiring passenger flow data, electronic equipment and storage medium
CN116055867B (en) * 2022-05-30 2023-11-24 荣耀终端有限公司 Shooting method and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109413584A (en) * 2017-08-14 2019-03-01 中国电信股份有限公司 Passenger flow trajectory track methods, devices and systems
CN111160243A (en) * 2019-12-27 2020-05-15 深圳云天励飞技术有限公司 Passenger flow volume statistical method and related product
WO2021073267A1 (en) * 2019-10-18 2021-04-22 平安科技(深圳)有限公司 Image recognition-based method and device for detecting pedestrian crossing during red light, and related apparatus
CN113705470A (en) * 2021-08-30 2021-11-26 北京市商汤科技开发有限公司 Method and device for acquiring passenger flow information, computer equipment and storage medium
CN114155488A (en) * 2021-11-30 2022-03-08 北京市商汤科技开发有限公司 Method and device for acquiring passenger flow data, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109413584A (en) * 2017-08-14 2019-03-01 中国电信股份有限公司 Passenger flow trajectory track methods, devices and systems
WO2021073267A1 (en) * 2019-10-18 2021-04-22 平安科技(深圳)有限公司 Image recognition-based method and device for detecting pedestrian crossing during red light, and related apparatus
CN111160243A (en) * 2019-12-27 2020-05-15 深圳云天励飞技术有限公司 Passenger flow volume statistical method and related product
CN113705470A (en) * 2021-08-30 2021-11-26 北京市商汤科技开发有限公司 Method and device for acquiring passenger flow information, computer equipment and storage medium
CN114155488A (en) * 2021-11-30 2022-03-08 北京市商汤科技开发有限公司 Method and device for acquiring passenger flow data, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114155488A (en) 2022-03-08

Similar Documents

Publication Publication Date Title
WO2023098081A1 (en) Method and apparatus for acquiring passenger flow data, and electronic device and storage medium
US10990830B2 (en) Auto-calibration of tracking systems
US10417503B2 (en) Image processing apparatus and image processing method
CN103488973B (en) Vehicle brand recognition methods and system based on image
US20140092244A1 (en) Object search method, search verification method and apparatuses thereof
CN108694399B (en) License plate recognition method, device and system
CN110852269B (en) Cross-lens portrait correlation analysis method and device based on feature clustering
KR101935010B1 (en) Apparatus and method for recognizing license plate of car based on image
CN111429483A (en) High-speed cross-camera multi-target tracking method, system, device and storage medium
WO2018058530A1 (en) Target detection method and device, and image processing apparatus
CN112257660B (en) Method, system, equipment and computer readable storage medium for removing invalid passenger flow
CN110135377B (en) Method and device for detecting motion state of object in vehicle-road cooperation and server
TWI798815B (en) Target re-identification method, device, and computer readable storage medium
CN113792586A (en) Vehicle accident detection method and device and electronic equipment
CN114783037B (en) Object re-recognition method, object re-recognition apparatus, and computer-readable storage medium
CN110088807B (en) Separation line identification device
TW202242803A (en) Positioning method and apparatus, electronic device and storage medium
CN111476070A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN115620098B (en) Evaluation method and system of cross-camera pedestrian tracking algorithm and electronic equipment
JP2019096062A (en) Object tracking device, object tracking method, and object tracking program
WO2002007096A1 (en) Device for tracking feature point on face
US10839552B2 (en) Image processing apparatus, tracking method, and program
CN112286780A (en) Method, device and equipment for testing recognition algorithm and storage medium
US20230386253A1 (en) Image processing device, image processing method, and program
KR20160078154A (en) Customer information provision method, device and computer program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22899901

Country of ref document: EP

Kind code of ref document: A1