WO2023155350A1 - Crowd positioning method and apparatus, electronic device, and storage medium - Google Patents

Crowd positioning method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2023155350A1
WO2023155350A1 PCT/CN2022/100170 CN2022100170W WO2023155350A1 WO 2023155350 A1 WO2023155350 A1 WO 2023155350A1 CN 2022100170 W CN2022100170 W CN 2022100170W WO 2023155350 A1 WO2023155350 A1 WO 2023155350A1
Authority
WO
WIPO (PCT)
Prior art keywords
initial
target
image
human body
head
Prior art date
Application number
PCT/CN2022/100170
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 WO2023155350A1 publication Critical patent/WO2023155350A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/52Surveillance or monitoring of activities, e.g. for recognising suspicious objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands

Definitions

  • the present disclosure relates to the field of computer technology, and in particular to a crowd positioning method and device, electronic equipment, and a storage medium.
  • Crowd analysis is of great significance to public safety and urban planning.
  • Common crowd analysis tasks include crowd counting, crowd behavior analysis, crowd positioning, etc.
  • crowd positioning is the basis of other crowd analysis tasks.
  • Crowd positioning refers to estimating the position of the key points of the head included in the image or video through computer vision algorithms, and determining the coordinates of the key points of the head included in the image or video, so as to perform crowd analysis tasks such as subsequent crowd counting and group behavior analysis.
  • crowd positioning Provide data basis.
  • the accuracy of crowd positioning directly affects the accuracy of crowd counting and the results of crowd behavior analysis. Therefore, there is an urgent need for a crowd location method with high accuracy.
  • the disclosure proposes a crowd positioning method and device, electronic equipment and a technical solution of a storage medium.
  • a crowd positioning method including: performing key point positioning on a crowd image to obtain an initial positioning map corresponding to the crowd image, wherein the initial positioning map is used to indicate the crowd The position of the initial human body key point included in the image; based on the position of the initial human body key point in the crowd image, determine the target neighborhood corresponding to the initial human body key point; the target neighborhood, and filter the initial positioning map to obtain a target positioning map, wherein the target positioning map is used to indicate the positions of the key points of the target human body included in the crowd image.
  • the determining the target neighborhood corresponding to the initial human body key point based on the position of the initial human body key point in the crowd image includes: for any one of the initial human body key points point, based on the position of the initial human body key point in the crowd image and the preset perspective mapping relationship, determine the target neighborhood corresponding to the initial human body key point, wherein the preset perspective mapping relationship uses at image scales indicating different locations in the crowd image.
  • the initial human body key points are initial human head key points.
  • the determining the target neighborhood corresponding to the initial human body key point based on the position of the initial human body key point in the crowd image and a preset perspective mapping relationship includes : Based on the preset perspective mapping relationship, determine the target image scale corresponding to the position of the initial human head key point in the crowd image; based on the target image scale, determine the head frame height corresponding to the initial human head key point ; Based on the height of the head frame corresponding to the initial key point of the human head, determine the target neighborhood corresponding to the initial key point of the human head.
  • the determining the target neighborhood corresponding to the initial head key point based on the head frame height corresponding to the initial head key point includes: when the head frame height is greater than a preset In the case of the head frame height threshold, the target neighborhood is determined based on the first neighborhood radius; or, when the head frame height is less than or equal to the preset head frame height threshold, based on the second neighborhood radius, to determine the target neighborhood, wherein the radius of the first neighborhood is greater than the radius of the second neighborhood.
  • the positioning of the key points of the human body on the crowd image to obtain the initial positioning map corresponding to the crowd image includes: positioning the key points of the human body on the crowd image, and determining the corresponding The predicted positioning map, wherein the predicted positioning map is used to indicate the prediction confidence that the pixels in the crowd image are key points of the human body; based on the preset confidence threshold, image processing is performed on the predicted positioning map to obtain The initial positioning map.
  • the filtering of the initial positioning map based on the target neighborhood corresponding to the initial human key point to obtain the target positioning map includes: for any initial human head key point i , determine whether there is at least one other initial head key point in the target neighborhood corresponding to the initial head key point i; if there is at least one other initial head point j in the target neighborhood, based on the predicted location Figure, determining the prediction confidence corresponding to the initial head point i, and the prediction confidence corresponding to the at least one other initial head point j; based on the initial head key point i and the at least one other initial head key point j In , predict the initial head key point with the highest confidence, and determine the target head key point in the target neighborhood.
  • the method further includes: based on the target positioning map and the preset perspective mapping relationship, determining positions of key points of the target person's feet included in the crowd image.
  • the determining the positions of the key points of the target's feet included in the crowd image based on the target positioning map and the preset perspective mapping relationship includes: for any one of the targets For the key points of the human head, according to the target positioning map, determine the first image coordinates of the key points of the target human head in the crowd image; based on the preset perspective mapping relationship, perform coordinate transformation on the first image coordinates, Obtaining the second image coordinates of the target human foot key points corresponding to the target human head key points in the crowd image.
  • coordinate transformation is performed on the coordinates of the first image to obtain key points of the target human feet corresponding to the key points of the target human head in the crowd image.
  • the second image coordinates in include: based on the preset perspective mapping relationship, determining the target image scale corresponding to the key point of the target person's head; based on the target image scale, determining the relationship between the target person's head key point and the target person An image distance between foot key points; according to the first image coordinates and the image distance, determine the second image coordinates of the target person's foot key points in the crowd image.
  • the method further includes: acquiring a plurality of annotated human body frames obtained by annotating human body frames of pedestrians in different positions in the crowd image; based on the plurality of annotated human body frames, determining the Default perspective mapping relationship.
  • the determining the preset perspective mapping relationship based on the plurality of labeled human body frames includes: for any one of the labeled human body frames, determining a reference human body in the labeled human body frame The reference image scale corresponding to the key point; according to the third image coordinates of the reference human key point in the labeled human body frame, and the reference image scale corresponding to the reference human key point in the labeled human body frame, Fitting obtains the preset perspective mapping relationship.
  • a crowd positioning device including: a human body key point positioning module, configured to perform human body key point positioning on a crowd image, and obtain an initial positioning map corresponding to the crowd image, wherein the initial The positioning map is used to indicate the position of the initial human body key points included in the crowd image; the target neighborhood determination module is used to determine the initial human body key points based on the positions of the initial human body key points in the crowd image Corresponding target neighborhood; a filtering module, configured to filter the initial positioning map based on the target neighborhood corresponding to the initial human key point to obtain a target positioning map, wherein the target positioning map is used to indicate The positions of key points of the target human body included in the crowd image.
  • an electronic device including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the above-mentioned method.
  • a computer-readable storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented.
  • the key points of the human body are located on the crowd image, and the initial positioning map indicating the position of the initial key points of the human body included in the crowd image can be obtained end-to-end.
  • Position determine the target neighborhoods corresponding to different initial human key points, and then use target neighborhoods of different sizes that match different initial human key points to filter the initial positioning map to reduce the number of initial human body key points corresponding to the same human body.
  • the false detection probability of the point is obtained, and the target positioning map with high accuracy is obtained.
  • FIG. 1 shows a flow chart of a crowd positioning method according to an embodiment of the present disclosure
  • FIG. 2 shows a schematic diagram of a crowd image and its corresponding preset perspective mapping relationship according to an embodiment of the present disclosure
  • Fig. 3 shows a block diagram of a crowd locating device according to an embodiment of the present disclosure
  • Fig. 4 shows a block diagram of an electronic device according to an embodiment of the present disclosure
  • FIG. 5 shows a block diagram of another electronic device according to an embodiment of the present disclosure.
  • crowd positioning is the basis of other crowd analysis tasks.
  • the accuracy of crowd positioning directly affects the accuracy of crowd counting and the results of crowd behavior analysis.
  • crowd positioning is a technology for estimating the positions of key points of the human body in the picture through computer vision algorithms for the video or image in the detection scene, and finally the coordinates of the key points of the human body in the picture can be obtained, which can be used for subsequent crowds.
  • Analysis tasks such as counting and group behavior analysis provide basic data basis.
  • crowd localization methods rely on object detection algorithms. Transform the crowd positioning task into head target detection, and finally use the center of the head detection frame as the positioning result of the key points of the head.
  • Crowd positioning algorithm based on head target detection On the one hand, the training of the head target detection model based on convolutional neural network relies on a large amount of labeled data. For the task of crowd positioning, a large number of head frame labels are required.
  • Most human head target detection frameworks are two-stage detection, that is, firstly extract features from the image through the pre-trained feature extraction network, and then send the extracted features to the ROI (Region Of Interest) network to obtain candidate areas that may have human heads , and then perform ROI pooling/ROI alignment on the candidate area to map the two-dimensional features into a fixed-length feature vector, and finally send the feature vector to two neural networks for classification and position regression respectively to obtain the detection result.
  • ROI Region Of Interest
  • the crowd positioning algorithm In addition to the crowd positioning method based on head target detection, there is also a crowd positioning algorithm that directly generates a target positioning map. This method reduces the limitations of the head target detection algorithm: input the original crowd image, and directly End-to-end outputs an object localization map of the same size as the original crowd image.
  • the target localization map In the target localization map, the key point of the target head is represented by 1, otherwise it is 0.
  • the crowd count metric is obtained by summing the object localization maps.
  • the convolutional neural network can only output the initial positioning map, and image post-processing needs to be performed on the initial positioning map to obtain the final target positioning map.
  • Filtering for example, non-maximum suppression processing NMS
  • a neighborhood with a fixed neighborhood radius is used for filtering. In this way, it is easy to cause false detection of multiple key points of the same human head in places with relatively large heads, or missed detection in places with relatively small heads.
  • An embodiment of the present disclosure provides a method for crowd positioning, which can be applied to crowd positioning in a dense scene.
  • the human body key point positioning is performed on the crowd images collected in dense scenes, and the initial positioning map used to indicate the position of the initial human body key points included in the crowd image can be obtained end-to-end, and then based on the position of the initial human body key points in the crowd image , determine different target neighborhoods corresponding to different initial human key points, and then filter multiple initial human key points in the initial positioning map using target neighborhoods of different sizes to reduce the number of initial human key points corresponding to the same human body.
  • the probability of false detection is higher, and the target positioning map with higher accuracy is obtained.
  • Fig. 1 shows a flow chart of a crowd locating method according to an embodiment of the present disclosure.
  • the crowd positioning method can be performed by electronic devices such as terminal equipment or servers, and the terminal equipment can be user equipment (User Equipment, UE), mobile equipment, user terminal, terminal, cellular phone, cordless phone, personal digital assistant (Personal Digital Assistant, PDA), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc.
  • the crowd positioning method can be realized by calling the computer-readable instructions stored in the memory by the processor.
  • the crowd locating method can be executed by a server.
  • the crowd positioning method may include:
  • step S11 the human body key points are located on the crowd image to obtain an initial positioning map corresponding to the crowd image, wherein the initial positioning map is used to indicate the position of the initial human body key points included in the crowd image.
  • the crowd image here is an image containing dense crowds, which can be obtained after the image acquisition device collects images of dense crowds within a certain spatial range, or it can be a key image frame containing dense crowds obtained from a video, or It may be obtained by other means, which is not specifically limited in the present disclosure.
  • Human body key points are located on the crowd image, and an initial positioning map used to indicate the position of the initial human body key points included in the crowd image is obtained end-to-end.
  • the head key point location is performed on the crowd image, and an initial positioning map used to indicate the position of the initial head key point included in the crowd image is obtained end-to-end.
  • step S12 based on the positions of the initial human body key points in the crowd image, the target neighborhood corresponding to the initial human body key points is determined.
  • the size of the target neighborhood for subsequent image processing of the initial human key points can be determined.
  • the process of determining the target neighborhood corresponding to the initial human key point based on the position of the initial human key point in the crowd image will be described in detail later in combination with possible implementations of the present disclosure, and will not be repeated here.
  • step S13 based on the target neighborhood corresponding to the initial key points of the human body, the initial positioning map is filtered to obtain the target positioning map, wherein the target positioning map is used to indicate the position of the key points of the target human body included in the crowd image.
  • the initial positioning map is filtered to obtain a target positioning map with high accuracy.
  • the process of filtering the initial positioning map based on the target neighborhood corresponding to the initial key points of the human body will be described in detail later in combination with possible implementations of the present disclosure, and will not be repeated here.
  • the key points of the human body are located on the crowd image, and the initial positioning map indicating the position of the initial key points of the human body included in the crowd image can be obtained end-to-end.
  • Position determine the target neighborhoods corresponding to different initial human key points, and then use target neighborhoods of different sizes that match different initial human key points to filter the initial positioning map to reduce the number of initial human body key points corresponding to the same human body.
  • the false detection probability of the point is obtained, and the target positioning map with high accuracy is obtained.
  • the target neighborhood corresponding to the initial human key point is determined based on the position of the initial human key point in the crowd image, including: for any initial human key point, based on the position of the initial human key point in the crowd image
  • the position in and the preset perspective mapping relationship determine the target neighborhood corresponding to the initial human body key point, wherein the preset perspective mapping relationship is used to indicate the image scale of different positions in the crowd image.
  • the image scale can be the number of pixel rows required to represent a unit height in the real world at a location in the crowd image.
  • the unit height can be flexibly set according to actual conditions, for example, the unit height can be 1 meter, which is not specifically limited in the present disclosure.
  • the image scale corresponding to the nearby pedestrians is large, and the image scale corresponding to the distant pedestrians is small.
  • the number of pixel rows required by pedestrian A near the crowd image is p1
  • the number of pixel rows required by pedestrian B far away from the crowd image is p2.
  • “Far” here refers to the distance between the real pedestrian corresponding to the pedestrian in the crowd image and the image acquisition device that collects the crowd image. The distance between the image acquisition devices is short.
  • the preset perspective mapping relationship may indicate image scales corresponding to different positions in the crowd image.
  • the process of determining the preset perspective mapping relationship will be described in detail later in combination with possible implementations of the present disclosure, and will not be repeated here.
  • the initial human key point can be determined based on the position of the initial human key point in the crowd image and the preset perspective mapping relationship.
  • the image scale corresponding to the point, and then based on the image scale corresponding to the initial human key point, the target neighborhood corresponding to the initial human key point is determined.
  • the position of the initial human key points in the crowd image in addition to determining the image scale corresponding to the initial human key points based on the preset perspective mapping relationship to determine the target neighborhood corresponding to the initial human key points, it can also be directly based on the initial human key points
  • the position of the point in the crowd image and the preset neighborhood radius corresponding to different positions in the preset crowd image are used to determine the target neighborhood corresponding to the initial key point of the head. Other methods of determining the target area can also be used.
  • the implementation of this disclosure The example does not specifically limit this.
  • the crowd positioning method further includes: acquiring a plurality of marked human body frames obtained by marking pedestrians in different positions in the crowd image; determining a preset perspective mapping relationship based on the multiple marked human body frames .
  • Select pedestrians in different positions in the crowd image for human body frame labeling, and multiple labeled human body frames in the crowd image can be obtained. Based on the proportional relationship between the height of the marked human body frame and the actual height of the pedestrian, it can be determined The image scale corresponding to the limited position in the crowd image (where the body frame is marked), and then, based on the image scale corresponding to the limited position, further fitting is performed to effectively obtain the image scale corresponding to each position in the crowd image, that is, the preset perspective map is obtained relation.
  • Fig. 2 shows a schematic diagram of a crowd image and its corresponding preset perspective mapping relationship according to an embodiment of the present disclosure.
  • pedestrians in different positions in the crowd image are selected for human body frame labeling, and four marked human body frames A, B, C, and D in different positions in the crowd image are obtained. Then, based on the four Label the human body frames A, B, C, and D, and fit them to effectively obtain the preset perspective mapping relationship corresponding to the crowd image.
  • determining the preset perspective mapping relationship based on multiple labeled human body frames includes: for any labeled human body frame, determining the reference image scale corresponding to the key points of the reference human body in the labeled human body frame; The third image coordinates of the key points of the reference human body marked in the human body frame and the reference image scale corresponding to the key points of the reference human body marked in the human body frame are fitted to obtain a preset perspective mapping relationship.
  • the image scales at different positions change linearly. Therefore, after determining the image scales corresponding to the key points of the reference human body at limited positions in the crowd image according to the labeled human frame, it can be fitted by a linear function to effectively obtain
  • the image scale corresponding to each position in the crowd image is to obtain the preset perspective mapping relationship corresponding to the crowd image.
  • the height of the marked human frame can be regarded as the height of the pedestrian in the crowd image.
  • the height of the labeled human body frame can be expressed by the number of pixel rows occupied by the labeled human body frame. For example, if the labeled human frame occupies 17 rows of pixels in the crowd image, the height of the labeled human frame is 17. Assuming that the real height of the pedestrian corresponding to the marked human body frame is 1.7 meters, the position of the key point of the reference human foot in the marked human body frame can be determined, indicating that 1.7 meters in the real world requires 17 rows of pixels.
  • the unit height is 1m, therefore, at the position of the key points of the reference human feet in the body frame, it means that 1 meter in the real world requires 10 lines of pixels, that is, the scale of the reference image corresponding to the key points of the reference human feet in the body frame is 10.
  • the real height of the pedestrian corresponding to the marked body frame can be selected as an appropriate value according to the actual situation, which is not specifically limited in the present disclosure.
  • Marking the key points of the reference human feet in the human body frame may be marking the midpoint of the bottom edge of the human body frame, or marking other pixel points in the human body frame, which is not specifically limited in the present disclosure.
  • the image coordinates refer to the position coordinates in the pixel coordinate system of the crowd image.
  • the image coordinates take the upper left corner of the crowd image as the coordinate origin (0, 0)
  • the row direction parallel to the image is the x-axis direction
  • the column direction parallel to the image is the y-axis direction to construct the pixel coordinate system of the crowd image
  • the image The units of the abscissa and ordinate of the coordinates are pixels. For example, if the image coordinates of the key points of the reference human feet are (10, 15), it indicates that the key points of the reference human feet are the pixel points at the 10th row and the 15th column in the crowd image.
  • a and b are the parameters obtained by linear function fitting
  • y is the vertical coordinate of the image coordinates of different positions in the crowd image
  • p is the image scale corresponding to the position.
  • the key points of the human body are located on the crowd image to obtain an initial positioning map corresponding to the crowd image.
  • the initial human body key points are initial human head key points.
  • determining the key points of the head as the key points of the human body can effectively distinguish different pedestrians and improve the accuracy of crowd positioning.
  • the key point of the human head may be the center point of the human head, or other preset key points of the human head, which is not specifically limited in the present disclosure.
  • the human body key point positioning is performed on the crowd image to obtain the initial positioning map corresponding to the crowd image, including: performing head key point positioning on the crowd image, and determining a predicted positioning map corresponding to the crowd image, wherein, the predicted The positioning map is used to indicate the prediction confidence that the pixels in the crowd image are the key points of the head; based on the preset reliability threshold, image processing is performed on the predicted positioning map to obtain the initial positioning map.
  • Carry out head key point positioning on the crowd image determine the prediction confidence of each pixel in the crowd image as the key point of the head end-to-end, and then perform threshold segmentation on the predicted positioning map by setting the reliability threshold to determine the initial information included in the crowd image The location of key points of the human head.
  • the trained human head key point positioning neural network can be used to perform head key point positioning on crowd images.
  • the crowd image is input into the trained human head key point positioning neural network, and the predicted positioning map is directly output after the positioning of the human head key point positioning neural network.
  • the specific network structure and training process of the trained human head key point positioning neural network can adopt the network structure and training process in related technologies, which is not specifically limited in this disclosure.
  • the pixel value of each pixel in the predicted positioning map represents the prediction confidence of the pixel, that is, the probability that the pixel is a key point of a human head.
  • a sigmoid operation is performed on the predicted positioning map, so that the pixel value of each pixel in the predicted positioning map is between 0 and 1. For example, if the pixel value of a certain pixel in the predicted localization map is 0.7, it means that the probability that the pixel is a key point of a human head is 0.7.
  • the predicted localization map is only used to indicate the prediction confidence that each pixel in the crowd image is a key point of the head, by presetting the confidence threshold, the predicted localization map is thresholded, so that it can be effectively used to indicate the crowd image.
  • An initial localization map including the positions of the initial head keypoints.
  • the specific value of the preset reliability threshold can be flexibly set according to the actual situation, which is not specifically limited in the present disclosure.
  • the relative The pixel value of the pixel at the same position is determined to be 1; when the pixel value of a certain pixel in the predicted positioning map is less than the preset reliability threshold, the pixel value of the pixel at the same relative position in the initial positioning map is determined as 0.
  • the initial positioning map and the crowd image have the same size, and the position of a pixel with a pixel value of 1 in the initial positioning map is used to indicate the position of the initial head key point included in the crowd image.
  • the pixel value of the pixel point whose image coordinates are (x, y) in the initial positioning map is 1, it can be determined that the pixel point whose image coordinates are (x, y) in the crowd image is the initial key point of the head; If the pixel value of the pixel with image coordinates (x, y) in the initial positioning image is 0, it can be determined that the pixel with image coordinates (x, y) in the crowd image is a part other than the initial key point of the head.
  • the target neighborhood corresponding to each initial head key point may be determined based on a preset perspective mapping relationship.
  • the target neighborhood corresponding to the initial human body key point is determined, including: based on the preset perspective mapping relationship, determining the initial The target image scale corresponding to the position of the head key point in the crowd image; based on the target image scale, determine the head frame height corresponding to the initial head key point; based on the head frame height corresponding to the initial head key point, determine the target corresponding to the initial head key point Area.
  • the scale of the target image corresponding to the initial key points of the head can be quickly determined, and then the height of the head frame corresponding to the initial key points of the head at different positions can be determined, so that the matching target can be further determined according to the height of the head frame Area.
  • the real head frame height corresponding to the pedestrian in the crowd image is 0.4m*0.4m
  • determining the target neighborhood corresponding to the initial head key point includes: when the head frame height is greater than the preset head frame height threshold, based on the first A neighborhood radius to determine the target neighborhood; or, when the height of the head frame is less than or equal to the preset head frame height threshold, based on the second neighborhood radius, determine the target neighborhood, wherein the first neighborhood radius is greater than the first Second neighborhood radius.
  • the height of the head frame is greater than the preset height threshold of the head frame, it can be determined that the size of the head frame is relatively large, so a larger first neighborhood radius is used for subsequent filtering processing; when the height of the head frame is less than or equal to the preset
  • the height threshold of the head frame is set, it can be determined that the size of the head frame is relatively small, so a smaller second neighborhood radius is used for subsequent filtering processing.
  • the specific values of the preset head frame height threshold, the first neighborhood radius, and the second neighborhood radius can be flexibly set according to actual conditions, and this disclosure does not specifically limit them.
  • the height threshold of the head frame is 32.
  • the target neighborhood corresponding to the initial key point i of the human head includes pixels whose pixel distance from the initial key point i of the human head does not exceed 2 pixels.
  • the target neighborhood corresponding to the initial human head key point i includes pixels whose pixel distance from the initial human head key point i does not exceed 1 pixel point.
  • the initial positioning map is filtered to obtain the target positioning map, including: for any initial key point i of the human head, determine the initial key point i In the corresponding target neighborhood, whether there is at least one other initial head key point; in the case of at least one other initial head point j in the target neighborhood, determine the prediction confidence corresponding to the initial head point i according to the predicted positioning map, and at least The prediction confidence corresponding to one other initial head point j; among the initial head key point i and at least one other initial head key point j, the initial head key point with the highest prediction confidence is determined as the target head key point in the target neighborhood.
  • the initial localization map is filtered by further using the target neighborhood of the initial human head key points to obtain a high-precision target localization map.
  • any initial head key point i in the initial positioning map after determining its corresponding target neighborhood according to the above method, detect whether there are other initial head key points in the target neighborhood, if there are other image coordinates (x j , y j ), the prediction confidence corresponding to the initial head key point i and the prediction confidence corresponding to the initial head point j are determined according to the predicted positioning map.
  • the pixel value of the pixel whose image coordinates are (xi , y i ) is kept as 1, and the image coordinates are (x j , y j )
  • the pixel value of the pixel point is updated to 0, that is, the initial head key point j in the initial positioning map is filtered out.
  • each initial head key point in the initial positioning map is traversed to obtain the final target positioning map.
  • the crowd positioning method further includes: based on the target positioning map and the preset perspective mapping relationship, determining the positions of the key points of the target person's feet included in the crowd image.
  • the line is generally drawn in advance according to the actual set position, and then it is judged whether to cross the line according to the positional relationship of the human feet in the front and rear frames. Therefore, in the crowd positioning task, how to accurately locate the position of human feet is very important.
  • the position of the key points of the target person's head included in the crowd image can be determined, and then based on the target positioning map and the preset perspective mapping relationship, the key points of the target person's feet included in the crowd image can be further quickly determined s position.
  • determining the position of the key point of the target person's foot included in the crowd image includes: for any key point of the target person's head, according to the target positioning map, determine The first image coordinates of the key points of the target person's head in the crowd image; based on the preset perspective mapping relationship, coordinate conversion is performed on the first image coordinates to obtain the first position of the key points of the target's feet corresponding to the key points of the target person's head in the crowd image Two image coordinates.
  • the preset perspective mapping relationship can indicate the image scales of different positions in the crowd image
  • the coordinate conversion of the first image coordinates of the key points of the target head can be performed to obtain the target corresponding to the key points of the target head
  • the second image coordinates of the key points of the human feet in the crowd image can indicate the image scales of different positions in the crowd image
  • the first image coordinates of the key point of the target's head in the crowd image are (h x , h y ), and the first image coordinates are known.
  • coordinate transformation can be performed on the first image coordinates (h x , h y ), and the second image coordinates of the target human foot key points corresponding to the target human head key points are (f x , f y ).
  • coordinate conversion is performed on the coordinates of the first image to obtain the second image coordinates of the key points of the target human feet corresponding to the key points of the target human head in the crowd image, including: based on Preset the perspective mapping relationship to determine the target image scale corresponding to the key points of the target person's head; determine the image distance between the key points of the target person's head and the key points of the target person's feet based on the target image scale; determine the target image according to the first image coordinates and image distance The second image coordinates of the key points of the human feet in the crowd image.
  • the distance from the center of the head to the feet of the person is 1.5 meters, that is, the real distance between the key points of the target person’s head and the key points of the target person’s feet is 1.5 meters, then the image of the key points of the target person’s feet and the key points of the target person’s head in the crowd image
  • crowd behavior analysis such as passenger flow statistics and behavior trajectory analysis can be performed, which is not specifically limited in this disclosure.
  • the present disclosure also provides crowd locating devices, electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any of the crowd locating methods provided in the present disclosure.
  • crowd locating devices electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any of the crowd locating methods provided in the present disclosure.
  • Fig. 3 shows a block diagram of a crowd locating device according to an embodiment of the present disclosure.
  • the device 30 includes:
  • the human body key point positioning module 31 is configured to perform human body key point positioning on the crowd image to obtain an initial positioning map corresponding to the crowd image, wherein the initial positioning map is used to indicate the position of the initial human key point included in the crowd image;
  • the target neighborhood determination module 32 is used to determine the target neighborhood corresponding to the initial human body key point based on the position of the initial human body key point in the crowd image;
  • the filtering module 33 is configured to filter the initial positioning map based on the target neighborhoods corresponding to the initial key points of the human body to obtain the target positioning map, wherein the target positioning map is used to indicate the position of the key points of the target human body included in the crowd image.
  • the target neighborhood determination module 32 is specifically used for:
  • any initial human body key point based on the position of the initial human body key point in the crowd image and the preset perspective mapping relationship, determine the target neighborhood corresponding to the initial human body key point, wherein the preset perspective mapping relationship is used to indicate the crowd image Image scales at different locations in .
  • the initial human body key points are initial human head key points.
  • the target neighborhood determination module 32 includes:
  • the first determination sub-module is used to determine the target image scale corresponding to the position of the initial key point of the head in the crowd image based on the preset perspective mapping relationship;
  • the second determination submodule is used to determine the height of the head frame corresponding to the initial key point of the head based on the scale of the target image;
  • the third determination sub-module is configured to determine the target neighborhood corresponding to the initial key point of the human head based on the height of the head frame corresponding to the initial key point of the human head.
  • the third determination submodule is specifically used for:
  • the target neighborhood is determined based on the second neighborhood radius, wherein the first neighborhood radius is greater than the second neighborhood radius.
  • the human body key point positioning module 31 includes:
  • the human body key point positioning sub-module is used to locate the key points of the human body on the crowd image, and determine the predicted positioning map corresponding to the crowd image, wherein the predicted positioning map is used to indicate the prediction confidence that the pixel in the crowd image is the key point of the human body;
  • the fourth determination sub-module is configured to perform image processing on the predicted positioning map based on a preset reliability threshold to obtain an initial positioning map.
  • the filtering module 33 is specifically used for:
  • any initial head key point i determine whether there is at least one other initial head key point in the target neighborhood corresponding to the initial head key point i;
  • the initial head key point with the highest prediction confidence is determined to determine the target head key point in the target neighborhood.
  • the device 30 further includes:
  • the human foot key point determination module is configured to determine the position of the target human foot key points included in the crowd image based on the target positioning map and the preset perspective mapping relationship.
  • the human foot key point determination module includes:
  • the fifth determination sub-module is used to determine the first image coordinates of the key points of the target head in the crowd image according to the target positioning map for any key point of the target head;
  • the sixth determination sub-module is used to perform coordinate transformation on the first image coordinates based on the preset perspective mapping relationship, and obtain the second image coordinates of the key points of the target human feet corresponding to the key points of the target human head in the crowd image.
  • the sixth determination submodule is specifically used for:
  • the second image coordinates of the key points of the target person's feet in the crowd image are determined.
  • the device 30 further includes:
  • An acquisition module configured to acquire a plurality of annotated human body frames obtained by annotating human body frames of pedestrians in different positions in the crowd image
  • the perspective mapping relationship determination module is configured to determine a preset perspective mapping relationship based on a plurality of labeled human body frames.
  • the perspective mapping relationship determination module is specifically used for:
  • a preset perspective mapping relationship is obtained by fitting.
  • This method has a specific technical relationship with the internal structure of the computer system, and it can solve the technical problems of how to improve the hardware computing efficiency or execution effect (including reducing the amount of data storage, reducing the amount of data transmission, increasing the processing speed of the hardware, etc.), so as to obtain a natural The technical effect of regular computer system internal performance improvements.
  • the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the methods described in the method embodiments above, and its specific implementation can refer to the description of the method embodiments above. For brevity, here No longer.
  • Embodiments of the present disclosure also provide a computer-readable storage medium, on which computer program instructions are stored, and the above-mentioned method is implemented when the computer program instructions are executed by a processor.
  • Computer readable storage media may be volatile or nonvolatile computer readable storage media.
  • An embodiment of the present disclosure also proposes an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to invoke the instructions stored in the memory to execute the above method.
  • An embodiment of the present disclosure also provides a computer program product, including computer-readable codes, or a non-volatile computer-readable storage medium carrying computer-readable codes, when the computer-readable codes are stored in a processor of an electronic device When running in the electronic device, the processor in the electronic device executes the above method.
  • Electronic devices may be provided as terminals, servers, or other forms of devices.
  • Fig. 4 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • the electronic device 800 may be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle Devices, wearable devices and other terminal equipment.
  • UE User Equipment
  • PDA personal digital assistant
  • electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and a communication component 816 .
  • the processing component 802 generally controls the overall operations of the electronic device 800, such as those associated with display, telephone calls, data communications, camera operations, and recording operations.
  • the processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802 .
  • the memory 804 is configured to store various types of data to support operations at the electronic device 800 . Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like.
  • the memory 804 can be implemented by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic or Optical Disk Magnetic Disk
  • the power supply component 806 provides power to various components of the electronic device 800 .
  • Power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device 800 .
  • the multimedia component 808 includes a screen providing an output interface between the electronic device 800 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user.
  • the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or swipe action, but also detect duration and pressure associated with the touch or swipe action.
  • the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capability.
  • the audio component 810 is configured to output and/or input audio signals.
  • the audio component 810 includes a microphone (MIC), which is configured to receive external audio signals when the electronic device 800 is in operation modes, such as call mode, recording mode and voice recognition mode. Received audio signals may be further stored in memory 804 or sent via communication component 816 .
  • the audio component 810 also includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: a home button, volume buttons, start button, and lock button.
  • Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of electronic device 800 .
  • the sensor component 814 can detect the open/closed state of the electronic device 800, the relative positioning of components, such as the display and the keypad of the electronic device 800, the sensor component 814 can also detect the electronic device 800 or a Changes in position of components, presence or absence of user contact with electronic device 800 , electronic device 800 orientation or acceleration/deceleration and temperature changes in electronic device 800 .
  • Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact.
  • Sensor assembly 814 may also include an optical sensor, such as a complementary metal-oxide-semiconductor (CMOS) or charge-coupled device (CCD) image sensor, for use in imaging applications.
  • CMOS complementary metal-oxide-semiconductor
  • CCD charge-coupled device
  • the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
  • the communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices.
  • the electronic device 800 can access wireless networks based on communication standards, such as wireless networks (Wi-Fi), second-generation mobile communication technologies (2G), third-generation mobile communication technologies (3G), fourth-generation mobile communication technologies (4G ), the long-term evolution (LTE) of the universal mobile communication technology, the fifth generation mobile communication technology (5G) or their combination.
  • the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID Radio Frequency Identification
  • IrDA Infrared Data Association
  • UWB Ultra Wideband
  • Bluetooth Bluetooth
  • electronic device 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation for performing the methods described above.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A programmable gate array
  • controller microcontroller, microprocessor or other electronic component implementation for performing the methods described above.
  • a non-volatile computer-readable storage medium such as the memory 804 including computer program instructions, which can be executed by the processor 820 of the electronic device 800 to implement the above method.
  • This disclosure relates to the field of augmented reality.
  • acquiring the image information of the target object in the real environment and then using various visual correlation algorithms to detect or identify the relevant features, states and attributes of the target object, and thus obtain the image information that matches the specific application.
  • AR effect combining virtual and reality.
  • the target object may involve faces, limbs, gestures, actions, etc. related to the human body, or markers and markers related to objects, or sand tables, display areas or display items related to venues or places.
  • Vision-related algorithms may involve visual positioning, SLAM, 3D reconstruction, image registration, background segmentation, object key point extraction and tracking, object pose or depth detection, etc.
  • Specific applications can not only involve interactive scenes such as guided tours, navigation, explanations, reconstructions, virtual effect overlays and display related to real scenes or objects, but also special effects processing related to people, such as makeup beautification, body beautification, special effect display, virtual Interactive scenarios such as model display.
  • the relevant features, states and attributes of the target object can be detected or identified through the convolutional neural network.
  • the above-mentioned convolutional neural network is a network model obtained by performing model training based on a deep learning framework.
  • FIG. 5 shows a block diagram of another electronic device according to an embodiment of the present disclosure.
  • an electronic device 1900 may be provided as a server or terminal device.
  • electronic device 1900 includes processing component 1922 , which further includes one or more processors, and a memory resource represented by memory 1932 for storing instructions executable by processing component 1922 , such as application programs.
  • the application programs stored in memory 1932 may include one or more modules each corresponding to a set of instructions.
  • the processing component 1922 is configured to execute instructions to perform the above method.
  • Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input-output (I/O) interface 1958 .
  • the electronic device 1900 can operate based on the operating system stored in the memory 1932, such as the Microsoft server operating system (Windows Server TM ), the graphical user interface-based operating system (Mac OS X TM ) introduced by Apple Inc., and the multi-user and multi-process computer operating system (Unix TM ), a free and open source Unix-like operating system (Linux TM ), an open source Unix-like operating system (FreeBSD TM ), or the like.
  • Microsoft server operating system Windows Server TM
  • Mac OS X TM graphical user interface-based operating system
  • Unix TM multi-user and multi-process computer operating system
  • Linux TM free and open source Unix-like operating system
  • FreeBSD TM open source Unix-like operating system
  • a non-transitory computer-readable storage medium such as the memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to implement the above method.
  • the present disclosure can be a system, method and/or computer program product.
  • a computer program product may include a computer readable storage medium having computer readable program instructions thereon for causing a processor to implement various aspects of the present disclosure.
  • a computer readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device.
  • a computer readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Computer-readable storage media include: portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory), static random access memory (SRAM), compact disc read only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanically encoded device, such as a printer with instructions stored thereon A hole card or a raised structure in a groove, and any suitable combination of the above.
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • flash memory static random access memory
  • SRAM static random access memory
  • CD-ROM compact disc read only memory
  • DVD digital versatile disc
  • memory stick floppy disk
  • mechanically encoded device such as a printer with instructions stored thereon
  • a hole card or a raised structure in a groove and any suitable combination of the above.
  • computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., pulses of light through fiber optic cables), or transmitted electrical signals.
  • Computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers.
  • a network adapter card or a network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
  • Computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or Source or object code written in any combination, including object-oriented programming languages—such as Smalltalk, C++, etc., and conventional procedural programming languages—such as the “C” language or similar programming languages.
  • Computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement.
  • the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as via the Internet using an Internet service provider). connect).
  • LAN local area network
  • WAN wide area network
  • an electronic circuit such as a programmable logic circuit, field programmable gate array (FPGA), or programmable logic array (PLA)
  • FPGA field programmable gate array
  • PDA programmable logic array
  • These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine such that when executed by the processor of the computer or other programmable data processing apparatus , producing an apparatus for realizing the functions/actions specified in one or more blocks in the flowchart and/or block diagram.
  • These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause computers, programmable data processing devices and/or other devices to work in a specific way, so that the computer-readable medium storing instructions includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks in flowcharts and/or block diagrams.
  • each block in a flowchart or block diagram may represent a module, a portion of a program segment, or an instruction that includes one or more Executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified function or action , or may be implemented by a combination of dedicated hardware and computer instructions.
  • 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.
  • a software development kit Software Development Kit, SDK
  • 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 product applying the technical solution of this application has clearly notified the personal information processing rules and obtained the individual's independent consent before processing personal information.
  • the technical solution of this application involves sensitive personal information
  • the products applying the technical solution of this application have obtained individual consent before processing sensitive personal information, and at the same time meet the requirements of "express consent". For example, at a personal information collection device such as a camera, a clear and prominent sign is set up to inform that it has entered the scope of personal information collection, and personal information will be collected.
  • the personal information processing rules may include Information such as the information processor, the purpose of personal information processing, the method of processing, and the type of personal information processed.

