Method for detecting items in display cabinet, display cabinet and storage medium
Through binocular cameras and video splitting technology, changes in the number of items in the display cabinet are identified, which solves the problem of a single camera being unable to recognize multiple items and improves the reliability of target detection in the display cabinet.
Patent Information
- Application Number
- CN202111546392.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-16
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-12-16
AI Technical Summary
A single camera installed in an existing display case cannot identify users taking multiple items from the same aisle, resulting in poor target detection reliability.
A binocular camera is used to acquire the binocular video from the opening to closing of the display cabinet door. By splitting the video into the first binocular video before the item is acquired and the second binocular video after the item is acquired, the two binocular videos are extracted. images to determine channel change information and then identify changes in item quantity.
It improves the target detection reliability of display cabinets, accurately identifies the number of items taken by users from the same channel, and avoids economic losses.
Smart Images

Figure CN114025075B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of image processing, and in particular to a method for detecting objects in a display cabinet, a display cabinet, and a storage medium. Background Art
[0002] In recent years, display cabinets have been widely used in convenience stores and large supermarkets, such as unmanned self-service display cabinets, refrigerated display cabinets for displaying refrigerated items, etc. In existing display cabinets, a single camera is usually installed or no camera is installed. When a single camera is installed, the single camera cannot recognize the situation where a user takes multiple items from the same channel in the display cabinet, resulting in poor reliability of the target detection method of the existing display cabinet. Summary of the invention
[0003] The disclosed embodiments at least provide a method for detecting objects in a display cabinet, a display cabinet, and a storage medium. The disclosed embodiments can accurately identify objects when a user takes multiple objects from the same channel in the display cabinet, thereby improving the reliability of object detection in the display cabinet.
[0004] In a first aspect, an embodiment of the present disclosure provides a method for detecting objects in a display cabinet, comprising: obtaining a binocular video shot by a binocular camera toward the inside of the display cabinet; wherein the binocular video is a video captured by the binocular camera from the time when a door of the display cabinet is opened to the time when the door is closed; splitting the binocular video into a first binocular video before the object is acquired and a second binocular video after the object is acquired; extracting a first binocular video image from the first binocular video, and extracting a second binocular video image from the second binocular video; wherein the first binocular video image and the second binocular video image each contain two video images; determining channel change information in the display cabinet based on the first binocular video image and the second binocular video image, the channel change information being used to indicate distance change information of objects in a target channel in the display cabinet relative to the binocular camera; and determining object change information in the display cabinet based on the channel change information.
[0005] In a second aspect, an embodiment of the present disclosure provides an object detection device in a display cabinet, comprising: an acquisition unit, configured to acquire a binocular video shot by a binocular camera toward the inside of the display cabinet; wherein the binocular video is a video captured by the binocular camera from the time when the cabinet door of the display cabinet is opened to the time when the cabinet door is closed; a video splitting unit, configured to split the binocular video into a first binocular video before the object is acquired and a second binocular video after the object is acquired; an image extraction unit, configured to extract a first binocular video image from the first binocular video and a second binocular video image from the second binocular video; wherein the first binocular video image and the second binocular video image each contain two video images; a first determination unit, configured to determine channel change information in the display cabinet based on the first binocular video image and the second binocular video image, wherein the channel change information is used to indicate distance change information of an object in a target channel in the display cabinet relative to an outer edge of the channel; and a second determination unit, configured to determine object change information in the display cabinet based on the channel change information.
[0006] In a third aspect, an embodiment of the present disclosure provides a display cabinet, comprising: a display cabinet body, a binocular camera and a processor; wherein the binocular camera is installed on the display cabinet body, and the lens of the binocular camera is arranged toward the interior of the display cabinet body, and the binocular camera is communicatively connected to the processor; the binocular camera is configured to shoot the interior of the display cabinet to obtain a binocular video from the time when the cabinet door of the display cabinet is opened to the time when the cabinet door is closed; the processor is configured to obtain the binocular video and split the binocular video into a first binocular video before the object is obtained and a second binocular video after the object is obtained; extract a first binocular video image from the first binocular video, and extract a second binocular video image from the second binocular video; wherein the first binocular video image and the second binocular video image each contain two video images; determine channel change information in the display cabinet based on the first binocular video image and the second binocular video image, the channel change information being used to indicate distance change information of the object in the target channel in the display cabinet relative to the outer edge of the channel; determine the object change information in the display cabinet based on the channel change information.
[0007] In a fourth aspect, an embodiment of the present disclosure further provides a display cabinet, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect, or any possible implementation of the first aspect are performed.
[0008] In a fifth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are executed.
[0009] In the embodiments of the present disclosure, a binocular video is acquired, and a first binocular video image before the object is acquired and a second binocular video image after the object is acquired are extracted from the binocular video in the manner described above, so as to determine distance change information of the objects in the target channel in the display cabinet relative to the outer edge of the channel according to the first binocular video image and the second binocular video image. By determining the object change information according to the distance change information, the target channel in which the number of objects changes in the display cabinet can be accurately identified, and the number of objects that changes in the target channel can be identified, so that in the case where a user takes multiple objects from the same channel in the display cabinet, accurate identification can still be performed, thereby improving the reliability of target detection of the display cabinet.
[0010] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0012] Figure 1 A flow chart of a method for detecting items in a display cabinet provided by an embodiment of the present disclosure is shown;
[0013] Figure 2 A schematic diagram showing the effect of a channel on a display shelf in a display cabinet provided by an embodiment of the present disclosure;
[0014] Figure 3 A flowchart showing a specific method for splitting a binocular video into a first binocular video before the object is acquired and a second binocular video after the object is acquired in the method for detecting the object in the display cabinet provided by the embodiment of the present disclosure;
[0015] Figure 4A flowchart showing a specific method for extracting a first binocular video image from the first binocular video in the method for detecting objects in a display cabinet provided by an embodiment of the present disclosure;
[0016] Figure 5 A flowchart showing a specific method for extracting a second binocular video image from the second binocular video in the method for detecting objects in a display cabinet provided by an embodiment of the present disclosure;
[0017] Figure 6 A flowchart showing a specific method for determining channel change information in a display cabinet based on a first binocular video image and a second binocular video image in a method for detecting objects in a display cabinet provided by an embodiment of the present disclosure;
[0018] Figure 7 A first optional principle diagram of calculating distance change information based on binocular vision provided by an embodiment of the present disclosure is shown;
[0019] Figure 8 A schematic diagram showing a second optional method of calculating distance change information based on binocular vision provided by an embodiment of the present disclosure is shown;
[0020] Fig. 9 A flow chart showing another method for detecting items in a display cabinet provided by an embodiment of the present disclosure is shown;
[0021] Fig.10 A schematic diagram of an object detection device in a display cabinet provided by an embodiment of the present disclosure is shown;
[0022] Fig.11 A schematic diagram of the structure of a display cabinet provided in an embodiment of the present disclosure is shown;
[0023] Fig.12 A schematic structural diagram of another display cabinet provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0025] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0026] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.
[0027] Research has found that when a single camera is installed, the single camera cannot recognize the situation where a user takes multiple items from the same channel in the display cabinet, resulting in poor reliability of the target detection method of the existing display cabinet.
[0028] When a user takes items from a display cabinet, if the user blocks a single camera of the display cabinet, the single camera can collect the image before and after the blockage, and compare the image before and after the blockage, so as to determine the number of items taken by the consumer according to the image comparison result. When the user takes the same type of items, the above method will not be able to detect the number of items taken by the user, resulting in poor reliability of the target detection method in the existing display cabinet.
[0029] Based on the above research, the present disclosure provides a method for detecting items in a display cabinet, a display cabinet, and a storage medium. In an embodiment of the present disclosure, first, a binocular video shot by a binocular camera toward the interior of the display cabinet from the time when the cabinet door of the display cabinet is opened to the time when it is closed is obtained; and the binocular video is split into a first binocular video before the item is obtained and a second binocular video after the item is obtained; then, a first binocular video image can be extracted from the first binocular video, and a second binocular video image can be extracted from the second binocular video, and then channel change information in the display cabinet is determined based on the first binocular video image and the second binocular video image, so as to determine item change information in the display cabinet according to the channel change information.
[0030] By acquiring a binocular video, and extracting a first binocular video image before the object is acquired, and a second binocular video image after the object is acquired from the binocular video in the manner described above, so as to determine distance change information of the object in the target channel in the display cabinet relative to the outer edge of the channel according to the first binocular video image and the second binocular video image, and in such a manner as to determine the object change information according to the distance change information, the target channel in which the number of objects changes in the display cabinet can be accurately identified, and the number of objects that changes in the target channel can be identified, so that in the case where a user takes multiple objects from the same channel in the display cabinet, accurate identification can still be performed, thereby improving the reliability of target detection of the display cabinet.
[0031] In the embodiments of the present disclosure, the display cabinet can be any cabinet whose doors can be opened and closed. For example, the display cabinet can be a display cabinet that supports unmanned self-service functions. The display cabinet can also be a refrigerated cabinet for placing refrigerated items in a supermarket. In addition, the display cabinet can also be a warming cabinet, a freezer for placing frozen items, and any other cabinet whose doors can be opened and closed. The present disclosure does not specifically limit the types of display cabinets.
[0032] To facilitate understanding of this embodiment, a method for detecting objects in a display cabinet disclosed in an embodiment of the present disclosure is first introduced in detail.
[0033] See also Figure 1 FIG. 1 is a flow chart of a method for detecting items in a display cabinet provided by an embodiment of the present disclosure, the method comprising steps S101 to S109, wherein:
[0034] S101: Acquire a binocular video shot by a binocular camera toward the interior of the display cabinet; wherein the binocular video is a video captured by the binocular camera during a period from when a door of the display cabinet is opened to when the door is closed.
[0035] In the disclosed embodiment, the binocular camera can be installed on the door handle of the cabinet door, and the lens of the binocular camera is set toward the interior of the display cabinet. When the cabinet door of the display cabinet is detected to be opened, the binocular camera starts shooting, and after the cabinet door of the display cabinet is detected to be closed, the binocular camera stops shooting to obtain a binocular video.
[0036] Here, the period from the cabinet door opening to the cabinet door closing can be understood as the cabinet door opening process and the cabinet door closing process. Among them, for a sales operation of the display cabinet, the cabinet door opening process is the process before obtaining the items in the display cabinet (that is, before the sale), and the cabinet door closing process is the process after obtaining the items in the display cabinet (that is, after the sale).
[0037] Here, the binocular video includes two videos, wherein one of the two videos is a video captured by a first camera in a binocular camera, and the other of the two videos is a video captured by a second camera in the binocular camera.
[0038] S103: Split the binocular video into a first binocular video before the object is acquired and a second binocular video after the object is acquired.
[0039] In the embodiment of the present disclosure, after the binocular video is acquired, the binocular video may be split into a first binocular video before the object is acquired and a second binocular video after the object is acquired.
[0040] S105: extracting a first binocular video image from the first binocular video, and extracting a second binocular video image from the second binocular video; wherein the first binocular video image and the second binocular video image each include two video images.
[0041] In an embodiment of the present disclosure, after acquiring the first binocular video, a first binocular video image can be extracted from the first binocular video, wherein the first binocular video image is a video image in the first binocular video that meets the object detection requirements, for example, it can be a video image containing the largest number of objects in the first binocular video.
[0042] Afterwards, the second binocular video image can be extracted from the second binocular video based on the first binocular video image. In specific implementation, a video image matching the first binocular video image can be extracted from the second binocular video as the second binocular video image.
[0043] Here, the first binocular video image matches the second binocular video image, which can be understood as the image similarity between the first binocular video image and the second binocular video image meets the requirement (for example, the image similarity is greater than the corresponding threshold).
[0044] S107: Determine channel change information in the display cabinet based on the first binocular video image and the second binocular video image, where the channel change information is used to indicate distance change information of objects in a target channel in the display cabinet relative to a binocular camera.
[0045] After the first binocular video image and the second binocular video image are determined, channel change information in the display cabinet can be determined based on the first binocular video image and the second binocular video image.
[0046] Here, the channel change information may include channel information of the target channel, for example, including at least one of the following: the channel position of the target channel, the channel number of the target channel, and the distance change information of the objects in the target channel relative to the binocular camera. Specifically, the target channel may be a channel in which the number of objects in the display cabinet changes.
[0047] like Figure 2 As shown, in the embodiment of the present disclosure, the display cabinet includes a plurality of display shelves, each of which is used to place items to be displayed. Figure 2 As shown, for the items displayed on each display shelf, the area extending from the outer edge of the display shelf to the inside of the display cabinet is the channel in the embodiment of the present disclosure.
[0048] S109: Determine the item change information in the display cabinet based on the channel change information.
[0049] In the embodiment of the present disclosure, the item change information is used to indicate the quantity and types of items that have changed in the target channel.
[0050] In the embodiments of the present disclosure, a binocular video is acquired, and a first binocular video image before the object is acquired and a second binocular video image after the object is acquired are extracted from the binocular video in the manner described above, so as to determine distance change information of the object in the target channel in the display cabinet relative to the binocular camera based on the first binocular video image and the second binocular video image. By determining the object change information based on the distance change information, the target channel in which the number of objects changes in the display cabinet can be accurately identified, and the number of objects that change in the target channel can be identified, so that in the case where a user takes multiple objects from the same channel in the display cabinet, accurate identification can still be performed, thereby improving the reliability of target detection of the display cabinet.
[0051] The following will introduce the above-mentioned method for detecting items in the display cabinet in detail in combination with specific application scenarios.
[0052] Scene 1: Unmanned self-service display cabinet.
[0053] The unmanned self-service display cabinet can be placed in any environment, such as a hospital, office building, convenience store, tourist attraction, school, etc. In specific applications, the user can open the door of the unmanned self-service display cabinet in a predetermined manner (for example, scanning a code) and take the items in the unmanned self-service display cabinet, so that the unmanned self-service display cabinet automatically settles the items taken by the user.
[0054] However, the following problem exists for the unmanned self-service display cabinet: when a user takes items from the display cabinet, if the user blocks a single camera of the display cabinet and the user takes items of the same type, the above method will not be able to detect the number of items taken by the user. For the unmanned self-service display cabinet, the existing target detection method in the display cabinet will not be able to accurately detect the number of items taken by the user, thereby causing certain economic losses to the user of the display cabinet.
[0055] In order to solve the above problems, the embodiment of the present disclosure provides a method for detecting items in a display cabinet. Before executing the method, first, a binocular camera can be installed in the unmanned self-service display cabinet. If a binocular camera has been installed in the unmanned self-service display cabinet, the above binocular video can be collected based on the existing binocular camera in the unmanned self-service display cabinet.
[0056] After the binocular video is acquired, the first binocular video image before the acquisition of the object and the second binocular video image after the acquisition of the object can be extracted from the binocular video, so as to determine the distance change information of the objects in the target channel in the unmanned self-service display cabinet relative to the binocular camera based on the first binocular video image and the second binocular video image. Through this processing method, the target channel where the number of objects changes in the unmanned self-service display cabinet can be accurately identified, and the number of objects that change in the target channel can be identified, so that the user can still accurately identify the situation where multiple objects are taken from the same channel in the unmanned self-service display cabinet, thereby improving the reliability of the target detection of the display cabinet. The user can still accurately identify the situation where multiple different objects are taken from different channels in the unmanned self-service display cabinet.
[0057] Scene 2: Ordinary display cabinet.
[0058] For ordinary display cabinets, they can be placed in supermarkets, convenience stores and other environments where manual settlement is required. For example, users can take corresponding items from ordinary display cabinets placed in convenience stores, and then the items taken by the users are automatically settled at the settlement counter.
[0059] However, there is a problem with this common showcase: when a user takes an item from the showcase, if the user blocks a single camera of the showcase and the user takes items of the same type, the showcase can only detect that the user has taken one item. If the user takes multiple items of the same type and hides some of the items during settlement, the user of the showcase will suffer certain economic losses.
[0060] In order to solve the above problem, the embodiment of the present disclosure provides a method for detecting items in a display cabinet. Before executing the method, first, a binocular camera can be installed in an ordinary display cabinet. If a binocular camera has been installed in the ordinary display cabinet, the above binocular video can be collected based on the existing binocular camera in the ordinary display cabinet.
[0061] After the binocular video is acquired, a first binocular video image before the object is acquired and a second binocular video image after the object is acquired can be extracted from the binocular video, so as to determine the distance change information of the object in the target channel in the unmanned self-service display cabinet relative to the binocular camera based on the first binocular video image and the second binocular video image.
[0062] Through this processing method, the target channel where the number of items in the ordinary display cabinet changes can be accurately identified, and the number of items that have changed in the target channel can be identified. Therefore, in the case where a user takes multiple items from the same channel in the ordinary display cabinet, accurate identification can still be performed, thereby improving the reliability of target detection of the display cabinet.
[0063] For ordinary display cabinets, after identifying the target channel and the number of items that have changed in the target channel, the type of items taken by the user can also be identified. At this time, the processor in the ordinary display cabinet can send the channel change information and the type of items to the settlement system. At this time, when the user settles the items at the settlement counter, the settlement system can verify the number of the user's items to be settled based on the acquired channel change information and item type.
[0064] The above steps will be described below in conjunction with specific embodiments.
[0065] In the disclosed embodiment, a first sensor may be pre-installed at the door of the display cabinet. When the first sensor detects that the door is open, the binocular camera may be triggered to start shooting, and when the first sensor detects that the door is closed, the binocular camera may be controlled to end video shooting, thereby obtaining a binocular video.
[0066] Here, the first sensor may be a gyroscope installed in the display cabinet, or may be other types of door opening sensors, which are not specifically limited in the present disclosure and are subject to implementation.
[0067] After the binocular video is captured, the binocular video may be split into a first binocular video before the object is acquired and a second binocular video after the object is acquired.
[0068] In an optional embodiment, if Figure 3As shown, the above step S103: splitting the binocular video into a first binocular video before the object is acquired and a second binocular video after the object is acquired, specifically includes the following steps:
[0069] Step S301: determining a video split point in the binocular video;
[0070] Step S302: split each video in the binocular video based on the video splitting point to obtain a first binocular video and a second binocular video.
[0071] In an optional implementation, one video may be selected from the two videos of the binocular video, and a video split point may be determined in the video, and then the video split point of the video may be determined as the video split point of the other video.
[0072] In another optional implementation, the video splitting point of each video in the binocular video may also be determined separately.
[0073] Therefore, in the embodiments of the present disclosure, one or more video splitting points may be determined for each video in the binocular video, and the video splitting points determined for each video in the binocular video may be the same or different, and the present disclosure does not make any specific limitation on this.
[0074] After the video splitting points are determined, each video in the binocular video can be split based on the video splitting points, thereby splitting to obtain a first binocular video and a second binocular video.
[0075] In specific implementation, if there is only one video splitting point, the binocular video can be split into a first binocular video and a second binocular video based on the video splitting point. At this time, the first binocular video is a video before the consumer obtains the item, and the second binocular video is a video after the consumer obtains the item.
[0076] If there are two video splitting points, the binocular video can be split into three videos according to the two video splitting points, wherein the first video is the first binocular video, i.e., the video before the consumer obtains the item, the second video is the video of the consumer obtaining the item, and the third video is the second binocular video, i.e., the video after the consumer obtains the item.
[0077] In the above implementation, by determining the video splitting point and then splitting the binocular video according to the video splitting point, the binocular video can be accurately split into a first binocular video before the object is taken and a second binocular video after the object is taken, thereby improving the splitting accuracy of the binocular video and further improving the accuracy of the channel change information.
[0078] In the embodiments of the present disclosure, the video splitting points may be determined in the binocular video in the following ways.
[0079] Method 1:
[0080] During the period from the cabinet door of the display cabinet being opened to the cabinet door being closed, angle change information of the opening angle of the cabinet door of the display cabinet is obtained; then, the video splitting point is determined based on the angle change information.
[0081] In the embodiment of the present disclosure, when the first sensor detects that the cabinet door is opened, it can trigger the second sensor (angle sensor) pre-installed in the display cabinet to detect the opening angle of the cabinet door, and then determine the angle change information based on the detected opening angle.
[0082] Here, the angle change information can be understood as an increase in the opening angle, a constant opening angle, and a decrease in the opening angle.
[0083] If the door opening angle increases, it indicates that the door of the display cabinet is in the open period, that is, the consumer is opening the door of the display cabinet. At this time, it can be considered that the period is before the item is taken. If the door opening angle remains unchanged, it indicates that the door of the display cabinet has been opened and is in a relatively static state. At this time, it can be considered that the consumer is taking the item from the display cabinet, that is, the item is being taken. If the door opening angle decreases, it indicates that the door of the display cabinet is in the closed period, that is, the consumer is closing the door of the display cabinet. At this time, it can be considered that the period is after the item is taken.
[0084] After the angle change information is determined, the video splitting points can be determined according to the angle change information.
[0085] Case 1: There are multiple video splitting points.
[0086] In specific implementation, the time period when the opening angle increases can be determined according to the angle change information to obtain the first time period; and the time period when the opening angle decreases can be determined to obtain the second time period; and then the first time period and the second time period can be determined as the video splitting point. At this time, the video in the first time period of the binocular video can be determined as the first binocular video, and the video in the second time period of the binocular video can be determined as the second binocular video.
[0087] Case 2: The video split point is one.
[0088] In specific implementation, the time period when the opening angle remains unchanged can be determined according to the angle change information to obtain the third time period, and the third time period can be determined as the video splitting point. At this time, the video before the third time period in the binocular video can be split into the first binocular video, and the video after the third time period in the binocular video can be split into the second binocular video.
[0089] In the above implementation manner, by determining the angle change information and then determining the video splitting point according to the angle change information, the video splitting point can be quickly determined to improve the efficiency of video splitting.
[0090] Method 2:
[0091] The difference between any adjacent video frames in the binocular video is calculated to obtain a plurality of differences; a target difference that meets a preset difference requirement is determined among the plurality of differences; and a video splitting point of each video in the binocular video is determined based on adjacent video frames corresponding to the target difference.
[0092] In the embodiment of the present disclosure, the pixel difference between any adjacent video frames in the binocular video can be calculated to obtain multiple differences, and then the video splitting points can be determined according to the multiple differences.
[0093] Case 1: The video split point is one.
[0094] In this case, the maximum difference among the multiple differences can be determined as the target difference, and then the video split point is determined based on the adjacent video frames corresponding to the target difference. For example, the video before the previous video frame of the adjacent video frame is determined as the first binocular video, and the video after the next video frame of the adjacent video frame is determined as the second binocular video.
[0095] Case 2: The video is split into two points.
[0096] In this case, the two largest difference values among the multiple difference values may be determined as target difference values, and then the video splitting point is determined based on adjacent video frames corresponding to the two target difference values.
[0097] In a specific implementation, a first target difference and a second target difference may be determined from the two target differences, wherein the video frame corresponding to the first target difference is located before the video frame corresponding to the second target difference. At this time, the video located before the video frame corresponding to the first target difference may be determined as the first binocular video, and the video located after the video frame corresponding to the second target difference may be determined as the second binocular video.
[0098] In the embodiment of the present disclosure, when calculating the difference between any adjacent video frames in a binocular video, the difference between any adjacent video frames in any one video of the binocular video can be calculated; and then the video splitting point of each video in the binocular video is determined according to the calculated difference.
[0099] In addition, the difference between any adjacent video frames in each video in the binocular video can also be calculated, and then the video splitting point of the corresponding video in the binocular video can be determined according to the calculated difference.
[0100] Method 3:
[0101] It is also possible to detect a video frame containing the user's hand in the binocular video, thereby obtaining at least one video frame containing the user's hand. In this case, the video splitting point can be determined based on the at least one video frame containing the user's hand.
[0102] If at least one video frame contains the user's hand, the video frame can be used as a video splitting point, and the video before the video frame is determined as the first binocular video, and the video in the video frame is determined as the second binocular video.
[0103] If there are multiple video frames containing at least one user's hand, the first video frame containing the user's hand and the last video frame containing the user's hand can be determined among the multiple video frames containing the user's hand. In this case, the first video frame containing the user's hand and the last video frame containing the user's hand can be used as video splitting points. The video before the first video frame containing the user's hand is determined as the first binocular video, and the video in the last video frame containing the user's hand is determined as the second binocular video.
[0104] In the above implementation, by calculating the pixel difference between adjacent video frames in the binocular video and determining the video splitting point according to the pixel difference, the video splitting point can be determined more accurately to improve the video splitting accuracy.
[0105] In the embodiment of the present disclosure, after obtaining the first binocular video and the second binocular video, the first binocular video image may be extracted from the first binocular video, and the second binocular video image may be extracted from the second binocular video.
[0106] like Figure 4 As shown, for the step in the above step S105: extracting the first binocular video image from the first binocular video includes:
[0107] Step S401, determining a first video in the first binocular video;
[0108] Step S402, determining the target detection result of each video frame in the first video;
[0109] Step S403: determining a first target video frame in the first video that meets a preset object quantity requirement based on the target detection result, and determining the first binocular video image based on the first target video frame.
[0110] In the disclosed embodiment, firstly, a first video may be determined in the first binocular video, wherein the first video may be any video in the first binocular video. Then, a target detection model is used to perform target detection on each video image in the first video, thereby obtaining a target detection result, wherein the target detection result includes object position information (e.g., an object bounding box) of each object in the video image.
[0111] After the target detection result is determined, the video frame containing the largest number of objects in the first video can be determined based on the target detection result, and determined as the first target video frame that meets the preset object quantity requirement.
[0112] After the first target video frame is determined, the first binocular video image may be determined based on the first target video frame.
[0113] In another optional implementation, the first binocular video image may be extracted from the first binocular video in the following manner, which specifically includes the following steps:
[0114] A video frame that meets the definition requirement is determined in video frames adjacent to the video splitting point in the first video of the first binocular video as a first target video frame, and then a first binocular video image is determined according to the first target video frame.
[0115] Since the video split point is close to the video of the object being taken, the video frames close to the video split point in the first binocular video contain more objects. When the user takes the object, the door of the display cabinet is in a relatively static state, and at this time, the binocular video captured by the binocular camera is clearer.
[0116] In the embodiment of the present disclosure, the target detection model may be a deep learning model. Before performing target detection on each video image in the first video through the target detection model, the target detection model needs to be trained. The specific training process is described as follows:
[0117] (1) Collect data offline. Select multiple video frames from the videos shot at each display cabinet offline as training images, and annotate each training image.
[0118] (2) Image enhancement processing. Then, the training image is enhanced by using a data enhancement method. The data enhancement method may include at least one of the following: randomly changing the HSV color model (Hue, Saturation, Value) in the image, random cropping, random rotation, mirroring, etc.
[0119] (3) Image compression: After image enhancement, the training image is proportionally compressed to the image input size required by the deep network.
[0120] If the training image after proportional compression does not meet the image input size required by the deep network, it will be filled with blanks. For example, an image with a size of 1080*1920 is proportionally compressed to 360*640. If the image input size required by the deep network is 640*640, then 140*640 blanks are added to the left and right sides of the proportionally compressed image.
[0121] (4) Divide the labeled training images into training set, validation set and test set; then train the to-be-trained detection model based on the training set, validation set and test set to obtain the target detection result. When training the to-be-trained detection model, label smoothing and focal loss function can be added to the training to improve the generalization ability of target detection.
[0122] The deep learning model used here is (YOLOV5), and other series or improved versions of YOLO, RCNN series, retina series can also be used. In addition, other deep learning models can also be selected. This disclosure does not make specific requirements for this, and it is subject to what can be implemented.
[0123] In the above implementation manner, a more comprehensive video image can be obtained by determining the first binocular video image. When the channel change information is determined according to the first binocular video image, the accuracy of the channel change information can be improved.
[0124] In an optional implementation, the above step S403: determining the first binocular video image based on the first target video frame specifically includes the following steps:
[0125] Step S4031, determining a first acquisition time of the first target video frame;
[0126] Step S4032, determining a second target video frame corresponding to the first acquisition time in the second video of the first binocular video;
[0127] Step S4033: determining the first binocular video image based on the first target video frame and the second target video frame.
[0128] In the embodiment of the present disclosure, first, the acquisition time of the first target video frame can be determined to obtain the first acquisition time; then, the second video can be determined in the first binocular video, and the video frame corresponding to the first acquisition time can be determined in the second video as the second target video frame. Here, the first binocular video contains two videos, namely the first video and the second video.
[0129] Here, the video frames corresponding to the first acquisition time can be understood as the following situations:
[0130] Case 1: A video frame captured at the first capture time in the second video is determined as the second target video frame.
[0131] Case 2: In the second video, a preset time period is determined with the first acquisition time as the center; and among the video frames in the second video within the preset time period, the video frames that meet the object quantity requirement and / or image clarity requirement are determined as second target video frames.
[0132] In the above implementation, by determining the first acquisition time of the first target video frame and determining the first binocular video image in the first binocular video, the first binocular video image can be obtained quickly and accurately.
[0133] In addition, the second target video frame may also be determined by the following methods, specifically including:
[0134] Method 1:
[0135] Determine a second video in the first binocular video; determine target detection results of each video frame in the second video; and determine a second target video frame in the second video that meets a preset object quantity requirement based on the target detection results.
[0136] Method 2:
[0137] A video frame that meets the definition requirement is determined in the second video of the first binocular video and is adjacent to the video split point and is used as a second target video frame.
[0138] In an optional embodiment, if Figure 5 As shown, the above step S105: extracting the second binocular video image from the second binocular video specifically includes the following steps:
[0139] Step S501, determining a third video corresponding to the first video in the second binocular video;
[0140] Step S502, calculating the similarity between each video frame in the third video and the first target video frame;
[0141] Step S503: determine a third target video frame in the third video that meets the similarity requirement, and determine the second binocular video image based on the third target video frame.
[0142] In the disclosed embodiment, the second binocular video includes two videos, namely, the third video and the fourth video. At this time, the third video corresponding to the first video can be determined in the second binocular video. Among them, the first video and the third video belong to the same video in the binocular video. After that, the similarity between each video frame in the third video and the first target video frame can be calculated, so that the video frame corresponding to the maximum similarity is determined as the third target video frame in the third video that meets the similarity requirement.
[0143] After the third target video frame is determined, the fourth target video frame can be determined based on the third target video frame, and then the second binocular video image can be determined according to the third target video frame and the fourth target video frame. In the embodiment of the present disclosure, the fourth target video frame can be determined in the following manner.
[0144] Method 1:
[0145] Determine a second acquisition time of the third target video frame; determine a fourth target video frame corresponding to the second acquisition time in a fourth video of the second binocular video; and determine the second binocular video image based on the third target video frame and the fourth target video frame.
[0146] In the embodiment of the present disclosure, after the third target video frame is determined, the acquisition time of the third target video frame can be determined based on the third video to obtain the second acquisition time. After that, the fourth target video frame corresponding to the second acquisition time can be determined in another video (i.e., the fourth video) of the second binocular video; and then, the third target video frame and the fourth target video frame are determined as the second binocular video image.
[0147] Here, the video frames corresponding to the first acquisition time can be understood as the following situations:
[0148] Case 1: determining a video frame in the fourth video captured at the second capture time as a fourth target video frame.
[0149] Case 2: In the fourth video, a preset time period is determined with the second acquisition time as the center; and among the video frames in the fourth video within the preset time period, the video frames that meet the object quantity requirement and / or image clarity requirement are determined as fourth target video frames.
[0150] Method 2:
[0151] Determine a fourth video corresponding to the second video in the second binocular video; calculate the similarity between each video frame in the fourth video and the second target video frame; and determine a fourth target video frame in the fourth video that meets the similarity requirement.
[0152] Method 3:
[0153] Determine a fourth video in the second binocular video; determine target detection results of each video frame in the fourth video; and determine a fourth target video frame in the fourth video that meets a preset object quantity requirement based on the target detection results.
[0154] In the above implementation, by determining the third target video frame that meets the similarity requirement in the third video, the video frame that is closest to the first target video frame during the cabinet door closing period can be obtained, and the video frame that is closest to the second target video frame during the cabinet door closing period can also be obtained. At this time, the matching degree of each object in the first binocular video image and the second binocular video image can be improved, and when determining the channel change information based on the first binocular video image and the second binocular video image, the distance change information of each object in the display cabinet relative to the binocular camera can be determined more accurately.
[0155] In the embodiment of the present disclosure, after determining the first binocular video image and the second binocular video image, the channel change information in the display cabinet can be determined based on the first binocular video image and the second binocular video image, which specifically includes the following steps:
[0156] Step S1071, determining a first video image in the first binocular video image, and determining a second video image corresponding to the first video image in the second binocular video image;
[0157] Step S1072, performing item matching on the item in the first video image and the item in the second video image to obtain an item matching result;
[0158] Step S1073, determining the target channel where the item is changed in each channel of the display cabinet according to the item matching result.
[0159] In the embodiment of the present disclosure, the target channel where the item changes can be determined in each channel of the display cabinet based on the first binocular video image and the second binocular video image. The process of determining the target channel is the process described in the above steps S1071 to S1073.
[0160] In a specific implementation, any one of the two video images (i.e., the first target video frame and the second target video frame) included in the first binocular video image can be determined as the first video image, and the second video image corresponding to the first video image can be determined in the second binocular video image (i.e., the third target video frame and the fourth target video frame).
[0161] Afterwards, the object in the first video image and the object in the second video image can be matched to obtain an object matching result. The specific matching process is described as follows:
[0162] (1) Extracting a sub-image of each object in the first video image to obtain a first sub-image.
[0163] Here, the object position information of each object in the first video image may be determined based on the target detection result of the first video image, and then a sub-image of each object may be extracted from the first video image based on the object position information, thereby obtaining a first sub-image.
[0164] (2) Determine a second sub-image corresponding to the first sub-image in the second video image.
[0165] Here, the mapping position of the object position information of each object in the first video image in the second video image may be determined, and then the image in the second video image located within the mapping position may be cropped to obtain a second sub-image corresponding to the first sub-image.
[0166] (3) Calculating the image similarity between the first sub-image and the second sub-image, and determining the object matching result based on the image similarity.
[0167] After obtaining the first sub-image and the second sub-image, the image similarity between the first sub-image and the second sub-image can be calculated. Then, the object matching result between the object corresponding to the first sub-image and the object corresponding to the second sub-image can be determined according to the image similarity. Here, the object matching result can be a match or a mismatch.
[0168] When the object matching result is a mismatch, it can be determined that the channel where the object corresponding to the first sub-image in the display cabinet is located is the target channel, indicating that the number of objects in the target channel has changed.
[0169] In the above embodiment, by matching the items in the first video image with the items in the second video image as described above, and then determining the target channel where the item changes in each channel of the display cabinet based on the item matching results, the items taken by the consumer in the display cabinet can be located more accurately to obtain more accurate item change information.
[0170] In an optional embodiment, if Figure 6 As shown, the above step S107: determining the channel change information in the display cabinet based on the first binocular video image and the second binocular video image includes:
[0171] Step S601: determining a first distance between the object in the target channel and the binocular camera during the cabinet door opening process based on the first binocular video image;
[0172] Step S602: determining a second distance between the object in the target channel and the binocular camera during the closing process of the cabinet door based on the second binocular video image;
[0173] Step S603: Calculate the distance difference between the first distance and the second distance, and determine the distance change information based on the distance difference.
[0174] The following will be combined Figure 7 and Figure 8 The process of determining distance change information is introduced.
[0175] like Figure 7 The diagram shown is a first optional schematic diagram of calculating distance change information based on binocular vision, such as Figure 8 Shown is a second optional schematic diagram of calculating distance change information based on binocular vision.
[0176] like Figure 7 As shown, P is the item in the display cabinet, O and O' are the optical center positions of the binocular cameras, A and A' are the first binocular video image (or the second binocular video image), and Z represents the first distance (or the second distance) mentioned above.
[0177] If the consumer takes the corresponding item in the target channel of the display cabinet, the distance between the items in the target channel and the binocular camera will change. Since the size of the items is known, the number of items taken by the consumer can be determined based on the distance change information between the items in the target channel and the binocular camera before and after the items are taken.
[0178] At this time, the first distance between the object in the target channel and the binocular camera before the object is taken can be calculated based on the first binocular video image, and the second distance between the object in the target channel and the binocular camera after the object is taken can be calculated based on the second binocular video image. Then, the distance change information is determined based on the distance difference between the first distance and the second distance.
[0179] In an optional embodiment, determining a first distance between the object in the target channel and the binocular camera during the cabinet door opening process based on the first binocular video image includes:
[0180] Determine the pixel coordinates of the object in the two video images of the first binocular video image respectively to obtain the first pixel coordinate and the second pixel coordinate; calculate the coordinate difference between the first pixel coordinate and the second pixel coordinate; obtain the optical center distance between the binocular cameras, and obtain the focal length of the binocular cameras; determine the first distance based on the coordinate difference, the optical center distance and the focal length.
[0181] Assume that Figure 7 A and A' in it are the first binocular video images, and Z is the first distance. Figure 7 and Figure 8 As shown in , the imaging points of object P on the two camera head photoreceptors of the binocular camera are p and p' respectively. Point p is the center position of object P in frame A, and point p' is the center position of object P in frame A'. Figure 8 As shown, x is the horizontal coordinate of point p (ie, the first pixel coordinate), and x' is the horizontal coordinate of point p' (ie, the second pixel coordinate).
[0182] At this time, the coordinate difference between the first pixel coordinate and the second pixel coordinate can be calculated by the formula (x-x'), and then the first distance can be calculated by the formula Z=fb / (x-x').
[0183] Here, the derivation process of the formula Z=fb / (x-x') is described as follows:
[0184] The distance between p and p' is d, then d = b-(x-x'); according to the principle of similar triangles, we can obtain: d / b = (zf) / z, then z = fb / (bd) = fb / (x-x').
[0185] In an optional embodiment, determining a second distance between the object in the target channel and the binocular camera during the closing process of the cabinet door based on the second binocular video image includes:
[0186] Determine the pixel coordinates of the object in the two video images of the second binocular video image respectively to obtain a third pixel coordinate and a fourth pixel coordinate; calculate the coordinate difference between the third pixel coordinate and the fourth pixel coordinate; obtain the optical center distance between the binocular cameras, and obtain the focal length of the binocular cameras; determine the second distance based on the coordinate difference, the optical center distance and the focal length.
[0187] Assume that Figure 7 A and A' in it are the second binocular video images, and Z is the second distance. Figure 7 and Figure 8 As shown in , the imaging points of object P on the two camera head photoreceptors of the binocular camera are P and P' respectively. Point P is the center position of object P in frame A, and point P' is the center position of object P in frame A'. Figure 8 As shown, x is the horizontal coordinate of point P (ie, the third pixel coordinate), and x' is the horizontal coordinate of point P' (ie, the fourth pixel coordinate).
[0188] At this time, the coordinate difference between the third pixel coordinate and the fourth pixel coordinate can be calculated by the formula (x-x'), and then the second distance can be calculated by the formula Z=fb / (x-x').
[0189] In the above-mentioned implementation manner, a first distance is calculated based on the first binocular video image, and a second distance is calculated based on the second binocular video image, so as to determine the distance change information of the objects in the target channel in the display cabinet relative to the binocular camera according to the distance difference between the first distance and the second distance, thereby determining the object change information according to the distance change information, so as to accurately identify the target channel in which the number of objects changes in the display cabinet, and identify the changed number of objects in the target channel. In the case where a user takes multiple objects from the same channel of the display cabinet, accurate identification can still be performed, thereby improving the reliability of target detection of the display cabinet.
[0190] In another optional implementation, when the first binocular video image and the second binocular video image are images carrying depth information, determining the channel change information in the display cabinet based on the first binocular video image and the second binocular video image specifically includes the following steps:
[0191] Determine the depth information of each item in the display cabinet relative to the binocular camera based on the first target video frame to obtain the first depth information, and determine the depth information of each item in the display cabinet relative to the binocular camera based on the third target video frame to obtain the second depth information; then calculate the depth information difference based on the first depth information and the second depth information to obtain the first difference. After that, determine the depth information of each item in the display cabinet relative to the binocular camera based on the second target video frame to obtain the third depth information, and determine the depth information of each item in the display cabinet relative to the binocular camera based on the fourth target video frame to obtain the fourth depth information; then calculate the depth information difference based on the third depth information and the fourth depth information to obtain the second difference. Finally, the channel change information can be determined based on the first difference and the second difference.
[0192] In specific implementation, the gap between the first difference and the second difference can be compared. If the comparison result shows that the gap between the first difference and the second difference meets the preset gap requirement, the channel change information in the display cabinet can be determined according to the first difference or the second difference.
[0193] See also Fig. 9 FIG. 1 is a flow chart of another method for detecting items in a display cabinet provided by an embodiment of the present disclosure. Fig. 9 As shown, the method mainly comprises the following steps:
[0194] S901: Obtain a binocular video shot by a binocular camera toward the interior of the display cabinet from the time when the cabinet door is opened to the time when the cabinet door is closed, and determine any one video in the binocular video as a target video;
[0195] S902: Split the target video into videos before the object is obtained, and split the target video into videos after the object is obtained;
[0196] S903: extracting a video frame A from the video before the object is obtained, that is, the first target video frame;
[0197] S904: Calculate the similarity between the video frame A and each video frame in the video after the object is acquired;
[0198] S905: Determine a video frame B in the video after the object is acquired based on the similarity, that is, the third target video frame;
[0199] S906: Perform target detection on the video frame A to obtain a target detection result;
[0200] S907: Matching the objects in the video frame A and the video frame B based on the target detection result to obtain an object matching result;
[0201] S908: determining a target channel where the item is changed in each channel of the display cabinet according to the item matching result;
[0202] S909: Determine a video frame A' in another video of the binocular video based on the acquisition time of the video frame A;
[0203] S910: Determine a video frame B′ in another video of the binocular video based on the acquisition time of the video frame B;
[0204] S911: determining a first distance based on video frame A and video frame A′, determining a second distance based on video frame B and video frame B′, and determining a distance difference between the first distance and the second distance;
[0205] S912: Determine item change information of the items in the target channel based on the distance difference.
[0206] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0207] Based on the same inventive concept, an apparatus for detecting objects in a display cabinet corresponding to the method for detecting objects in a display cabinet is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the apparatus in the embodiment of the present disclosure is similar to the method for detecting objects in a display cabinet mentioned above in the embodiment of the present disclosure, the implementation of the apparatus can refer to the implementation of the method, and the repeated parts will not be repeated.
[0208] Reference Fig.10, which is a schematic diagram of a device for detecting items in a display cabinet provided by an embodiment of the present disclosure, the device comprises: an acquisition unit 10, a video splitting unit 20, an image extraction unit 30, a first determination unit 40 and a second determination unit 50;
[0209] The acquisition unit 10 is used to acquire a binocular video shot by the binocular camera toward the interior of the display cabinet; wherein the binocular video is a video captured by the binocular camera from the time when the cabinet door of the display cabinet is opened to the time when the cabinet door is closed;
[0210] A video splitting unit 20, configured to split the binocular video into a first binocular video before the object is acquired and a second binocular video after the object is acquired;
[0211] An image extraction unit 30 is used to extract a first binocular video image from the first binocular video, and to extract a second binocular video image from the second binocular video; wherein the first binocular video image and the second binocular video image each include two video images;
[0212] A first determining unit 40 is used to determine channel change information in the display cabinet based on the first binocular video image and the second binocular video image, wherein the channel change information is used to indicate distance change information of an object in a target channel in the display cabinet relative to an outer edge of the channel;
[0213] The second determining unit 50 is configured to determine the item change information in the display cabinet based on the channel change information.
[0214] In the embodiments of the present disclosure, a binocular video is acquired, and a first binocular video image before the object is acquired and a second binocular video image after the object is acquired are extracted from the binocular video in the manner described above, so as to determine distance change information of the object in the target channel in the display cabinet relative to the binocular camera based on the first binocular video image and the second binocular video image. By determining the object change information based on the distance change information, the target channel in which the number of objects changes in the display cabinet can be accurately identified, and the number of objects that change in the target channel can be identified, so that in the case where a user takes multiple objects from the same channel in the display cabinet, accurate identification can still be performed, thereby improving the reliability of target detection of the display cabinet.
[0215] In a possible implementation, the image extraction unit is further used to: determine a first video in the first binocular video; determine target detection results of each video frame in the first video; determine a first target video frame in the first video that meets a preset object quantity requirement based on the target detection results, and determine the first binocular video image based on the first target video frame.
[0216] In a possible implementation, the image extraction unit is further used to: determine a first acquisition time of the first target video frame; determine a second target video frame corresponding to the first acquisition time in a second video of the first binocular video; and determine the first binocular video image based on the first target video frame and the second target video frame.
[0217] In a possible implementation, the image extraction unit is further used to: determine a third video corresponding to the first video in the second binocular video; calculate the similarity between each video frame in the third video and the first target video frame; determine a third target video frame in the third video that meets the similarity requirement, and determine the second binocular video image based on the third target video frame.
[0218] In a possible implementation, the image extraction unit is further used to: determine a second acquisition time of the third target video frame; determine a fourth target video frame corresponding to the second acquisition time in a fourth video of the second binocular video; and determine the second binocular video image based on the third target video frame and the fourth target video frame.
[0219] In a possible implementation, the first determination unit is further used to: determine a first video image in the first binocular video image, and determine a second video image corresponding to the first video image in the second binocular video image; perform object matching on an object in the first video image and an object in the second video image to obtain an object matching result; and determine a target channel where the object changes in each channel of the display cabinet according to the object matching result.
[0220] In a possible implementation, the first determination unit is further used to: extract a sub-image of each object in the first video image to obtain a first sub-image; determine a second sub-image corresponding to the first sub-image in the second video image; calculate the image similarity between the first sub-image and the second sub-image, and determine the object matching result based on the image similarity.
[0221] In a possible implementation, the first determination unit is further used to: determine a first distance between the object in the target channel and the binocular camera during the door opening process based on the first binocular video image; determine a second distance between the object in the target channel and the binocular camera during the door closing process based on the second binocular video image; calculate the distance difference between the first distance and the second distance, and determine the distance change information based on the distance difference.
[0222] In a possible implementation, the first determination unit is further used to: respectively determine the pixel coordinates of the object in the two video images of the first binocular video image to obtain a first pixel coordinate and a second pixel coordinate; calculate the coordinate difference between the first pixel coordinate and the second pixel coordinate; obtain the optical center distance between the binocular cameras, and obtain the focal length of the binocular cameras; and determine the first distance based on the coordinate difference, the optical center distance and the focal length.
[0223] In a possible implementation manner, the video splitting unit is further used to: determine a video splitting point in the binocular video; and split each video in the binocular video based on the video splitting point to obtain a first binocular video and a second binocular video.
[0224] In a possible implementation, the video splitting unit is further used to: obtain angle change information of the opening angle of the cabinet door of the display cabinet during the period from the cabinet door being opened to the cabinet door being closed; and determine the video splitting point based on the angle change information.
[0225] In a possible implementation, the video splitting unit is further used to: calculate the difference between any adjacent video frames in the binocular video to obtain multiple differences; determine a target difference that meets a preset difference requirement among the multiple differences; and determine a video splitting point for each video in the binocular video based on adjacent video frames corresponding to the target difference.
[0226] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0227] Reference Fig.11 , which is a schematic diagram of the structure of a display cabinet provided by an embodiment of the present disclosure, wherein the display cabinet comprises: a display cabinet body 111 , a binocular camera 112 and a processor 113 .
[0228] The binocular camera is installed on the cabinet body of the display cabinet, and the lens of the binocular camera is arranged toward the interior of the cabinet body of the display cabinet. The binocular camera is communicatively connected with the processor.
[0229] The binocular camera is configured to capture the interior of the display cabinet from the time when the cabinet door is opened to the time when the cabinet door is closed to obtain a binocular video.
[0230] The processor is configured to acquire the binocular video and split the binocular video into a first binocular video before the object is acquired and a second binocular video after the object is acquired; extract a first binocular video image from the first binocular video and extract a second binocular video image from the second binocular video; wherein the first binocular video image and the second binocular video image each contain two video images; determine channel change information in a display cabinet based on the first binocular video image and the second binocular video image, the channel change information being used to indicate distance change information of an object in a target channel in the display cabinet relative to an outer edge of the channel; and determine object change information in the display cabinet based on the channel change information.
[0231] Corresponds to Figure 1 The method for detecting items in a display cabinet in the embodiment of the present disclosure further provides a display cabinet 1200, such as Fig.12 FIG. 1 is a schematic diagram of a display cabinet 1200 provided in an embodiment of the present disclosure, including:
[0232] Processor 121, memory 122, and bus 123; memory 122 is used to store execution instructions, including internal memory 1221 and external memory 1222; the internal memory 1221 is also called internal memory, which is used to temporarily store the operation data in the processor 121 and the data exchanged with the external memory 1222 such as a hard disk. The processor 121 exchanges data with the external memory 1222 through the internal memory 1221. When the display cabinet 1200 is turned on and operated, the processor 121 communicates with the memory 122 through the bus 123, so that the processor 121 executes the following instructions:
[0233] Acquire a binocular video shot by a binocular camera toward the interior of the display cabinet; wherein the binocular video is a video captured by the binocular camera from the time when the cabinet door of the display cabinet is opened to the time when the cabinet door is closed;
[0234] Splitting the binocular video into a first binocular video before the object is acquired and a second binocular video after the object is acquired;
[0235] Extracting a first binocular video image from the first binocular video, and extracting a second binocular video image from the second binocular video; wherein the first binocular video image and the second binocular video image each include two video images;
[0236] Determining channel change information in the display case based on the first binocular video image and the second binocular video image, wherein the channel change information is used to indicate distance change information of an object in a target channel in the display case relative to an outer edge of the channel;
[0237] Based on the channel change information, the item change information in the display cabinet is determined.
[0238] The present disclosure also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the steps of the method for detecting items in a display cabinet described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0239] The present disclosure also provides a computer program product that carries a program code. The program code includes instructions that can be used to execute the steps of the method for detecting objects in a display cabinet described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0240] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0241] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0242] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0243] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0244] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0245] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A method for detecting items in a display cabinet, characterized in that: include: Acquire a binocular video shot by a binocular camera toward the interior of the display cabinet; wherein the binocular video is a video captured by the binocular camera from the time when the cabinet door of the display cabinet is opened to the time when the cabinet door is closed; Splitting the binocular video into a first binocular video before the object is acquired and a second binocular video after the object is acquired; A first binocular video image is extracted from the first binocular video, and a second binocular video image is extracted from the second binocular video; wherein, the first binocular video image and the second binocular video image each include two video images, and the acquisition time of the two video images included in the first binocular video image corresponds to that of the two video images included in the second binocular video image; the first binocular video image refers to a video image in which the number of objects included in the first binocular video meets a preset object number requirement; the second binocular video image refers to a video image in which the image similarity between the first binocular video image and the second binocular video image meets a preset similarity requirement; the image similarity meeting the preset similarity requirement means that the image similarity is greater than a threshold value; Determining channel change information in the display cabinet based on the first binocular video image and the second binocular video image, wherein the channel change information is used to indicate distance change information of objects in a target channel in the display cabinet relative to a binocular camera; the target channel refers to a channel in which the number of objects in the display cabinet changes; Based on the channel change information, the item change information in the display cabinet is determined.
2. The method according to claim 1, characterized in that The step of extracting a first binocular video image from the first binocular video includes: Determining a first video in the first binocular video; Determine the target detection result of each video frame in the first video; A first target video frame that meets a preset object quantity requirement in the first video is determined based on the target detection result, and the first binocular video image is determined based on the first target video frame.
3. The method according to claim 2, characterized in that The determining the first binocular video image based on the first target video frame includes: Determining a first acquisition time of the first target video frame; Determine a second target video frame corresponding to the first acquisition time in a second video of the first binocular video; The first binocular video image is determined based on the first target video frame and the second target video frame.
4. The method according to claim 2 or 3, characterized in that: The extracting the second binocular video image from the second binocular video includes: Determining a third video corresponding to the first video in the second binocular video; Calculating the similarity between each video frame in the third video and the first target video frame; A third target video frame that meets the similarity requirement in the third video is determined, and the second binocular video image is determined based on the third target video frame.
5. The method according to claim 4, characterized in that The determining the second binocular video image based on the third target video frame includes: Determining a second acquisition time of the third target video frame; Determine a fourth target video frame corresponding to the second acquisition time in a fourth video of the second binocular video; The second binocular video image is determined based on the third target video frame and the fourth target video frame.
6. The method according to claim 1, characterized in that The determining of channel change information in the display cabinet based on the first binocular video image and the second binocular video image includes: Determine a first video image in the first binocular video image, and determine a second video image corresponding to the first video image in the second binocular video image; Matching the object in the first video image with the object in the second video image to obtain an object matching result; A target channel where the object has changed is determined in each channel of the display cabinet according to the object matching result.
7. The method according to claim 6, characterized in that The performing object matching on the object in the first video image and the object in the second video image to obtain an object matching result includes: Extracting a sub-image of each object in the first video image to obtain a first sub-image; determining a second sub-image corresponding to the first sub-image in the second video image; An image similarity between the first sub-image and the second sub-image is calculated, and the object matching result is determined based on the image similarity.
8. The method according to claim 1, characterized in that The determining of channel change information in the display cabinet based on the first binocular video image and the second binocular video image includes: Determine a first distance between the object in the target channel and the binocular camera during the cabinet door opening process based on the first binocular video image; Determine a second distance between the object in the target channel and the binocular camera during the closing process of the cabinet door based on the second binocular video image; A distance difference between the first distance and the second distance is calculated, and the distance change information is determined based on the distance difference.
9. The method according to claim 8, characterized in that The determining, based on the first binocular video image, a first distance between the object in the target channel and the binocular camera during the cabinet door opening process includes: Determine pixel coordinates of the object in the two video images of the first binocular video image respectively to obtain first pixel coordinates and second pixel coordinates; Calculating a coordinate difference between the first pixel coordinate and the second pixel coordinate; Obtaining the optical center distance between the binocular cameras and obtaining the focal length of the binocular cameras; The first distance is determined based on the coordinate difference, the optical center distance and the focal length.
10. The method according to claim 1, characterized in that The step of splitting the binocular video into a first binocular video before the object is acquired and a second binocular video after the object is acquired includes: Determining a video split point in the binocular video; Each video in the binocular video is split based on the video splitting point to obtain a first binocular video and a second binocular video.
11. The method according to claim 10, characterized in that The step of determining a video split point in the binocular video includes: Acquiring angle change information of the opening angle of the door of the display cabinet during the period from the door of the display cabinet being opened to the door of the display cabinet being closed; The video splitting point is determined based on the angle change information.
12. The method according to claim 10, characterized in that The step of determining a video split point in the binocular video includes: Calculating the difference between any adjacent video frames in the binocular video to obtain multiple difference values; Determining a target difference value that meets a preset difference value requirement among the multiple difference values; A video splitting point of each video in the binocular video is determined based on adjacent video frames corresponding to the target difference.
13. A display cabinet, characterized in that: include: A display cabinet body, a binocular camera and a processor; wherein the binocular camera is mounted on the display cabinet body, and the lens of the binocular camera is arranged toward the inside of the display cabinet body, and the binocular camera is communicatively connected with the processor; The binocular camera is configured to capture the interior of the display cabinet to obtain a binocular video from the time when the cabinet door is opened to the time when the cabinet door is closed; The processor is configured to acquire the binocular video and split the binocular video into a first binocular video before the object is acquired and a second binocular video after the object is acquired; extract a first binocular video image from the first binocular video, and extract a second binocular video image from the second binocular video; wherein the first binocular video image and the second binocular video image each include two video images, and the acquisition time of the two video images included in the first binocular video image corresponds to the acquisition time of the two video images included in the second binocular video image; the first binocular video image refers to a video image whose number of objects included in the first binocular video meets a preset number of objects requirement; the second binocular video image refers to a video image whose image similarity with the first binocular video image meets a preset similarity requirement; the image similarity meeting the preset similarity requirement means that the image similarity is greater than a threshold; determine channel change information in a display cabinet based on the first binocular video image and the second binocular video image, the channel change information being used to indicate distance change information of objects in a target channel in the display cabinet relative to an outer edge of the channel; the target channel refers to a channel in which the number of objects in the display cabinet changes; and determine object change information in the display cabinet based on the channel change information.
14. A display cabinet, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, the processor and the memory communicate via a bus, and when the machine-readable instructions are executed by the processor, the steps of the method for detecting objects in a display cabinet as described in any one of claims 1 to 12 are performed.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for detecting objects in a display cabinet according to any one of claims 1 to 12 are executed.
Citation Information
Patent Citations
Mirror image vision identification self-service vending machine system
CN108230553A
Recognition method and device
CN110009800A
