Commodity picking and placing identification device and commodity picking and placing identification method
Through frame image decomposition and contour determination, combined with predetermined rules, the corresponding relationship of the goods in the smart vending cabinet is determined, and the movement trajectory of the goods is formed, which solves the problem of low recognition accuracy of the smart vending cabinet and achieves accurate identification of goods for sale.
Patent Information
- Application Number
- CN202110262710.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-11
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-03-11
AI Technical Summary
The product recognition accuracy of existing smart vending cabinets is low, and it is difficult to accurately determine whether the product identified in the video frame is a product for sale that is picked up and placed by the user, especially when the user wears gloves or his hands are blocked by clothing, and the angle or distance of the product changes. The recognition failed, resulting in a settlement error.
Through frame image decomposition, product analysis, contour determination and movement trajectory formation, the predetermined contour deformation range and position movement range determination rules are used to determine the corresponding relationship of the contours in the frame image, form a product movement trajectory, and determine whether the product for sale has been picked up and placed by the user. .
The accuracy and stability of product identification are improved. Even if the angle or distance of the product changes during the picking and placing process, the movement trajectory of the product can be correctly constructed to ensure accurate identification of products for sale.
Smart Images

Figure CN113052020B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent vending, relates to an intelligent vending cabinet, and specifically relates to a commodity picking and placing identification device and method. Background Art
[0002] Smart vending machines are common equipment in commercial automation and can be placed in shopping malls, supermarkets, and other locations to provide retail services to users. Dynamic image cabinets are a common type of smart vending machine that can identify the goods taken out by users by shooting videos with cameras. They have the characteristics of low production and maintenance costs and high internal space utilization.
[0003] However, there are still many shortcomings in the dynamic image cabinets currently on the market. The main problem is that the recognition accuracy is low. It is difficult to accurately determine whether the goods recognized in the video frame are indeed the goods for sale that are picked up and placed by the user. Therefore, it is easy to cause errors in the settlement of goods, and often relies on manual cooperation to review the order. This not only greatly affects the user's shopping experience, but also increases the cost of personnel management.
[0004] In order to improve the recognition accuracy of dynamic image cabinets, the existing product recognition method (patent 201910923841.2) first identifies handheld products from the video, and then identifies and classifies the handheld products to determine the products for sale taken by the user. However, this method still has shortcomings: first, it cannot be correctly recognized when the user wears gloves or his hands are blocked by clothes; second, it is easy to mistakenly identify the products brought by the customer as products for sale.
[0005] In addition to the above-mentioned methods, the main reason for the low recognition accuracy of various existing product recognition methods is generally that the state of the product may change significantly during the process of being taken and placed. For example, when the angle or distance between the product and the camera changes, the area, length, width and height of the product will change significantly, which will lead to recognition failure. Summary of the invention
[0006] In order to solve the above problems, a commodity picking and placing identification device and method are provided, which can determine the correspondence between the contours of each identified commodity in each frame image of the video, thereby realizing accurate identification of the movement trajectory and the picking and placing status of the commodity. The present invention adopts the following technical solutions:
[0007] <Structure 1>
[0008] The present invention provides a commodity picking and placing identification device, which is used for identifying a picking and placing video obtained when a user picks and places commodities for sale in an intelligent vending machine, and is characterized in that it includes: a frame image decomposition unit, which decomposes the picking and placing video into multiple frame images; a commodity parsing unit, which respectively parses the contours and corresponding position information of each commodity contained in each frame image; a contour determination unit, which determines the correspondence between each contour in each frame image based on a predetermined contour deformation range determination rule and a predetermined position information movement range determination rule, and according to the contours and position information of each commodity contained in two adjacent frame images, and regards the commodity corresponding to the contour with the corresponding relationship as the same commodity for sale; a movement trajectory forming unit, which connects the position information of the same commodity for sale in each frame image in time sequence to form a commodity movement trajectory of the commodity for sale; and a picking and placing determination unit, which determines whether the commodity for sale is picked up and placed by the user at least according to the commodity movement trajectory.
[0009] <Structure 2>
[0010] The present invention also provides a commodity picking and placing identification method, which is used to identify the picking and placing video captured when a user picks and places commodities for sale in a smart vending machine, and is characterized in that it includes the following steps: a frame image decomposition step, decomposing the picking and placing video into multiple frame images; a commodity parsing step, respectively parsing the contours and corresponding position information of each commodity contained in the frame image from each frame image; a contour determination step, based on a predetermined contour deformation range determination rule and a predetermined position information movement range determination rule, and according to the contours and position information of each commodity contained in two adjacent frame images, determining the correspondence between each contour in each frame image, and treating the commodity corresponding to the contour with the corresponding relationship as the same commodity for sale; a movement trajectory forming step, connecting the position information of the same commodity for sale in each frame image in chronological order to form a commodity movement trajectory of the commodity for sale; a picking and placing determination step, at least determining whether the commodity for sale is picked up and placed by the user based on the commodity movement trajectory.
[0011] Function and Effect of the Invention
[0012] According to the commodity picking and placing identification device and commodity picking and placing identification method provided by the present invention, after obtaining the picking and placing video of the user picking and placing the commodity for sale, the contours and positions of all commodities in each video frame of the video are identified, and the corresponding relationship between the contours in two adjacent frame images is determined according to the predetermined contour deformation range determination rule and the predetermined position movement range determination rule. Finally, according to the corresponding relationship, the commodity corresponding to the contour is used as the commodity for sale and the position information is linked to form a commodity movement trajectory. Therefore, in this way, it is possible to accurately determine which two contours in two adjacent frames belong to the same commodity. Even if the commodity contours continue to change accordingly due to changes in the angle and distance from the camera during the picking and placing process, it can be ensured that the commodity movement trajectory of the commodity for sale can be correctly constructed, and finally the accuracy and stability of the picking and placing identification of the commodity for sale are guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 is a block diagram of a user portrait construction device in Embodiment 1 of the present invention;
[0014] Figure 2 is a schematic diagram of a frame image in Embodiment 1 of the present invention;
[0015] Figure 3 is a block diagram of a contour determination unit in Embodiment 1 of the present invention;
[0016] Figure 4 This is one of the schematic diagrams for comparing two adjacent video frames in the first embodiment of the present invention;
[0017] Figure 5 This is the second schematic diagram of comparing two adjacent video frames in the first embodiment of the present invention;
[0018] Figure 6 is a schematic diagram of the inner and outer dividing lines in the first embodiment of the present invention;
[0019] Figure 7 is a flow chart of a commodity picking and placing identification action of a commodity picking and placing identification device in Embodiment 1 of the present invention;
[0020] Figure 8 is a block diagram of a user portrait construction device in Embodiment 2 of the present invention;
[0021] Fig. 9 is a block diagram of a contour determination unit in a second embodiment of the present invention; and
[0022] Fig.10 4 is a flow chart of a commodity picking and placing identification action of a commodity picking and placing identification device in Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0023] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the commodity picking and placing identification device and the commodity picking and placing identification method of the present invention are specifically described below in combination with embodiments and drawings.
[0024] As an embodiment, the present invention provides a commodity picking and placing identification device, which is used to identify the picking and placing video captured when a user picks and places commodities for sale in a smart vending machine, and is characterized in that it includes: a frame image decomposition unit, which decomposes the picking and placing video into multiple frame images; a commodity analysis unit, which analyzes the contours and corresponding position information of each commodity contained in each frame image respectively; a contour determination unit, which determines the correspondence between each contour in each frame image based on a predetermined contour deformation range determination rule and a predetermined position information movement range determination rule, and according to the contours and position information of each commodity contained in two adjacent frame images, and regards the commodity corresponding to the contour with the corresponding relationship as the same commodity for sale; a movement trajectory formation unit, which connects the position information of the same commodity for sale in each frame image in chronological order to form a commodity movement trajectory of the commodity for sale; and a picking and placing determination unit, which determines whether the commodity for sale is picked up and placed by the user at least based on the commodity movement trajectory.
[0025] In the first embodiment, it can also have such technical features, wherein the outline of the product is a range frame that can select a range frame that is compatible with the size of the graphic of the product in the frame image, the position information is the coordinates of the center point of the range frame in the frame image, and the outline determination unit has: a contour setting unit, for two adjacent frame images, setting each contour in one frame image as a first contour, and setting each contour in the other frame image as a second contour; a position movement range determination unit, calculating the movement distance between the first contour and the second contour based on the position information of the first contour and the second contour, and determining whether the movement distance is below the position movement threshold corresponding to the side length of the second contour; a contour deformation range determination unit, determining whether the side length of the first contour is within the contour deformation range corresponding to the side length of the second contour; a correspondence determination unit, when the movement distance between the first contour and the second contour is within the position movement range, and the side length of the first contour is within the contour deformation range, determining the first contour with the shortest movement distance as having a corresponding relationship with the second contour.
[0026] In the first embodiment, it can also have such technical features, wherein the side length is the width value and the height value of the range box, the position movement threshold is the height value multiplied by a predetermined movement distance coefficient, the predetermined movement distance coefficient has a value range of 1.3 to 1.7, the contour deformation range is from the side length multiplied by a predetermined minimum deformation coefficient to the side length multiplied by a predetermined maximum deformation coefficient, the predetermined minimum deformation coefficient is 0.6, and the predetermined maximum deformation coefficient is 1.7.
[0027] In the first embodiment, it can also have such technical features, wherein the outline of the product is a range frame that can select a size that is compatible with the graphic size of the product in the frame image, the position information is the coordinates of the center point of the range frame in the frame image, and the outline determination unit has: a standard side length storage unit, which stores the standard side length of the range frame corresponding to each product; a contour setting unit, for two adjacent frame images, setting each contour in one frame image as a first contour, and setting each contour in the other frame image as a second contour; a product distance calculation unit, which calculates the product distance between the product and the camera according to the side length of the second contour in the frame image, the standard side length of the range frame corresponding to the product, and the focal length of the camera. distance; a position movement threshold calculation unit, which calculates a predetermined position threshold according to the product distance, the focal length and the predetermined actual movement threshold; a position movement range judgment unit, which calculates the movement distance between the first contour and the second contour according to the position information of the first contour and the second contour, and judges whether the movement distance is below the position movement threshold; a contour deformation range judgment unit, which judges whether the side length of the first contour is within the contour deformation range corresponding to the side length of the second contour; a corresponding relationship judgment unit, which, when the movement distance between the first contour and the second contour is within the position movement range and the side length of the first contour is within the contour deformation range, judges the first contour with the shortest movement distance and the second contour as having a corresponding relationship.
[0028] In the first embodiment, it can also have such a technical feature, wherein the commodity analysis unit analyzes the contours and corresponding position information of each commodity contained in the frame image, and also analyzes the category of each commodity corresponding to the contour. When the contour determination unit determines the correspondence between each contour in each frame image, it determines the contours corresponding to the same category in two adjacent frame images in pairs.
[0029] In the first embodiment, the technical feature may also include: a product list generating unit, which generates a product list containing the categories of all the products for sale that are picked up and placed and the corresponding pick-up and placement status according to the pick-up and placement status and the category of the products.
[0030] In the first embodiment, it may also have such technical features, further including: an inner and outer dividing line storage unit, storing inner and outer dividing line information for distinguishing the inside and outside of the smart vending machine in the frame image, wherein the pick-up and place determination unit includes: a movement trajectory acquisition unit, acquiring the commodity movement trajectory of the commodity to be determined; and a pick-up and place state determination unit, determining the position information corresponding to the latest multiple frame images in the commodity movement trajectory according to the inner and outer dividing line information, when the position information is outside the inner and outer dividing line, the commodity to be sold is determined to be in the taken-out state, and when the position information is inside the inner and outer dividing line, the commodity to be sold is determined to be in the put-in state.
[0031] In the first embodiment, the present invention may further have such a technical feature that, when forming the commodity movement trajectory, the movement trajectory forming unit also forms a contour change trajectory corresponding to the commodity movement trajectory according to the contour of the same commodity for sale.
[0032] As a second embodiment, the present invention further provides a method for identifying commodity picking and placing, which is used to identify a picking and placing video captured when a user picks and places commodities for sale in a smart vending machine, and is characterized in that it includes the following steps: a frame image decomposition step, decomposing the picking and placing video into multiple frame images; a commodity analysis step, respectively analyzing the contours and corresponding position information of each commodity contained in the frame image from each frame image; a contour determination step, based on a predetermined contour deformation range determination rule and a predetermined position information movement range determination rule, and according to the contours and position information of each commodity contained in two adjacent frame images, determining the correspondence between each contour in each frame image, and treating the commodity corresponding to the contour having the corresponding relationship as the same commodity for sale; a movement trajectory formation step, connecting the position information of the same commodity for sale in each frame image in chronological order to form a commodity movement trajectory of the commodity for sale; a picking and placing determination step, at least determining whether the commodity for sale is picked up and placed by the user based on the commodity movement trajectory.
[0033] <Example 1>
[0034] The commodity picking and placing identification device of this embodiment is a processor that is connected to the smart vending cabinet. The smart vending cabinet stores a plurality of commodities for sale, and can shoot a video through a camera when a user opens the cabinet door and picks and places the commodities for sale, and sends the captured picking and placing video to the commodity picking and placing identification device after the user closes the cabinet door.
[0035] Figure 1 It is a block diagram of a user portrait building device in Embodiment 1 of the present invention.
[0036] like Figure 1 As shown, the commodity picking and placing identification device 100 is connected to a smart vending cabinet 200 for communication, and is used to identify the picking and placing video sent by the smart vending cabinet 200, so as to identify the commodity for sale taken out or put in by the user in the smart vending cabinet 200. The commodity picking and placing device 100 specifically includes a frame image decomposition unit 11, a commodity analysis unit 12, a contour determination unit 13, a movement track formation unit 14, a movement track storage unit 15, an inner and outer dividing line storage unit 16, a picking and placing determination unit 17, a commodity list generation unit 18, a communication unit 19, and a control unit 20 for controlling the above-mentioned units.
[0037] Once the communication unit 19 acquires the pick-up and placement video sent by the smart vending machine 200 , the frame image decomposition unit 11 decomposes the pick-up and placement video into a plurality of frame images in chronological order.
[0038] The product analysis unit 12 stores a pre-trained product analysis model, which is used to input each frame image into the product analysis model for analysis. In this embodiment, the product analysis model is pre-trained based on the SSD neural network model. After the product analysis model processes the frame image, it will output the analysis information of all the products contained in the frame image. Each piece of analysis information contains the outline of the analyzed product, the location information of the outline, the category of the product, and the confidence score of the analysis (the confidence score ranges from 0 to 1, indicating the credibility of the analysis information). The product analysis unit 12 will retain the analysis information with a confidence score above the confidence threshold (0.7 in this embodiment).
[0039] The outline is a range frame that can be used to select the size of the product in the frame image, that is, the range frame can just frame the product in the frame image. The range frame is a rectangle, and the position information is the coordinates of the center point of the range frame. The product parsing model also outputs the width and height of the range frame. The category of the product is the product name and specifications, such as 500ml of cola.
[0040] The contour determination unit 13 can determine the correspondence between the contours in each frame image based on the predetermined contour deformation range determination rules and the predetermined position movement range determination rules, as well as the contours and position information of each commodity contained in two adjacent frame images, and regard the commodities corresponding to the contours with the corresponding relationship as the same commodity for sale.
[0041] Figure 2 It is a schematic diagram of a frame image in Embodiment 1 of the present invention.
[0042] like Figure 2 As shown, the frame image 121 contains commodities A, B and C, with the outline 122 of commodity A ( Figure 2 Taking the dotted rectangle in the middle as an example, the width value of the outline 122 is w, the height value is h, and its position information is the center point coordinates of the center point c in the frame image 121.
[0043] In addition, in this embodiment, the analysis information of each product analyzed by the product analyzing unit 12 is grouped according to categories, so that when the outline determining unit 13 determines the correspondence between outlines, it is convenient to determine only the outlines belonging to the same category.
[0044] Figure 3 It is a block diagram of the contour determination unit in the first embodiment of the present invention.
[0045] like Figure 3As shown, the contour determination unit 13 includes a contour setting unit 131, a position movement range determination unit 132, a contour deformation range determination unit 133, a correspondence determination unit 134, and a determination control unit 135. The contour deformation range determination unit 133 corresponds to a predetermined contour deformation range determination rule, and the position movement range determination unit 132 and the correspondence determination unit 134 correspond to a predetermined position movement range determination rule.
[0046] Once the determination control unit 135 determines the first two frame images as the two adjacent frame images to be determined, the contour setting unit 131 sets each contour in the latter frame image as the first contour and each contour in the former frame image as the second contour for the two frame images.
[0047] The position movement range judgment unit 132 is used to calculate the movement distance between the first contour and the second contour according to the position information of the first contour and the second contour, and judge whether the movement distance is below the position movement threshold corresponding to the side length of the second contour. The position movement threshold is the height value of the range box multiplied by the predetermined movement distance coefficient. In this embodiment, the value of the predetermined movement distance coefficient is preferably 1.5.
[0048] The contour deformation range judgment unit 133 is used to judge whether the side length of the first contour (i.e., the width value w1 and the height value h1) is within the contour deformation range corresponding to the side length of the second contour (i.e., the width value w2 and the height value h2). The predetermined deformation range is between the side length multiplied by the predetermined minimum deformation coefficient and the side length multiplied by the predetermined maximum deformation coefficient. In this embodiment, the predetermined minimum deformation coefficient is 0.6 and the predetermined maximum deformation coefficient is 1.7.
[0049] Figure 4 This is one of the schematic diagrams for comparing two adjacent video frames in the first embodiment of the present invention.
[0050] like Figure 4 As shown, in frame image 121 and frame image 123, contours A1 and A2 are respectively identified, and these two contour deformation range judgment units 133 will respectively determine whether the width value w1 of contour A1 is between the width values w2*0.6 and w2*1.7 of contour A2 and whether the height value h1 of contour A1 is between the height values h2*0.6 and h2*1.7 of contour A2.
[0051] When the position movement range judgment unit 132 judges that the movement distance between the first contour and the second contour is within the position movement range, and the contour deformation range judgment unit 133 judges that the side length of the first contour is within the contour deformation range, the correspondence judgment unit 134 judges that the first contour and the second contour with the shortest movement distance have a corresponding relationship, that is, it judges that the goods corresponding to the first contour and the second contour are the same goods for sale.
[0052] Figure 5 This is the second schematic diagram of comparing two adjacent frames of video in the first embodiment of the present invention.
[0053] In this embodiment, when there are multiple contours of the same category that meet the judgment conditions of the position movement range judgment unit 132 and the contour deformation range judgment unit 133, such as Figure 5 As shown, the first contour A1 in the next frame image and the second contours A2 and B2 in the previous frame image all meet the determination conditions, and similarly, the first contour B1 and the second contours A2 and B2 in the previous frame image all meet the determination conditions. At this time, the correspondence determination unit 134 calculates the distances between each first contour and the second contour according to the center point coordinates of the contours A1, A2, B1, and B2, respectively. If the distance between A1 and A2 is less than the distance between A1 and B2, the correspondence determination unit 134 determines that A1 and A2 have a correspondence relationship, and determines that B1 and B2 have a correspondence relationship.
[0054] In addition, when the first contour meets the determination condition only with one second contour, the correspondence determination unit 134 directly determines that the first contour has a correspondence relationship with the second contour.
[0055] After controlling the position movement range judgment unit 132, the contour deformation range judgment unit 133, and the correspondence judgment unit 134 to complete the judgment of the correspondence between all contours in two adjacent image frames, the judgment control unit 135 uses the latter frame image as the new previous frame image, and obtains the latter frame image in chronological order as the two adjacent frame images to be judged, and further controls the contour setting unit 131, the position movement range judgment unit 132, the contour deformation range judgment unit 133, and the correspondence judgment unit 134 to complete the recognition of all contours for the two frame images again until all frame images have been processed.
[0056] The movement track forming unit 14 connects the outline and position information of the same commodity for sale in each frame image in chronological order to form commodity track information of the commodity for sale. The commodity track information corresponds to a track ID generated by the movement track forming unit 14 .
[0057] In this embodiment, the commodity trajectory information includes the commodity movement trajectory, the contour change trajectory, and the number of times the trajectory is not updated of the contour of the commodity for sale. The contour change trajectory consists of a width value change trajectory and a height value change trajectory.
[0058] The commodity movement trajectory is composed of the center point coordinates of multiple contours of the same commodity for sale in different frame images, and the width value change trajectory and the height value change trajectory are respectively composed of the width values and height values of the corresponding multiple contours. Whenever the contour determination unit 13 determines the correspondence between the contours in two adjacent frame images, the movement trajectory forming unit 14 will add the center point coordinates, width value and height value of the contour in the next frame image to the commodity movement trajectory, width value change trajectory and height value change trajectory according to the correspondence.
[0059] The number of times the trajectory is not updated is the number of times the product trajectory information is not updated by the moving trajectory forming unit 14. The number is incremented by one each time the contour determination unit 13 completes the determination of two adjacent frame images, and is reset to zero when the moving trajectory forming unit 14 updates the product trajectory information. Once the number of times the trajectory is not updated exceeds a predetermined non-updated threshold (the predetermined non-updated threshold is set to 3 in this embodiment), the moving trajectory forming unit 14 stops updating the product trajectory information.
[0060] In addition, if the contour determination unit 13 determines that a first contour has no corresponding second contour in the previous frame image, the movement trajectory formation unit 14 forms a new commodity trajectory information according to the commodity for sale corresponding to the first contour, and uses the center point coordinates of the first contour as the first coordinate of the commodity movement trajectory, the width value and the height value of the first contour as the first values of the width value change trajectory and the height value change trajectory, and sets an initial zero number of trajectory non-update times in the new commodity trajectory information.
[0061] The movement track storage unit 15 is used to store the movement track of the commodity for sale formed by the movement track forming unit.
[0062] In this embodiment, the determination control unit 135 of the contour determination unit 13 controls the contour setting unit 131 to use the latest contour of each contour change trajectory whose trajectory has not been updated the number of times below the predetermined non-update threshold in the moving trajectory storage unit 15 as the second contour, that is, the contours of the product in the first two (predetermined non-update threshold minus one) frame images of the two frame images currently to be determined are also used as the second contour to determine the corresponding relationship.
[0063] The inside-outside dividing line storage unit 16 stores inside-outside dividing line information for distinguishing the inside and outside of the smart vending cabinet 200 in the frame image.
[0064] The pick-up and place determination unit 17 is used to determine whether the commodity for sale is picked up and placed by the user according to the inner and outer dividing line information and the commodity movement trajectory.
[0065] Figure 6 It is a schematic diagram of the inner and outer dividing lines in the first embodiment of the present invention.
[0066] like Figure 6 As shown, the dotted line 171 corresponds to the inner and outer dividing line divided according to the inner and outer dividing line information stored in the inner and outer dividing line storage unit 16. Figure 6 The area above the dotted line 171 is the area inside the cabinet, and the area below the dotted line 171 is the area outside the cabinet. When the pick-and-place determination unit 17 determines the commodity A for sale, the commodity movement trajectory of the commodity A for sale obtained is the trajectory formed by passing through the contours A2, A1, A3, and A4 (arranged in chronological order). It can be seen that since the commodity movement trajectory formed by passing through the contours A2, A1, and A3 moves from the area inside the cabinet to the area outside the cabinet, and the final position information A4 is located in the area outside the cabinet, the pick-and-place determination unit 17 determines that the commodity A for sale is in a taken-out state by the user.
[0067] If the moving track of the commodity for sale is always in the cabinet area, or moves to the outside cabinet area but the final position information moves back to the cabinet area, the pick-and-place determination unit 17 determines that the pick-and-place state of the commodity for sale has not changed.
[0068] If the commodity movement track of the commodity for sale moves from the area outside the counter to the area inside the counter, the placement determination unit 17 determines that the commodity for sale is in the placed state where it is placed by the user.
[0069] The commodity list generating unit 18 is used to generate a commodity list, which contains the categories of all the commodities for sale that are picked up and placed and the corresponding picking and placing statuses.
[0070] Figure 7 1 is a flow chart of a commodity picking and placing identification action of a commodity picking and placing identification device in Embodiment 1 of the present invention.
[0071] like Figure 7 As shown, once the smart vending machine 200 has finished shooting the pick-up and placement video, the process of the commodity pick-up and placement identification action of the commodity pick-up and placement identification device 100 begins, and the process specifically includes the following steps:
[0072] Step S1-1, the communication unit 19 receives the pick-up and placement video sent by the smart vending machine 200, and the frame image decomposition unit 11 decomposes the pick-up and placement video into multiple frame images in time sequence, and then enters step S1-2;
[0073] Step S1-2, the product analysis unit 12 analyzes each frame image separately through the product analysis model, thereby analyzing the contours of all products contained in the frame image, the position information of the contours, the categories of the products and the confidence scores of the analysis, and retains the contours with confidence scores higher than the confidence threshold and the corresponding position information and categories, and then enters step S1-3;
[0074] Step S1-3, the determination control unit 135 determines the first two frame images as two adjacent frame images to be determined, and then proceeds to step S1-4;
[0075] Step S1-4, the contour setting unit 131 sets each contour in the latter frame image as the first contour and each contour in the former frame image as the second contour for the two adjacent frame images to be determined, and then proceeds to step S1-5;
[0076] Step S1-5, the position movement range determination unit 132 calculates the movement distance between the first contour and the second contour according to the position information of the first contour and the second contour, and determines whether the movement distance is below the position movement threshold corresponding to the side length of the second contour, if it is determined to be yes, proceeding to step S1-6, if it is determined to be no, proceeding to step S1-8;
[0077] Step S1-6, the contour deformation range judgment unit 133 judges whether the side length of the first contour is within the contour deformation range corresponding to the side length of the second contour, if it is judged to be yes, then proceed to step S1-7, if it is judged to be no, then proceed to step S1-8;
[0078] Step S1-7, the correspondence determination unit 134 determines that the first contour and the second contour with the shortest moving distance have a correspondence relationship, that is, determines that the commodities corresponding to the first contour and the second contour are the same commodity for sale, and then proceeds to step S1-8;
[0079] Step S1-8, the control unit 135 determines whether all frame images have been processed. If it is determined to be no, the process proceeds to step S1-9; if it is determined to be yes, the process proceeds to step S1-10;
[0080] Step S1-9, the determination control unit 135 uses the next frame image as the new previous frame image, and uses the next frame image as the two adjacent frame images to be determined in chronological order, and then enters step S1-4;
[0081] Step S1-10, the moving track forming unit 14 connects the outline and position information of the same commodity for sale in each frame image in time sequence to form commodity track information of the commodity for sale, and then proceeds to step S1-11;
[0082] Step S1-11, the pick-up and put-down determination unit 17 determines whether the commodity for sale is picked up and put down by the user according to the inner and outer dividing line information stored in the inner and outer dividing line storage unit 16 and the commodity movement track formed in step S1-10, and then proceeds to step S1-12;
[0083] In step S1-12, the commodity list generating unit 18 generates a commodity list according to the determination result of step S1-11 and the categories corresponding to the commodities for sale, and then enters the end state.
[0084] Through the above process, the placement and identification of goods for sale can be completed and a corresponding list of goods can be generated. This list of goods can not only be used as a shopping list for consumers for the sales system to settle the amount, but also as a loading list for the loader to allow the loader to count how many goods for sale are placed in the smart vending machine.
[0085] Example 1 Function and Effect
[0086] According to the commodity picking and placing identification device and method provided in the first embodiment, after obtaining the picking and placing video of the user picking and placing the commodity for sale, the contours and positions of all commodities in each video frame of the video are identified, and the corresponding relationship between the contours in two adjacent frame images is determined according to the predetermined contour deformation range determination rule and the predetermined position movement range determination rule. Finally, according to the corresponding relationship, the commodity corresponding to the contour is used as the commodity for sale and the position information is linked to form the commodity movement trajectory. Therefore, in this way, it is possible to accurately determine which two contours in two adjacent frames belong to the same commodity. Even if the commodity contours are constantly changing due to changes in the angle and distance from the camera during the picking and placing process, it can be ensured that the commodity movement trajectory of the commodity for sale can be correctly constructed, and finally the accuracy and stability of the picking and placing identification of the commodity for sale are guaranteed.
[0087] In the first embodiment, when the moving distance between the first contour and the second contour of two adjacent frame images is determined by the predetermined position movement range determination rule, it is determined whether the moving distance is below the position movement threshold corresponding to the side length of the second contour. The position movement threshold is obtained by multiplying the height value of the second contour by the predetermined movement distance coefficient. In this way, it is possible to adapt to the characteristics of the product being larger when closer and smaller when farther away from the camera, and more accurately determine whether the moving distance of the product is within the expected range, thereby improving the accuracy.
[0088] In the first embodiment, since the deformation of the first contour and the second contour of two adjacent frame images is determined by the contour deformation range determination rule, even if the commodity for sale is deflected or moved away from the camera, the contours of the commodity for sale in the two frames before and after can be accurately matched, thereby better ensuring the picking and placing identification of the commodity for sale.
[0089] In the first embodiment, since the category of the commodity is also identified when parsing the contour and position information of each commodity in the frame image, and the contour determination unit only determines the contours belonging to the same category in pairs when determining the contours in two adjacent frame images, it can not only save the computing resources consumed by determining the contour correspondence relationship, but also improve the recognition accuracy of commodities of different categories.
[0090] <Example 2>
[0091] In the second embodiment, components having the same structure as those in the first embodiment are given the same reference numerals and corresponding descriptions are omitted.
[0092] Compared with the first embodiment, the second embodiment is to perform more effective recognition for some commodities whose lengths and widths are similar (such as beverages, instant noodles, and other commodities whose lengths and widths are similar). The difference lies in that the contour determination unit determines the corresponding relationship between contours in another way. Specifically:
[0093] Figure 8 It is a block diagram of a user portrait building device in Embodiment 2 of the present invention.
[0094] like Figure 8 As shown, the commodity picking and placing identification device 100' specifically includes a frame image decomposition unit 11, a commodity analysis unit 12, a contour determination unit 13', a movement trajectory formation unit 14, a movement trajectory storage unit 15, an inner and outer dividing line storage unit 16, a picking and placing determination unit 17, a commodity list generation unit 18, a communication unit 19 and a control unit 20 for controlling the above-mentioned units.
[0095] Fig. 9 It is a block diagram of the contour determination unit in the second embodiment of the present invention.
[0096] like Fig. 9 As shown, the contour determination unit 13' has a standard side length storage unit 136, a contour setting unit 131, a product distance calculation unit 137, a position movement threshold calculation unit 138, a position movement range determination unit 139, a contour deformation range determination unit 133, a correspondence determination unit 134 and a determination control unit 135.
[0097] The standard side length storage unit 231 stores the standard side length of the range box corresponding to each commodity. In this embodiment, the standard side length of the range box is the width value w1 of the range box corresponding to the actual size of the commodity.
[0098] After the contour setting unit 131 sets the first contour and the second contour, the product distance calculation unit 137 calculates the product distance l = (f / w)*w1 between the product and the camera based on the imaging principle, according to the side length of the second contour in the frame image (width value w), the standard side length of the range box of the corresponding product (width value w1) and the focal length f of the camera.
[0099] The position movement threshold calculation unit 138 calculates the position predetermined threshold d1 = l / d*f according to the commodity distance l, the focal length f and the predetermined actual movement threshold d.
[0100] In this embodiment, the predetermined actual movement threshold d is the actual distance that the commodity may move in k adjacent frames (k<=3).
[0101] The position movement range determination unit 139 calculates the movement distance between the first contour and the second contour based on the position information of the first contour and the second contour, and determines whether the movement distance is less than the position movement threshold calculated by the position movement threshold calculation unit 138 .
[0102] Next, the contour deformation range determination unit 133 and the correspondence determination unit 134 perform subsequent processing, thereby finally determining the correspondence between the first contour and the second contour.
[0103] Fig.10 4 is a flow chart of a commodity picking and placing identification action of a commodity picking and placing identification device in Embodiment 2 of the present invention.
[0104] like Fig.10 As shown, once the smart vending machine 200 captures the pick-up and placement video, the process of the commodity pick-up and placement identification action of the commodity pick-up and placement identification device 100' begins, and the process specifically includes the following steps:
[0105] Step S2-1, the communication unit 19 obtains the pick-up and placement video sent by the smart vending machine 200, and the frame image decomposition unit 11 decomposes the pick-up and placement video into multiple frame images in time sequence, and then enters step S2-2;
[0106] Step S2-2, the product analysis unit 12 analyzes each frame image separately through the product analysis model, thereby analyzing the contours of all products contained in the frame image, the position information of the contours, the categories of the products and the confidence scores of the analysis, and retains the contours with confidence scores higher than the confidence threshold and the corresponding position information and categories, and then enters step S2-3;
[0107] Step S2-3, the determination control unit 135 determines the first two frame images as two adjacent frame images to be determined, and then proceeds to step S2-4;
[0108] Step S2-4, the contour setting unit 131 sets each contour in the latter frame image as the first contour and each contour in the former frame image as the second contour for the two adjacent frame images to be determined, and then proceeds to step S2-5;
[0109] Step S2-5, the product distance calculation unit 137 calculates the product distance between the product and the camera according to the side length of the second outline in the frame image, the standard side length of the range box corresponding to the product, and the focal length of the camera, and then proceeds to step S2-6;
[0110] Step S2-6, the position movement threshold calculation unit 138 calculates the position predetermined threshold according to the commodity distance, the focal length and the predetermined actual movement threshold, and then proceeds to step S2-7;
[0111] Step S2-7, the position movement range determination unit 132 calculates the movement distance between the first contour and the second contour according to the position information of the first contour and the second contour, and determines whether the movement distance is below the position movement threshold calculated in step S2-6, if it is determined to be yes, proceeding to step S2-8, if it is determined to be no, proceeding to step S2-10;
[0112] Step S2-8, the contour deformation range judgment unit 133 determines whether the side length of the first contour is within the contour deformation range corresponding to the side length of the second contour, and if so, proceeds to step S2-9, and if not, proceeds to step S2-10;
[0113] Step S2-9, the correspondence determination unit 134 determines that the first contour and the second contour with the shortest moving distance have a correspondence relationship, that is, determines that the commodities corresponding to the first contour and the second contour are the same commodity for sale, and then proceeds to step S2-10;
[0114] Step S2-10, the control unit 135 determines whether all frame images have been processed. If it is determined to be no, the process proceeds to step S2-11; if it is determined to be yes, the process proceeds to step S2-12;
[0115] Step S2-11, the determination control unit 135 uses the next frame image as the new previous frame image, and uses the next frame image as the two adjacent frame images to be determined in chronological order, and then enters step S2-4;
[0116] Step S2-12, the moving track forming unit 14 connects the outline and position information of the same commodity for sale in each frame image in time sequence to form commodity track information of the commodity for sale, and then proceeds to step S2-13;
[0117] Step S2-13, the pick-up and put-down determination unit 17 determines whether the commodity for sale is picked up and put down by the user according to the inner and outer dividing line information stored in the inner and outer dividing line storage unit 16 and the commodity movement track formed in step S2-12, and then proceeds to step S2-14;
[0118] In step S2-14, the commodity list generating unit 18 generates a commodity list according to the determination result of step S2-13 and the categories corresponding to the commodities for sale, and then enters the end state.
[0119] Example 2 Function and Effect
[0120] According to the commodity picking and placing identification device and method provided in the second embodiment, on the basis of having the same technical effects as the first embodiment, the contour determination unit calculates the actual distance between the commodity and the camera according to the range box side length of the commodity in the frame image through the predetermined standard side length of the range box, and calculates the corresponding position movement threshold of the commodity in the frame image according to the actual distance and the predetermined actual movement threshold. Therefore, although due to the principle of near big and far small, the same kind of commodity is taken out from different layers of the smart vending machine at the same speed and the pixel distance moved in the frame image is quite different, the method of the second embodiment can also accurately adjust the position movement threshold according to the actual distance between the commodity and the camera, so that the commodity movement trajectory can be constructed more accurately.
[0121] The above embodiments are only used to illustrate specific implementation modes of the present invention, and the present invention is not limited to the description scope of the above embodiments.
[0122] For example, in the first embodiment above, the commodity picking and placing identification device is a processor. In other schemes of the present invention, the commodity picking and placing identification device may also be a server, which is connected to multiple smart vending cabinets and user terminals held by users, so as to respectively identify the picking and placing videos of each smart vending cabinet, and send the commodity list to the corresponding user terminal according to the user's identification information.
[0123] For another example, in the above embodiment, the commodity picking and placing identification device processes the complete picking and placing video. In other schemes of the present invention, the picking and placing video can also be sent to the commodity picking and placing identification device in the form of a video stream, so that the commodity picking and placing identification device can identify the picking and placing video in real time and determine the commodity for sale picked up and placed by the user.
[0124] For example, in the above embodiment, the commodity analysis model is obtained by training the SSD neural network model. As an alternative, the target recognition model can also be obtained by training other neural network models such as YOLO and Faster RCNN.
[0125] In addition, in the above embodiment, the commodity analysis unit analyzes the contour, position and category of the commodity through the commodity analysis model. As an alternative, other image recognition technologies such as image matching can also be used to complete the analysis of the commodity in the video frame.
Claims
1. A commodity picking and placing identification device, used to identify the picking and placing video taken when a user picks and places the commodity for sale in a smart vending cabinet, characterized in that: include: A frame image decomposition unit, decomposing the pick-up and put-down video into a plurality of frame images; A commodity analysis unit, which analyzes each frame image to obtain the outline and corresponding position information of each commodity contained in the frame image; The contour determination unit determines the correspondence between the contours in the frame images based on a predetermined contour deformation range determination rule and a predetermined position movement range determination rule, and based on the contours and position information of the commodities contained in two adjacent frame images, and determines the commodities corresponding to the contours having the corresponding relationship as the same commodity for sale; A movement track forming unit, which connects the position information of the same commodity for sale in each frame image in time sequence to form a commodity movement track of the commodity for sale; as well as a pick-up and place determination unit, which determines whether the commodity for sale is picked up and placed by the user at least according to the commodity movement trajectory; The outline of the commodity is a range frame that can be used to select a size that matches the size of the commodity in the frame image, and the position information is the coordinates of the center point of the range frame in the frame image. The contour determination unit comprises: a contour setting unit, for two adjacent frame images, setting each contour in one frame image as a first contour, and setting each contour in the other frame image as a second contour; a position movement range judgment unit, which calculates a movement distance between the first contour and the second contour according to the position information of the first contour and the second contour, and judges whether the movement distance is below a position movement threshold corresponding to the side length of the second contour; a contour deformation range judgment unit, for judging whether the side length of the first contour is within a contour deformation range corresponding to the side length of the second contour; The correspondence determination unit determines that the first contour and the second contour having the shortest movement distance have the correspondence relationship when the movement distance between the first contour and the second contour is within the position movement range and the side length of the first contour is within the contour deformation range.
2. The commodity picking and placing identification device according to claim 1, characterized in that: in, The side length is the width and height of the range box. The position movement threshold is the height value multiplied by a predetermined movement distance coefficient, and the predetermined movement distance coefficient ranges from 1.3 to 1.
7. The contour deformation range is between the side length multiplied by a predetermined minimum deformation coefficient and the side length multiplied by a predetermined maximum deformation coefficient, the predetermined minimum deformation coefficient is 0.6, and the predetermined maximum deformation coefficient is 1.
7.
3. The commodity picking and placing identification device according to claim 1, Features: Wherein, the contour determination unit further comprises: A standard side length storage unit storing the standard side lengths of the range boxes corresponding to the respective commodities; a commodity distance calculation unit, which calculates the commodity distance between the commodity and the camera according to the side length of the second outline in the frame image, the standard side length of the range frame corresponding to the commodity, and the focal length of the camera; The position movement threshold calculation unit calculates the position movement threshold according to the commodity distance, the focal length and a predetermined actual movement threshold.
4. The commodity picking and placing identification device according to claim 1, characterized in that: in, The commodity analysis unit analyzes the contours and corresponding position information of each commodity contained in the frame image, and also analyzes the categories of each commodity corresponding to the contours. When determining the correspondence between the contours in the frame images, the contour determination unit determines the contours corresponding to the same category in two adjacent frame images in pairs.
5. The commodity picking and placing identification device according to claim 4, characterized in that: Also includes: The commodity list generating unit generates a commodity list containing the categories of all the commodities for sale that are picked up and placed and the corresponding picking up and placing states according to the picking up and placing states and the categories of the commodities.
6. The commodity picking and placing identification device according to claim 1, characterized in that: Also includes: an inner and outer dividing line storage unit, storing inner and outer dividing line information for distinguishing the inside and outside of the smart vending cabinet in the frame image, Wherein, the pick-and-place determination unit comprises: a movement track acquisition unit, which acquires the movement track of the commodity to be sold to be determined; and The pick-and-place state determination unit determines the position information corresponding to the latest plurality of frame images in the commodity movement trajectory according to the inner and outer dividing line information, When the position information is outside the inner and outer dividing lines, it is determined that the commodity for sale is in the taken-out state. When the position information is within the inner and outer dividing lines, it is determined that the commodity for sale is in the put-in state.
7. The commodity picking and placing identification device according to claim 1, characterized in that: in, When forming the commodity movement trajectory, the movement trajectory forming unit further forms a contour change trajectory corresponding to the commodity movement trajectory according to the contour of the same commodity for sale.
8. A method for identifying commodity picking and placing according to the commodity picking and placing identification device according to any one of claims 1 to 7, which is used to identify the picking and placing video taken when a user picks and places commodities for sale in a smart vending cabinet, characterized in that: The following steps are involved: A frame image decomposition step, decomposing the pick-up and place video into a plurality of frame images; A commodity analysis step, analyzing the outline and corresponding position information of each commodity contained in each frame image respectively from the frame image; an outline determination step, based on a predetermined outline deformation range determination rule and a predetermined position information movement range determination rule, and according to the outlines and the position information of the commodities contained in two adjacent frame images, determining the correspondence between the outlines in the frame images, and treating the commodities corresponding to the outlines having the corresponding relationship as the same commodity for sale; a moving track forming step of connecting the position information of the same commodity for sale in each frame image in chronological order to form a commodity moving track of the commodity for sale; The step of determining whether the commodity for sale is picked up and placed by the user is performed at least according to the movement track of the commodity.
