Detection methods, recommended methods, detection systems and media for the number of people in target places
Through environmental image processing technology, facial and non-face head target boxes in the target place are identified and counted, which solves the problem of accurately counting people in the existing technology, and realizes accurate identification of people and rational utilization of resources.
Patent Information
- Application Number
- CN202010923053.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-04
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2040-09-04
AI Technical Summary
The prior art cannot accurately count the number of people in a certain place or area, resulting in unreasonable resource utilization and inconvenience to users.
By obtaining the environmental image of the target site, determine the facial head target box and non-face head target box in the target detection area. According to the number and movement direction of these target boxes, calculate the number of people entering and leaving within any time period, and estimate the current number of people queuing. .
It realizes accurate identification and statistics of the number of people in the target venue, provides relatively accurate reference data, helps users make quick choices, and reduces selection time and resource waste.
Smart Images

Figure CN112036345B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart system technology. Specifically, the present application relates to a method for detecting the number of people in a target place, a recommendation method, a detection system and a medium. Background Art
[0002] Currently, it is necessary to count the number of people in a certain place or area in many scenarios. For example, when a user chooses a place to use, he usually needs to know the number of people queuing, the number of people entering and leaving, the resource usage, etc. of a certain place, so as to make a better choice and save time. However, there is currently no more accurate method to count the number of people in a certain place or area, which causes great inconvenience to users when they need to select free resources in a place, and also causes a waste of some resources. Summary of the invention
[0003] In view of the shortcomings of existing methods, this application proposes a detection method, recommendation method, detection system and medium for the number of people in a target place, so as to solve the technical problems existing in the prior art that the number of people in a place or area cannot be accurately counted and resources cannot be reasonably utilized.
[0004] In a first aspect, an embodiment of the present application provides a method for detecting the number of people in a target place, comprising:
[0005] Acquire an environmental image of a target location;
[0006] Determine the target detection area in the environment image;
[0007] Determine the face and head target frame and the non-face and head target frame in the target detection area;
[0008] According to the face and head target frames and non-face and head target frames of each target detection area in any time period, the number of people entering and leaving the target place in the time period is determined.
[0009] Optionally, according to the face and head target frames and non-face and head target frames of each target detection area in any time period, determining the number of people entering and leaving the target place in the time period includes:
[0010] For each head target frame in the facial head target frame and the non-facial head target frame, determine whether the head target frame satisfies the following conditions at the same time in any time period: the head target frame overlaps with the reference mark in the environment image; the intersection and union ratio of the head target frame of each frame with the head target frame of the previous frame is greater than the intersection and union ratio threshold; the head target frame of each frame is in the specified direction of the head target frame of the previous frame;
[0011] If the head target frame satisfies the above conditions at the same time during the time period, the moving direction of the head target frame is determined to be entering or leaving the target location;
[0012] According to the number of head target frames entering or leaving the target place during the time period, the number of people entering and leaving the target place during the time period is determined.
[0013] Optionally, the method for detecting the number of people in a target place provided in an embodiment of the present application further includes:
[0014] The current number of people queuing at the target place is determined according to the number of face and head target frames or the number of people entering and leaving the target place within the first time period.
[0015] Optionally, determining a face and head target frame and a non-face and head target frame in the target detection area includes:
[0016] Cut out a sub-environment image containing the target detection area from the environment image;
[0017] Determine each head target frame in the sub-environment image according to the head detection algorithm;
[0018] From each head target frame in the sub-environment image, determine the head target frame located within the target detection area;
[0019] According to the face recognition algorithm, a facial head target frame and a non-facial head target frame are identified in each head target frame in the target detection area.
[0020] Optionally, identifying a facial head target frame and a non-facial head target frame in each head target frame in the target detection area according to a face recognition algorithm includes:
[0021] For each head target frame in the target detection area, identifying, according to a face recognition algorithm, whether the current head target frame and a first number of head target frames adjacent to the current head target frame are all facial head target frames;
[0022] If the current head target frame and a first number of head target frames adjacent to the current head target frame are all facial head target frames, determining that the current head target frame is a facial head target frame;
[0023] If the current head target frame is a facial head target frame, and a first number of head target frames adjacent to the current head target frame are all non-facial head target frames, then determining that the current head target frame is a non-facial head target frame;
[0024] If the current head target frame and a first number of head target frames adjacent to the current head target frame are all non-face head target frames, determining that the current head target frame is a non-face head target frame;
[0025] If the current head target frame is a non-face head target frame, and a first number of head target frames adjacent to the current head target frame are all face head target frames, then the current head target frame is determined to be a face head target frame.
[0026] In a second aspect, an embodiment of the present application provides a resource recommendation method, including:
[0027] For multiple target places, the current number of people in the queue, the number of people entering and leaving the place in the second time period, the location information of the place, and the request information of the user terminal are obtained for each target place; the current number of people in the queue is the current number of people in the queue determined by an optional scheme of the detection method provided by the first aspect of the embodiment of the present application; the number of people entering and leaving is the number of people entering and leaving determined by the detection method provided by the first aspect of the embodiment of the present application; the request information includes the location information of the user terminal;
[0028] Determine the recommendation score of each target venue according to the current number of people queuing at each venue, the number of people entering and leaving the venue during the second time period, venue location information, and user location information;
[0029] At least one target place to be recommended is determined according to the recommendation score and sent to the user terminal.
[0030] Optionally, determining a recommendation score for each target venue according to the current number of people queuing at each venue, the number of people entering and leaving the venue during the second time period, venue location information, and user location information includes:
[0031] Determine the resource usage speed of each target place according to the number of people entering and exiting each target place in the second time period;
[0032] Determine the distance between the user terminal and each target location based on the user terminal location information and the location information of each target location;
[0033] The recommendation score of each target location is determined based on the current number of people queuing at each target location, the resource usage speed, and the distance between the user and each target location.
[0034] Optionally, the resource recommendation method provided in the embodiment of the present application further includes:
[0035] For each target place to be recommended, at least one route from the current location of the user terminal to the current location of the target place is determined according to the location information and the user terminal location information, and route information of the at least one route is sent to the user terminal.
[0036] In a third aspect, an embodiment of the present application provides a detection system, including: an image acquisition device and a server;
[0037] The image acquisition device is arranged at the target location, and the image acquisition device is connected to the server for communication;
[0038] The image acquisition device is used to: acquire an environmental image of a target location and send the environmental image to a server;
[0039] The server is used to execute and implement the detection method provided in the first aspect of the embodiment of the present application.
[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the detection method provided in the first aspect of the embodiment of the present application, or the resource recommendation method provided in the second aspect of the embodiment of the present application.
[0041] The technical solution provided in the embodiments of the present application has at least the following beneficial effects:
[0042] 1) The embodiment of the present application can determine the target detection area and the face head target frame and non-face head target frame therein based on the environmental image of the target place, and realize the accurate recognition of the head target frame in the target detection area; based on the number of accurately recognized face head target frames and non-face head target frames, the number of people entering and leaving the target place in any time period can be accurately determined, providing more accurate reference data for users to select the target place, so that users can quickly make a choice that is more suitable for them, and reduce the waste of users' selection time and resources;
[0043] 2) The embodiment of the present application can accurately determine the number of people currently queuing at the target place based on the number of accurately identified face and head target frames; if no face and head target frames are identified, the number of people currently queuing at the target place can be more accurately estimated based on the number of people entering and leaving the target place in the previous first time period, providing more accurate reference data for users to select target places, facilitating users to quickly make a choice that is more suitable for them, and reducing the user's selection time and waste of resources;
[0044] 3) The embodiment of the present application can determine the recommendation score of each venue based on the number of people in the target venue (the current number of people in the queue and the number of people entering and exiting in the second time period), the venue location information and the user terminal location information, and recommend a suitable target venue to the user terminal as a reference based on the recommendation score, so that the user can choose a suitable target venue more quickly based on his or her own situation, which provides great convenience for the user and saves the user's time.
[0045] Additional aspects and advantages of the present application will be partially given in the following description, which will become apparent from the following description, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0047] Figure 1 A flow chart of a method for detecting the number of people in a target place provided in an embodiment of the present application;
[0048] Figure 2 A schematic diagram of an environment image area, a sub-environment image area, and a target detection area in an embodiment of the present application;
[0049] Figure 3 A flow chart of another method for detecting the number of people in a target place provided in an embodiment of the present application;
[0050] Figure 4 A schematic diagram of a resource recommendation method provided in an embodiment of the present application;
[0051] Figure 5 A flowchart of another resource recommendation method provided in an embodiment of the present application;
[0052] Figure 6 A schematic diagram of the structural framework of a detection system provided in an embodiment of the present application;
[0053] Figure 7 A schematic diagram of the structural framework of another detection system provided in an embodiment of the present application;
[0054] Figure 8 A schematic diagram of the structural framework of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] The present application is described in detail below, and examples of embodiments of the present application are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar components or components with the same or similar functions. In addition, if the detailed description of the known technology is unnecessary for the features of the present application shown, it will be omitted. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0056] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0057] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0058] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments.
[0059] The present application embodiment provides a method for detecting the number of people in a target place, such as Figure 1 As shown, the detection method includes:
[0060] S101, acquiring an environmental image of a target location.
[0061] Optionally, an environmental image of the target place captured by a camera device installed inside or outside the target place can be obtained; the environmental image can be an internal environmental image or an external environmental image of the target place, depending on the actual situation of the target place and the placement position of the camera device.
[0062] The target place is not limited in the embodiment of the present application, and can be any place or area where the number of people needs to be counted, such as public toilets, restaurants, airports, railway stations and other public places.
[0063] S102: Determine a target detection area in the environment image.
[0064] The target detection area can be determined according to the actual situation of the target place. For example, if the target detection area is a public toilet, the entrance area of the public toilet in the environment image can be used as the target detection area; if the target detection area is a restaurant, the entrance waiting area in the environment image (restaurants usually have waiting areas) can be used as the target detection area.
[0065] For target locations involving queuing and determination of queue size, the target detection area may include the tail of the queue within the normal field of view.
[0066] S103, determining a face and head target frame and a non-face and head target frame in the target detection area.
[0067] Optionally, a sub-environment image including the target detection area is cropped from the environment image; each head target frame in the sub-environment image is determined according to a head detection algorithm; a head target frame located within the target detection area is determined from each head target frame in the sub-environment image; and a facial head target frame and a non-facial head target frame are identified from each head target frame in the target detection area according to a face recognition algorithm.
[0068] In one example, Figure 2 An environment image 201 is shown, and the target detection area in the environment image can be Figure 2 When determining the sub-environment image, the area within the trapezoidal frame 202 can be determined with the center of the trapezoidal frame 202 (ie, the target detection area) as the center to determine a rectangular frame 203 as the sub-environment image containing the target detection area.
[0069] exist Figure 2 In the example shown, a sub-environment image including the trapezoidal frame 202 is cropped according to the range of the rectangular frame 203, which can be easily input into the head detection algorithm in the form of an image to realize head detection in the target detection area. The sub-environment image size (for example, 512 pixels) is smaller than the original environment image, which can reduce unnecessary interference during the processing and speed up the detection speed.
[0070] Optionally, determining a human head target frame located within the target detection area from each human head target frame in the sub-environment image includes:
[0071] For each head target frame, determine the extreme value range of the center coordinates of the head target frame according to the coordinates of the vertices and boundaries of the target detection area; determine whether the center coordinates of the head target frame are within the extreme value range; if the center coordinates of the head target frame are within the extreme value range of the coordinates, determine whether the center coordinates of the head target frame are within the boundary coordinate range of the head target frame; if the center coordinates of the head target frame are within the boundary coordinate range, determine that the head target frame is located in the target detection area.
[0072] Each coordinate in the embodiment of the present application may be a coordinate in a plane coordinate system established in the environment image, and may be represented by (x, y).
[0073] In one example, the coordinates of the boundary of the target detection area can be expressed by the straight line formula between two adjacent vertices, according to Figure 2The straight line formula between the four vertices and two adjacent vertices of the target detection area shown in the figure, for the central coordinate (x1, y1) of the head target frame, the maximum and minimum values of 1x and y1 can be determined respectively as the coordinate extreme value range, and whether the central coordinate (x1, y1) is within the coordinate extreme value range is determined; if the central coordinate (x1, y1) is within the coordinate extreme value range, it is further determined whether the central coordinate (x1, y1) is within the range surrounded by the four boundary lines of the head target frame. If the central coordinate (x1, y1) is within the range surrounded by the four boundary lines of the head target frame, the head target frame to which the central coordinate (x1, y1) belongs is retained as the head target frame in the target detection area and counted; if the central coordinate (x1, y1) is not within the range surrounded by the four boundary lines of the head target frame, the head target frame to which the central coordinate (x1, y1) belongs is excluded, and the head target frame is not considered when counting.
[0074] Optionally, identifying a facial head target frame and a non-facial head target frame in each head target frame in the target detection area according to a face recognition algorithm includes:
[0075] For each head target frame in the target detection area, identifying, according to a face recognition algorithm, whether the current head target frame and a first number of head target frames adjacent to the current head target frame are all facial head target frames;
[0076] If the current head target frame and the first number of head target frames adjacent to the current head target frame are all facial head target frames, then the current head target frame is determined to be a facial head target frame; if the current head target frame is a facial head target frame, and the first number of head target frames adjacent to the current head target frame are all non-facial head target frames, then the current head target frame is determined to be a non-facial head target frame; if the current head target frame and the first number of head target frames adjacent to the current head target frame are all non-facial head target frames, then the current head target frame is determined to be a non-facial head target frame; if the current head target frame is a non-facial head target frame, and the first number of head target frames adjacent to the current head target frame are all facial head target frames, then the current head target frame is determined to be a facial head target frame.
[0077] Optionally, when identifying whether each head target frame (such as the current head target frame or an adjacent head target frame) is a facial head target frame according to the face recognition algorithm, it can be determined according to the face recognition algorithm whether the facial feature data of the head target frame is greater than the facial threshold. If so, it is preliminarily determined that the head target frame is a facial head target frame, and then based on the preliminary determination results of the adjacent head target frames, a final determination is made on whether the head target frame is a facial head target frame.
[0078] The first number in the embodiment of the present application can be set according to actual needs, and the selection range of the first number of head target frames can be determined according to actual conditions. Figure 2 If the image is in the area between the two dotted lines shown in FIG. 1 , the adjacent first data head target frame can also be selected in the area between the two dotted lines. For target places with obvious queuing areas, this method can be used to select adjacent head target frames with more consistent facial orientations. In scenarios where some users face the image acquisition device but cannot capture facial features (such as looking down at a mobile phone), it can be more accurately determined whether the current head target frame is a facial head target frame, reducing or even avoiding erroneous judgments.
[0079] Optionally, the head detection algorithm of the embodiment of the present application may be a CenterNet algorithm, and the face recognition algorithm may be a SeetaFace algorithm.
[0080] S104, determining the number of people entering and leaving the target place within any time period according to the face and head target frames and non-face and head target frames of each target detection area within the time period.
[0081] Any time period may be the first time period or the second time period described below.
[0082] Optionally, for each head target frame in the facial head target frame and the non-facial head target frame, determine whether the head target frame satisfies the following conditions at the same time in any time period: the head target frame has overlapping parts with the reference marker in the environment image; the intersection over union (IoU) of the head target frame of each frame with the head target frame of the previous frame is greater than the intersection over union threshold; the head target frame of each frame is in the specified direction of the head target frame of the previous frame.
[0083] If the head target frames meet the conditions at the same time during the time period, the moving direction of the head target frames is determined to be entering or leaving the target place; according to the number of head target frames entering or leaving the target place during the time period, the number of people entering and leaving the target place during the time period is determined.
[0084] The reference mark in the embodiment of the present application can be set in the environment image according to actual needs. In one example, the reference mark can be Figure 2 Straight line A and straight line B are shown.
[0085] The intersection over union (IoU) threshold in the embodiment of the present application can be set according to actual needs, for example, 0.5. If IoU is greater than 0.5, it can be considered that the head target frame of the currently judged frame and the head target frame of the previous frame are the head target frames of the same person; if IoU is less than or greater than 0.5, it can be considered that the head target frame of the currently judged frame and the head target frame of the previous frame are not the head target frames of the same person, and the head target frame of the currently judged frame can be used as a newly appeared head target frame to re-judge the above conditions.
[0086] The previous frame in the embodiment of the present application may be any frame within a frame number range before the current frame, and the frame number range may be set according to the reference mark. Figure 2 In the example shown, the frame range can be set according to the distance between straight line A and straight line B. If the distance between straight line A and straight line B is small, the frame range can be set to a smaller range. If the distance between straight line A and straight line B is large, the frame range can be set to a larger range.
[0087] The specified direction in the embodiment of the present application can be determined according to the actual situation. Figure 2 For example, when determining whether the moving direction of the head target frame is to enter the target place, the specified direction is the direction from straight line A to straight line B. If the center of the head target frame moves from straight line A to straight line B in the current frame compared with the previous frame, the moving direction of the head target frame is considered to be the direction to enter the target place; when determining whether the moving direction of the head target frame is to leave the target place, the specified direction is the direction from straight line B to straight line A. If the center of the head target frame moves from straight line B to straight line A in the current frame compared with the previous frame, the moving direction of the head target frame is considered to be the direction to leave the target place.
[0088] In an optional embodiment, when determining that the moving direction of the head target frame is entering or leaving the target place, the moving direction of the head target frame can be further determined by a target tracking algorithm based on the above method, thereby making the statistics of the number of people entering and leaving more accurate.
[0089] In another optional implementation, a target tracking algorithm may be used instead of the above method to determine the moving direction of the head target frame.
[0090] Optionally, in the process of determining the moving direction of the head target frame through the target tracking algorithm, specifically, each head target frame in the target detection area is input into the target tracking algorithm, different head target frames will have different ID (Identity Document, identity identification number) labels, and the same head target frame will have continuous tracking of the same ID. The moving direction of the head target frame can be determined based on the moving direction of the center of the target frame of the previous and next frames marked with the same ID.
[0091] The target tracking algorithm in the embodiment of the present application can be a Kalman algorithm or a KCF (Kernel Correlation Filter) algorithm. The target tracking algorithm has a high accuracy and can ensure accuracy even in scenes with a large number of people and complex movements, without counting errors.
[0092] Alternatively, if Figure 3 As shown, the detection method provided in the embodiment of the present application, based on the above steps S101 to S104, further includes the following steps:
[0093] S105, determining the current number of people queuing at the target place according to the number of face and head target frames or the number of people entering and leaving the target place during the first time period.
[0094] In an optional implementation, when the number of face and head target frames in the target detection area is greater than 0, the current number of people queuing at the target location is determined based on the number of face and head target frames, specifically in the following manner:
[0095] h=hf+hw Expression (1)
[0096] In expression (1), h represents the current number of people queuing at the target location, hf represents the number of face and head target frames in the target detection area, and hw represents the number of people that can be accommodated in the area between the starting position of the target location and the target detection area. The area corresponding to hw is an area that cannot be captured by the image acquisition device but may still contain people queuing. hw is used to make up for the missing acquisition of the image acquisition device, so that the current number of people queuing is determined more accurately.
[0097] Optionally, when h determined according to expression (1) is greater than a preset threshold number of people, the threshold number of people is used as the value of h. The threshold number of people can be set to the maximum number of people that can be accommodated in the photographable area of the image acquisition device, and can be set based on empirical values.
[0098] In another optional implementation, when the number of face and head target frames in the target detection area is less than or equal to 0, the current number of people queuing at the target place is determined based on the number of people entering and leaving the target place during the first time period.
[0099] The time range of the first time period can be set according to actual needs. In an example, the first time period can be set to 20 minutes before the current moment, and the difference between the number of people entering and leaving the target place within 20 minutes before the current moment is used as the current queue number of the target place.
[0100] When the face and head target frame is not detected in the target detection area (for example, the current queue is short and has not reached the shooting area or there is no queue at present), the queue situation of the target place cannot be measured well based on the detection results of the target detection area alone. The current queue number of the target place can be estimated more accurately based on the number of people entering and exiting in the first time period before the current moment.
[0101] Based on the same inventive concept, the present application embodiment provides a resource recommendation method, such as Figure 4 As shown, the resource recommendation method includes:
[0102] S401, for multiple target places, obtaining the current number of people queuing at each target place, the number of people entering and leaving the place during a second time period, the location information of the place, and the request information of the user terminal.
[0103] The current number of people in the queue is the current number of people in the queue determined by the detection method described above in the embodiment of the present application; the number of people entering and exiting is the number of people entering and exiting determined by the detection method described above in the embodiment of the present application; the request information of the user terminal includes the location information of the user terminal.
[0104] The second time period can be set according to actual needs, for example, it can be set to within 10 minutes before the current time.
[0105] S402, determining a recommendation score for each target venue according to the current number of people queuing at each venue, the number of people entering and leaving the venue during the second time period, venue location information, and user location information.
[0106] Optionally, the resource usage speed of each target place is determined according to the number of people entering and exiting each target place during the second time period; the distance between the user terminal and each target place is determined according to the user terminal location information and the place location information of each target place; the recommendation score of each target place is determined according to the current number of people queuing at each target place, the resource usage speed, and the distance between the user and each target place.
[0107] In an optional implementation, the resource usage speed of each target place can be expressed as the number of people leaving per unit time (for example, per minute). Specifically, the resource usage speed of the target place can be determined by:
[0108]
[0109] In expression (2), v represents the resource usage rate of the target location, t represents the duration of the second time period (which can be assigned according to actual needs), and h[-t:] represents the number of people who have left the target location in the second time period before the current time period.
[0110] In an optional implementation, the recommendation score of each target location can be determined in the following manner:
[0111]
[0112] In expression (3), score represents the recommendation score of the target place, v represents the resource usage speed of the target place, h represents the current number of people queuing at the target place, s represents the distance between the user terminal and the target place, and k is a constant (which can be set according to actual needs).
[0113] Expression (3) can comprehensively consider the resource usage speed v of the target location, the current number of people in the queue h, and the distance s between the user terminal and the target location to determine the recommendation score, so that the recommendation scheme determined according to the recommendation score is more in line with the actual user needs.
[0114] S403: Determine at least one target place to be recommended according to the recommendation score and send it to the user terminal.
[0115] Optionally, at least one target place is selected and ranked as the target place to be recommended and sent to the user terminal in descending order of recommendation scores. In one example, the first three target places are selected and ranked as the target places to be recommended and sent to the user terminal in descending order of recommendation scores to achieve the purpose of recommending target places to the user.
[0116] Alternatively, if Figure 5 As shown, the resource recommendation method provided in the embodiment of the present application, based on the above steps S401 to S403, further includes the following steps:
[0117] S404: for each target place to be recommended, determine at least one route from the current location of the user terminal to the current location of the target place according to the location information and the location information of the user terminal, and send route information of the at least one route to the user terminal.
[0118] The user can query the received route information through the query function of the user terminal, and select a route suitable for him / her to the target location according to the route information.
[0119] In an optional embodiment, the route information of at least one route sent to the user terminal includes: scenic spot information on at least one route. The scenic spot information can help the user to select a route. If the user is interested in a scenic spot on a route, the user can select a route passing through the scenic spot.
[0120] Based on the same inventive concept, the present application embodiment provides a detection system, such as Figure 6 As shown, the detection system includes: an image acquisition device 610 and a server 620; the image acquisition device 610 is arranged at a target location, and the image acquisition device 610 is in communication connection with the server 620.
[0121] The image acquisition device 610 is used to: acquire an environmental image of a target location and send the environmental image to a server 620; the server 620 is used to execute a method for detecting the number of people in a target location provided in an embodiment of the present application.
[0122] Optionally, the image acquisition device 610 can be set near the entrance of the target place, and the lens can be directed toward the outside of the target place to acquire the environmental image outside the target place, and can also be directed toward the inside of the target place to acquire the environmental image inside the target place. It can depend on the specific location of the waiting area of the target place, and can capture the queuing crowd at the target place; one or more image acquisition devices 610 can be set near the entrance of each target place.
[0123] exist Figure 2 In the example shown, the lens of the image acquisition device 610 faces the outside of the target place. In order to be able to capture the end of the queue, the image acquisition device 610 is set near the front edge of the frame 201 (ie, near the entrance).
[0124] In an optional embodiment, if Figure 7 As shown, the detection system provided in the embodiment of the present application also includes: a user terminal 630; the user terminal 630 is communicatively connected to the server 620.
[0125] The user terminal 630 is used to: send a request message to the server 620 in response to a query operation for a target place, and receive at least one target place to be recommended sent by the server 620.
[0126] When receiving a query operation for a target location, the user terminal 630 allows its own location information to be obtained by the server 620 by default, and when sending a request message to the server 620, it carries its own location information in the request message and sends it to the server 620.
[0127] Optionally, the user terminal 630 is further used to: receive route information of at least one route from the current location of the user terminal 630 to the current location of the target place, sent by the server 620.
[0128] Optionally, the user terminal 630 is further used to: display the received target location and route information.
[0129] The user can query the required target location and route information in real time through the user terminal 630, and select the appropriate target location and route according to his own situation.
[0130] There may be one or more user terminals in the embodiments of the present application.
[0131] The server 620 in the embodiment of the present application may include: a memory and a processor, and the memory is electrically connected to the processor.
[0132] A computer program is stored in the memory, and the computer program is executed by the processor to implement any method for detecting the number of people in a target place or any method for recommending resources provided in the embodiments of the present application.
[0133] Those skilled in the art will appreciate that the server provided by the embodiments of the present application can be specially designed and manufactured for the desired purpose, or can also include known devices in general-purpose computers. These devices have computer programs stored therein, which are selectively activated or reconstructed. Such computer programs can be stored in a device (e.g., computer) readable medium or in any type of medium suitable for storing electronic instructions and coupled to a bus respectively.
[0134] In an optional embodiment, the present application provides a server, such as Figure 8 As shown, the server 620 includes: a memory 621 and a processor 622 , and the memory 621 and the processor 622 are electrically connected, such as through a bus 623 .
[0135] Optionally, the memory 621 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 622. The processor 622 is used to execute the application code stored in the memory 621 to implement any method for detecting the number of people in a target place or any method for recommending resources provided in the embodiments of the present application.
[0136] The memory 621 can be a ROM (Read-Only Memory) or other types of static storage devices that can store static information and instructions, can be a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, can also be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read-Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.
[0137] The processor 622 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor 622 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0138] The bus 623 may include a path to transmit information between the above components. The bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0139] Optionally, the server 620 may further include a transceiver 624. The transceiver 624 may be used for receiving and sending signals. The transceiver 624 may allow the server 620 to communicate with other devices wirelessly or by wire to exchange data. It should be noted that in actual applications, the transceiver 624 is not limited to one.
[0140] Optionally, the server 620 may further include an input unit 625. The input unit 625 may be used to receive input digital, character, image and / or sound information, or generate key signal input related to user settings and function control of the server 620. The input unit 625 may include, but is not limited to, one or more of a touch screen, a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, a camera, a microphone, etc.
[0141] Optionally, the server 620 may further include an output unit 626. The output unit 626 may be used to output or display information processed by the processor 622. The output unit 626 may include but is not limited to one or more of a display device, a speaker, a vibration device, and the like.
[0142] Although Figure 8The server 620 is shown with various devices, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have instead.
[0143] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements any method for detecting the number of people in a target place or any resource recommendation method provided in the embodiment of the present application.
[0144] The computer readable medium includes, but is not limited to, any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM, RAM, EPROM (Erasable Programmable Read-Only Memory), EEPROM, flash memory, magnetic card or optical card. In other words, the readable medium includes any medium that can store or transmit information in a readable form by a device (e.g., a computer).
[0145] The embodiment of the present application provides a computer-readable storage medium applicable to any of the above-mentioned methods for detecting the number of people in a target place or any of the resource recommendation methods, which will not be described in detail here.
[0146] By applying the embodiments of the present application, at least the following beneficial effects can be achieved:
[0147] 1) The embodiments of the present application can determine the target detection area and the facial head target frames and non-facial head target frames therein based on the environmental image of the target place, thereby realizing accurate recognition of the head target frames in the target detection area; based on the number of accurately identified facial head target frames and non-facial head target frames, the number of people entering and leaving the target place within any time period can be accurately determined, providing users with more accurate reference data for selecting the target place, facilitating users to quickly make choices that are more suitable for them, and reducing the waste of users' selection time and resources.
[0148] 2) When the embodiment of the present application determines the number of people entering and leaving a target place within any time period based on the number of facial head target frames and non-facial head target frames, the moving direction of each head target frame can be accurately identified according to whether the head target frame coincides with the reference mark, the intersection and union ratio of the head target frames of the two frames before and after, and the relative directions of the head target frames of the two frames before and after, thereby determining the number of people entering and leaving the target place.
[0149] 3) The embodiment of the present application can accurately determine the current number of people queuing at the target place based on the number of accurately identified facial and head target frames; if no facial and head target frames are identified, the current number of people queuing at the target place can be more accurately estimated based on the number of people entering and leaving the target place in the previous first time period, thereby providing users with more accurate reference data for selecting the target place, facilitating users to quickly make choices that are more suitable for them, and reducing the user's selection time and waste of resources.
[0150] 4) When determining whether each head target frame is a facial head target frame or a non-facial head target frame, the embodiment of the present application may refer to the types of the first number of head target frames adjacent to the current head target frame, so that the type of the current head target frame is determined to be consistent with the type of the adjacent head target frame, thereby avoiding possible erroneous recognition when identifying a certain head target frame alone, and making the recognition result more accurate.
[0151] 5) The embodiment of the present application can determine the recommendation score of each venue based on the number of people in the target venue (the current number of people in the queue and the number of people entering and exiting in the second time period), the venue location information and the user terminal location information, and recommend a suitable target venue to the user terminal as a reference based on the recommendation score, so that the user can choose a suitable target venue more quickly based on his or her own situation, which provides great convenience for the user and saves the user's time.
[0152] Those skilled in the art will appreciate that the various operations, methods, steps, measures, and schemes in the processes discussed in this application may be alternated, altered, combined, or deleted. Further, other steps, measures, and schemes in the various operations, methods, and processes discussed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted. Further, the steps, measures, and schemes in the prior art that are similar to those disclosed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted.
[0153] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the feature. In the description of this application, unless otherwise specified, "plurality" means two or more.
[0154] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0155] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for detecting the number of people in a target place, characterized in that: include: Acquire an environmental image of a target location; Determining a target detection area in the environment image; Determine a face and head target frame and a non-face and head target frame in the target detection area; Determine the number of people entering and leaving the target place within any time period according to the face and head target frames and non-face and head target frames of each target detection area within the time period; The step of determining a face and head target frame and a non-face and head target frame in the target detection area comprises: Cutting out a sub-environmental image including the target detection area from the environmental image; Determine each head target frame in the sub-environment image according to a head detection algorithm; Determining a human head target frame located within the target detection area from each human head target frame in the sub-environment image; Identify facial head target frames and non-facial head target frames in each head target frame in the target detection area according to a face recognition algorithm; The step of identifying a facial head target frame and a non-facial head target frame in each head target frame in the target detection area according to a face recognition algorithm comprises: For each of the head target frames in the target detection area, identifying, according to the face recognition algorithm, whether the current head target frame and a first number of head target frames adjacent to the current head target frame are all-face head target frames; If the current head target frame and a first number of head target frames adjacent to the current head target frame are all facial head target frames, determining that the current head target frame is a facial head target frame; If the current head target frame is a facial head target frame, and a first number of head target frames adjacent to the current head target frame are all non-facial head target frames, then determining that the current head target frame is a non-facial head target frame; If the current head target frame and a first number of head target frames adjacent to the current head target frame are all non-face head target frames, determining that the current head target frame is a non-face head target frame; If the current head target frame is a non-face head target frame, and a first number of head target frames adjacent to the current head target frame are all face head target frames, then the current head target frame is determined to be a face head target frame.
2. The detection method according to claim 1, characterized in that: Determining the number of people entering and leaving the target place within any time period according to the face and head target frames and non-face and head target frames of each target detection area within the time period includes: For each head target frame in the facial head target frame and the non-facial head target frame, determine whether the head target frame satisfies the following conditions at the same time in any time period: the head target frame has an overlapping portion with the reference mark in the environment image; the intersection-and-union ratio of the head target frame of each frame to the head target frame of the previous frame is greater than the intersection-and-union ratio threshold; the head target frame of each frame is in a specified direction of the head target frame of the previous frame; If the head target frame satisfies the above conditions at the same time during the time period, it is determined that the moving direction of the head target frame is entering or leaving the target place; The number of people entering and leaving the target place within the time period is determined according to the number of the head target frames entering or leaving the target place within the time period.
3. The detection method according to claim 1, characterized in that: Also includes: The current number of people queuing at the target place is determined according to the number of the face and head target frames or the number of people entering and leaving the target place within the first time period.
4. A resource recommendation method, characterized in that: include: For multiple target places, obtaining the current number of people in the queue, the number of people entering and leaving the place in the second time period, the location information of the place, and the request information of the user terminal of each of the target places; the current number of people in the queue is the current number of people in the queue determined by the detection method described in any one of claims 1 to 3; The number of people entering and exiting is the number of people entering and exiting determined by the detection method described in any one of claims 1 to 3; the request information includes user terminal location information; Determine a recommendation score for each of the target places according to the current number of people queuing at each of the places, the number of people entering and leaving the places during the second time period, the location information of the places, and the location information of the user terminal; At least one target place to be recommended is determined according to the recommendation score and sent to the user terminal.
5. The resource recommendation method according to claim 4, characterized in that: The determining the recommendation score of each of the target places according to the current number of people queuing at each of the places, the number of people entering and leaving the places during the second time period, the location information of the places, and the location information of the user terminal includes: Determining a resource usage speed of each of the target places according to the number of people entering and exiting each of the target places within the second time period; Determining the distance between the user terminal and each of the target places according to the user terminal location information and the place location information of each of the target places; The recommendation score of each target place is determined according to the current number of people queuing at each target place, the resource usage speed, and the distance between the user and each target place.
6. The resource recommendation method according to claim 4 or 5, characterized in that: Also includes: For each target place to be recommended, at least one route from the current location of the user terminal to the current location of the target place is determined based on the place location information and the user terminal location information, and route information of the at least one route is sent to the user terminal.
7. A detection system, characterized in that: include: Image acquisition device and server; The image acquisition device is arranged at the target location, and the image acquisition device is communicatively connected with the server; The image acquisition device is used to: acquire an environmental image of a target location and send the environmental image to the server; The server is used to execute the method for detecting the number of people entering and exiting a target place as described in any one of claims 1-3.
8. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the method for detecting the number of people entering and leaving a target place as described in any one of claims 1-3, or the method for recommending resources as described in any one of claims 4-6 is implemented.
Citation Information
Patent Citations
People counting method and device based on head shoulder detection
CN105844234A
Face detection method and device and equipment and computer readable storage medium
CN111160169A