Abstract

The present invention relates to a crowd positioning method and apparatus, an electronic device, and a storage medium. The method comprises: performing positioning of human body key points of a crowd image to obtain an initial positioning map corresponding to the crowd image, wherein the initial positioning map is used for indicating positions of initial human body key points comprised in the crowd image; on the basis of the positions of the initial human body key points in the crowd image, determining a target neighborhood corresponding to the initial human body key points; and on the basis of the target neighborhood corresponding to the initial human body key points, filtering the initial positioning map to obtain a target positioning map, wherein the target positioning map is used for indicating positions of target human body key points comprised in the crowd image. According to embodiments of the present invention, a false detection probability that a same human body corresponds to a plurality of initial human body key points can be reduced, and the target positioning map having relatively high accuracy is obtained.

Description

一种人群定位方法及装置、电子设备和存储介质A crowd positioning method and device, electronic equipment and storage medium
本申请要求2022年02月17日提交、申请号为202210146593.7,发明名称为“一种人群定位方法及装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on February 17, 2022, with the application number 202210146593.7, and the title of the invention is "a crowd positioning method and device, electronic equipment and storage medium", the entire content of which is incorporated herein by reference Applying.
技术领域technical field
本公开涉及计算机技术领域,尤其涉及一种人群定位方法及装置、电子设备和存储介质。The present disclosure relates to the field of computer technology, and in particular to a crowd positioning method and device, electronic equipment, and a storage medium.
背景技术Background technique
随着人口的增长、城市化进程的加速,大量人群聚集的行为越来越多,且规模越来越大。人群分析对于公共安全、城市规划有着重要意义。常见的人群分析任务包括人群计数、群体行为解析、人群定位等,其中,人群定位是其它人群分析任务的基础。人群定位指的是,通过计算机视觉算法对图像或视频中包括的人头关键点的位置进行估计,确定图像或视频中包括的人头关键点的坐标,以为后续人群计数和群体行为解析等人群分析任务提供数据依据。人群定位的准确率直接影响人群计数的精度和人群行为解析的结果。因此,亟需一种准确率较高的人群定位方法。With the growth of the population and the acceleration of the urbanization process, there are more and more behaviors where a large number of people gather, and the scale is getting bigger and bigger. Crowd analysis is of great significance to public safety and urban planning. Common crowd analysis tasks include crowd counting, crowd behavior analysis, crowd positioning, etc. Among them, crowd positioning is the basis of other crowd analysis tasks. Crowd positioning refers to estimating the position of the key points of the head included in the image or video through computer vision algorithms, and determining the coordinates of the key points of the head included in the image or video, so as to perform crowd analysis tasks such as subsequent crowd counting and group behavior analysis. Provide data basis. The accuracy of crowd positioning directly affects the accuracy of crowd counting and the results of crowd behavior analysis. Therefore, there is an urgent need for a crowd location method with high accuracy.
发明内容Contents of the invention
本公开提出了一种人群定位方法及装置、电子设备和存储介质的技术方案。The disclosure proposes a crowd positioning method and device, electronic equipment and a technical solution of a storage medium.
根据本公开的一方面,提供了一种人群定位方法,包括:对人群图像进行人体关键点定位,得到所述人群图像对应的初始定位图,其中,所述初始定位图用于指示所述人群图像中包括的初始人体关键点的位置;基于所述初始人体关键点在所述人群图像中的位置,确定所述初始人体关键点对应的目标邻域;基于所述初始人体关键点对应的所述目标邻域,对所述初始定位图进行过滤,得到目标定位图,其中,所述目标定位图用于指示所述人群图像中包括的目标人体关键点的位置。According to an aspect of the present disclosure, a crowd positioning method is provided, including: performing key point positioning on a crowd image to obtain an initial positioning map corresponding to the crowd image, wherein the initial positioning map is used to indicate the crowd The position of the initial human body key point included in the image; based on the position of the initial human body key point in the crowd image, determine the target neighborhood corresponding to the initial human body key point; the target neighborhood, and filter the initial positioning map to obtain a target positioning map, wherein the target positioning map is used to indicate the positions of the key points of the target human body included in the crowd image.
在一种可能的实现方式中,所述基于所述初始人体关键点在所述人群图像中的位置,确定所述初始人体关键点对应的目标邻域,包括:针对任意一个所述初始人体关键点,基于所述初始人体关键点在所述人群图像中的位置,以及预设透视映射关系,确定所述初始人体关键点对应的所述目标邻域,其中,所述预设透视映射关系用于指示所述人群图像中不同位置的图像尺度。In a possible implementation manner, the determining the target neighborhood corresponding to the initial human body key point based on the position of the initial human body key point in the crowd image includes: for any one of the initial human body key points point, based on the position of the initial human body key point in the crowd image and the preset perspective mapping relationship, determine the target neighborhood corresponding to the initial human body key point, wherein the preset perspective mapping relationship uses at image scales indicating different locations in the crowd image.
在一种可能的实现方式中,所述初始人体关键点为初始人头关键点。In a possible implementation manner, the initial human body key points are initial human head key points.
在一种可能的实现方式中,所述基于所述初始人体关键点在所述人群图像中的位置,以及预设透视映射关系,确定所述初始人体关键点对应的所述目标邻域,包括:基于所述预设透视映射关系,确定所述初始人头关键点在所述人群图像中的位置对应的目标图像尺度;基于所述目标图像尺度,确定所述初始人头关键点对应的人头框高度;基于所述初始人头关键点对应的人头框高度,确定所述初始人头关键点对应的所述目标邻域。In a possible implementation manner, the determining the target neighborhood corresponding to the initial human body key point based on the position of the initial human body key point in the crowd image and a preset perspective mapping relationship includes : Based on the preset perspective mapping relationship, determine the target image scale corresponding to the position of the initial human head key point in the crowd image; based on the target image scale, determine the head frame height corresponding to the initial human head key point ; Based on the height of the head frame corresponding to the initial key point of the human head, determine the target neighborhood corresponding to the initial key point of the human head.
在一种可能的实现方式中,所述基于所述初始人头关键点对应的人头框高度,确定所述初始人头关键点对应的所述目标邻域,包括:在所述人头框高度大于预设人头框高 度阈值的情况下,基于第一邻域半径,确定所述目标邻域;或,在所述人头框高度小于或等于所述预设人头框高度阈值的情况下,基于第二邻域半径,确定所述目标邻域,其中,所述第一邻域半径大于所述第二邻域半径。In a possible implementation manner, the determining the target neighborhood corresponding to the initial head key point based on the head frame height corresponding to the initial head key point includes: when the head frame height is greater than a preset In the case of the head frame height threshold, the target neighborhood is determined based on the first neighborhood radius; or, when the head frame height is less than or equal to the preset head frame height threshold, based on the second neighborhood radius, to determine the target neighborhood, wherein the radius of the first neighborhood is greater than the radius of the second neighborhood.
在一种可能的实现方式中,所述对人群图像进行人体关键点定位,得到所述人群图像对应的初始定位图,包括:对所述人群图像进行人体关键点定位,确定所述人群图像对应的预测定位图,其中,所述预测定位图用于指示所述人群图像中的像素点是人体关键点的预测置信度;基于预设置信度阈值,对所述预测定位图进行图像处理,得到所述初始定位图。In a possible implementation manner, the positioning of the key points of the human body on the crowd image to obtain the initial positioning map corresponding to the crowd image includes: positioning the key points of the human body on the crowd image, and determining the corresponding The predicted positioning map, wherein the predicted positioning map is used to indicate the prediction confidence that the pixels in the crowd image are key points of the human body; based on the preset confidence threshold, image processing is performed on the predicted positioning map to obtain The initial positioning map.
在一种可能的实现方式中,所述基于所述初始人体关键点对应的所述目标邻域,对所述初始定位图进行过滤,得到目标定位图,包括:针对任意一个初始人头关键点i,确定所述初始人头关键点i对应的所述目标邻域内,是否存在至少一个其它初始人头关键点;在所述目标邻域内存在至少一个其它初始人头点j的情况下,基于所述预测定位图,确定所述初始人头点i对应的预测置信度,以及所述至少一个其它初始人头点j对应的预测置信度;基于所述初始人头关键点i和所述至少一个其它初始人头关键点j中,预测置信度最大的初始人头关键点,确定所述目标邻域内的目标人头关键点。In a possible implementation manner, the filtering of the initial positioning map based on the target neighborhood corresponding to the initial human key point to obtain the target positioning map includes: for any initial human head key point i , determine whether there is at least one other initial head key point in the target neighborhood corresponding to the initial head key point i; if there is at least one other initial head point j in the target neighborhood, based on the predicted location Figure, determining the prediction confidence corresponding to the initial head point i, and the prediction confidence corresponding to the at least one other initial head point j; based on the initial head key point i and the at least one other initial head key point j In , predict the initial head key point with the highest confidence, and determine the target head key point in the target neighborhood.
在一种可能的实现方式中,所述方法还包括:基于所述目标定位图和所述预设透视映射关系,确定所述人群图像中包括的目标人脚关键点的位置。In a possible implementation manner, the method further includes: based on the target positioning map and the preset perspective mapping relationship, determining positions of key points of the target person's feet included in the crowd image.
在一种可能的实现方式中,所述基于所述目标定位图和所述预设透视映射关系,确定所述人群图像中包括的目标人脚关键点的位置,包括:针对任意一个所述目标人头关键点,根据所述目标定位图,确定所述目标人头关键点在所述人群图像中的第一图像坐标;基于所述预设透视映射关系,对所述第一图像坐标进行坐标转换,得到所述目标人头关键点对应的目标人脚关键点在所述人群图像中的第二图像坐标。In a possible implementation manner, the determining the positions of the key points of the target's feet included in the crowd image based on the target positioning map and the preset perspective mapping relationship includes: for any one of the targets For the key points of the human head, according to the target positioning map, determine the first image coordinates of the key points of the target human head in the crowd image; based on the preset perspective mapping relationship, perform coordinate transformation on the first image coordinates, Obtaining the second image coordinates of the target human foot key points corresponding to the target human head key points in the crowd image.
在一种可能的实现方式中,所述基于所述预设透视映射关系,对所述第一图像坐标进行坐标转换,得到所述目标人头关键点对应的目标人脚关键点在所述人群图像中的第二图像坐标,包括:基于所述预设透视映射关系,确定所述目标人头关键点对应的目标图像尺度;基于所述目标图像尺度,确定所述目标人头关键点与所述目标人脚关键点之间的图像距离;根据所述第一图像坐标和所述图像距离,确定所述目标人脚关键点在所述人群图像中的第二图像坐标。In a possible implementation manner, based on the preset perspective mapping relationship, coordinate transformation is performed on the coordinates of the first image to obtain key points of the target human feet corresponding to the key points of the target human head in the crowd image. The second image coordinates in include: based on the preset perspective mapping relationship, determining the target image scale corresponding to the key point of the target person's head; based on the target image scale, determining the relationship between the target person's head key point and the target person An image distance between foot key points; according to the first image coordinates and the image distance, determine the second image coordinates of the target person's foot key points in the crowd image.
在一种可能的实现方式中,所述方法还包括:获取对所述人群图像中不同位置的行人进行人体框标注得到的多个标注人体框;基于所述多个标注人体框,确定所述预设透视映射关系。In a possible implementation manner, the method further includes: acquiring a plurality of annotated human body frames obtained by annotating human body frames of pedestrians in different positions in the crowd image; based on the plurality of annotated human body frames, determining the Default perspective mapping relationship.
在一种可能的实现方式中,所述基于所述多个标注人体框,确定所述预设透视映射关系,包括:针对任意一个所述标注人体框,确定所述标注人体框中的参考人体关键点对应的参考图像尺度;根据所述标注人体框中的所述参考人体关键点的第三图像坐标,以及所述标注人体框中的所述参考人体关键点对应的所述参考图像尺度,拟合得到所述预设透视映射关系。In a possible implementation manner, the determining the preset perspective mapping relationship based on the plurality of labeled human body frames includes: for any one of the labeled human body frames, determining a reference human body in the labeled human body frame The reference image scale corresponding to the key point; according to the third image coordinates of the reference human key point in the labeled human body frame, and the reference image scale corresponding to the reference human key point in the labeled human body frame, Fitting obtains the preset perspective mapping relationship.
根据本公开的一方面,提供了一种人群定位装置,包括:人体关键点定位模块,用于对人群图像进行人体关键点定位,得到所述人群图像对应的初始定位图,其中,所述初始定位图用于指示所述人群图像中包括的初始人体关键点的位置;目标邻域确定模块,用于基于所述初始人体关键点在所述人群图像中的位置,确定所述初始人体关键点对应的目标邻域;过滤模块,用于基于所述初始人体关键点对应的所述目标邻域,对所述初始定位图进行过滤,得到目标定位图,其中,所述目标定位图用于指示所述人群图像中包括的目标人体关键点的位置。According to an aspect of the present disclosure, a crowd positioning device is provided, including: a human body key point positioning module, configured to perform human body key point positioning on a crowd image, and obtain an initial positioning map corresponding to the crowd image, wherein the initial The positioning map is used to indicate the position of the initial human body key points included in the crowd image; the target neighborhood determination module is used to determine the initial human body key points based on the positions of the initial human body key points in the crowd image Corresponding target neighborhood; a filtering module, configured to filter the initial positioning map based on the target neighborhood corresponding to the initial human key point to obtain a target positioning map, wherein the target positioning map is used to indicate The positions of key points of the target human body included in the crowd image.
根据本公开的一方面,提供了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。According to an aspect of the present disclosure, there is provided an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the above-mentioned method.
根据本公开的一方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。According to one aspect of the present disclosure, there is provided a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented.
在本公开实施例中,对人群图像进行人体关键点定位,可以端到端的得到用于指示人群图像中包括的初始人体关键点的位置的初始定位图,基于初始人体关键点在人群图像中的位置,确定不同初始人体关键点对应的目标邻域,进而利用与不同初始人体关键点匹配的不同大小的目标邻域,对初始定位图中进行过滤,以降低同一个人体对应多个初始人体关键点的误检概率,得到准确率较高的目标定位图。In the embodiment of the present disclosure, the key points of the human body are located on the crowd image, and the initial positioning map indicating the position of the initial key points of the human body included in the crowd image can be obtained end-to-end. Position, determine the target neighborhoods corresponding to different initial human key points, and then use target neighborhoods of different sizes that match different initial human key points to filter the initial positioning map to reduce the number of initial human body key points corresponding to the same human body. The false detection probability of the point is obtained, and the target positioning map with high accuracy is obtained.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。The accompanying drawings here are incorporated into the description and constitute a part of the present description. These drawings show embodiments consistent with the present disclosure, and are used together with the description to explain the technical solution of the present disclosure.
图1示出根据本公开实施例的一种人群定位方法的流程图;FIG. 1 shows a flow chart of a crowd positioning method according to an embodiment of the present disclosure;
图2示出根据本公开实施例的人群图像和其对应的预设透视映射关系的示意图;FIG. 2 shows a schematic diagram of a crowd image and its corresponding preset perspective mapping relationship according to an embodiment of the present disclosure;
图3示出根据本公开实施例的一种人群定位装置的框图;Fig. 3 shows a block diagram of a crowd locating device according to an embodiment of the present disclosure;
图4示出根据本公开实施例的一种电子设备的框图;Fig. 4 shows a block diagram of an electronic device according to an embodiment of the present disclosure;
图5示出根据本公开实施例的另一种电子设备的框图。FIG. 5 shows a block diagram of another electronic device according to an embodiment of the present disclosure.
具体实施方式Detailed ways
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。Various exemplary embodiments, features, and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numbers in the figures indicate functionally identical or similar elements. While various aspects of the embodiments are shown in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as superior or better than other embodiments.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。 另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this article is just an association relationship describing associated objects, which means that there can be three relationships, for example, A and/or B can mean: A exists alone, A and B exist simultaneously, and there exists alone B these three situations. In addition, the term "at least one" herein means any one of a variety or any combination of at least two of the more, for example, including at least one of A, B, and C, which may mean including from A, Any one or more elements selected from the set formed by B and C.
另外,为了更好地说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific implementation manners. It will be understood by those skilled in the art that the present disclosure may be practiced without some of the specific details. In some instances, methods, means, components and circuits that are well known to those skilled in the art have not been described in detail so as to obscure the gist of the present disclosure.
快速人群分析对于公共安全、城市规划有着重要意义。常见的人群分析任务包括人群计数、群体行为解析、人群定位等,其中,人群定位其它人群分析任务的基础。人群定位的准确率直接影响人群计数的精度和人群行为解析的结果。具体而言,人群定位是对于检测场景下的视频或图像,通过计算机视觉算法来对画面中的人体关键点的位置进行估计的技术,最终可以获取画面中的人体关键点的坐标,为后续人群计数和群体行为解析等分析任务提供基础数据依据。Rapid crowd analysis is of great significance for public safety and urban planning. Common crowd analysis tasks include crowd counting, crowd behavior analysis, crowd positioning, etc. Among them, crowd positioning is the basis of other crowd analysis tasks. The accuracy of crowd positioning directly affects the accuracy of crowd counting and the results of crowd behavior analysis. Specifically, crowd positioning is a technology for estimating the positions of key points of the human body in the picture through computer vision algorithms for the video or image in the detection scene, and finally the coordinates of the key points of the human body in the picture can be obtained, which can be used for subsequent crowds. Analysis tasks such as counting and group behavior analysis provide basic data basis.
常见的人群定位方法依赖目标检测算法。将人群定位任务转化为人头目标检测,最后使用人头检测框的中心作为人头关键点的定位结果。基于人头目标检测的人群定位算法:一方面,基于卷积神经网络的人头目标检测模型的训练依赖大量标注数据,针对人群定位任务,便需要大量的人头框标注,对于十分密集的人群场景,进行人头框标注成本较高;另一方面,由于拥挤场景中远处人头较小,标注的人头框并不准确,这会对人头目标检测模型的训练带来影响;此外,相关技术中性能较高的人头目标检测框架大都为两阶段检测,即先通过预训练的特征提取网络对图像进行特征提取,然后将提取的特征送入感兴趣区域(ROI,Region Of Interest)网络得到可能存在人头的候选区域,接着对候选区域进行ROI池化/ROI对齐将二维特征映射为一个固定长度的特征向量,最后将特征向量送入两个神经网络分别进行分类和位置回归,得到检测结果。上述检测过程较为复杂,对于实时性要求较高的人群分析而言,显然不具有实用性。Common crowd localization methods rely on object detection algorithms. Transform the crowd positioning task into head target detection, and finally use the center of the head detection frame as the positioning result of the key points of the head. Crowd positioning algorithm based on head target detection: On the one hand, the training of the head target detection model based on convolutional neural network relies on a large amount of labeled data. For the task of crowd positioning, a large number of head frame labels are required. For very dense crowd scenes, the The cost of labeling the head frame is high; on the other hand, due to the small number of distant heads in crowded scenes, the labeled head frame is not accurate, which will affect the training of the head target detection model; in addition, the high performance of related technologies Most human head target detection frameworks are two-stage detection, that is, firstly extract features from the image through the pre-trained feature extraction network, and then send the extracted features to the ROI (Region Of Interest) network to obtain candidate areas that may have human heads , and then perform ROI pooling/ROI alignment on the candidate area to map the two-dimensional features into a fixed-length feature vector, and finally send the feature vector to two neural networks for classification and position regression respectively to obtain the detection result. The above-mentioned detection process is relatively complicated, and it is obviously not practical for crowd analysis with high real-time requirements.
除基于人头目标检测的人群定位方法外,目前还存在直接生成目标定位图的人群定位算法,这种方法降低了基于人头目标检测算法的局限性:输入原始人群图像,经过卷积神经网络网络直接端到端输出与原始人群图像大小相同的目标定位图。在目标定位图中,目标人头关键点用1表示,否则为0。对目标定位图求和便可得到人群计数指标。In addition to the crowd positioning method based on head target detection, there is also a crowd positioning algorithm that directly generates a target positioning map. This method reduces the limitations of the head target detection algorithm: input the original crowd image, and directly End-to-end outputs an object localization map of the same size as the original crowd image. In the target localization map, the key point of the target head is represented by 1, otherwise it is 0. The crowd count metric is obtained by summing the object localization maps.
然后,卷积神经网络仅能输出初始定位图,需要对初始定位图进行图像后处理,来得到最终的目标定位图。图像后处理时需要进行过滤(例如,非极大值抑制处理NMS)操作。相关技术中,使用邻域半径固定的邻域进行过滤,这样,容易导致人头比较大的地方出现同一个人体头部多个人头关键点的误检,或者人头比较小的地方出现漏检。Then, the convolutional neural network can only output the initial positioning map, and image post-processing needs to be performed on the initial positioning map to obtain the final target positioning map. Filtering (for example, non-maximum suppression processing NMS) operations are required during image post-processing. In related technologies, a neighborhood with a fixed neighborhood radius is used for filtering. In this way, it is easy to cause false detection of multiple key points of the same human head in places with relatively large heads, or missed detection in places with relatively small heads.
本公开实施例提供了一种人群定位方法,可以应用到密集场景下的人群定位。对密集场景下采集的人群图像进行人体关键点定位,可以端到端的得到用于指示人群图像中包括的初始人体关键点的位置的初始定位图,进而基于初始人体关键点在人群图像中的位置,确定不同初始人体关键点对应的不同目标邻域,进而对初始定位图中的多个初始 人体关键点利用不同大小的目标邻域进行过滤,以降低同一个人体对应多个初始人体关键点的误检概率,得到准确率较高的目标定位图。An embodiment of the present disclosure provides a method for crowd positioning, which can be applied to crowd positioning in a dense scene. The human body key point positioning is performed on the crowd images collected in dense scenes, and the initial positioning map used to indicate the position of the initial human body key points included in the crowd image can be obtained end-to-end, and then based on the position of the initial human body key points in the crowd image , determine different target neighborhoods corresponding to different initial human key points, and then filter multiple initial human key points in the initial positioning map using target neighborhoods of different sizes to reduce the number of initial human key points corresponding to the same human body. The probability of false detection is higher, and the target positioning map with higher accuracy is obtained.
下面对本公开实施例提供的人群定位方法进行详细描述。The crowd positioning method provided by the embodiments of the present disclosure will be described in detail below.
图1示出根据本公开实施例的一种人群定位方法的流程图。该人群定位方法可以由终端设备或服务器等电子设备执行,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等,该人群定位方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。或者,可通过服务器执行该人群定位方法。如图1所示,该人群定位方法可以包括:Fig. 1 shows a flow chart of a crowd locating method according to an embodiment of the present disclosure. The crowd positioning method can be performed by electronic devices such as terminal equipment or servers, and the terminal equipment can be user equipment (User Equipment, UE), mobile equipment, user terminal, terminal, cellular phone, cordless phone, personal digital assistant (Personal Digital Assistant, PDA), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc., the crowd positioning method can be realized by calling the computer-readable instructions stored in the memory by the processor. Alternatively, the crowd locating method can be executed by a server. As shown in Figure 1, the crowd positioning method may include:
在步骤S11中,对人群图像进行人体关键点定位,得到人群图像对应的初始定位图,其中,初始定位图用于指示人群图像中包括的初始人体关键点的位置。In step S11 , the human body key points are located on the crowd image to obtain an initial positioning map corresponding to the crowd image, wherein the initial positioning map is used to indicate the position of the initial human body key points included in the crowd image.
这里的人群图像是包含密集人群的图像,其可以是图像采集设备对某个空间范围内的密集人群进行图像采集后得到的,也可以是从视频中获取的包含密集人群的关键图像帧,还可以是通过其它方式获取得到的,本公开对此不作具体限定。The crowd image here is an image containing dense crowds, which can be obtained after the image acquisition device collects images of dense crowds within a certain spatial range, or it can be a key image frame containing dense crowds obtained from a video, or It may be obtained by other means, which is not specifically limited in the present disclosure.
对人群图像进行人体关键点定位,端到端的得到用于指示人群图像中包括的初始人体关键点的位置的初始定位图。例如,对人群图像进行人头关键点定位,端到端的得到用于指示人群图像中包括的初始人头关键点的位置的初始定位图。后文会结合本公开可能的实现方式,对人头关键点定位的具体过程进行详细描述,此处不作赘述。Human body key points are located on the crowd image, and an initial positioning map used to indicate the position of the initial human body key points included in the crowd image is obtained end-to-end. For example, the head key point location is performed on the crowd image, and an initial positioning map used to indicate the position of the initial head key point included in the crowd image is obtained end-to-end. The specific process of head key point positioning will be described in detail later in combination with possible implementations of the present disclosure, and will not be repeated here.
在步骤S12中,基于初始人体关键点在人群图像中的位置,确定初始人体关键点对应的目标邻域。In step S12, based on the positions of the initial human body key points in the crowd image, the target neighborhood corresponding to the initial human body key points is determined.
针对初始定位图指示的人群图像中包括的初始人体关键点,基于初始人体关键点在人群图像中的位置,可以确定初始人体关键点需要进行后续图像处理的目标邻域大小。后文会结合本公开可能的实现方式,对基于初始人体关键点在人群图像中的位置确定初始人体关键点对应的目标邻域的过程进行详细描述,此处不做赘述。For the initial human key points included in the crowd image indicated by the initial positioning map, based on the positions of the initial human key points in the crowd image, the size of the target neighborhood for subsequent image processing of the initial human key points can be determined. The process of determining the target neighborhood corresponding to the initial human key point based on the position of the initial human key point in the crowd image will be described in detail later in combination with possible implementations of the present disclosure, and will not be repeated here.
在步骤S13中,基于初始人体关键点对应的目标邻域,对初始定位图进行过滤,得到目标定位图,其中,目标定位图用于指示人群图像中包括的目标人体关键点的位置。In step S13, based on the target neighborhood corresponding to the initial key points of the human body, the initial positioning map is filtered to obtain the target positioning map, wherein the target positioning map is used to indicate the position of the key points of the target human body included in the crowd image.
根据不同初始人体关键点对应的不同目标邻域,对初始定位图进行过滤处理,得到准确率较高的目标定位图。后文会结合本公开可能的实现方式,对基于初始人体关键点对应的目标邻域对初始定位图进行过滤的过程进行详细描述,此处不做赘述。According to different target neighborhoods corresponding to different initial human key points, the initial positioning map is filtered to obtain a target positioning map with high accuracy. The process of filtering the initial positioning map based on the target neighborhood corresponding to the initial key points of the human body will be described in detail later in combination with possible implementations of the present disclosure, and will not be repeated here.
在本公开实施例中,对人群图像进行人体关键点定位,可以端到端的得到用于指示人群图像中包括的初始人体关键点的位置的初始定位图,基于初始人体关键点在人群图像中的位置,确定不同初始人体关键点对应的目标邻域,进而利用与不同初始人体关键点匹配的不同大小的目标邻域,对初始定位图中进行过滤,以降低同一个人体对应多个初始人体关键点的误检概率,得到准确率较高的目标定位图。In the embodiment of the present disclosure, the key points of the human body are located on the crowd image, and the initial positioning map indicating the position of the initial key points of the human body included in the crowd image can be obtained end-to-end. Position, determine the target neighborhoods corresponding to different initial human key points, and then use target neighborhoods of different sizes that match different initial human key points to filter the initial positioning map to reduce the number of initial human body key points corresponding to the same human body. The false detection probability of the point is obtained, and the target positioning map with high accuracy is obtained.
在一种可能的实现方式中,基于初始人体关键点在人群图像中的位置,确定初始人体关键点对应的目标邻域,包括:针对任意一个初始人体关键点,基于初始人体关键点 在人群图像中的位置,以及预设透视映射关系,确定初始人体关键点对应的目标邻域,其中,预设透视映射关系用于指示人群图像中不同位置的图像尺度。In a possible implementation, the target neighborhood corresponding to the initial human key point is determined based on the position of the initial human key point in the crowd image, including: for any initial human key point, based on the position of the initial human key point in the crowd image The position in and the preset perspective mapping relationship determine the target neighborhood corresponding to the initial human body key point, wherein the preset perspective mapping relationship is used to indicate the image scale of different positions in the crowd image.
图像尺度可以是人群图像中某一位置用于表示真实世界中的单位高度所需的像素行数。单位高度可以根据实际情况进行灵活设置,例如,单位高度可以是1米,本公开对此不做具体限定。The image scale can be the number of pixel rows required to represent a unit height in the real world at a location in the crowd image. The unit height can be flexibly set according to actual conditions, for example, the unit height can be 1 meter, which is not specifically limited in the present disclosure.
人群图像中近处的行人对应的图像尺度大,远处的行人对应的图像尺度小。例如,身高同样是1.7米的两个行人A和B,处于人群图像中近处的行人A所需的像素行数是p1,处于人群图像远处的行人B所需的像素行数是p2,其中,p1>P2。In the crowd image, the image scale corresponding to the nearby pedestrians is large, and the image scale corresponding to the distant pedestrians is small. For example, for two pedestrians A and B with the same height of 1.7 meters, the number of pixel rows required by pedestrian A near the crowd image is p1, and the number of pixel rows required by pedestrian B far away from the crowd image is p2. Among them, p1>P2.
这里的“远”指的是人群图像中的行人对应的真实行人与采集人群图像的图像采集设备之间的距离远,“近”指的是人群图像中的行人对应的真实行人与采集人群图像的图像采集设备之间的距离近。"Far" here refers to the distance between the real pedestrian corresponding to the pedestrian in the crowd image and the image acquisition device that collects the crowd image. The distance between the image acquisition devices is short.
预设透视映射关系可以指示人群图像中不同位置对应的图像尺度。后文会结合本公开可能的实现方式,对确定预设透视映射关系的过程进行详细描述,此处不做赘述。The preset perspective mapping relationship may indicate image scales corresponding to different positions in the crowd image. The process of determining the preset perspective mapping relationship will be described in detail later in combination with possible implementations of the present disclosure, and will not be repeated here.
在确定人群图像对应的预设透视映射关系之后,针对初始定位图指示的任意一个初始人体关键点,可以基于初始人体关键点在人群图像中的位置,以及预设透视映射关系,确定初始人体关键点对应的图像尺度,进而基于初始人体关键点对应的图像尺度,确定初始人体关键点对应的目标邻域。After determining the preset perspective mapping relationship corresponding to the crowd image, for any initial human key point indicated by the initial positioning map, the initial human key point can be determined based on the position of the initial human key point in the crowd image and the preset perspective mapping relationship. The image scale corresponding to the point, and then based on the image scale corresponding to the initial human key point, the target neighborhood corresponding to the initial human key point is determined.
基于初始人体关键点在人群图像中的位置,除了基于预设透视映射关系确定初始人体关键点对应的图像尺度,以确定初始人体关键点对应的目标邻域之外,还可以直接基于初始人体关键点在人群图像中的位置,以及预先设置的人群图像中不同位置对应的预设邻域半径,来确定初始人头关键点对应的目标邻域,还可以采用其它确定目标领域的方式,本公开实施例对此不做具体限定。Based on the position of the initial human key points in the crowd image, in addition to determining the image scale corresponding to the initial human key points based on the preset perspective mapping relationship to determine the target neighborhood corresponding to the initial human key points, it can also be directly based on the initial human key points The position of the point in the crowd image and the preset neighborhood radius corresponding to different positions in the preset crowd image are used to determine the target neighborhood corresponding to the initial key point of the head. Other methods of determining the target area can also be used. The implementation of this disclosure The example does not specifically limit this.
在一种可能的实现方式中,该人群定位方法还包括:获取对人群图像中不同位置的行人进行人体框标注得到的多个标注人体框;基于多个标注人体框,确定预设透视映射关系。In a possible implementation, the crowd positioning method further includes: acquiring a plurality of marked human body frames obtained by marking pedestrians in different positions in the crowd image; determining a preset perspective mapping relationship based on the multiple marked human body frames .
在人群图像中选择远、中、近不同位置的行人进行人体框标注,可以得到人群图像中的多个标注人体框,基于标注人体框的高度以及行人的实际身高之间的比例关系,可以确定人群图像中有限位置(标注人体框位置处)对应的图像尺度,进而,基于有限位置对应的图像尺度,进一步拟合以有效得到人群图像中每个位置对应的图像尺度,即得到预设透视映射关系。Select pedestrians in different positions in the crowd image for human body frame labeling, and multiple labeled human body frames in the crowd image can be obtained. Based on the proportional relationship between the height of the marked human body frame and the actual height of the pedestrian, it can be determined The image scale corresponding to the limited position in the crowd image (where the body frame is marked), and then, based on the image scale corresponding to the limited position, further fitting is performed to effectively obtain the image scale corresponding to each position in the crowd image, that is, the preset perspective map is obtained relation.
图2示出根据本公开实施例的人群图像和其对应的预设透视映射关系的示意图。如图2所示,在人群图像中选择远、中、近不同位置的行人进行人体框标注,得到人群图像中不同位置的四个标注人体框A、B、C、D,进而,基于四个标注人体框A、B、C、D,拟合以有效得到人群图像对应的预设透视映射关系。Fig. 2 shows a schematic diagram of a crowd image and its corresponding preset perspective mapping relationship according to an embodiment of the present disclosure. As shown in Figure 2, pedestrians in different positions in the crowd image are selected for human body frame labeling, and four marked human body frames A, B, C, and D in different positions in the crowd image are obtained. Then, based on the four Label the human body frames A, B, C, and D, and fit them to effectively obtain the preset perspective mapping relationship corresponding to the crowd image.
在一种可能的实现方式中,基于多个标注人体框,确定预设透视映射关系,包括:针对任意一个标注人体框,确定该标注人体框中的参考人体关键点对应的参考图像尺度; 根据标注人体框中的参考人体关键点的第三图像坐标,以及标注人体框中的参考人体关键点对应的参考图像尺度,拟合得到预设透视映射关系。In a possible implementation, determining the preset perspective mapping relationship based on multiple labeled human body frames includes: for any labeled human body frame, determining the reference image scale corresponding to the key points of the reference human body in the labeled human body frame; The third image coordinates of the key points of the reference human body marked in the human body frame and the reference image scale corresponding to the key points of the reference human body marked in the human body frame are fitted to obtain a preset perspective mapping relationship.
沿人群图像的列方向,不同位置的图像尺度是线性变化的,因此,在根据标注人体框确定人群图像中有限位置的参考人体关键点对应的图像尺度之后,可以通过线性函数拟合,有效得到人群图像中每个位置对应的图像尺度,即得到人群图像对应的预设透视映射关系。Along the column direction of the crowd image, the image scales at different positions change linearly. Therefore, after determining the image scales corresponding to the key points of the reference human body at limited positions in the crowd image according to the labeled human frame, it can be fitted by a linear function to effectively obtain The image scale corresponding to each position in the crowd image is to obtain the preset perspective mapping relationship corresponding to the crowd image.
由于行人是竖直站立的,以人脚关键点作为参考人体关键点,标注人体框的高度可以看作是行人在人群图像中的高度。标注人体框的高度可以用标注人体框所占像素行数来表示。例如,标注人体框在人群图像中占据17行像素,则标注人体框的高度是17。假设标注人体框对应的行人的真实身高是1.7米,可以确定在标注人体框中的参考人脚关键点的位置,表示真实世界中的1.7米需要17行像素。假设单位高度是1m,因此,在标注人体框中的参考人脚关键点的位置,表示真实世界中的1米需要10行像素,即标注人体框中的参考人脚关键点对应的参考图像尺度是10。标注人体框对应的行人的真实身高可以根据实际情况选择适当取值,本公开对此不做具体限定。Since pedestrians stand upright, the key points of human feet are used as reference key points of the human body, and the height of the marked human frame can be regarded as the height of the pedestrian in the crowd image. The height of the labeled human body frame can be expressed by the number of pixel rows occupied by the labeled human body frame. For example, if the labeled human frame occupies 17 rows of pixels in the crowd image, the height of the labeled human frame is 17. Assuming that the real height of the pedestrian corresponding to the marked human body frame is 1.7 meters, the position of the key point of the reference human foot in the marked human body frame can be determined, indicating that 1.7 meters in the real world requires 17 rows of pixels. Assuming that the unit height is 1m, therefore, at the position of the key points of the reference human feet in the body frame, it means that 1 meter in the real world requires 10 lines of pixels, that is, the scale of the reference image corresponding to the key points of the reference human feet in the body frame is 10. The real height of the pedestrian corresponding to the marked body frame can be selected as an appropriate value according to the actual situation, which is not specifically limited in the present disclosure.
标注人体框中的参考人脚关键点可以是标注人体框底边中点,还可以是标注人体框中的其它像素点,本公开对此不做具体限定。Marking the key points of the reference human feet in the human body frame may be marking the midpoint of the bottom edge of the human body frame, or marking other pixel points in the human body frame, which is not specifically limited in the present disclosure.
仍以上述图2为例,在人群图像中标注得到四个标注人体框A、B、C、D之后,按照上述方式确定每个标注人体框中的参考人脚关键点对应的参考图像尺度。进而,根据四个标注人体框中的参考人脚关键点的第三图像坐标,及其对应的参考图像尺度进行线性函数拟合,得到线性映射函数p=a*y+b。Still taking the above-mentioned Figure 2 as an example, after the four marked human body frames A, B, C, and D are marked in the crowd image, the reference image scale corresponding to the reference human foot key points in each marked human body frame is determined according to the above method. Furthermore, a linear function fitting is performed according to the third image coordinates of the key points of the reference human feet in the four labeled human body frames and the corresponding reference image scales to obtain a linear mapping function p=a*y+b.
其中,图像坐标指的是在人群图像的像素坐标系下的位置坐标。例如,以人群图像的左上角为坐标原点(0,0),平行于图像的行方向为x轴的方向,平行于图像的列方向为y轴的方向,构建人群图像的像素坐标系,图像坐标的横坐标和纵坐标的单位均为像素点。例如,参考人脚关键点的图像坐标是(10,15),则指示参考人脚关键点是人群图像中位于第10行第15列处的像素点。Wherein, the image coordinates refer to the position coordinates in the pixel coordinate system of the crowd image. For example, take the upper left corner of the crowd image as the coordinate origin (0, 0), the row direction parallel to the image is the x-axis direction, and the column direction parallel to the image is the y-axis direction to construct the pixel coordinate system of the crowd image, the image The units of the abscissa and ordinate of the coordinates are pixels. For example, if the image coordinates of the key points of the reference human feet are (10, 15), it indicates that the key points of the reference human feet are the pixel points at the 10th row and the 15th column in the crowd image.
线性映射函数p=a*y+b是人群图像对应的预设透视映射关系的函数表示形式。其中,a和b是线性函数拟合得到的参数,y是人群图像中不同位置的图像坐标的纵坐标,p是该位置对应的图像尺度。利用线性映射函数p=a*y+b,可以确定人群图像中每个位置对应的图像尺度。The linear mapping function p=a*y+b is a functional representation of the preset perspective mapping relationship corresponding to the crowd image. Among them, a and b are the parameters obtained by linear function fitting, y is the vertical coordinate of the image coordinates of different positions in the crowd image, and p is the image scale corresponding to the position. Using the linear mapping function p=a*y+b, the image scale corresponding to each position in the crowd image can be determined.
在确定人群图像对应的预设透视映射关系之前或之后,对人群图像进行人体关键点定位,得到人群图像对应的初始定位图。Before or after determining the preset perspective mapping relationship corresponding to the crowd image, the key points of the human body are located on the crowd image to obtain an initial positioning map corresponding to the crowd image.
在一种可能的实现方式中,初始人体关键点为初始人头关键点。In a possible implementation manner, the initial human body key points are initial human head key points.
由于在密集人群图像中,不同行人的身体之间遮挡严重,因此,将人头关键点确定为人体关键点,可以有效区分不同行人,提高人群定位精度。Due to the severe occlusion between the bodies of different pedestrians in dense crowd images, determining the key points of the head as the key points of the human body can effectively distinguish different pedestrians and improve the accuracy of crowd positioning.
人头关键点可以是人体头部的中心点,也可以是人体头部的其它预设关键点,本公开对此不作具体限定。The key point of the human head may be the center point of the human head, or other preset key points of the human head, which is not specifically limited in the present disclosure.
在一种可能的实现方式中,对人群图像进行人体关键点定位,得到人群图像对应的初始定位图,包括:对人群图像进行人头关键点定位,确定人群图像对应的预测定位图,其中,预测定位图用于指示人群图像中的像素点是人头关键点的预测置信度;基于预设置信度阈值,对预测定位图进行图像处理,得到初始定位图。In a possible implementation, the human body key point positioning is performed on the crowd image to obtain the initial positioning map corresponding to the crowd image, including: performing head key point positioning on the crowd image, and determining a predicted positioning map corresponding to the crowd image, wherein, the predicted The positioning map is used to indicate the prediction confidence that the pixels in the crowd image are the key points of the head; based on the preset reliability threshold, image processing is performed on the predicted positioning map to obtain the initial positioning map.
对人群图像进行人头关键点定位,端到端的确定人群图像中各像素点是人头关键点的预测置信度,进而通过预设置信度阈值对预测定位图进行阈值分割,确定人群图像中包括的初始人头关键点的位置。Carry out head key point positioning on the crowd image, determine the prediction confidence of each pixel in the crowd image as the key point of the head end-to-end, and then perform threshold segmentation on the predicted positioning map by setting the reliability threshold to determine the initial information included in the crowd image The location of key points of the human head.
在一示例中,可以利用训练好的人头关键点定位神经网络,对人群图像进行人头关键点定位。具体地,将人群图像输入训练好的人头关键点定位神经网络,经过人头关键点定位神经网络的定位,直接输出预测定位图。训练好的人头关键点定位神经网络的具体网络结构,以及训练过程,可以采用相关技术中的网络结构和训练过程,本公开对此不做具体限定。In an example, the trained human head key point positioning neural network can be used to perform head key point positioning on crowd images. Specifically, the crowd image is input into the trained human head key point positioning neural network, and the predicted positioning map is directly output after the positioning of the human head key point positioning neural network. The specific network structure and training process of the trained human head key point positioning neural network can adopt the network structure and training process in related technologies, which is not specifically limited in this disclosure.
在一示例中,预测定位图中每个像素点的像素值,表示该像素点的预测置信度,即该像素点是人头关键点的概率。对预测定位图进行sigmoid操作,以使得预测定位图中每个像素点的像素值位于0~1之间。例如,预测定位图中某一像素点的像素值为0.7,则表示该像素点是人头关键点的概率是0.7。In an example, the pixel value of each pixel in the predicted positioning map represents the prediction confidence of the pixel, that is, the probability that the pixel is a key point of a human head. A sigmoid operation is performed on the predicted positioning map, so that the pixel value of each pixel in the predicted positioning map is between 0 and 1. For example, if the pixel value of a certain pixel in the predicted localization map is 0.7, it means that the probability that the pixel is a key point of a human head is 0.7.
由于预测定位图仅用于指示人群图像中各像素点是人头关键点的预测置信度,因此,通过预设置信度阈值,对预测定位图进行阈值分割,从而可以有效得到用于指示人群图像中包括的初始人头关键点的位置的初始定位图。预设置信度阈值的具体取值可以根据实际情况进行灵活设置,本公开对此不做具体限定。Since the predicted localization map is only used to indicate the prediction confidence that each pixel in the crowd image is a key point of the head, by presetting the confidence threshold, the predicted localization map is thresholded, so that it can be effectively used to indicate the crowd image. An initial localization map including the positions of the initial head keypoints. The specific value of the preset reliability threshold can be flexibly set according to the actual situation, which is not specifically limited in the present disclosure.
将预测定位图中逐像素点的像素值与预设置信度阈值进行比较,在预测定位图中某一像素点的像素值大于或等于预设置信度阈值的情况下,将初始定位图中相对位置相同的像素点的像素值确定为1;在预测定位图中某一像素点的像素值小于预设置信度阈值的情况下,将初始定位图中相对位置相同的像素点的像素值确定为0。Compare the pixel value of each pixel in the predicted positioning map with the preset reliability threshold, and if the pixel value of a certain pixel in the predicted positioning map is greater than or equal to the preset reliability threshold, the relative The pixel value of the pixel at the same position is determined to be 1; when the pixel value of a certain pixel in the predicted positioning map is less than the preset reliability threshold, the pixel value of the pixel at the same relative position in the initial positioning map is determined as 0.
初始定位图和人群图像具有相同的尺寸,初始定位图中像素值为1的像素点的位置,用于指示人群图像中包括的初始人头关键点的位置。例如,在初始定位图中图像坐标为(x,y)的像素点的像素值为1的情况下,可以确定人群图像中图像坐标为(x,y)的像素点是初始人头关键点;在初始定位图中图像坐标为(x,y)的像素点的像素值为0的情况下,可以确定人群图像中图像坐标为(x,y)的像素点是初始人头关键点以外的部分。The initial positioning map and the crowd image have the same size, and the position of a pixel with a pixel value of 1 in the initial positioning map is used to indicate the position of the initial head key point included in the crowd image. For example, in the case where the pixel value of the pixel point whose image coordinates are (x, y) in the initial positioning map is 1, it can be determined that the pixel point whose image coordinates are (x, y) in the crowd image is the initial key point of the head; If the pixel value of the pixel with image coordinates (x, y) in the initial positioning image is 0, it can be determined that the pixel with image coordinates (x, y) in the crowd image is a part other than the initial key point of the head.
在确定人群图像中包括的初始人头关键点的位置之后,可以基于预设透视映射关系,确定每个初始人头关键点对应的目标邻域。After determining the positions of the initial head key points included in the crowd image, the target neighborhood corresponding to each initial head key point may be determined based on a preset perspective mapping relationship.
在一种可能的实现方式中,基于初始人体关键点在人群图像中的位置,以及预设透视映射关系,确定初始人体关键点对应的目标邻域,包括:基于预设透视映射关系,确定初始人头关键点在人群图像中的位置对应的目标图像尺度;基于目标图像尺度,确定初始人头关键点对应的人头框高度;基于初始人头关键点对应的人头框高度,确定初始人头关键点对应的目标邻域。In a possible implementation, based on the position of the initial human body key point in the crowd image and the preset perspective mapping relationship, the target neighborhood corresponding to the initial human body key point is determined, including: based on the preset perspective mapping relationship, determining the initial The target image scale corresponding to the position of the head key point in the crowd image; based on the target image scale, determine the head frame height corresponding to the initial head key point; based on the head frame height corresponding to the initial head key point, determine the target corresponding to the initial head key point Area.
基于预设透视映射关系,可以快速确定初始人头关键点对应的目标图像尺度,进而确定不同位置的初始人头关键点对应的人头框高度,以使得可以进一步根据人头框高度,确定与之匹配的目标邻域。Based on the preset perspective mapping relationship, the scale of the target image corresponding to the initial key points of the head can be quickly determined, and then the height of the head frame corresponding to the initial key points of the head at different positions can be determined, so that the matching target can be further determined according to the height of the head frame Area.
例如,针对初始定位图中的某一个初始人头关键点i,该初始人头关键点i在人群图像中的图像坐标是(h x,h y),则根据人群图像对应的预设透视映射关系(线性映射函数p=a*y+b),可以确定该初始人头关键点i对应的目标尺度是p i=a*h y+b。假设人群图像中的行人对应的真实人头框高度是0.4米*0.4米,则人群图像中该初始人头关键点i对应的人头框高度为s i=0.4*p i。根据该初始人头关键点对应的人头框高度为s i=0.4*p i,确定与之大小匹配的目标邻域。 For example, for a certain initial head key point i in the initial positioning map, the image coordinates of the initial head key point i in the crowd image are (h x , h y ), then according to the preset perspective mapping relationship corresponding to the crowd image ( The linear mapping function p=a*y+b), it can be determined that the target scale corresponding to the initial key point i of the head is p i =a*h y +b. Assuming that the real head frame height corresponding to the pedestrian in the crowd image is 0.4m*0.4m, then the head frame height corresponding to the initial key point i of the head in the crowd image is s i =0.4*p i . According to the height of the head frame corresponding to the initial head key point is s i =0.4*p i , determine the target neighborhood matching its size.
在一种可能的实现方式中,基于初始人头关键点对应的人头框高度,确定初始人头关键点对应的目标邻域,包括:在人头框高度大于预设人头框高度阈值的情况下,基于第一邻域半径,确定目标邻域;或,在人头框高度小于或等于预设人头框高度阈值的情况下,基于第二邻域半径,确定目标邻域,其中,第一邻域半径大于第二邻域半径。In a possible implementation, based on the head frame height corresponding to the initial head key point, determining the target neighborhood corresponding to the initial head key point includes: when the head frame height is greater than the preset head frame height threshold, based on the first A neighborhood radius to determine the target neighborhood; or, when the height of the head frame is less than or equal to the preset head frame height threshold, based on the second neighborhood radius, determine the target neighborhood, wherein the first neighborhood radius is greater than the first Second neighborhood radius.
在人头框高度大于预设人头框高度阈值的情况下,可以确定该人头框大小较大,因此,采用较大的第一邻域半径对其进行后续过滤处理;在人头框高度小于或等于预设人头框高度阈值的情况下,可以确定该人头框大小较小,因此,采用较小的第二邻域半径对其进行后续过滤处理。通过灵活确定邻域半径,可以提高过滤操作的准确性。预设人头框高度阈值、第一邻域半径、第二邻域半径的具体取值可以根据实际情况灵活进行设置,本公开对此不做具体限定。When the height of the head frame is greater than the preset height threshold of the head frame, it can be determined that the size of the head frame is relatively large, so a larger first neighborhood radius is used for subsequent filtering processing; when the height of the head frame is less than or equal to the preset When the height threshold of the head frame is set, it can be determined that the size of the head frame is relatively small, so a smaller second neighborhood radius is used for subsequent filtering processing. By flexibly determining the neighborhood radius, the accuracy of the filtering operation can be improved. The specific values of the preset head frame height threshold, the first neighborhood radius, and the second neighborhood radius can be flexibly set according to actual conditions, and this disclosure does not specifically limit them.
在一示例中,人头框高度阈值是32,针对某一个初始人头关键点i,在其对应的人头框高度s i>32的情况下,基于第一邻域半径2确定其目标邻域;在其对应的人头框高度s i<=32的情况下,基于第二邻域半径1确定其目标邻域。 In one example, the height threshold of the head frame is 32. For an initial key point i, if the corresponding head frame height s i >32, the target neighborhood is determined based on the first neighborhood radius 2; In the case of the corresponding head frame height s i <= 32, the target neighborhood is determined based on the second neighborhood radius 1.
在第一预设邻域半径为2的情况下,初始人头关键点i对应的目标邻域包括,与初始人头关键点i之间的像素距离不超过2个像素点的像素点。在第二预设邻域半径为1的情况下,初始人头关键点i对应的目标邻域包括,与初始人头关键点i之间的像素距离不超过1个像素点的像素点。In the case where the first preset neighborhood radius is 2, the target neighborhood corresponding to the initial key point i of the human head includes pixels whose pixel distance from the initial key point i of the human head does not exceed 2 pixels. In the case that the second preset neighborhood radius is 1, the target neighborhood corresponding to the initial human head key point i includes pixels whose pixel distance from the initial human head key point i does not exceed 1 pixel point.
在基于上述方式确定初始定位图中每个初始人头关键点对应的目标邻域之后,利用每个初始人头关键点对应的目标邻域,对初始定位图进行过滤,以得到准确率较高的目标定位图。After determining the target neighborhood corresponding to each initial head key point in the initial positioning map based on the above method, use the target neighborhood corresponding to each initial head key point to filter the initial positioning map to obtain a target with high accuracy Location map.
在一种可能的实现方式中,基于初始人体关键点对应的目标邻域,对初始定位图进行过滤,得到目标定位图,包括:针对任意一个初始人头关键点i,确定在初始人头关键点i对应的目标邻域内,是否存在至少一个其它初始人头关键点;在目标邻域内存在至少一个其它初始人头点j的情况下,根据预测定位图,确定初始人头点i对应的预测置信度,以及至少一个其它初始人头点j对应的预测置信度;将初始人头关键点i和至少一个其它初始人头关键点j中,预测置信度最大的初始人头关键点,确定为目标邻域内的目标人头关键点。In a possible implementation, based on the target neighborhood corresponding to the initial key points of the human body, the initial positioning map is filtered to obtain the target positioning map, including: for any initial key point i of the human head, determine the initial key point i In the corresponding target neighborhood, whether there is at least one other initial head key point; in the case of at least one other initial head point j in the target neighborhood, determine the prediction confidence corresponding to the initial head point i according to the predicted positioning map, and at least The prediction confidence corresponding to one other initial head point j; among the initial head key point i and at least one other initial head key point j, the initial head key point with the highest prediction confidence is determined as the target head key point in the target neighborhood.
为了降低同一个人体头部对应多个初始人头关键点的误检测概率,进一步利用初始人头关键点的目标邻域,对初始定位图进行过滤,以得到精度较高的目标定位图。In order to reduce the false detection probability of the same human head corresponding to multiple initial head key points, the initial localization map is filtered by further using the target neighborhood of the initial human head key points to obtain a high-precision target localization map.
针对初始定位图中的任意一个初始人头关键点i,根据上述方式确定其对应的目标邻域之后,在其目标邻域内检测是否存在其它初始人头关键点,若存在其它图像坐标为(x j,y j)的初始人头关键点j,则根据预测定位图,确定初始人头关键点i对应的预测置信度,以及初始人头点j对应的预测置信度。当初始人头关键点i的预测置信度大于初始人头关键点j的预测置信度的情况下,保持图像坐标为(x i,y i)的像素点的像素值为1,将图像坐标为(x j,y j)的像素点的像素值更新为0,即过滤掉初始定位图中的初始人头关键点j。以此类推,遍历初始定位图中的每个初始人头关键点,得到最终的目标定位图。 For any initial head key point i in the initial positioning map, after determining its corresponding target neighborhood according to the above method, detect whether there are other initial head key points in the target neighborhood, if there are other image coordinates (x j , y j ), the prediction confidence corresponding to the initial head key point i and the prediction confidence corresponding to the initial head point j are determined according to the predicted positioning map. When the prediction confidence of the initial head key point i is greater than the prediction confidence of the initial head key point j, the pixel value of the pixel whose image coordinates are (xi , y i ) is kept as 1, and the image coordinates are (x j , y j ) The pixel value of the pixel point is updated to 0, that is, the initial head key point j in the initial positioning map is filtered out. By analogy, each initial head key point in the initial positioning map is traversed to obtain the final target positioning map.
在一种可能的实现方式中,该人群定位方法还包括:基于目标定位图和预设透视映射关系,确定人群图像中包括的目标人脚关键点的位置。In a possible implementation manner, the crowd positioning method further includes: based on the target positioning map and the preset perspective mapping relationship, determining the positions of the key points of the target person's feet included in the crowd image.
在检测系统中对行人进行位置分析时,一般情况下需要知道人脚的位置。例如,在做客流量统计的情况下,一般根据实际设定的位置提前画线,然后根据人脚在前后帧的位置关系来判断是否跨线。因此,在人群定位任务中,如何精准定位人脚的位置至关重要。When analyzing the position of pedestrians in the detection system, it is generally necessary to know the position of the person's feet. For example, in the case of passenger traffic statistics, the line is generally drawn in advance according to the actual set position, and then it is judged whether to cross the line according to the positional relationship of the human feet in the front and rear frames. Therefore, in the crowd positioning task, how to accurately locate the position of human feet is very important.
在基于前述方法确定目标定位图之后,可以确定人群图像中包括的目标人头关键点的位置,进而基于目标定位图和预设透视映射关系,可以进一步快速确定人群图像中包括的目标人脚关键点的位置。After the target positioning map is determined based on the aforementioned method, the position of the key points of the target person's head included in the crowd image can be determined, and then based on the target positioning map and the preset perspective mapping relationship, the key points of the target person's feet included in the crowd image can be further quickly determined s position.
在一种可能的实现方式中,基于目标定位图和预设透视映射关系,确定人群图像中包括的目标人脚关键点的位置,包括:针对任意一个目标人头关键点,根据目标定位图,确定目标人头关键点在所述人群图像中的第一图像坐标;基于预设透视映射关系,对第一图像坐标进行坐标转换,得到目标人头关键点对应的目标人脚关键点在人群图像中的第二图像坐标。In a possible implementation, based on the target positioning map and the preset perspective mapping relationship, determining the position of the key point of the target person's foot included in the crowd image includes: for any key point of the target person's head, according to the target positioning map, determine The first image coordinates of the key points of the target person's head in the crowd image; based on the preset perspective mapping relationship, coordinate conversion is performed on the first image coordinates to obtain the first position of the key points of the target's feet corresponding to the key points of the target person's head in the crowd image Two image coordinates.
由于预设透视映射关系可以指示人群图像中不同位置的图像尺度,因此,基于预设透视映射关系,可以对目标人头关键点的第一图像坐标进行坐标转换,得到该目标人头关键点对应的目标人脚关键点在人群图像中的第二图像坐标。Since the preset perspective mapping relationship can indicate the image scales of different positions in the crowd image, based on the preset perspective mapping relationship, the coordinate conversion of the first image coordinates of the key points of the target head can be performed to obtain the target corresponding to the key points of the target head The second image coordinates of the key points of the human feet in the crowd image.
例如,针对目标定位图中的某一个目标人头关键点,该目标人头关键点在人群图像中的第一图像坐标是(h x,h y),第一图像坐标是已知的。根据人群图像对应的预设透视映射关系,可以对第一图像坐标(h x,h y)进行坐标转换,得到该目标人头关键点对应的目标人脚关键点的第二图像坐标是(f x,f y)。 For example, for a key point of a target's head in the target location map, the first image coordinates of the key point of the target's head in the crowd image are (h x , h y ), and the first image coordinates are known. According to the preset perspective mapping relationship corresponding to the crowd image, coordinate transformation can be performed on the first image coordinates (h x , h y ), and the second image coordinates of the target human foot key points corresponding to the target human head key points are (f x , f y ).
在一种可能的实现方式中,基于预设透视映射关系,对第一图像坐标进行坐标转换,得到目标人头关键点对应的目标人脚关键点在人群图像中的第二图像坐标,包括:基于预设透视映射关系,确定目标人头关键点对应的目标图像尺度;基于目标图像尺度,确定目标人头关键点与目标人脚关键点之间的图像距离;根据第一图像坐标和图像距离,确定目标人脚关键点在人群图像中的第二图像坐标。In a possible implementation manner, based on the preset perspective mapping relationship, coordinate conversion is performed on the coordinates of the first image to obtain the second image coordinates of the key points of the target human feet corresponding to the key points of the target human head in the crowd image, including: based on Preset the perspective mapping relationship to determine the target image scale corresponding to the key points of the target person's head; determine the image distance between the key points of the target person's head and the key points of the target person's feet based on the target image scale; determine the target image according to the first image coordinates and image distance The second image coordinates of the key points of the human feet in the crowd image.
由于行人是竖直站立的,因此,可以确定f x=h x。根据预设透视映射关系(线性映射 函数p=a*y+b),可以确定目标人脚关键点对应的目标尺度是a*f x+b。假设真实世界中,人头中心到人脚的距离是1.5米,即目标人头关键点和目标人脚关键点的真实距离是1.5米,则人群图像中目标人脚关键点和目标人头关键点的图像距离是1.5*(a*f x+b),即h x=f y-1.5*(a*f x+b),进而可以确定f y=(h y+1.5*b)/(1-1.5*a),因此,得到目标人脚关键点在人群图像中的第二图像坐标是(h x,(h y+1.5*b)/(1-1.5*a))。 Since pedestrians stand upright, it can be determined that f x =h x . According to the preset perspective mapping relationship (linear mapping function p=a*y+b), it can be determined that the target scale corresponding to the key point of the target human foot is a*f x +b. Assuming that in the real world, the distance from the center of the head to the feet of the person is 1.5 meters, that is, the real distance between the key points of the target person’s head and the key points of the target person’s feet is 1.5 meters, then the image of the key points of the target person’s feet and the key points of the target person’s head in the crowd image The distance is 1.5*(a*f x +b), that is, h x =f y -1.5*(a*f x +b), and then it can be determined that f y =(h y +1.5*b)/(1-1.5 *a), therefore, the second image coordinates of key points of the target human feet in the crowd image are (h x , (h y +1.5*b)/(1-1.5*a)).
遍历目标定位图中的每个目标人头关键点,可以确定每个目标人头关键点对应的目标人脚关键点在人群图像中的位置。进而根据相邻前后帧人群图像中目标人脚关键点的位置,可以进行客流量统计、行为轨迹分析等人群行为分析,本公开对此不做具体限定。By traversing each key point of the target's head in the target location map, the position of the key point of the target's foot corresponding to each key point of the target's head in the crowd image can be determined. Furthermore, according to the positions of the key points of the target person's feet in the adjacent and preceding frames of crowd images, crowd behavior analysis such as passenger flow statistics and behavior trajectory analysis can be performed, which is not specifically limited in this disclosure.
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开不再赘述。本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。It can be understood that the above-mentioned method embodiments mentioned in this disclosure can all be combined with each other to form a combined embodiment without violating the principle and logic. Due to space limitations, this disclosure will not repeat them. Those skilled in the art can understand that, in the above method in the specific implementation manner, the specific execution order of each step should be determined according to its function and possible internal logic.
此外,本公开还提供了人群定位装置、电子设备、计算机可读存储介质、程序,上述均可用来实现本公开提供的任一种人群定位方法,相应技术方案和描述和参见方法部分的相应记载,不再赘述。In addition, the present disclosure also provides crowd locating devices, electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any of the crowd locating methods provided in the present disclosure. For the corresponding technical solutions and descriptions, refer to the corresponding records in the method section ,No longer.
图3示出根据本公开实施例的一种人群定位装置的框图。如图3所示,装置30包括:Fig. 3 shows a block diagram of a crowd locating device according to an embodiment of the present disclosure. As shown in Figure 3, the device 30 includes:
人体关键点定位模块31,用于对人群图像进行人体关键点定位,得到人群图像对应的初始定位图,其中,初始定位图用于指示人群图像中包括的初始人体关键点的位置;The human body key point positioning module 31 is configured to perform human body key point positioning on the crowd image to obtain an initial positioning map corresponding to the crowd image, wherein the initial positioning map is used to indicate the position of the initial human key point included in the crowd image;
目标邻域确定模块32,用于基于初始人体关键点在人群图像中的位置,确定初始人体关键点对应的目标邻域;The target neighborhood determination module 32 is used to determine the target neighborhood corresponding to the initial human body key point based on the position of the initial human body key point in the crowd image;
过滤模块33,用于基于初始人体关键点对应的目标邻域,对初始定位图进行过滤,得到目标定位图,其中,目标定位图用于指示人群图像中包括的目标人体关键点的位置。The filtering module 33 is configured to filter the initial positioning map based on the target neighborhoods corresponding to the initial key points of the human body to obtain the target positioning map, wherein the target positioning map is used to indicate the position of the key points of the target human body included in the crowd image.
在一种可能的实现方式中,目标邻域确定模块32,具体用于:In a possible implementation manner, the target neighborhood determination module 32 is specifically used for:
针对任意一个初始人体关键点,基于初始人体关键点在人群图像中的位置,以及预设透视映射关系,确定初始人体关键点对应的目标邻域,其中,预设透视映射关系用于指示人群图像中不同位置的图像尺度。For any initial human body key point, based on the position of the initial human body key point in the crowd image and the preset perspective mapping relationship, determine the target neighborhood corresponding to the initial human body key point, wherein the preset perspective mapping relationship is used to indicate the crowd image Image scales at different locations in .
在一种可能的实现方式中,初始人体关键点为初始人头关键点。In a possible implementation manner, the initial human body key points are initial human head key points.
在一种可能的实现方式中,目标邻域确定模块32,包括:In a possible implementation, the target neighborhood determination module 32 includes:
第一确定子模块,用于基于预设透视映射关系,确定初始人头关键点在人群图像中的位置对应的目标图像尺度;The first determination sub-module is used to determine the target image scale corresponding to the position of the initial key point of the head in the crowd image based on the preset perspective mapping relationship;
第二确定子模块,用于基于目标图像尺度,确定初始人头关键点对应的人头框高度;The second determination submodule is used to determine the height of the head frame corresponding to the initial key point of the head based on the scale of the target image;
第三确定子模块,用于基于初始人头关键点对应的人头框高度,确定初始人头关键点对应的目标邻域。The third determination sub-module is configured to determine the target neighborhood corresponding to the initial key point of the human head based on the height of the head frame corresponding to the initial key point of the human head.
在一种可能的实现方式中,第三确定子模块,具体用于:In a possible implementation manner, the third determination submodule is specifically used for:
在人头框高度大于预设人头框高度阈值的情况下,基于第一邻域半径,确定目标邻域;或,When the height of the head frame is greater than the preset height threshold of the head frame, based on the first neighborhood radius, determine the target neighborhood; or,
在人头框高度小于或等于预设人头框高度阈值的情况下,基于第二邻域半径,确定目标邻域,其中,第一邻域半径大于第二邻域半径。When the height of the head frame is less than or equal to the preset height threshold of the head frame, the target neighborhood is determined based on the second neighborhood radius, wherein the first neighborhood radius is greater than the second neighborhood radius.
在一种可能的实现方式中,人体关键点定位模块31,包括:In a possible implementation, the human body key point positioning module 31 includes:
人体关键点定位子模块,用于对人群图像进行人体关键点定位,确定人群图像对应的预测定位图,其中,预测定位图用于指示人群图像中的像素点是人体关键点的预测置信度;The human body key point positioning sub-module is used to locate the key points of the human body on the crowd image, and determine the predicted positioning map corresponding to the crowd image, wherein the predicted positioning map is used to indicate the prediction confidence that the pixel in the crowd image is the key point of the human body;
第四确定子模块,用于基于预设置信度阈值,对预测定位图进行图像处理,得到初始定位图。The fourth determination sub-module is configured to perform image processing on the predicted positioning map based on a preset reliability threshold to obtain an initial positioning map.
在一种可能的实现方式中,过滤模块33,具体用于:In a possible implementation manner, the filtering module 33 is specifically used for:
针对任意一个初始人头关键点i,确定初始人头关键点i对应的目标邻域内,是否存在至少一个其它初始人头关键点;For any initial head key point i, determine whether there is at least one other initial head key point in the target neighborhood corresponding to the initial head key point i;
在目标邻域内存在至少一个其它初始人头点j的情况下,基于预测定位图,确定初始人头点i对应的预测置信度,以及至少一个其它初始人头点j对应的预测置信度;In the case where there is at least one other initial head point j in the target neighborhood, based on the predicted positioning map, determine the prediction confidence corresponding to the initial head point i, and the prediction confidence corresponding to at least one other initial head point j;
基于初始人头关键点i和至少一个其它初始人头关键点j中,预测置信度最大的初始人头关键点,确定目标邻域内的目标人头关键点。Based on the initial head key point i and at least one other initial head key point j, the initial head key point with the highest prediction confidence is determined to determine the target head key point in the target neighborhood.
在一种可能的实现方式中,装置30,还包括:In a possible implementation manner, the device 30 further includes:
人脚关键点确定模块,用于基于目标定位图和预设透视映射关系,确定人群图像中包括的目标人脚关键点的位置。The human foot key point determination module is configured to determine the position of the target human foot key points included in the crowd image based on the target positioning map and the preset perspective mapping relationship.
在一种可能的实现方式中,人脚关键点确定模块,包括:In a possible implementation, the human foot key point determination module includes:
第五确定子模块,用于针对任意一个目标人头关键点,根据目标定位图,确定目标人头关键点在人群图像中的第一图像坐标;The fifth determination sub-module is used to determine the first image coordinates of the key points of the target head in the crowd image according to the target positioning map for any key point of the target head;
第六确定子模块,用于基于预设透视映射关系,对第一图像坐标进行坐标转换,得到目标人头关键点对应的目标人脚关键点在人群图像中的第二图像坐标。The sixth determination sub-module is used to perform coordinate transformation on the first image coordinates based on the preset perspective mapping relationship, and obtain the second image coordinates of the key points of the target human feet corresponding to the key points of the target human head in the crowd image.
在一种可能的实现方式中,第六确定子模块,具体用于:In a possible implementation manner, the sixth determination submodule is specifically used for:
基于预设透视映射关系,确定目标人头关键点对应的目标图像尺度;Based on the preset perspective mapping relationship, determine the target image scale corresponding to the key points of the target head;
基于目标图像尺度,确定目标人头关键点与目标人脚关键点之间的图像距离;Based on the target image scale, determine the image distance between the key points of the target person's head and the key points of the target person's feet;
根据第一图像坐标和图像距离,确定目标人脚关键点在人群图像中的第二图像坐标。According to the first image coordinates and the image distance, the second image coordinates of the key points of the target person's feet in the crowd image are determined.
在一种可能的实现方式中,装置30,还包括:In a possible implementation manner, the device 30 further includes:
获取模块,用于获取对人群图像中不同位置的行人进行人体框标注得到的多个标注人体框;An acquisition module, configured to acquire a plurality of annotated human body frames obtained by annotating human body frames of pedestrians in different positions in the crowd image;
透视映射关系确定模块,用于基于多个标注人体框,确定预设透视映射关系。The perspective mapping relationship determination module is configured to determine a preset perspective mapping relationship based on a plurality of labeled human body frames.
在一种可能的实现方式中,透视映射关系确定模块,具体用于:In a possible implementation manner, the perspective mapping relationship determination module is specifically used for:
针对任意一个标注人体框,确定标注人体框中的参考人体关键点对应的参考图像尺度;For any one marked human body frame, determine the reference image scale corresponding to the key points of the reference human body in the marked human body frame;
根据标注人体框中的参考人体关键点的第三图像坐标,以及标注人体框中的参考人体关键点对应的参考图像尺度,拟合得到预设透视映射关系。According to the third image coordinates of the key points of the reference human body marked in the frame of the human body, and the scale of the reference image corresponding to the key points of the reference human body in the frame of the marked human body, a preset perspective mapping relationship is obtained by fitting.
该方法与计算机系统的内部结构存在特定技术关联,且能够解决如何提升硬件运算效率或执行效果的技术问题(包括减少数据存储量、减少数据传输量、提高硬件处理速度等),从而获得符合自然规律的计算机系统内部性能改进的技术效果。This method has a specific technical relationship with the internal structure of the computer system, and it can solve the technical problems of how to improve the hardware computing efficiency or execution effect (including reducing the amount of data storage, reducing the amount of data transmission, increasing the processing speed of the hardware, etc.), so as to obtain a natural The technical effect of regular computer system internal performance improvements.
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the methods described in the method embodiments above, and its specific implementation can refer to the description of the method embodiments above. For brevity, here No longer.
本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。计算机可读存储介质可以是易失性或非易失性计算机可读存储介质。Embodiments of the present disclosure also provide a computer-readable storage medium, on which computer program instructions are stored, and the above-mentioned method is implemented when the computer program instructions are executed by a processor. Computer readable storage media may be volatile or nonvolatile computer readable storage media.
本公开实施例还提出一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。An embodiment of the present disclosure also proposes an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to invoke the instructions stored in the memory to execute the above method.
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器执行上述方法。An embodiment of the present disclosure also provides a computer program product, including computer-readable codes, or a non-volatile computer-readable storage medium carrying computer-readable codes, when the computer-readable codes are stored in a processor of an electronic device When running in the electronic device, the processor in the electronic device executes the above method.
电子设备可以被提供为终端、服务器或其它形态的设备。Electronic devices may be provided as terminals, servers, or other forms of devices.
图4示出根据本公开实施例的一种电子设备的框图。参照图4,电子设备800可以是用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字处理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等终端设备。Fig. 4 shows a block diagram of an electronic device according to an embodiment of the present disclosure. Referring to FIG. 4, the electronic device 800 may be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle Devices, wearable devices and other terminal equipment.
参照图4,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)接口812,传感器组件814,以及通信组件816。Referring to FIG. 4, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and a communication component 816 .
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。The processing component 802 generally controls the overall operations of the electronic device 800, such as those associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802 .
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 804 is configured to store various types of data to support operations at the electronic device 800 . Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like. The memory 804 can be implemented by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。The power supply component 806 provides power to various components of the electronic device 800 . Power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device 800 .
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在 一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。The multimedia component 808 includes a screen providing an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or swipe action, but also detect duration and pressure associated with the touch or swipe action. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capability.
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a microphone (MIC), which is configured to receive external audio signals when the electronic device 800 is in operation modes, such as call mode, recording mode and voice recognition mode. Received audio signals may be further stored in memory 804 or sent via communication component 816 . In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: a home button, volume buttons, start button, and lock button.
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如互补金属氧化物半导体(CMOS)或电荷耦合装置(CCD)图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。 Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of electronic device 800 . For example, the sensor component 814 can detect the open/closed state of the electronic device 800, the relative positioning of components, such as the display and the keypad of the electronic device 800, the sensor component 814 can also detect the electronic device 800 or a Changes in position of components, presence or absence of user contact with electronic device 800 , electronic device 800 orientation or acceleration/deceleration and temperature changes in electronic device 800 . Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. Sensor assembly 814 may also include an optical sensor, such as a complementary metal-oxide-semiconductor (CMOS) or charge-coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如无线网络(Wi-Fi)、第二代移动通信技术(2G)、第三代移动通信技术(3G)、第四代移动通信技术(4G)、通用移动通信技术的长期演进(LTE)、第五代移动通信技术(5G)或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access wireless networks based on communication standards, such as wireless networks (Wi-Fi), second-generation mobile communication technologies (2G), third-generation mobile communication technologies (3G), fourth-generation mobile communication technologies (4G ), the long-term evolution (LTE) of the universal mobile communication technology, the fifth generation mobile communication technology (5G) or their combination. In an exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上 述方法。In an exemplary embodiment, electronic device 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation for performing the methods described above.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器804,上述计算机程序指令可由电子设备800的处理器820执行以完成上述方法。In an exemplary embodiment, there is also provided a non-volatile computer-readable storage medium, such as the memory 804 including computer program instructions, which can be executed by the processor 820 of the electronic device 800 to implement the above method.
本公开涉及增强现实领域,通过获取现实环境中的目标对象的图像信息,进而借助各类视觉相关算法实现对目标对象的相关特征、状态及属性进行检测或识别处理,从而得到与具体应用匹配的虚拟与现实相结合的AR效果。示例性的,目标对象可涉及与人体相关的脸部、肢体、手势、动作等,或者与物体相关的标识物、标志物,或者与场馆或场所相关的沙盘、展示区域或展示物品等。视觉相关算法可涉及视觉定位、SLAM、三维重建、图像注册、背景分割、对象的关键点提取及跟踪、对象的位姿或深度检测等。具体应用不仅可以涉及跟真实场景或物品相关的导览、导航、讲解、重建、虚拟效果叠加展示等交互场景,还可以涉及与人相关的特效处理,比如妆容美化、肢体美化、特效展示、虚拟模型展示等交互场景。可通过卷积神经网络,实现对目标对象的相关特征、状态及属性进行检测或识别处理。上述卷积神经网络是基于深度学习框架进行模型训练而得到的网络模型。This disclosure relates to the field of augmented reality. By acquiring the image information of the target object in the real environment, and then using various visual correlation algorithms to detect or identify the relevant features, states and attributes of the target object, and thus obtain the image information that matches the specific application. AR effect combining virtual and reality. Exemplarily, the target object may involve faces, limbs, gestures, actions, etc. related to the human body, or markers and markers related to objects, or sand tables, display areas or display items related to venues or places. Vision-related algorithms may involve visual positioning, SLAM, 3D reconstruction, image registration, background segmentation, object key point extraction and tracking, object pose or depth detection, etc. Specific applications can not only involve interactive scenes such as guided tours, navigation, explanations, reconstructions, virtual effect overlays and display related to real scenes or objects, but also special effects processing related to people, such as makeup beautification, body beautification, special effect display, virtual Interactive scenarios such as model display. The relevant features, states and attributes of the target object can be detected or identified through the convolutional neural network. The above-mentioned convolutional neural network is a network model obtained by performing model training based on a deep learning framework.
图5示出根据本公开实施例的另一种电子设备的框图。参照图5,电子设备1900可以被提供为一服务器或终端设备。参照图5,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。FIG. 5 shows a block diagram of another electronic device according to an embodiment of the present disclosure. Referring to FIG. 5, an electronic device 1900 may be provided as a server or terminal device. Referring to FIG. 5 , electronic device 1900 includes processing component 1922 , which further includes one or more processors, and a memory resource represented by memory 1932 for storing instructions executable by processing component 1922 , such as application programs. The application programs stored in memory 1932 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设备1900可以操作基于存储在存储器1932的操作系统,例如微软服务器操作系统(Windows Server TM),苹果公司推出的基于图形用户界面操作系统(Mac OS X TM),多用户多进程的计算机操作系统(Unix TM),自由和开放原代码的类Unix操作系统(Linux TM),开放原代码的类Unix操作系统(FreeBSD TM)或类似。 Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input-output (I/O) interface 1958 . The electronic device 1900 can operate based on the operating system stored in the memory 1932, such as the Microsoft server operating system (Windows Server TM ), the graphical user interface-based operating system (Mac OS X TM ) introduced by Apple Inc., and the multi-user and multi-process computer operating system (Unix ), a free and open source Unix-like operating system (Linux ), an open source Unix-like operating system (FreeBSD ), or the like.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium, such as the memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to implement the above method.
本公开可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。The present disclosure can be a system, method and/or computer program product. A computer program product may include a computer readable storage medium having computer readable program instructions thereon for causing a processor to implement various aspects of the present disclosure.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是(但不限于)电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、 只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。A computer readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device. A computer readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory), static random access memory (SRAM), compact disc read only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanically encoded device, such as a printer with instructions stored thereon A hole card or a raised structure in a groove, and any suitable combination of the above. As used herein, computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., pulses of light through fiber optic cables), or transmitted electrical signals.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。Computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or a network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。Computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or Source or object code written in any combination, including object-oriented programming languages—such as Smalltalk, C++, etc., and conventional procedural programming languages—such as the “C” language or similar programming languages. Computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement. In cases involving a remote computer, the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as via the Internet using an Internet service provider). connect). In some embodiments, an electronic circuit, such as a programmable logic circuit, field programmable gate array (FPGA), or programmable logic array (PLA), can be customized by utilizing state information of computer-readable program instructions, which can Various aspects of the present disclosure are implemented by executing computer readable program instructions.
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It should be understood that each block of the flowcharts and/or block diagrams, and combinations of blocks in the flowcharts and/or block diagrams, can be implemented by computer-readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine such that when executed by the processor of the computer or other programmable data processing apparatus , producing an apparatus for realizing the functions/actions specified in one or more blocks in the flowchart and/or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause computers, programmable data processing devices and/or other devices to work in a specific way, so that the computer-readable medium storing instructions includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks in flowcharts and/or block diagrams.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以 产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。It is also possible to load computer-readable program instructions into a computer, other programmable data processing device, or other equipment, so that a series of operational steps are performed on the computer, other programmable data processing device, or other equipment to produce a computer-implemented process , so that instructions executed on computers, other programmable data processing devices, or other devices implement the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams.
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, a portion of a program segment, or an instruction that includes one or more Executable instructions. In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified function or action , or may be implemented by a combination of dedicated hardware and computer instructions.
该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。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.
上文对各个实施例的描述倾向于强调各个实施例之间的不同之处,其相同或相似之处可以互相参考,为了简洁,本文不再赘述。The above descriptions of the various embodiments tend to emphasize the differences between the various embodiments, the same or similar points can be referred to each other, and for the sake of brevity, details are not repeated herein.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。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.
若本申请技术方案涉及个人信息,应用本申请技术方案的产品在处理个人信息前,已明确告知个人信息处理规则,并取得个人自主同意。若本申请技术方案涉及敏感个人信息,应用本申请技术方案的产品在处理敏感个人信息前,已取得个人单独同意,并且同时满足“明示同意”的要求。例如,在摄像头等个人信息采集装置处,设置明确显著的标识告知已进入个人信息采集范围,将会对个人信息进行采集,若个人自愿进入采集范围即视为同意对其个人信息进行采集;或者在个人信息处理的装置上,利用明显的标识/信息告知个人信息处理规则的情况下,通过弹窗信息或请个人自行上传其个人信息等方式获得个人授权;其中,个人信息处理规则可包括个人信息处理者、个人信息处理目的、处理方式以及处理的个人信息种类等信息。If the technical solution of this application involves personal information, the product applying the technical solution of this application has clearly notified the personal information processing rules and obtained the individual's independent consent before processing personal information. If the technical solution of this application involves sensitive personal information, the products applying the technical solution of this application have obtained individual consent before processing sensitive personal information, and at the same time meet the requirements of "express consent". For example, at a personal information collection device such as a camera, a clear and prominent sign is set up to inform that it has entered the scope of personal information collection, and personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed to agree to the collection of his personal information; or On the personal information processing device, when the personal information processing rules are informed with obvious signs/information, personal authorization is obtained through pop-up information or by asking individuals to upload their personal information; among them, the personal information processing rules may include Information such as the information processor, the purpose of personal information processing, the method of processing, and the type of personal information processed.
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。Having described various embodiments of the present disclosure above, the foregoing description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and alterations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principle of each embodiment, practical application or improvement of technology in the market, or to enable other ordinary skilled in the art to understand each embodiment disclosed herein.

