A customer anonymous flow analysis method, device and medium based on machine vision
By extracting customers' body contours and clothing features from retail stores to generate anonymous appearance features, the problem of cross-camera identity association is solved, enabling continuous tracking of customer movement, satisfying privacy protection and providing complete trajectory data.
Patent Information
- Application Number
- CN202611380462.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-07
- Publication Date
- 2026-11-20
AI Technical Summary
Existing technologies struggle to achieve continuous tracking of customer movement across areas while adhering to privacy protection constraints, particularly regarding identity verification across cameras in retail stores. Traditional methods, such as facial recognition, pose privacy compliance risks and involve complex multi-robot collaborative scheduling, making them difficult to deploy economically.
By using a machine vision-based anonymous customer movement analysis method, the system extracts the customer's body contour and clothing features to generate anonymous appearance features. It then uses a historical appearance feature database for matching and association to generate temporary anonymous identifiers, records the location and timestamp, and splices trajectory fragments to achieve trajectory continuity across cameras.
It enables continuous tracking of customer movement across areas without collecting facial biometric data, meeting privacy protection requirements, avoiding compliance risks, and providing complete movement trajectory data for analysis.
Smart Images

Figure CN123142124A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision technology, and in particular to a method, device and medium for anonymous customer movement analysis based on machine vision. Background Technology
[0002] In the field of customer behavior analysis in retail stores, obtaining continuous customer movement patterns is of great value for optimizing merchandise display and store layout. Machine vision technology has been widely used for human detection and tracking in video streams, but it is usually limited to the field of view of a single camera. When a customer leaves the coverage area of one camera and enters the coverage area of another camera, the problem of cross-field identity association needs to be solved.
[0003] Currently, common technologies rely on facial recognition, which involves biometric data collection and poses significant privacy compliance risks. Furthermore, while embodied intelligence technologies use mobile robots to follow customers within stores and can acquire localized continuous trajectories, the coverage of a single robot is limited, and multi-robot collaborative scheduling is complex, making economical deployment in large-scale stores difficult. Additionally, while physical model-based crowd movement simulation methods can extrapolate macroscopic customer flow distribution, they lack sufficient precision in depicting individual shopping behavior and cannot provide reliable individual-level movement data. Therefore, the limitations of these technological approaches make it difficult for store operators to obtain complete cross-regional customer movement data under privacy compliance constraints, thus restricting refined operational analysis based on movement patterns. Summary of the Invention
[0004] This invention provides a machine vision-based method, device, and medium for anonymous customer movement analysis. The technical problem it aims to solve is: how to provide an effective solution for continuous tracking of customer movement across regions under privacy protection constraints.
[0005] In a first aspect, the present invention provides a machine vision-based method for anonymous customer movement analysis, comprising: Acquire video streams captured by multiple cameras deployed within retail stores; Human detection is performed on the video stream to obtain the detection target; Extract the body contour features and clothing features of the detected target to generate anonymous appearance features; Obtain the stored historical appearance feature library, which contains appearance features associated with temporary anonymous identifiers; Determine whether there is a historical appearance feature in the historical appearance feature library that matches the anonymous appearance feature; If a matching historical appearance feature exists, the detection target is associated with the temporary anonymous identifier corresponding to the matching historical appearance feature; If no matching historical appearance features exist, a new temporary anonymous identifier is assigned to the detection target, and the anonymous appearance features are added to the historical appearance feature library. Record the position coordinates and timestamp of the detected target under each camera, and generate the trajectory segment of the detected target under the corresponding camera; Based on the timestamps of the same temporary anonymous identifier appearing in the multiple cameras, the trajectory segments corresponding to the same temporary anonymous identifier are spliced together in chronological order to generate the complete movement trajectory of the detected target.
[0006] Optionally, recording the position coordinates and timestamp of the detected target under each camera, and generating the trajectory segment of the detected target under the corresponding camera, includes: Perform homography matrix calibration on each camera to obtain the homography matrix corresponding to each camera; Obtain the pixel coordinates of the video frame in the video stream where the detected target is located; Based on the homography matrix corresponding to the camera where the detection target is located, the pixel coordinates are mapped to store planar coordinates; Record the store plane coordinates and frame timestamp of the detected target in the video frame. Arrange the store's planar coordinates under the same camera with the same temporary anonymous identifier in chronological order to generate the trajectory segment of the detected target under the camera.
[0007] Optionally, the method further includes: Obtain the store planar coordinates of the first and second video frames that are temporally adjacent to the detected target, wherein the second video frame is later than the first video frame. The motion direction vector of the detected target is determined based on the store plane coordinates of the first video frame and the store plane coordinates of the second video frame. Determine whether the store's planar coordinates in the second video frame are within a preset store exit area to obtain a first determination result; Determine whether the motion direction vector points outside the store exit area to obtain a second determination result; When both the first judgment result and the second judgment result are yes, it is determined that the detected target has left the retail store; Destroy the temporary anonymous identifier corresponding to the detection target and remove the anonymous appearance feature from the historical appearance feature library.
[0008] Optionally, the method further includes: Obtain the floor plan of the retail store and divide the floor plan into multiple grid areas; The store's planar coordinates in the complete movement trajectories of multiple detection targets are mapped to the grid area, and the number of detection targets in each grid area is counted to obtain the customer flow density; Based on the timestamps in the complete movement trajectory, calculate the dwell time of each detected target in each grid area, and sum them up to obtain the cumulative dwell time in each grid area; Spatial smoothing is performed on the passenger flow density and the cumulative dwell time to generate a passenger flow heat map.
[0009] Optionally, the plurality of cameras includes a first camera deployed in the shelf area, the first camera having a resolution higher than a preset resolution threshold; the method further includes: Obtain the video stream captured by the first camera; The head pose of the detected target appearing in the video stream captured by the first camera is estimated to obtain the head deflection angle of the detected target; Extract the eye region image of the target from the video stream captured by the first camera; The eye region image is subjected to lossy dimensionality reduction encoding to obtain a gaze feature vector, the data size of which is smaller than the data size of the eye region image; Based on the head deflection angle and the gaze feature vector, gaze estimation is performed to obtain the gaze point of the detected target; The line of sight is matched with the pre-marked shelf and inventory unit positions to determine the target inventory unit being observed by the detection target. Record the start and end times of the detection target's gaze at the target product inventory unit to obtain the gaze direction and duration of the detection target's gaze at the target product inventory unit.
[0010] Optionally, the method further includes: Acquire the gaze duration of multiple detection targets on the same target product inventory unit; The fixation duration is threshold filtered to remove fixation records that are less than a preset fixation duration threshold, thus obtaining the effective fixation duration. The number of detected targets focusing on the target product inventory unit is counted to obtain the number of people who have paid attention to the target product inventory unit; The effective gaze duration is grouped and accumulated according to the target product inventory unit to obtain the cumulative effective gaze duration of the target product inventory unit; Based on the cumulative effective gaze duration and the number of people who pay attention, product visual attention data is generated.
[0011] Optionally, the method further includes: Acquire point-of-sale transaction data, which includes the sales quantity of each product inventory unit within a preset time window; The product visual attention data and the sales point transaction data are associated by target product inventory unit. The number of people who pay attention to the target product inventory unit is extracted from the product visual attention data, and the purchase quantity of the target product inventory unit within the preset time window is extracted from the sales point transaction data. Based on the number of followers and the number of purchases, the visual attention-to-purchase conversion rate is calculated, whereby the visual attention-to-purchase conversion rate is the ratio of the number of purchases to the number of followers.
[0012] Optionally, the method further includes: Obtain the complete movement trajectory, the passenger flow heatmap, the product visual attention data, and the visual attention-to-purchase conversion rate; The complete movement trajectory is curve-fitted and rendered to generate a motion diagram; The passenger flow heatmap is color-rendered to generate a heatmap display; The product visual attention data is sorted to generate a product attention ranking list; Render a funnel chart of the visual attention-purchase conversion rate to generate a conversion funnel.
[0013] Secondly, the present invention also provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0014] Thirdly, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the above-described method.
[0015] This invention provides a machine vision-based method, device, and medium for anonymous customer movement analysis. It acquires video streams from multiple cameras and performs human detection to identify the target, providing a target basis for cross-camera association. Further, it extracts the body contour and clothing features of the detected target to generate anonymous appearance features. Since these anonymous appearance features rely solely on body contours and clothing features and do not include biometric features such as faces, privacy constraints are met in terms of data source. Further, it performs similarity matching between the anonymous appearance features and the appearance features of temporary anonymous identifiers already associated in a historical appearance feature database. If a match exists, it is associated with an existing temporary anonymous identifier; otherwise, a new temporary anonymous identifier is assigned and added to the historical appearance feature database. This achieves the association of the same customer's identity across multiple cameras, and the association process does not involve personal identity information. Further, it records the position coordinates and timestamps of the detected target under each camera to generate trajectory segments, providing spatiotemporal data for movement line construction. Based on the timestamps of the same temporary anonymous identifier appearing in multiple cameras, the corresponding trajectory segments are spliced in chronological order to generate the complete movement trajectory of the detected target, eliminating trajectory breaks caused by the limited field of view of a single camera. Therefore, this method achieves continuous tracking of customer movement across regions under privacy protection constraints by anonymous appearance feature matching and trajectory segment splicing without collecting facial biometric features. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart illustrating a machine vision-based anonymous customer movement analysis method provided in an embodiment of the present invention; Figure 2 This is a schematic block diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0020] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0021] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0022] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."
[0023] Please see Figure 1This invention provides a machine vision-based method for anonymous customer movement analysis, enabling the construction of continuous customer movement trajectories across cameras within a retail store without collecting personal biometric features such as facial features. Retail stores typically install multiple cameras to cover different functional areas, such as entrance areas, aisle areas, and checkout areas. Furthermore, a single camera can only acquire localized motion information of customers within its field of view, and cannot directly obtain the continuous movement trajectory of customers throughout the store. Moreover, traditional cross-camera pedestrian association schemes often use facial recognition technology to confirm customer identity; however, facial features are personal biometric information, and their collection and processing are subject to strict legal constraints, resulting in high compliance risks. Therefore, this embodiment generates anonymous appearance features by extracting customer body contour features and clothing features, and matches these anonymous appearance features against a historical appearance feature database to assign or associate temporary anonymous identifiers to customers. Finally, the trajectory segments recorded by the same temporary anonymous identifier under different cameras are spliced together in chronological order to generate a complete movement trajectory. This method does not involve processing facial region features, thus avoiding the collection of biometric information at the data source. It also enables continuous customer tracking across multiple cameras. Specifically, the method includes the following steps: S1 acquires video streams collected by multiple cameras deployed within the retail store.
[0024] In specific implementation, video streams are acquired from multiple cameras deployed within the retail store. These cameras are installed at predetermined locations on the store ceiling, each facing a different area. The camera installation height, tilt angle, and horizontal orientation are configured according to the store's floor plan to ensure a certain overlap between the fields of view of adjacent cameras, avoiding blind spots. Furthermore, each camera continuously acquires a video stream at a fixed frame rate, which can be 25 frames per second or 30 frames per second. The video stream contains consecutive image frames arranged in chronological order. Further, the cameras transmit the video stream to an edge computing device or cloud server for processing via a wired or wireless network. Further, in an optional implementation, at least some of the cameras are low-resolution cameras, with their image resolution configured to a minimum level sufficient to support human detection and facial feature extraction. Lower resolution not only reduces the transmission bandwidth and storage overhead of the video data but also reduces the clarity of facial details in the image from the source, further reducing the likelihood of facial information being captured. The video stream can be encoded in either H.264 (Advanced Video Coding, AVC) or H.265 (High-Efficiency Video Coding, HEVC) to balance image quality and transmission bandwidth.
[0025] S2, perform human detection on the video stream to obtain the detection target.
[0026] In specific implementation, human detection is performed on the video stream to obtain the detected targets. Human detection refers to locating the location region of the customer in each frame of the video stream. Human detection can be implemented using a detection model based on a deep convolutional neural network. Further, this detection model slides or directly regresses on the image to output multiple bounding boxes, each bounding box enclosing a detected pedestrian. The bounding box is usually a rectangle, and its position information includes the pixel coordinates of the top-left corner, width, and height. Further, after performing human detection frame-by-frame on the video stream captured by the same camera, each customer appearing in each frame is marked as a detected target. Further, detected targets of the same customer in consecutive frames are associated using a target tracking algorithm to maintain their continuity within the field of view of a single camera. Further, the target tracking algorithm can employ methods based on intersection-union matching (IoU) or motion prediction, etc., which are not specifically limited in this invention. IoU measures whether they are the same target by calculating the ratio of the overlap area to the union area of the detected bounding boxes in two adjacent frames; further, motion prediction uses algorithms such as Kalman filtering to predict the position of the next frame based on the target's historical position and matches it with the actual detection result. By associating detected targets belonging to the same customer in adjacent frames, a temporary local trajectory under the camera is formed.
[0027] S3, extract the body contour features and clothing features of the detected target to generate anonymous appearance features.
[0028] In specific implementation, the body contour features and clothing features of the detected target are extracted to generate anonymous appearance features. Body contour features refer to characteristics related to body shape, such as the customer's body type, height, shoulder width, and limb proportions. Clothing features refer to visual features such as the color, texture, style, and accessories of the customer's clothing. An image region is extracted from the bounding box of the detected target and input into a feature extraction network. The feature extraction network can employ a deep convolutional neural network trained using metric learning. Furthermore, the goal of metric learning training is to minimize the distance between appearance feature vectors of the same customer under different cameras and maximize the distance between appearance feature vectors of different customers. Further, a triplet loss function can be used during training, with each input consisting of an anchor sample, a positive sample, and a negative sample, optimizing the network parameters to ensure that the distance between the anchor sample and the positive sample is less than the distance between the anchor sample and the negative sample. Further, the network performs multi-layer convolution and downsampling operations on the input image region, ultimately outputting a fixed-dimensional feature vector, which is the anonymous appearance feature. Further, the feature vector can have 128 or 256 dimensions. Furthermore, during feature extraction, only the image content corresponding to the body and clothing regions is used. Specifically, the portion of the target image corresponding to the head region can be cropped or zeroed out, retaining only the body region below the neck as input for feature extraction, thus masking facial features at the algorithm level. Furthermore, the anonymized appearance feature is a numerical vector, where each dimension represents an abstract appearance attribute. It is non-reversible, and the customer's facial or clothing image cannot be reconstructed from this vector. Furthermore, this feature is used to distinguish different customers but does not contain biometric information that can be used to identify customer identity.
[0029] S4, obtain the stored historical appearance feature library, which contains appearance features associated with temporary anonymous identifiers.
[0030] In specific implementation, a stored historical appearance feature database is obtained, which contains appearance features associated with temporary anonymous identifiers. This database, stored in memory or a database, records the appearance features of all customers currently in the store who have been assigned temporary anonymous identifiers. Further, each historical appearance feature is bound to a temporary anonymous identifier. The temporary anonymous identifier is a randomly generated string or numeric number, such as one generated using a universally unique identifier or an incrementing numeric number. The temporary anonymous identifier does not contain any personal customer information and is only used to distinguish different customers within the system. The association between the temporary anonymous identifier and the anonymous appearance feature is stored in the historical appearance feature database as key-value pairs. When a customer leaves the store, the corresponding temporary anonymous identifier and anonymous appearance feature are destroyed; therefore, the historical appearance feature database only retains data related to customers currently in the store.
[0031] S5, determine whether there is a historical appearance feature in the historical appearance feature library that matches the anonymous appearance feature.
[0032] In specific implementation, it is determined whether there are historical appearance features in the historical appearance feature database that match the anonymous appearance feature. Matching refers to calculating the similarity between the current anonymous appearance feature and each historical appearance feature in the historical appearance feature database, and determining whether the maximum similarity exceeds a preset similarity threshold. Further, the similarity can be calculated using cosine similarity. Cosine similarity measures the degree of similarity between two feature vectors by calculating the cosine of the angle between them, with values ranging from -1 to +1; a larger value indicates greater similarity. Alternatively, the reciprocal of the Euclidean distance can be used as a similarity measure; a smaller distance indicates higher similarity. The preset similarity threshold is set based on the discriminative ability of the feature extraction network and factors such as lighting changes, occlusion levels, and customer clothing changes in the actual scene. For example, in scenarios with stable lighting and where customers do not change clothing for a short period, the threshold can be set to 0.8; in scenarios with significant lighting changes, the threshold can be set to 0.6. Furthermore, the entire historical appearance feature database is traversed, and the similarity between the current anonymous appearance feature and each historical appearance feature is calculated. The maximum similarity is then compared with a preset similarity threshold. Further, if the maximum similarity is greater than or equal to the preset similarity threshold, a matching historical appearance feature is determined to exist; otherwise, no matching historical appearance feature is determined to exist. Further, to avoid excessively long matching times due to a large historical appearance feature database, an inverted index or hash index can be used to accelerate nearest neighbor lookup; this invention does not specifically limit the specific application of this method.
[0033] S6. If a matching historical appearance feature exists, the detection target is associated with the temporary anonymous identifier corresponding to the matching historical appearance feature.
[0034] In practice, if a matching historical appearance feature exists, the detected target is associated with the temporary anonymous identifier corresponding to that matching historical appearance feature. This means that the current detected target is considered to be the same customer who has appeared before. The detected target is then associated with the temporary anonymous identifier bound to the matched historical appearance feature. Furthermore, the detected target's position coordinates, timestamps, and other information in the current and subsequent frames are recorded under this temporary anonymous identifier. This association operation ensures that when a customer leaves the field of view of one camera and reappears in the field of view of another camera, their trajectory can be continued without interruption due to camera switching.
[0035] S7. If no matching historical appearance feature exists, a new temporary anonymous identifier is assigned to the detection target, and the anonymous appearance feature is added to the historical appearance feature library.
[0036] In practice, if no matching historical appearance feature exists, a new temporary anonymous identifier is assigned to the detected target, and the anonymous appearance feature is added to the historical appearance feature database. The new temporary anonymous identifier can be a number generated according to an incrementing rule or a randomly generated unique string. Further, after assigning the new temporary anonymous identifier, it is bound to the current anonymous appearance feature and added to the historical appearance feature database. Further, after addition, when the customer appears in subsequent frames or other camera views, they can be associated with the same temporary anonymous identifier through feature matching. The historical appearance feature database is updated in real time to ensure that subsequent detected targets can be matched with the latest historical appearance features in a timely manner.
[0037] S8, record the position coordinates and timestamp of the detected target under each camera, and generate the trajectory segment of the detected target under the corresponding camera.
[0038] In specific implementation, the position coordinates and timestamp of the detected target under each camera are recorded to generate a trajectory segment of the detected target under the corresponding camera. The position coordinates can be the pixel coordinates of the detected target in the image, or the store's planar coordinates after coordinate transformation. Further, the timestamp is the acquisition time of the current video frame. The position coordinates of the same detected target in multiple consecutive frames under the same camera are arranged in chronological order to form a trajectory segment of the detected target under that camera. Further, one trajectory segment corresponds to continuous movement within the field of view of one camera. Further, the trajectory segment ends when the detected target leaves the field of view of the camera. Further, the data structure of the trajectory segment is an ordered list, where each element contains two fields: position coordinates and timestamp. The trajectory segments are stored in a cache or database and associated with their corresponding temporary anonymous identifier.
[0039] In some preferred embodiments, recording the position coordinates and timestamps of the detected target under each camera and generating the trajectory segment of the detected target under the corresponding camera includes: performing homography matrix calibration on each camera to obtain the homography matrix corresponding to each camera; obtaining the pixel coordinates of the video frame where the detected target is located in the video stream; mapping the pixel coordinates to store plane coordinates according to the homography matrix corresponding to the camera where the detected target is located; recording the store plane coordinates and frame timestamp of the detected target in the video frame where it is located; arranging the store plane coordinates of the same temporary anonymous identifier under the same camera in chronological order to generate the trajectory segment of the detected target under the camera.
[0040] In practice, after acquiring the target and its anonymized appearance features and associating them with a temporary anonymity identifier, the target's position in the video stream needs to be recorded as trajectory points. Images captured by different cameras have different pixel coordinate systems. If pixel coordinates are directly used to record the trajectory, trajectory segments from different cameras will have different spatial references, making it impossible to directly stitch them into a complete movement trajectory. Therefore, this embodiment uses homography matrix calibration to map the pixel coordinates of the target in the video frame to a unified physical plane coordinate system, thereby eliminating the differences in coordinate systems between cameras and providing a consistent coordinate basis for cross-camera trajectory stitching. The specific implementation method is as follows: Each camera undergoes homography matrix calibration to obtain its corresponding homography matrix. The homography matrix is a 3x3 matrix used in machine vision to describe the perspective mapping relationship between two planes. For cameras mounted on the store ceiling with a fixed viewing angle, a definite homography mapping exists between their image plane and the store floor plane. Further, the calibration process involves placing a calibration object of known physical size on the store floor, such as a checkerboard pattern or a calibration board with marked points. Further, the actual coordinates of the corner points or marked points in the store plane coordinate system are known beforehand. Further, the camera captures images of the calibration object, and the pixel coordinates of the corner points or marked points in the images are identified. Further, corner detection can employ the Harris corner detection algorithm or a checkerboard-based black-and-white grid intersection point extraction algorithm. Further, based on the correspondence between multiple sets of pixel coordinates and their corresponding store plane coordinates, a direct linear transformation algorithm is used to solve for the nine elements of the homography matrix. Further, the direct linear transformation constructs a system of linear equations and uses singular value decomposition to obtain the least-squares solution. Furthermore, since homography matrices are equivalent in scale, they are typically normalized to a form where the last element is one, thus reducing the number of parameters to be solved to eight. Furthermore, after calibration, each camera corresponds to a fixed homography matrix, which is stored in the data storage unit for subsequent coordinate transformations. Furthermore, once the camera's installation position and angle are fixed, the homography matrix remains unchanged, eliminating the need for repeated calibration.
[0041] Further, the pixel coordinates of the detected target within the video frame of the video stream are obtained. Pixel coordinates refer to the position of the detected target in the video frame image. Further, the pixel coordinates of the midpoint of the bottom edge of the detected target's bounding box can be taken as the representative point of the detected target's position. The midpoint of the bottom edge typically approximates the contact point between the customer's foot and the ground. Since the foot-ground contact point is located on the store floor, choosing this point helps improve the accuracy of the store's planar coordinates after homography mapping. Further, the pixel coordinates include horizontal and vertical coordinates, with units of pixels. The pixel coordinates are output in each frame using a target tracking algorithm. For the pixel coordinates of the same detected target in consecutive frames, further smoothing processing can be performed, such as using Kalman filtering or simple moving average. Further, Kalman filtering optimizes the detection coordinates by establishing a linear state model of the target's motion, reducing coordinate jitter caused by detection noise. The state vector can contain position and velocity, and the observation vector is the pixel coordinates.
[0042] Further, based on the homography matrix corresponding to the camera where the detected target is located, the pixel coordinates are mapped to store planar coordinates. For any pixel coordinate, it is represented in homogeneous coordinate form, that is, a third-dimensional component with a value of one is added after the pixel coordinate. Further, this homogeneous coordinate is multiplied by the homography matrix of the corresponding camera to obtain a three-dimensional result vector. The first two dimensions of this result vector are divided by the third dimension for normalization to obtain the store planar coordinates. The store planar coordinates are the actual physical position of the customer on the store floor plane, in meters. Further, the origin of the store planar coordinates can be set at a fixed position on the store floor plan, such as the upper left corner of the store entrance. The coordinate axis direction is consistent with the drawing direction of the store floor plan. Further, during the mapping process, the accuracy of the homography matrix directly affects the accuracy of the store planar coordinates. Further, since the camera installation height and angle are fixed, the homography matrix remains stable after calibration, and the mapping error mainly comes from the positioning error of the detected target bounding box and the deviation in the selection of the foot contact point.
[0043] Further, the store plane coordinates and frame timestamp of the detected target in the current video frame are recorded. The frame timestamp is the acquisition time of the video frame and can be obtained from the video stream's metadata, such as from the timestamp field of a real-time streaming protocol. Further, the frame timestamp has millisecond-level precision. The store plane coordinates and frame timestamp are combined into a trajectory point record and appended to the trajectory point sequence corresponding to the detected target. Further, the data structure of the trajectory point record includes three fields: the store plane horizontal coordinate, the store plane vertical coordinate, and the frame timestamp. Further, the trajectory point sequence is arranged in chronological order, with each trajectory point corresponding to one video frame. Further, if the detected target is occluded or detection fails in a frame, no trajectory point is generated for that frame, but a time interval will appear in the trajectory point sequence; this interval does not affect the overall structure of the trajectory segment.
[0044] Furthermore, the store's planar coordinates under the same camera with the same temporary anonymous identifier are arranged in chronological order to generate a trajectory segment of the detected target under the camera. The trajectory segment is a time-ordered list of trajectory points, each containing store planar coordinates and a frame timestamp. Furthermore, as the detected target moves within the same camera's field of view, newly generated trajectory points are continuously added to the trajectory segment under that camera. Furthermore, when the detected target leaves the camera's field of view, the trajectory segment ends, is marked as a complete segment, and stored. Furthermore, if the detected target subsequently re-enters the camera's field of view, a new trajectory segment is created for that re-entry. Furthermore, the same temporary anonymous identifier can correspond to multiple trajectory segments, each trajectory segment corresponding to a continuous movement within a single camera's field of view. Furthermore, the trajectory segments are stored in a data storage unit, associated with the temporary anonymous identifier, and used for stitching together subsequent complete movement trajectories.
[0045] This embodiment unifies the detected target positions in video streams captured by different cameras to the same store plane coordinate system through homography matrix calibration and mapping of pixel coordinates to store plane coordinates. This eliminates spatial reference differences between trajectory segments across cameras, ensuring spatial consistency in subsequent complete motion trajectory stitching. Furthermore, each trajectory point in the trajectory segment carries store plane coordinates and a frame timestamp, reflecting both the customer's spatial location and temporal sequence. Furthermore, using the midpoint of the bottom edge as the position representative point makes the store plane coordinates closer to the actual contact position between the customer's feet and the ground, improving mapping accuracy. Furthermore, homography matrix calibration only needs to be performed once after camera installation and can be used long-term, resulting in low maintenance costs. Furthermore, this implementation method allows subsequent heatmap generation, dwell time statistics, and movement line visualization to be performed under a unified spatial coordinate system, avoiding statistical errors caused by coordinate inconsistencies.
[0046] S9. Based on the timestamps of the same temporary anonymous identifier appearing in the multiple cameras, the trajectory segments corresponding to the same temporary anonymous identifier are spliced together in chronological order to generate the complete movement trajectory of the detected target.
[0047] In specific implementation, based on the timestamps of the same temporary anonymous identifier appearing in the multiple cameras, the trajectory segments corresponding to the same temporary anonymous identifier are spliced together in chronological order to generate the complete movement trajectory of the detected target. Furthermore, since the same customer may appear in the field of view of different cameras at different times, all trajectory segments corresponding to the customer's temporary anonymous identifier are collected. Further, for each trajectory segment, the timestamp of its first trajectory point is taken as the start time of the trajectory segment, and the timestamp of its last trajectory point is taken as the end time. Further, all trajectory segments are sorted according to the order of their start times, and the sorted trajectory segments are spliced together end-to-end to obtain the complete movement trajectory from entering the store to leaving the store. Further, the complete movement trajectory is a series of store planar coordinate sequences with time information. Further, if there is a time interval between adjacent trajectory segments, this interval indicates that the customer is in an area not covered by any camera, and this time interval is retained without interpolation. Further, the complete movement trajectory is stored in a data storage unit as the basic data for subsequent customer flow analysis, heat map generation, and product attention analysis.
[0048] This embodiment achieves cross-camera customer identity association by extracting anonymous appearance features that do not contain facial region features and matching them with a historical appearance feature database, thus avoiding the privacy compliance risks associated with facial recognition. Furthermore, by stitching together trajectory segments from multiple cameras in chronological order based on the same temporary anonymous identifier, a complete customer movement trajectory within the store is obtained. Furthermore, this method achieves continuous tracking of customer group behavior without collecting facial biometric features, resolving the contradiction between data analysis and privacy protection in the retail industry. Furthermore, the anonymous appearance features are based solely on body contours and clothing features, and the feature extraction process masks the facial region, cutting off the path for biometric information collection at the algorithmic level. Furthermore, the temporary anonymous identifier is destroyed after the customer leaves the store, further shortening the lifecycle of anonymous data and complying with the requirements of personal information protection laws and regulations regarding data minimization and timely deletion. Furthermore, the construction of the complete movement trajectory provides a data foundation for subsequent customer flow density statistics, dwell time calculation, movement line visualization, and product attention analysis.
[0049] In some preferred embodiments, the method further includes: acquiring the store planar coordinates of a first video frame and a second video frame that are temporally adjacent to the detected target, wherein the second video frame is later than the first video frame; determining the motion direction vector of the detected target based on the store planar coordinates of the first video frame and the second video frame; determining whether the store planar coordinates of the second video frame are located within a preset store exit area to obtain a first determination result; determining whether the motion direction vector points outside the store exit area to obtain a second determination result; determining that the detected target has left the retail store when both the first determination result and the second determination result are yes; destroying the temporary anonymous identifier corresponding to the detected target and removing the anonymous appearance feature from the historical appearance feature library.
[0050] In practice, after a customer completes their shopping and leaves the store, their temporary anonymous identifier and anonymous appearance characteristics need to be promptly destroyed to avoid the long-term retention of anonymous data. Furthermore, inaccurate departure detection may result in the temporary anonymous identifier remaining even after the customer leaves, increasing the data storage burden, or it may lead to the temporary anonymous identifier being destroyed prematurely while the customer is still in the store, causing a disruption in the tracking. Therefore, this embodiment analyzes the changes in the store's planar coordinates of the detected target in consecutive video frames to determine whether a customer has left the store, and destroys the temporary anonymous identifier upon confirmation of departure, ensuring the shortest possible lifespan of anonymous data. The specific implementation method is as follows: The store plane coordinates of the first and second video frames, which are temporally adjacent to the detected target, are obtained, with the second video frame being later than the first video frame. The first and second video frames are two consecutive frames of the same detected target taken from a single camera, with the time interval between them equal to the frame period of that camera. The store plane coordinates of the two video frames are obtained through homography matrix mapping, representing the actual positions of the detected target on the store floor plane at two adjacent moments. Further, these two coordinate values are read from the trajectory point sequence corresponding to the detected target. If the detected target experiences a brief occlusion in two adjacent frames, resulting in missing coordinates in the second video frame, the missing frame can be skipped, and the two most recent valid frames are taken.
[0051] Further, the motion direction vector of the detected target is determined based on the store plane coordinates of the first video frame and the store plane coordinates of the second video frame. The motion direction vector is obtained by subtracting the store plane coordinates of the first video frame from the store plane coordinates of the second video frame. This vector represents the displacement of the detected target from the corresponding moment in the first video frame to the corresponding moment in the second video frame, with its direction pointing forward and its magnitude being the actual distance the detected target moves between the two frames. The motion direction vector is represented using a two-dimensional vector in the store plane coordinate system, with units in meters. Since the time interval between the two frames is very small, this vector can approximately reflect the instantaneous motion direction of the detected target at its current position. If the detected target is stationary, the magnitude of the motion direction vector is close to zero, and the direction is uncertain. In this case, the reliability of subsequent direction judgment results decreases. However, stationary customers are usually located inside the exit area and do not meet the position conditions, so this does not affect the final result of the departure judgment.
[0052] Further, it is determined whether the store's planar coordinates in the second video frame are within a preset store exit area, thus obtaining a first determination result. The preset store exit area is the ground area corresponding to the exit area marked on the store's floor plan beforehand. For example, for a store with a single entrance, the exit area can be defined as a rectangular area extending a certain distance inward and outward from the center line of the entrance door, with the length and width of this area determined according to the door width and store layout. Further, this area can be represented as a polygonal region, with its vertex coordinates stored in the configuration information. Further, it is determined whether the store's planar coordinates in the second video frame fall within this polygon. Determining whether a point is within the polygon can be done using either the ray method or the angle sum method. The ray method emits a ray from the detection target point in any direction and counts the number of intersections between the ray and the polygon boundary. If the number of intersections is odd, the point is inside the polygon; if it is even, the point is outside. Further, the angle sum method calculates the sum of the angles between the detection target point and the lines connecting each vertex of the polygon. If the sum of the angles is 360 degrees, the point is inside. If the store's planar coordinates in the second video frame are located within the polygon, then the first judgment result is yes; otherwise, the first judgment result is no.
[0053] Further, a second judgment result is obtained by determining whether the movement direction vector points to the outside of the store's exit area. The judgment method is as follows: a pre-determined outward normal direction pointing towards the outside of the store is established for the exit area. The outward normal direction can be the normal vector of the edge closest to the outside of the store in the boundary of the exit area, pointing outward. Further, the dot product of the movement direction vector and the outward normal direction vector is calculated. The dot product equals the product of the magnitudes of the two vectors multiplied by the cosine of the angle between them. Further, if the dot product is greater than zero, it indicates that the angle between the movement direction vector and the outward normal direction is acute, and the projection of the movement direction vector onto the outward normal direction is positive, meaning the detected target is moving towards the outside of the store, and the second judgment result is yes; further, if the dot product is less than or equal to zero, it indicates that the detected target is moving towards the inside of the store or moving parallel to the boundary of the exit area, and the second judgment result is no. Further, the dot product calculation can effectively distinguish between two opposite traversal behaviors: entering and leaving. Relying solely on position judgment cannot distinguish whether a customer is entering or leaving the store, but the introduction of the movement direction vector resolves this ambiguity.
[0054] Furthermore, when both the first and second judgment results are true, it is determined that the detected target has left the retail store. Both judgment results being true simultaneously indicates that the detected target is already within the exit area and is moving towards the outside of the store, which meets the behavioral characteristics of leaving the store. If the detected target is within the exit area but its direction of movement is towards the inside of the store, it means that the detected target is entering the store rather than leaving, and the departure condition is not met. Furthermore, if the detected target is moving towards the outside of the store but has not yet reached the exit area, the departure condition is also not met, because it may be moving towards the exit from other areas inside the store. This dual judgment mechanism effectively reduces the probability of false positives.
[0055] Furthermore, the temporary anonymous identifier corresponding to the detected target is destroyed, and the anonymous appearance feature is removed from the historical appearance feature database. The destruction operation includes deleting all trajectory segment records, location coordinate records, and other associated data corresponding to the temporary anonymous identifier from memory, and deleting the association between the temporary anonymous identifier and the anonymous appearance feature from the database. Furthermore, after removing the anonymous appearance feature from the historical appearance feature database, the anonymous appearance feature will no longer participate in the matching judgment between the detected target and historical appearance features. Furthermore, the removal operation ensures that the appearance features of customers who have left the store will not be mistakenly used to match other customers still in the store. Furthermore, after the destruction and removal operations are completed, the customer's anonymous data no longer exists in the system, complying with the data minimization and timely deletion principles required for personal information protection.
[0056] This embodiment determines the movement direction vector by acquiring the store's planar coordinates from two consecutive frames, and then determines whether the location is within the exit area and whether the movement direction points outwards. Only when both determinations are yes is the customer confirmed to have left the store. Furthermore, this dual-determination mechanism effectively avoids misjudgments caused by relying solely on location. For example, an anonymous tag will not be incorrectly destroyed if a customer lingers near the exit but has not left, nor will it be mistakenly judged as leaving if a customer enters from the outside. Furthermore, the temporary anonymous tag is immediately destroyed and anonymous appearance features are removed upon confirmation of departure, ensuring the shortest possible lifespan for anonymous data and further strengthening privacy protection. Furthermore, the introduction of the movement direction vector improves the accuracy of departure determination and reduces trajectory interruptions or data retention issues caused by misjudgments.
[0057] In some preferred embodiments, the method further includes: obtaining a floor plan of the retail store and dividing the floor plan into multiple grid areas; mapping the store's planar coordinates in the complete movement trajectories of multiple detected targets to the grid areas, counting the number of detected targets in each grid area to obtain the customer flow density; calculating the dwell time of each detected target in each grid area based on the timestamps in the complete movement trajectories, and accumulating them to obtain the cumulative dwell time in each grid area; and performing spatial smoothing on the customer flow density and the cumulative dwell time to generate a customer flow heatmap.
[0058] In practice, after obtaining the complete movement trajectories of multiple detection targets, it is necessary to convert the discrete trajectory point data into visual data reflecting the density of customer flow in different areas of the store. Although the complete movement trajectory contains rich spatial and temporal information, it is difficult to intuitively represent the distribution of people flow at the regional level by directly displaying it as a trajectory. To address this, this embodiment divides the store's planar space into multiple grid areas and maps the store's planar coordinates from the complete movement trajectory to the grid areas. It then calculates the customer flow density and cumulative dwell time, and finally generates a customer flow heatmap through spatial smoothing. This solves the problem of converting trajectory data into regional statistics. The specific implementation method is as follows.
[0059] First, obtain the floor plan of the retail store and divide it into multiple grid regions. The floor plan is a two-dimensional plan of the store floor, including the boundaries and location information of areas such as shelves, aisles, cash registers, and entrances. Further, the floor plan can be derived from store design drawings or generated through on-site measurements. The grid regions can be divided into uniform square grids. For example, the store floor can be divided into square grids with sides of 0.5 meters, with each grid representing a local area. The choice of grid size needs to balance statistical resolution and computational cost. Too small a grid size will result in too few trajectory points within each grid, leading to large fluctuations in statistical values; too large a grid size will reduce spatial resolution and fail to reflect local differences. Further, in an optional implementation, grid division can also be based on functional areas of the store, such as dividing each section of shelf aisle into a grid, or dividing the floor area corresponding to each shelf unit into a grid. Furthermore, the grid boundaries obtained from functional area division correspond to the actual store layout, making the statistical results more business-interpretive. After the grid regions are divided, each grid is assigned a unique identifier, and its polygon vertex coordinates are recorded.
[0060] Furthermore, the store planar coordinates in the complete movement trajectories of multiple detection targets are mapped to the grid area, and the number of detection targets in each grid area is counted to obtain the customer flow density. Furthermore, for each trajectory point in the complete movement trajectory of each detection target, the grid area it belongs to is determined based on the store planar coordinates of that trajectory point. Furthermore, the method for determining the grid where a point is located is consistent with the method for determining whether a point is inside a polygon. Furthermore, a set of detection target identifiers is maintained for each grid. When the trajectory point of a detection target falls into a grid, the temporary anonymous identifier of that detection target is added to the detection target identifier set of that grid. Furthermore, after traversing all trajectory points of all detection targets, the number of elements in the detection target identifier set of each grid is the number of detection targets in that grid area. Furthermore, this number represents how many different customers have visited the grid area, i.e., the customer flow density. Furthermore, this method removes duplicates when the same detection target enters the same grid multiple times, ensuring that the customer flow density reflects the number of independent customers rather than the number of trajectory points. Furthermore, the customer flow density can be further divided by the grid area to obtain the customer flow density per unit area, for comparison between grids of different sizes.
[0061] Further, based on the timestamps in the complete movement trajectory, the dwell time of each detected target in each grid area is calculated, and the cumulative dwell time of each grid area is obtained. For each detected target, a sequence of trajectory points that consecutively fall into the same grid area is identified from the complete movement trajectory. Further, the difference in timestamps between adjacent trajectory points is the time spent by the detected target moving between the corresponding positions of the two trajectory points, which can be approximated as occurring entirely within the grid area. Further, for a group of trajectory points that consecutively fall into the same grid area, the timestamp of the last trajectory point is subtracted from the timestamp of the first trajectory point to obtain the single dwell time of the detected target within the grid area. Further, if the detected target enters and exits the same grid area multiple times, the single dwell times of each instance are calculated separately and then summed to obtain the total dwell time of the detected target within the grid area. Further, the total dwell time of all detected targets within a certain grid area is summed to obtain the cumulative dwell time of that grid area. Further, the cumulative dwell time reflects the attractiveness of the area to customers. The longer customers stay in an area, the more attractive that area is to them, which may be related to its merchandise display or functional design.
[0062] Furthermore, spatial smoothing is applied to the passenger flow density and the cumulative dwell time to generate a passenger flow heatmap. Spatial smoothing refers to performing a neighborhood-weighted average on the gridded statistical data to eliminate abrupt changes at grid boundaries, making the heatmap visually smoother. For example, one implementation method is to use a Gaussian smoothing kernel. For each grid, the statistical values of itself and its surrounding neighboring grids are taken and summed according to Gaussian weights related to the distance from the central grid to obtain the smoothed statistical value. Furthermore, the Gaussian weights are maximized at the central grid and decrease towards the surrounding areas, with the weight distribution conforming to the bell curve of the Gaussian function. Furthermore, the smoothing process can be performed separately for passenger flow density and cumulative dwell time. Furthermore, after smoothing, the processing result is mapped to a color gradient. The color mapping can use a blue-green-yellow-red gradient, with blue representing low values and red representing high values. Furthermore, the colors are filled into the corresponding grid areas and superimposed on the store floor plan to generate a passenger flow heatmap. Furthermore, the passenger flow heatmap can be stored as an image file or embedded as a layer in a visualization analysis platform. For example, in one alternative implementation, two heat maps can be generated separately based on passenger flow density and cumulative dwell time, or the two can be normalized and proportionally merged into a single comprehensive heat map. The comprehensive heat map can simultaneously reflect both the passenger flow density and dwell time of a region.
[0063] This embodiment transforms discrete, complete movement trajectory data into statistics of passenger flow density and cumulative dwell time on a spatial grid through grid division and trajectory point mapping, achieving aggregation from individual trajectories to regional statistics. Furthermore, passenger flow density is deduplicated using a set of detected target identifiers to avoid duplicate counting caused by the same customer repeatedly passing through the same area. Furthermore, cumulative dwell time is calculated using the difference in trajectory point timestamps, reflecting the actual duration of customer stay within each grid area. Furthermore, spatial smoothing eliminates the jagged effect of grid statistics, making the heatmap visually smoother and more natural, facilitating quick identification of cold and hot zones by store operators. Furthermore, passenger flow density and cumulative dwell time, two indicators, characterize customer spatial behavior from different dimensions; the former reflects the number of visitors to an area, while the latter reflects the degree of dwell time, providing data support for shelf adjustment, aisle planning, and promotional resource allocation.
[0064] In some preferred embodiments, the plurality of cameras includes a first camera deployed in the shelf area, the resolution of the first camera being higher than a preset resolution threshold; the method further includes: acquiring a video stream captured by the first camera; performing head pose estimation on the detected target appearing in the video stream captured by the first camera to obtain the head deflection angle of the detected target; extracting an eye region image of the detected target from the video stream captured by the first camera; performing lossy dimensionality reduction encoding on the eye region image to obtain a gaze feature vector, the data size of the gaze feature vector being smaller than the data size of the eye region image; performing gaze estimation based on the head deflection angle and the gaze feature vector to obtain the gaze point of the detected target; matching the gaze point with pre-marked shelf shelves and merchandise inventory unit positions to determine the target merchandise inventory unit being gazed at by the detected target; recording the start and end times of the detected target's gaze at the target merchandise inventory unit to obtain the gaze direction and gaze duration of the detected target at the target merchandise inventory unit.
[0065] In practice, customer flow heatmaps only reflect customer visits and dwell times, but cannot reveal which specific product a customer is looking at. In retail operations, the degree of attention a product receives directly impacts its sales potential; therefore, behavioral analysis needs to be deepened from a regional dimension to a product inventory unit dimension. To this end, this embodiment uses high-resolution cameras deployed in the shelf area to estimate customer head posture and gaze, and matches the gaze point with pre-marked shelf shelves and product inventory unit locations to obtain the customer's gaze direction and gaze duration for a specific product inventory unit. The specific implementation is as follows: The system includes a first camera deployed in the shelf area. This first camera has a resolution higher than a preset resolution threshold. This preset resolution threshold is set based on the image sharpness required for gaze estimation. For example, the resolution threshold could be set to 1920 x 1080 pixels. Furthermore, the first camera in the shelf area is mounted facing the front of the shelf, its field of view covering all shelves and the merchandise placed on them. Compared to other cameras mounted on the store ceiling, the first camera has higher spatial resolution, enabling it to clearly capture image details of the customer's head and eye areas, providing sufficient pixel information for head pose estimation and gaze estimation. Furthermore, cameras in other areas can maintain lower resolution to save computational resources and transmission bandwidth. Furthermore, the first camera is physically positioned close to the shelf area, and the angle between its optical axis and the shelf plane is calibrated to ensure the accuracy of subsequent gaze point calculations. Furthermore, the angle calibration process between the optical axis of the first camera and the shelf plane is as follows: A reference point with known store plane coordinates is set on the shelf plane. An image of the reference point is captured using the first camera, and its pixel coordinates are extracted. Combined with the intrinsic parameters of the first camera, the rotation matrix and translation vector of the first camera relative to the store plane coordinate system are solved using perspective n-point positioning. The optical axis direction vector is extracted from the rotation matrix, and the angle between the optical axis direction vector and the normal vector of the shelf plane is calculated, thus obtaining the angle calibration result. This angle is used for rotation compensation when the line of sight is transformed from the camera coordinate system to the store plane coordinate system.
[0066] Further, the video stream captured by the first camera is acquired. The video stream captured by the first camera only covers the shelf area. This video stream contains a sequence of images of customers entering the shelf area. The acquisition method is consistent with the aforementioned video stream acquisition method. The video stream captured by the first camera can be synchronized in time with the video streams of other cameras to ensure time alignment during subsequent correlation analysis. The video stream data is transmitted to the processing unit in real time, and the processing unit performs subsequent steps on each frame of the image.
[0067] Further, head pose estimation is performed on the detected target appearing in the video stream captured by the first camera to obtain the head deflection angle of the detected target. Further, head pose estimation refers to detecting the customer's head region from the image and estimating the head's orientation angle in three-dimensional space. Further, the head orientation angle typically includes three dimensions: yaw angle, pitch angle, and roll angle. The yaw angle represents the angle of left-right rotation of the head around the vertical axis, the pitch angle represents the angle of up-down rotation of the head around the horizontal axis, and the roll angle represents the angle of tilt of the head around the front-back axis. Further, head pose estimation can be implemented using a deep learning model. This model takes a head region image patch as input and outputs three angle values. The head region can be located in the video frame using face detection or head detection models, but the head region location is only used for pose estimation, not for identity recognition, and the head region image is not stored. The head deflection angle provides a constraint on the head orientation for subsequent gaze estimation. Because the gaze direction is determined by both the head orientation and the position of the eyeball relative to the head, head orientation is an important prior information.
[0068] Further, the eye region image of the detected target is extracted from the video stream captured by the first camera. The eye region image refers to an image patch of the area around the eyes on the face of the detected target. Further, key eye points can be located within the head region of the detected target. Key eye point localization can be achieved through a key point detection model, which outputs the positions of key points such as the pupil center, inner and outer corners of the eyes. Based on these key points, an eye region image containing both eyes is cropped. Further, the eye region image contains detailed information such as the eyes, pupils, and eyelids, and is the main visual cue for gaze estimation. When extracting the eye region image, only the region of one eye or both eyes can be retained, depending on the input requirements of the gaze estimation model. The cropped eye region image can be scaled to a fixed size, such as 64 by 64 pixels, to meet the input requirements of the subsequent encoding network.
[0069] Furthermore, the eye region image is subjected to lossy dimensionality reduction encoding to obtain a gaze feature vector, the size of which is smaller than the size of the eye region image. Lossy dimensionality reduction encoding is a data compression technique that reduces the amount of data by mapping the original high-dimensional data to a low-dimensional feature space, while retaining key information relevant to subsequent tasks. For example, in this embodiment, an encoding network is used to encode the eye region image, outputting a fixed-length vector, which is the gaze feature vector. The encoding network can adopt an autoencoder structure, whose training objective is to reduce dimensionality while retaining sufficient information to support gaze estimation. Specifically, the encoder part consists of multiple convolutional and pooling layers, progressively compressing the input image into a low-dimensional vector; the decoder part attempts to reconstruct the input image from the low-dimensional vector, with the goal of minimizing the reconstruction error during training. Further, after training, the decoder is discarded, and only the encoder output is used as the gaze feature vector. Because the encoding process is lossy, the size of the gaze feature vector is much smaller than the size of the original eye region image. For example, the original eye region image is a 64x64 pixel three-channel image, with a data size of approximately 12288 bytes, while the gaze feature vector can be a 256-dimensional floating-point number, with a data size of approximately 1024 bytes. Furthermore, since the encoding process is irreversible, the original eye region image cannot be reconstructed from the gaze feature vector. This further reduces storage and transmission overhead and avoids retaining the original eye image in the system, thus further protecting customer privacy. The gaze feature vector is passed to the gaze estimation model, and the eye region image itself is discarded after processing and not stored.
[0070] It should be noted that in this embodiment, the lossy dimensionality reduction encoding is implemented using a convolutional autoencoder. The encoder consists of four convolutional blocks (3×3 kernels, with channels of 32, 64, 128, and 256 respectively, each batch normalized, ReLU, and 2×2 max pooling) cascaded with a fully connected layer, encoding a 64×64×3 eye region image into a 256-dimensional gaze feature vector. The decoder is a symmetrical mirror structure, used only for reconstruction during the training phase (loss function is mean squared error), and discarded during the inference phase. The training set contains approximately 80,000 eye images (including publicly available datasets MPIIGaze and Columbia). Approximately 50,000 images were collected from Gaze and 30,000 from stores. The Adam optimizer (learning rate 1e-3, batch size 64) was used for 100 epochs of training. After convergence, the MSE of the validation set reconstruction was approximately 4.2e-4. To verify the effectiveness of the 256-dimensional model, ablation was performed using 128-dimensional, 256-dimensional, and 512-dimensional hidden layers. Under the same gaze regression network, the RMSE of gaze landing points were 4.82cm, 3.47cm, and 3.38cm, respectively. The 256-dimensional model improved the accuracy by approximately 28% compared to the 128-dimensional model, while the 512-dimensional model only improved the accuracy by approximately 2.6% compared to the 256-dimensional model, but the inference time increased by 21.7% and the data volume doubled. Therefore, the 256-dimensional model is the best overall and is sufficient to support the accuracy requirements of subsequent gaze estimation.
[0071] Further, gaze estimation is performed based on the head deflection angle and the gaze feature vector to obtain the gaze point of the detected target. The gaze point refers to the intersection of the customer's gaze with the shelf plane or the plane where the goods are located. The head deflection angle and the gaze feature vector can be concatenated and input into the gaze estimation model. Further, the gaze estimation model can be a regression network that outputs a gaze direction vector. The gaze direction vector represents the direction of the customer's gaze in three-dimensional space. Further, the position and orientation of the shelf plane in the store's plane coordinate system are obtained in advance through calibration. Based on the three-dimensional coordinates of the detected target's eye position and the gaze direction vector, the intersection of the gaze direction vector and the shelf plane is calculated, and this intersection point is the gaze point. The gaze point is represented by store plane coordinates or shelf local coordinates. Shelf local coordinates can be easily associated with the shelf shelf and the position of the goods inventory unit. The three-dimensional coordinates of the eye position can be obtained by estimating the position of the head region in the video frame, camera intrinsics, and head depth, or approximated by setting the average height of the customer's eyes.
[0072] Furthermore, the gaze point is matched with the pre-marked shelf shelves and inventory unit positions to determine the target inventory unit being observed. Pre-marking refers to labeling the positions of each shelf shelf and the inventory units placed on it beforehand. An inventory unit, or Stock Keeping Unit (SKU), is the smallest inventory unit used in retail management to distinguish different products; each SKU corresponds to a specific product specification. The marking result includes the boundary area of each SKU on the shelf plane, which is typically rectangular or polygonal. Marking can be done manually by measuring and inputting the data into the system, or by capturing images of the shelf using a camera and automatically identifying the boundary of each SKU using image segmentation and target detection algorithms. Determining which SKU's boundary area the gaze point falls into determines the target inventory unit being observed. If the gaze point does not fall into any SKU's boundary area, it indicates that the customer is observing an empty space between shelves or a location outside the shelves, and no SKU observation record is generated.
[0073] Further, the start and end times of the detected target's gaze at the target product inventory unit are recorded to obtain the gaze direction and gaze duration of the detected target towards the target product inventory unit. Further, the gaze direction is the gaze direction vector obtained from gaze estimation. Further, when the gaze points of multiple consecutive frames all fall within the boundary area of the same target product inventory unit, the gaze time of the first frame is taken as the start time, and the gaze time of the last frame is taken as the end time; the difference between the two is calculated to obtain the gaze duration. If the customer shifts their gaze and then re-gazes at the same SKU, it is recorded as multiple gazes. Further, each gaze record includes a temporary anonymous identifier corresponding to the detected target, the target product inventory unit identifier, the gaze start time, the gaze end time, and the gaze duration. The gaze direction can be taken as the average value of the gaze direction vector during that gaze period. The gaze records are stored in the data storage unit for the generation of subsequent product visual attention data.
[0074] This embodiment achieves non-invasive measurement of customer gaze direction and duration for specific product inventory units by deploying a high-resolution first camera in the shelf area and combining head pose estimation and gaze estimation. Furthermore, lossy dimensionality reduction encoding is performed on the eye region image to obtain a gaze feature vector, avoiding the storage of raw eye images while completing the gaze estimation task, thus reducing the risk of privacy leakage. Furthermore, the data volume of the gaze feature vector is less than that of the eye region image, saving storage and transmission resources. Matching the gaze point with pre-labeled SKU locations deepens the macro-level customer movement analysis to the micro-level of product visual attention. Furthermore, the recording of gaze duration and gaze direction provides a more refined data foundation for product display optimization and marketing strategy formulation, and also provides input data for subsequent visual attention statistics and conversion rate calculations.
[0075] In some preferred embodiments, the method further includes: acquiring the gaze duration of multiple detection targets on the same target product inventory unit; performing threshold filtering on the gaze duration to remove gaze records less than a preset gaze duration threshold to obtain effective gaze duration; counting the number of detection targets that gaze at the target product inventory unit to obtain the number of people paying attention to the target product inventory unit; grouping and accumulating the effective gaze duration by target product inventory unit to obtain the cumulative effective gaze duration of the target product inventory unit; and generating product visual attention data based on the cumulative effective gaze duration and the number of people paying attention.
[0076] In practice, the gaze record of a single customer on a single product inventory unit reflects individual behavior and cannot be directly used to measure the degree of attention a product receives among all customers. It is necessary to aggregate the gaze records of multiple customers on the same target product inventory unit to form a group-level statistical indicator. This embodiment generates product visual attention data by applying a threshold filter to gaze duration to exclude noise data such as brief glances, and by counting the number of people paying attention and the cumulative effective gaze duration. The specific implementation method is as follows: The system acquires the gaze duration of multiple detected targets on the same target product inventory unit. Gaze duration data is recorded during the gaze estimation and matching process. Each gaze record includes a temporary anonymity identifier corresponding to the detected target, a target product inventory unit identifier, a gaze start time, a gaze end time, and a gaze duration. Further, the system reads gaze duration records of all detected targets on the same target product inventory unit within a specified time period from the data storage unit. The target product inventory unit identifier is used to uniquely identify a SKU. During reading, the data can be grouped by target product inventory unit for subsequent statistical processing.
[0077] Furthermore, the gaze duration is threshold-filtered to remove gaze records shorter than a preset gaze duration threshold, thus obtaining the effective gaze duration. The preset gaze duration threshold is used to exclude brief glances where the customer's gaze sweeps over the product without genuine attention. For example, the preset gaze duration threshold can be set to 0.5 seconds. Gazes shorter than 0.5 seconds are usually unconscious scanning behavior and do not reflect the customer's true interest in the product. All gaze duration records are iterated through, and records with gaze durations shorter than the preset gaze duration threshold are removed; the remaining gaze duration is the effective gaze duration. Furthermore, threshold filtering reduces the interference of noise data on attention statistics, improving the accuracy of the statistical results. The preset gaze duration threshold can be adjusted according to factors such as product type, shelf height, and customer behavior habits. Furthermore, for products requiring higher cognitive input, such as electronic digital products, the effective gaze duration is usually longer, and the threshold can be appropriately increased; for fast-moving consumer goods, the effective gaze duration can be relatively shorter.
[0078] Furthermore, the number of detected targets that viewed the target product inventory unit is counted to obtain the number of times the target product inventory unit has been viewed. After threshold filtering, the retained valid view records are deduplicated according to the detected target. Specifically, all different temporary anonymous identifiers are extracted from the valid view records, and their number is counted, which is the number of times the product has been viewed. The number of times the product has been viewed reflects how many independent customers have effectively viewed the target product inventory unit. The number of times the product has been viewed is a deduplication indicator; multiple views of the same product by the same customer are counted only once. This indicator measures the breadth of attention received by the product from the dimension of the number of independent individuals.
[0079] Furthermore, the effective gaze durations are grouped and accumulated according to the target product inventory unit to obtain the cumulative effective gaze duration for that target product inventory unit. The effective gaze duration values belonging to the same target product inventory unit, after threshold filtering, are summed to obtain the cumulative effective gaze duration. The cumulative effective gaze duration reflects the total attention time of all customers to the product. Furthermore, this indicator measures the depth of attention received by the product from a time perspective. The longer the cumulative effective gaze duration, the more total attention customers invest in the product. This indicator is not affected by deduplication of attention counts and can reflect the contribution of repeated gazes and prolonged gazes.
[0080] Furthermore, based on the cumulative effective gaze duration and the number of people who paid attention, product visual attention data is generated. This data may include metrics such as the number of people who paid attention to each target product inventory unit, the cumulative effective gaze duration, and the average gaze duration. The average gaze duration can be obtained by dividing the cumulative effective gaze duration by the number of people who paid attention, reflecting the average duration of a single customer's gaze on the product. The data is stored in a structured format, such as a data table, with each row recording the statistical results for one target product inventory unit. The data table includes fields such as target product inventory unit identifier, number of people who paid attention, cumulative effective gaze duration, and average gaze duration. This data table is stored in a data storage unit for subsequent correlation analysis and visualization with point-of-sale transaction data.
[0081] This embodiment removes noisy gaze records such as brief saccades through threshold filtering, making the retained effective gaze duration more reflective of customers' true attention and improving the accuracy of product visual attention data. Furthermore, the number of attention visits measures the breadth of product attention from the perspective of the number of independent customers, while the cumulative effective gaze duration measures the depth of product attention from the perspective of the total time. Combining these two metrics provides a comprehensive characterization of the product's visual appeal. Average gaze duration, as a derived indicator, further reflects the average duration of attention a single customer gives to a product. Moreover, the generated product visual attention data provides reliable input for subsequent correlation analysis with point-of-sale transaction data and conversion rate calculations, and also provides a data source for visualization displays such as product attention rankings.
[0082] In some preferred embodiments, the method further includes: acquiring point-of-sale transaction data, the point-of-sale transaction data including the sales quantity of each product inventory unit within a preset time window; associating the product visual attention data with the point-of-sale transaction data by target product inventory unit; extracting the number of people paying attention to the target product inventory unit from the product visual attention data; and extracting the purchase quantity of the target product inventory unit within the preset time window from the point-of-sale transaction data; and calculating the visual attention-purchase conversion rate based on the number of people paying attention and the purchase quantity, the visual attention-purchase conversion rate being the ratio of the purchase quantity to the number of people paying attention.
[0083] In practice, product visual attention data reflects how often customers view a product. However, attention data alone cannot determine whether that attention ultimately translates into a purchase. Retail operations need to quantify the conversion efficiency from when a customer sees a product to when they actually buy it in order to assess the product's sales potential. Therefore, this embodiment obtains point-of-sale transaction data, correlates product visual attention data with point-of-sale transaction data by target product inventory unit, and calculates the visual attention-to-purchase conversion rate. The specific implementation method is as follows: The process involves acquiring point-of-sale (POS) transaction data, which includes the sales quantity of each product inventory unit within a preset time window. This POS transaction data originates from the store's point-of-sale (POS) system. Specifically, a point-of-sale (POS) system is an information system that records details of each transaction. POS transaction data typically includes information such as transaction number, transaction time, product inventory unit identifier, sales quantity, and sales price. The preset time window can be set according to analytical needs, such as one day, one week, or one month. Furthermore, the sales quantity of each product inventory unit within the preset time window is retrieved from the POS database to form sales statistics. The sales quantity is the cumulative number of units of that product inventory unit sold within the preset time window. The length of the preset time window needs to be consistent with the statistical time range of the product visual attention data to ensure the timeliness of the correlation analysis. For example, if the visual attention data is a record of gazes within a specific day, then the POS transaction data will also be the sales quantity for that day.
[0084] Furthermore, the product visual attention data and the point-of-sale transaction data are associated by target product inventory unit. The association operation uses the identifier of the target product inventory unit as the key to connect the corresponding records in the product visual attention data table and the point-of-sale transaction data table. Further, for each target product inventory unit, the number of people who have paid attention to the target product inventory unit is extracted from the product visual attention data, and the purchase quantity of the target product inventory unit within the preset time window is extracted from the point-of-sale transaction data. Further, the number of people who have paid attention and the purchase quantity reflect how many unique customers have paid attention to the product and how many customers have purchased it within the preset time window, respectively. Further, if a target product inventory unit has no sales record in the point-of-sale transaction data, its purchase quantity is recorded as zero. The associated data is organized into an intermediate data table containing three fields: target product inventory unit identifier, number of people who have paid attention, and purchase quantity.
[0085] Furthermore, based on the number of views and the number of purchases, a visual attention-to-purchase conversion rate is calculated, which is the ratio of the number of purchases to the number of views. The visual attention-to-purchase conversion rate measures the efficiency of converting customer visual attention into actual purchase. For example, if a product's inventory unit has 100 views and 20 purchases within a statistical time window, the visual attention-to-purchase conversion rate is 20 divided by 100, which is 0.2, and can be represented as 20%. A higher conversion rate indicates that the product is more effective at converting customer attention into actual purchase behavior, and that there is a stronger consistency between the product's visual appeal and sales results. Conversely, a lower conversion rate indicates that while the product has attracted attention, the purchase conversion is poor, potentially requiring optimization in pricing, promotions, or the product's inherent attributes. The calculated visual attention-to-purchase conversion rate is stored in a data storage unit as input data for subsequent visualization and operational decision-making.
[0086] This embodiment links product visual attention data with point-of-sale transaction data, calculating the visual attention-to-purchase conversion rate as the ratio of the number of people who pay attention to the product to the number of purchases. This establishes a quantitative link between customer visual attention behavior and purchasing behavior at the product inventory unit level. Furthermore, this conversion rate metric allows store operators to differentiate between four product categories: high attention / high conversion, high attention / low conversion, low attention / high conversion, and low attention / low conversion, enabling them to develop differentiated display and promotional strategies for different products. For high attention / low conversion products, pricing or promotional efforts may need to be optimized; for low attention / high conversion products, there may be potential for improvement, requiring better display placement to increase attention. Moreover, this calculation process fully utilizes product visual attention data, forming a closed-loop analysis with point-of-sale transaction data, a crucial step in transforming behavioral data into business decisions.
[0087] In some preferred embodiments, the method further includes: acquiring the complete movement trajectory, the passenger flow heatmap, the product visual attention data, and the visual attention-purchase conversion rate; performing curve fitting and rendering on the complete movement trajectory to generate a flow chart; performing color rendering on the passenger flow heatmap to generate a heatmap display; sorting the product visual attention data to generate a product attention ranking list; and rendering the visual attention-purchase conversion rate into a funnel chart to generate a conversion funnel.
[0088] In practice, after obtaining complete movement trajectories, customer flow heatmaps, product visual attention data, and visual attention-to-purchase conversion rates, this structured data needs to be presented to store operations personnel in an intuitive graphical format to facilitate quick understanding and application of the analysis results. This embodiment transforms the data into visual charts by rendering the above data as movement flow diagrams, heatmap displays, product attention rankings, and conversion funnels. The specific implementation method is as follows: The system acquires the complete movement trajectory, the customer flow heatmap, the product visual attention data, and the visual attention-to-purchase conversion rate. The complete movement trajectory is a time-ordered coordinate sequence of multiple detected targets in the store's planar coordinate system. Further, the customer flow heatmap is an image or layer data of gridded statistical values after color mapping. Further, the product visual attention data is a data table containing the number of people who paid attention to each target product inventory unit and the cumulative effective gaze duration. Further, the visual attention-to-purchase conversion rate is the conversion rate value for each target product inventory unit. These data are read from the data storage unit. Further, during reading, the data is filtered according to the time range of the visualization display to ensure that the displayed data is consistent with the analysis period.
[0089] Further, the complete movement trajectory is curve-fitted and rendered to generate a flow chart. Curve fitting refers to smoothing the discrete store planar coordinate points in the complete movement trajectory and connecting them into a continuous curve to more naturally represent the customer's movement path. Further, Bézier curve fitting or spline interpolation methods can be used. Further, cubic spline interpolation constructs a cubic polynomial between each adjacent trajectory point, making the curve have continuous first and second derivatives at the connection points, thus obtaining a smooth curve. Further, the sequence of trajectory points is converted into a smooth curve. Rendering involves plotting the curve on the store floor plan. Further, each customer's complete movement trajectory is drawn using a single color, with different colors for different customers. Color assignment can be based on a hash mapping using temporary anonymous identifiers to ensure consistent color for the same customer's trajectory. Further, the flow chart shows the actual movement routes of customers within the store. Operations personnel can use the flow chart to identify the main customer paths, detours, and path intersections. Further, in an optional implementation, only flow charts with dwell times exceeding a preset threshold can be displayed to reduce interference from noisy trajectories.
[0090] Furthermore, the customer flow heatmap is color-rendered to generate a heatmap display. The customer flow heatmap already consists of gridded statistical values; the rendering process maps these values to color gradients, which are then overlaid on the store floor plan. A predefined color mapping table can be used to render grids with high customer density or high cumulative dwell time in red, low values in blue, and intermediate values using a yellow and green transition. The color mapping table can be based on a linear or logarithmic scale. After color rendering, the heatmap is overlaid as a semi-transparent layer on the store floor plan, allowing operations staff to simultaneously see the store layout and customer flow distribution. The heatmap display enables operations staff to easily identify hot and cold areas within the store.
[0091] Furthermore, the visual attention data of the products is sorted to generate a product attention ranking list. The sorting criteria can be cumulative effective gaze duration or number of views. All target product inventory units are arranged from high to low according to preset sorting indicators to generate a ranking list. The ranking list can display the top few products, such as the top 10. Each entry in the ranking list includes information such as product name, product inventory unit identifier, number of views, and cumulative effective gaze duration. The ranking list is displayed on the data analysis platform interface in the form of a table or bar chart. Operations personnel can quickly understand which products receive the most customer attention through the ranking list.
[0092] Furthermore, a funnel chart is rendered for the visual attention-purchase conversion rate to generate a conversion funnel. A funnel chart is a visual chart used to show the conversion from one stage to the next. In this embodiment, the funnel chart can show the step-by-step conversion relationship from in-store traffic to attention to purchase quantity. Further, attention is taken as the middle stage of the funnel, and purchase quantity as the bottom stage, the conversion ratio between each stage is calculated, and rendered as a funnel shape. Further, the width of the funnel is proportional to the quantity of each stage. Further, the conversion funnel allows operations personnel to intuitively see the drop-off situation from attention to purchase. Further, in an optional implementation, the funnel chart can be generated individually for each target product inventory unit, or it can be generated based on aggregated data from the entire store.
[0093] This embodiment visualizes complete movement trajectories, customer flow heatmaps, product visual attention data, and visual attention-to-purchase conversion rates, generating four types of charts: movement flow maps, heatmap displays, product attention rankings, and conversion funnels. Furthermore, these charts transform abstract statistical data into intuitive visual elements, allowing store operators to quickly obtain key information without needing to understand the underlying data format. Moreover, visualization not only enhances the understandability of data analysis results but also supports multi-dimensional exploration by operators through chart interaction; for example, clicking on a heatmap area to view specific customer flow data for that area, or clicking on a product in the ranking to view its attention duration trend. Finally, this visualization solution presents the analysis results uniformly on the data analysis platform, forming a complete closed loop from data collection, processing, analysis to visualization.
[0094] Furthermore, regarding the technical solutions of the above embodiments, it should be further explained that for human detection, the training process is based on a deep convolutional neural network architecture (such as the YOLO series or Faster R-CNN). The training data comes from publicly available pedestrian detection datasets and a self-built retail store scene dataset. The self-built dataset is collected from real store environments with different lighting conditions, viewing angles, occlusion situations, and crowd densities, and pedestrian positions are labeled. During model training, a stochastic gradient descent optimizer is used, and multiple iterations of training are performed based on a preset learning rate. Before training, data augmentation operations such as scaling and cropping are performed on the images to improve the robustness of the model in complex scenes.
[0095] Furthermore, the feature extraction network employs a metric learning training strategy. Training data is derived from publicly available person re-identification datasets and self-built cross-camera scene video sequence data. This self-built data covers images of different detection targets under different viewpoints and lighting conditions, and each detection target has a unique labeled identity. During training, a triplet loss function is used, combined with data augmentation techniques such as random horizontal flipping, random cropping, and color jittering to optimize feature distances within the embedding space. The optimizer can employ the Adaptive Moment Estimation (Adam) algorithm and iteratively update based on preset hyperparameters. It is important to emphasize that the samples used for feature extraction training have all had their face regions pre-masked at the algorithm level, retaining only the body contours below the neck and clothing areas to ensure that the anonymized appearance features learned by the model do not contain biometric information.
[0096] Furthermore, for the head pose estimation and gaze estimation models, the training data comes from publicly available head pose datasets and gaze estimation datasets, and is fine-tuned using self-built data collected by the first camera. The self-built data labels the gaze point coordinates of the detected target at different pitch and yaw angles. During training, the head yaw angle is fused with the extracted gaze feature vector and input into a regression network for joint training, with the optimization objective being to minimize the mean square error between the predicted and true gaze point coordinates. The optimization process also employs an adaptive moment estimation optimizer, and parameters are adjusted according to a preset learning rate strategy.
[0097] Furthermore, the encoding network employs an autoencoder structure for unsupervised training. Training data is derived from publicly available eye image datasets and eye region image data captured using a first camera. The training objective is to minimize the reconstruction error between the decoder output and the input image. The model progressively compresses the feature dimension through multiple convolutional and pooling layers, followed by decoding via deconvolutional layers, thus achieving dimensionality reduction encoding. After training, only the encoder portion is retained to generate the gaze feature vector. Moreover, since the original eye region images are discarded after processing during the inference phase, privacy is ensured from the source by preventing data from being stored locally.
[0098] Understandably, based on the concept of this invention, all the model training data described above have undergone rigorous desensitization and anonymization processing, and do not contain any original facial images or real identity information that can identify an individual. Through the explicit disclosure of the model architecture, training data sources, and training methods described above, those skilled in the art can reproduce the various models involved in this invention without any creative effort, thereby realizing anonymous customer movement analysis under the privacy compliance constraints of this invention in retail stores.
[0099] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0100] Please see Figure 2 , Figure 2 This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 500 can be a terminal or a server, wherein the server can be a standalone server or a server cluster composed of multiple servers.
[0101] The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.
[0102] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, it causes the processor 502 to perform a machine vision-based anonymous customer movement analysis method.
[0103] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.
[0104] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a machine vision-based anonymous customer movement analysis method.
[0105] The network interface 505 is used for network communication with other devices. Those skilled in the art will understand that the above structure is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. A specific computer device 500 may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements.
[0106] The processor 502 is used to run a computer program 5032 stored in a memory to implement the steps of a machine vision-based anonymous customer movement analysis method provided in any of the above embodiments.
[0107] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0108] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0109] Therefore, the present invention also provides a storage medium. This storage medium may be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program causes the processor to perform the steps of a machine vision-based anonymous customer movement analysis method provided in any of the above embodiments.
[0110] The storage medium is a physical, non-transient storage medium, such as a USB flash drive, external hard drive, read-only memory (ROM), magnetic disk, or optical disk, or any other physical storage medium capable of storing program code. The computer-readable storage medium can be non-volatile or volatile.
[0111] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0112] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0113] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0114] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0115] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0116] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, this invention is also intended to include these modifications and variations as long as they fall within the scope of the claims of this invention and their equivalents.
[0117] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A machine vision-based method for analyzing anonymous customer movement patterns, characterized in that, include: Acquire video streams captured by multiple cameras deployed within retail stores; Human detection is performed on the video stream to obtain the detection target; Extract the body contour features and clothing features of the detected target to generate anonymous appearance features; Obtain the stored historical appearance feature library, which contains appearance features associated with temporary anonymous identifiers; Determine whether there is a historical appearance feature in the historical appearance feature library that matches the anonymous appearance feature; If a matching historical appearance feature exists, the detection target is associated with the temporary anonymous identifier corresponding to the matching historical appearance feature; If no matching historical appearance features exist, a new temporary anonymous identifier is assigned to the detection target, and the anonymous appearance features are added to the historical appearance feature library. Record the position coordinates and timestamp of the detected target under each camera, and generate the trajectory segment of the detected target under the corresponding camera; Based on the timestamps of the same temporary anonymous identifier appearing in the multiple cameras, the trajectory segments corresponding to the same temporary anonymous identifier are spliced together in chronological order to generate the complete movement trajectory of the detected target.
2. The method according to claim 1, characterized in that, The process of recording the position coordinates and timestamp of the detected target under each camera, and generating the trajectory segment of the detected target under the corresponding camera, includes: Perform homography matrix calibration on each camera to obtain the homography matrix corresponding to each camera; Obtain the pixel coordinates of the video frame in the video stream where the detected target is located; Based on the homography matrix corresponding to the camera where the detection target is located, the pixel coordinates are mapped to store planar coordinates; Record the store plane coordinates and frame timestamp of the detected target in the video frame. Arrange the store's planar coordinates under the same camera with the same temporary anonymous identifier in chronological order to generate the trajectory segment of the detected target under the camera.
3. The method according to claim 2, characterized in that, The method further includes: Obtain the store planar coordinates of the first and second video frames that are temporally adjacent to the detected target, wherein the second video frame is later than the first video frame. The motion direction vector of the detected target is determined based on the store plane coordinates of the first video frame and the store plane coordinates of the second video frame. Determine whether the store's planar coordinates in the second video frame are within a preset store exit area to obtain a first determination result; Determine whether the motion direction vector points outside the store exit area to obtain a second determination result; When both the first judgment result and the second judgment result are yes, it is determined that the detected target has left the retail store; Destroy the temporary anonymous identifier corresponding to the detection target and remove the anonymous appearance feature from the historical appearance feature library.
4. The method according to claim 2, characterized in that, The method further includes: Obtain the floor plan of the retail store and divide the floor plan into multiple grid areas; The store's planar coordinates in the complete movement trajectories of multiple detection targets are mapped to the grid area, and the number of detection targets in each grid area is counted to obtain the customer flow density; Based on the timestamps in the complete movement trajectory, calculate the dwell time of each detected target in each grid area, and sum them up to obtain the cumulative dwell time in each grid area; Spatial smoothing is performed on the passenger flow density and the cumulative dwell time to generate a passenger flow heat map.
5. The method according to claim 4, characterized in that, The plurality of cameras includes a first camera deployed in the shelf area, the first camera having a resolution higher than a preset resolution threshold; The method further includes: Obtain the video stream captured by the first camera; The head pose of the detected target appearing in the video stream captured by the first camera is estimated to obtain the head deflection angle of the detected target; Extract the eye region image of the target from the video stream captured by the first camera; The eye region image is subjected to lossy dimensionality reduction encoding to obtain a gaze feature vector, the data size of which is smaller than the data size of the eye region image; Based on the head deflection angle and the gaze feature vector, gaze estimation is performed to obtain the gaze point of the detected target; The line of sight is matched with the pre-marked shelf and inventory unit positions to determine the target inventory unit being observed by the detection target. Record the start and end times of the detection target's gaze at the target product inventory unit to obtain the gaze direction and duration of the detection target's gaze at the target product inventory unit.
6. The method according to claim 5, characterized in that, The method further includes: Acquire the gaze duration of multiple detection targets on the same target product inventory unit; The fixation duration is threshold filtered to remove fixation records that are less than a preset fixation duration threshold, thus obtaining the effective fixation duration. The number of detected targets focusing on the target product inventory unit is counted to obtain the number of people who have paid attention to the target product inventory unit; The effective gaze duration is grouped and accumulated according to the target product inventory unit to obtain the cumulative effective gaze duration of the target product inventory unit; Based on the cumulative effective gaze duration and the number of people who pay attention, product visual attention data is generated.
7. The method according to claim 6, characterized in that, The method further includes: Acquire point-of-sale transaction data, which includes the sales quantity of each product inventory unit within a preset time window; The product visual attention data and the sales point transaction data are associated by target product inventory unit. The number of people who pay attention to the target product inventory unit is extracted from the product visual attention data, and the purchase quantity of the target product inventory unit within the preset time window is extracted from the sales point transaction data. Based on the number of followers and the number of purchases, the visual attention-to-purchase conversion rate is calculated, whereby the visual attention-to-purchase conversion rate is the ratio of the number of purchases to the number of followers.
8. The method according to claim 7, characterized in that, The method further includes: Obtain the complete movement trajectory, the passenger flow heatmap, the product visual attention data, and the visual attention-to-purchase conversion rate; The complete movement trajectory is curve-fitted and rendered to generate a motion diagram; The passenger flow heatmap is color-rendered to generate a heatmap display; The product visual attention data is sorted to generate a product attention ranking list; Render a funnel chart of the visual attention-purchase conversion rate to generate a conversion funnel.
9. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, can implement the method as described in any one of claims 1-8.