Claims (16)

  1. 一种人群定位方法,其特征在于,包括:A crowd positioning method, characterized by comprising:
    对人群图像进行人体关键点定位,得到所述人群图像对应的初始定位图,其中,所述初始定位图用于指示所述人群图像中包括的初始人体关键点的位置;Perform human body key point positioning on the crowd image to obtain an initial positioning map corresponding to the crowd image, wherein the initial positioning map is used to indicate the position of the initial human key point included in the crowd image;
    基于所述初始人体关键点在所述人群图像中的位置,确定所述初始人体关键点对应的目标邻域;Determining a target neighborhood corresponding to the initial human body key point based on the position of the initial human body key point in the crowd image;
    基于所述初始人体关键点对应的所述目标邻域,对所述初始定位图进行过滤,得到目标定位图,其中,所述目标定位图用于指示所述人群图像中包括的目标人体关键点的位置。Based on the target neighborhood corresponding to the initial human body key points, filter the initial positioning map to obtain a target positioning map, wherein the target positioning map is used to indicate the target human body key points included in the crowd image s position.
  2. 根据权利要求1中所述的方法,其特征在于,所述基于所述初始人体关键点在所述人群图像中的位置,确定所述初始人体关键点对应的目标邻域,包括:The method according to claim 1, wherein the determining the target neighborhood corresponding to the initial human key point based on the position of the initial human key point in the crowd image comprises:
    针对任意一个所述初始人体关键点,基于所述初始人体关键点在所述人群图像中的位置,以及预设透视映射关系,确定所述初始人体关键点对应的所述目标邻域,其中,所述预设透视映射关系用于指示所述人群图像中不同位置的图像尺度。For any one of the initial human body key points, based on the position of the initial human body key points in the crowd image and the preset perspective mapping relationship, determine the target neighborhood corresponding to the initial human body key points, wherein, The preset perspective mapping relationship is used to indicate image scales of different positions in the crowd image.
  3. 根据权利要求1或2所述的方法,其特征在于,所述初始人体关键点为初始人头关键点。The method according to claim 1 or 2, wherein the initial human body key points are initial human head key points.
  4. 根据权利要求3所述的方法,其特征在于,所述基于所述初始人体关键点在所述人群图像中的位置,以及预设透视映射关系,确定所述初始人体关键点对应的所述目标邻域,包括:The method according to claim 3, wherein the target corresponding to the initial human body key point is determined based on the position of the initial human body key point in the crowd image and a preset perspective mapping relationship neighborhood, including:
    基于所述预设透视映射关系,确定所述初始人头关键点在所述人群图像中的位置对应的目标图像尺度;Based on the preset perspective mapping relationship, determine the target image scale corresponding to the position of the initial human head key point in the crowd image;
    基于所述目标图像尺度,确定所述初始人头关键点对应的人头框高度;Based on the target image scale, determine the height of the head frame corresponding to the initial key point of the head;
    基于所述初始人头关键点对应的人头框高度,确定所述初始人头关键点对应的所述目标邻域。Based on the height of the head frame corresponding to the initial key point of the human head, the target neighborhood corresponding to the initial key point of the human head is determined.
  5. 根据权利要求4所述的方法,其特征在于,所述基于所述初始人头关键点对应的人头框高度,确定所述初始人头关键点对应的所述目标邻域,包括:The method according to claim 4, wherein the determining the target neighborhood corresponding to the initial key point of the human head based on the height of the head frame corresponding to the initial key point of the human head comprises:
    在所述人头框高度大于预设人头框高度阈值的情况下,基于第一邻域半径,确定所述目标邻域;或,In the case where the head frame height is greater than a preset head frame height threshold, based on a first neighborhood radius, determine the target neighborhood; or,
    在所述人头框高度小于或等于所述预设人头框高度阈值的情况下,基于第二邻域半径,确定所述目标邻域,其中,所述第一邻域半径大于所述第二邻域半径。In the case that the head frame height is less than or equal to the preset head frame height threshold, the target neighborhood is determined based on a second neighborhood radius, wherein the first neighborhood radius is greater than the second neighborhood radius domain radius.
  6. 根据权利3至5中任意一项所述的方法,其特征在于,所述对人群图像进行人体关键点定位,得到所述人群图像对应的初始定位图,包括:According to the method described in any one of claims 3 to 5, it is characterized in that the positioning of the key points of the human body on the crowd image to obtain the initial positioning map corresponding to the crowd image includes:
    对所述人群图像进行人体关键点定位,确定所述人群图像对应的预测定位图,其中,所述预测定位图用于指示所述人群图像中的像素点是人体关键点的预测置信度;Perform human body key point positioning on the crowd image, and determine a predicted positioning map corresponding to the crowd image, wherein the predicted positioning map is used to indicate the prediction confidence that the pixels in the crowd image are key points of the human body;
    基于预设置信度阈值,对所述预测定位图进行图像处理,得到所述初始定位图。Based on a preset reliability threshold, image processing is performed on the predicted positioning map to obtain the initial positioning map.
  7. 根据权利要求6所述的方法,其特征在于,所述基于所述初始人体关键点对应的所述目标邻域,对所述初始定位图进行过滤,得到目标定位图,包括:The method according to claim 6, wherein the initial positioning map is filtered based on the target neighborhood corresponding to the initial key points of the human body to obtain a target positioning map, comprising:
    针对任意一个初始人头关键点i,确定所述初始人头关键点i对应的所述目标邻域内,是否存在至少一个其它初始人头关键点;For any initial head key point i, determine whether there is at least one other initial head key point in the target neighborhood corresponding to the initial head key point i;
    在所述目标邻域内存在至少一个其它初始人头点j的情况下,基于所述预测定位图,确定所述初始人头点i对应的预测置信度,以及所述至少一个其它初始人头点j对应的预测置信度;In the case where there is at least one other initial head point j in the target neighborhood, based on the predicted positioning map, determine the prediction confidence corresponding to the initial head point i, and the prediction confidence corresponding to the at least one other initial head point j prediction confidence;
    基于所述初始人头关键点i和所述至少一个其它初始人头关键点j中,预测置信度最大的初始人头关键点,确定所述目标邻域内的目标人头关键点。Based on the initial head key point i and the at least one other initial head key point j with the highest prediction confidence, the target head key point in the target neighborhood is determined.
  8. 根据权利要求3至7中任意一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 3 to 7, wherein the method further comprises:
    基于所述目标定位图和所述预设透视映射关系,确定所述人群图像中包括的目标人脚关键点的位置。Based on the target positioning map and the preset perspective mapping relationship, the positions of the key points of the target person's feet included in the crowd image are determined.
  9. 根据权利要求8所述的方法,其特征在于,所述基于所述目标定位图和所述预设透视映射关系,确定所述人群图像中包括的目标人脚关键点的位置,包括:The method according to claim 8, wherein, based on the target positioning map and the preset perspective mapping relationship, determining the position of the key points of the target person's feet included in the crowd image includes:
    针对任意一个所述目标人头关键点,根据所述目标定位图,确定所述目标人头关键点在所述人群图像中的第一图像坐标;For any key point of the target human head, according to the target positioning map, determine the first image coordinates of the key point of the target human head in the crowd image;
    基于所述预设透视映射关系,对所述第一图像坐标进行坐标转换,得到所述目标人头关键点对应的目标人脚关键点在所述人群图像中的第二图像坐标。Based on the preset perspective mapping relationship, coordinate transformation is performed on the first image coordinates to obtain second image coordinates of target human foot key points corresponding to the target human head key points in the crowd image.
  10. 根据权利要求9所述的方法,其特征在于,所述基于所述预设透视映射关系,对所述第一图像坐标进行坐标转换,得到所述目标人头关键点对应的目标人脚关键点在所述人群图像中的第二图像坐标,包括:The method according to claim 9, characterized in that, based on the preset perspective mapping relationship, coordinate conversion is performed on the first image coordinates to obtain the key points of the target human feet corresponding to the key points of the target human head. The second image coordinates in the crowd image include:
    基于所述预设透视映射关系,确定所述目标人头关键点对应的目标图像尺度;Based on the preset perspective mapping relationship, determine the target image scale corresponding to the key points of the target head;
    基于所述目标图像尺度,确定所述目标人头关键点与所述目标人脚关键点之间的图像距离;Based on the target image scale, determine the image distance between the key points of the target human head and the key points of the target human feet;
    根据所述第一图像坐标和所述图像距离,确定所述目标人脚关键点在所述人群图像中的第二图像坐标。According to the first image coordinates and the image distance, second image coordinates of key points of the target person's feet in the crowd image are determined.
  11. 根据权利要求2至10中任意一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 2 to 10, further comprising:
    获取对所述人群图像中不同位置的行人进行人体框标注得到的多个标注人体框;Obtaining multiple annotated human body frames obtained by annotating human body frames of pedestrians in different positions in the crowd image;
    基于所述多个标注人体框,确定所述预设透视映射关系。The preset perspective mapping relationship is determined based on the plurality of marked human body frames.
  12. 根据权利要求11所述的方法,其特征在于,所述基于所述多个标注人体框,确定所述预设透视映射关系,包括:The method according to claim 11, wherein the determining the preset perspective mapping relationship based on the plurality of marked human body frames comprises:
    针对任意一个所述标注人体框,确定所述标注人体框中的参考人体关键点对应的参考图像尺度;For any one of the labeled human body frames, determine the reference image scale corresponding to the key points of the reference human body in the labeled human body frame;
    根据所述标注人体框中的所述参考人体关键点的第三图像坐标,以及所述标注人体框中的所述参考人体关键点对应的所述参考图像尺度,拟合得到所述预设透视映射关系。The preset perspective is obtained by fitting according to the third image coordinates of the key points of the reference human body in the marked human body frame and the scale of the reference image corresponding to the key points of the reference human body in the marked human body frame. Mapping relations.
  13. 一种人群定位装置,其特征在于,包括:A crowd positioning device, characterized in that it includes:
    人体关键点定位模块,用于对人群图像进行人体关键点定位,得到所述人群图像对应的初始定位图,其中,所述初始定位图用于指示所述人群图像中包括的初始人体关键点的位置;The human body key point positioning module is configured to perform human body key point positioning on the crowd image to obtain an initial positioning map corresponding to the crowd image, wherein the initial positioning map is used to indicate the initial human body key points included in the crowd image Location;
    目标邻域确定模块,用于基于所述初始人体关键点在所述人群图像中的位置,确定所述初始人体关键点对应的目标邻域;A target neighborhood determination module, configured to determine a target neighborhood corresponding to the initial human body key point based on the position of the initial human body key point in the crowd image;
    过滤模块,用于基于所述初始人体关键点对应的所述目标邻域,对所述初始定位图进行过滤,得到目标定位图,其中,所述目标定位图用于指示所述人群图像中包括的目标人体关键点的位置。A filtering module, configured to filter the initial positioning map based on the target neighborhood corresponding to the initial key points of the human body to obtain a target positioning map, wherein the target positioning map is used to indicate that the crowd image includes The location of key points of the target human body.
  14. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    处理器;processor;
    用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;
    其中,所述处理器被配置为调用所述存储器存储的指令,以执行权利要求1至12中任意一项所述的方法。Wherein, the processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1-12.
  15. 一种计算机可读存储介质,其上存储有计算机程序指令,其特征在于,所述计算机程序指令被处理器执行时实现权利要求1至12中任意一项所述的方法。A computer-readable storage medium on which computer program instructions are stored, wherein the computer program instructions implement the method according to any one of claims 1 to 12 when executed by a processor.
  16. 一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器执行用于实现权利要求1至12中任意一项所述的方法。A computer program product, comprising computer readable codes, or a non-volatile computer readable storage medium bearing computer readable codes, when the computer readable codes are run in a processor of an electronic device, the electronic The processor in the device executes the method for realizing any one of claims 1-12.
PCT/CN2022/100170 2022-02-17 2022-06-21 Crowd positioning method and apparatus, electronic device, and storage medium WO2023155350A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210146593.7 2022-02-17
CN202210146593.7A CN114550086A (en) 2022-02-17 2022-02-17 Crowd positioning method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2023155350A1 true WO2023155350A1 (en) 2023-08-24

Family

ID=81675247

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/100170 WO2023155350A1 (en) 2022-02-17 2022-06-21 Crowd positioning method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN114550086A (en)
WO (1) WO2023155350A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114550086A (en) * 2022-02-17 2022-05-27 上海商汤智能科技有限公司 Crowd positioning method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110443144A (en) * 2019-07-09 2019-11-12 天津中科智能识别产业技术研究院有限公司 A kind of human body image key point Attitude estimation method
CN110941999A (en) * 2019-11-12 2020-03-31 通号通信信息集团有限公司 Method for adaptively calculating size of Gaussian kernel in crowd counting system
CN111445442A (en) * 2020-03-05 2020-07-24 中国平安人寿保险股份有限公司 Crowd counting method and device based on neural network, server and storage medium
CN111652107A (en) * 2020-05-28 2020-09-11 北京市商汤科技开发有限公司 Object counting method and device, electronic equipment and storage medium
CN112686173A (en) * 2020-12-31 2021-04-20 深圳云天励飞技术股份有限公司 Passenger flow counting method and device, electronic equipment and storage medium
CN114550086A (en) * 2022-02-17 2022-05-27 上海商汤智能科技有限公司 Crowd positioning method and device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110443144A (en) * 2019-07-09 2019-11-12 天津中科智能识别产业技术研究院有限公司 A kind of human body image key point Attitude estimation method
CN110941999A (en) * 2019-11-12 2020-03-31 通号通信信息集团有限公司 Method for adaptively calculating size of Gaussian kernel in crowd counting system
CN111445442A (en) * 2020-03-05 2020-07-24 中国平安人寿保险股份有限公司 Crowd counting method and device based on neural network, server and storage medium
CN111652107A (en) * 2020-05-28 2020-09-11 北京市商汤科技开发有限公司 Object counting method and device, electronic equipment and storage medium
CN112686173A (en) * 2020-12-31 2021-04-20 深圳云天励飞技术股份有限公司 Passenger flow counting method and device, electronic equipment and storage medium
CN114550086A (en) * 2022-02-17 2022-05-27 上海商汤智能科技有限公司 Crowd positioning method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114550086A (en) 2022-05-27

Similar Documents

Publication Publication Date Title
TWI766286B (en) Image processing method and image processing device, electronic device and computer-readable storage medium
TWI759647B (en) Image processing method, electronic device, and computer-readable storage medium
US11288531B2 (en) Image processing method and apparatus, electronic device, and storage medium
EP3206163A1 (en) Image processing method, mobile device and method for generating a video image database
WO2022188305A1 (en) Information presentation method and apparatus, and electronic device, storage medium and computer program
CN109635142B (en) Image selection method and device, electronic equipment and storage medium
WO2023103298A1 (en) Shielding detection method and apparatus, and electronic device, storage medium and computer program product
CN109671051B (en) Image quality detection model training method and device, electronic equipment and storage medium
WO2022193507A1 (en) Image processing method and apparatus, device, storage medium, program, and program product
WO2023173616A1 (en) Crowd counting method and apparatus, electronic device and storage medium
WO2023168957A1 (en) Pose determination method and apparatus, electronic device, storage medium, and program
CN110909203A (en) Video analysis method and device, electronic equipment and storage medium
CN108171222B (en) Real-time video classification method and device based on multi-stream neural network
KR20220123218A (en) Target positioning method, apparatus, electronic device, storage medium and program
WO2022247091A1 (en) Crowd positioning method and apparatus, electronic device, and storage medium
WO2023155350A1 (en) Crowd positioning method and apparatus, electronic device, and storage medium
CN111680646A (en) Motion detection method and device, electronic device and storage medium
WO2023035481A1 (en) Pedestrian volume statistical method and apparatus, electronic device, and storage medium
WO2022141969A1 (en) Image segmentation method and apparatus, electronic device, storage medium, and program
WO2022099988A1 (en) Object tracking method and apparatus, electronic device, and storage medium
CN112906484A (en) Video frame processing method and device, electronic equipment and storage medium
WO2023142554A1 (en) Counting method and apparatus, electronic device, storage medium and computer program product
WO2023051356A1 (en) Virtual object display method and apparatus, and electronic device and storage medium
WO2022110801A1 (en) Data processing method and apparatus, electronic device, and storage medium
CN113052874B (en) Target tracking method and device, electronic equipment and storage medium

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: 22926659

Country of ref document: EP

Kind code of ref document: A1