Commodity identification method and device in commodity cabinet, computer equipment and storage medium

By acquiring multiple images during the opening of the product display case, performing edge and line detection, and calculating the Magic Threshold to select the best image, the problem of product display case image capture affecting the accuracy of product recognition is solved, and high-quality image recognition is achieved.

CN115346201BActive Publication Date: 2026-05-15SHENZHEN HONGDIAN TECH CORP
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN HONGDIAN TECH CORP
Filing Date
2022-08-10
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing technologies do not consider the impact of door opening and closing on image quality during the product cabinet image capture process, resulting in low product recognition accuracy and the inability to capture effective images when the door opening speed is too fast.

Method used

Multiple images of the display cabinet are acquired during the opening process. The straight line contours are determined through edge detection and line detection. The Magic Threshold is calculated, and the best image is selected for uploading and recognition.

Benefits of technology

It improves image capture quality and product recognition accuracy, has a wide range of applications, is not affected by the position or color of the shelf, and does not require additional markers to determine the capture angle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115346201B_ABST
    Figure CN115346201B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a commodity identification method and device in a commodity cabinet, computer equipment and a storage medium. The method comprises: acquiring multiple cabinet images of the commodity cabinet in a door opening process, the commodity cabinet being located at a target side in the cabinet images; performing edge detection and straight line detection on the cabinet images to obtain straight line contours in each cabinet image; determining a first target distance between a target point on the straight line contour in each cabinet image closest to an opposite side edge and the opposite side edge; calculating a Magic threshold value of each cabinet image according to the first target distance and a second target distance between the edge of the target side and the opposite side edge; determining a best image in each cabinet image according to the Magic threshold value, and uploading the best image to the cloud for commodity identification. The quality of the captured image is improved, thereby improving the accuracy of commodity identification according to the captured image, and the application range is also wider.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to a method, apparatus, computer equipment and storage medium for recognizing goods in a merchandise cabinet. Background Technology

[0002] Merchandise display cases are refrigerated or frozen freezers used to store ice cream, beverages, dairy products, frozen foods, etc. They are generally categorized as commercial refrigerated cases, commercial frozen cases, and kitchen refrigerators, with capacities ranging from 20L to 1600L. Because they simultaneously provide refrigeration / freezing and display value, merchandise display cases are favored by manufacturers and merchants and are widely used in various public service venues. With the intelligent and digital transformation of enterprises, there is an increasing application of IoT-based image monitoring. This typically involves capturing images of the merchandise display cases in use and then transmitting these images to a server for product identification.

[0003] However, current solutions for capturing images of merchandise cabinets only focus on capturing images without considering the impact of the door opening and closing process on the captured images. This results in low accuracy of SKU recognition in the images sent to the server. Furthermore, if the door opens too quickly, the corresponding images during the opening process may not be captured, and only the pause after the door opens may be captured, which also fails to produce a good image. Summary of the Invention

[0004] This invention provides a product identification method, device, computer equipment, and storage medium in a product display case to improve the quality of captured images and solve the problem of low product identification accuracy.

[0005] In a first aspect, embodiments of the present invention provide a method for identifying goods in a merchandise cabinet, the method comprising:

[0006] Acquire multiple images of the cabinet during the opening process, wherein the cabinet is located on the target side in the cabinet images;

[0007] Edge detection and line detection are performed on the cabinet images to obtain the line contours in each cabinet image;

[0008] Determine the first target distance between the target point closest to the opposite edge of the target side on the straight contour of each cabinet image and the opposite edge;

[0009] The Magic threshold for each cabinet image is calculated based on the first target distance and the second target distance between the edge of the target side and the edge of the opposite side;

[0010] Based on the Magic threshold, the best image is determined from each of the cabinet images, and the best image is uploaded to the cloud for product recognition.

[0011] Optionally, determining the best image among the cabinet images based on the Magic threshold includes:

[0012] The threshold amplitude curve changing over time is obtained based on the Magic threshold.

[0013] Perform a short-time Fourier transform on the threshold amplitude curve to obtain the frequency domain spectrum;

[0014] The frequency domain spectrum is filtered using a preset bandpass filter, and the optimal image is determined based on the filtering result.

[0015] Optionally, calculating the Magic threshold for each cabinet image based on the first target distance and the second target distance between the edge on the target side and the opposite edge includes:

[0016] Magic = Log(A*(Y) min / Height)+B)

[0017] Where Magic represents the Magic threshold, Y min The distance to the first target is represented by A, the distance to the second target is represented by Height, A represents the amplitude coefficient, and B represents the displacement coefficient.

[0018] Optionally, the step of performing edge detection and line detection on the cabinet images to obtain the line contours in each cabinet image includes:

[0019] Edge detection is performed on the cabinet images based on the Sobel operator to obtain the edge contours in each cabinet image;

[0020] The Hough transform method is used to detect straight lines in the edge contour to obtain the straight line contour.

[0021] Optionally, before performing line detection on the edge contour using the Hough transform method to obtain the line contour, the method further includes:

[0022] The edge contour is eroded to cause it to shrink inward.

[0023] Optionally, before performing edge detection and line detection on the cabinet images to obtain the line contours in each cabinet image, the method further includes:

[0024] The cabinet image is converted to grayscale.

[0025] Optionally, acquiring multiple images of the cabinet during the opening process includes:

[0026] The camera continuously captures 20 images of the cabinet during the opening process.

[0027] Secondly, embodiments of the present invention also provide a product identification device for a merchandise cabinet, the device comprising:

[0028] The image acquisition module is used to acquire multiple images of the cabinet during the opening process, wherein the cabinet is located on the target side in the cabinet images;

[0029] The contour detection module is used to perform edge detection and line detection on the cabinet images to obtain the straight line contours in each cabinet image;

[0030] The distance determination module is used to determine the first target distance between the target point closest to the opposite edge of the target side on the straight contour of each cabinet image and the opposite edge;

[0031] The threshold calculation module is used to calculate the Magic threshold of each cabinet image based on the first target distance and the second target distance between the edge of the target side and the edge of the opposite side;

[0032] The image selection module is used to determine the best image among the cabinet images according to the Magic threshold, and upload the best image to the cloud for product recognition.

[0033] Thirdly, embodiments of the present invention also provide a computer device, the computer device comprising:

[0034] One or more processors;

[0035] Memory, used to store one or more programs;

[0036] When the one or more programs are executed by the one or more processors, the one or more processors implement the product identification method in the merchandise cabinet provided in any embodiment of the present invention.

[0037] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the product identification method in a merchandise cabinet provided in any embodiment of the present invention.

[0038] This invention provides a method for identifying goods in a display cabinet. First, multiple images of the display cabinet are acquired during the opening process, with the cabinet positioned on the target side of the images. Then, edge detection and line detection are performed on the cabinet images to obtain the straight line contours in each image. Next, a first target distance is determined between the nearest target point on the straight line contour to the opposite edge of the target side and the opposite edge. Based on the first target distance and a second target distance between the target side edge and the opposite edge, a Magic Threshold is calculated for each cabinet image. Finally, the best image is determined from the cabinet images based on each Magic Threshold and uploaded to the cloud for goods identification. This method for identifying goods in a display cabinet, by acquiring multiple consecutive images of the cabinet during the opening process and selecting the best image from the acquired images based on the straight line contour data, improves the quality of the captured images, thereby increasing the accuracy of goods identification based on the captured images. It also has a wide applicability, is not sensitive to the position and color of the shelves inside the display cabinet, and does not require additional markers to determine the required grasping angle. Attached Figure Description

[0039] Figure 1 This is a flowchart of a product identification method in a merchandise cabinet provided in Embodiment 1 of the present invention;

[0040] Figure 2 This is a schematic diagram of the structure of the product identification device in the merchandise cabinet provided in Embodiment 2 of the present invention;

[0041] Figure 3 This is a schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. Detailed Implementation

[0042] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.

[0043] Before discussing the exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of these steps can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the steps can be rearranged. The process can be terminated when its operation is complete, but may also have additional steps not included in the figures. The process can correspond to a method, function, procedure, subroutine, subroutine, etc.

[0044] Example 1

[0045] Figure 1 This is a flowchart of a product identification method in a merchandise cabinet according to Embodiment 1 of the present invention. This embodiment is applicable to situations where various merchandise cabinets capture open images for product identification. This method can be executed by the product identification device in the merchandise cabinet provided in this embodiment of the invention. This device can be implemented in hardware and / or software, and is generally integrated into a computer device. Figure 1 As shown, the specific steps include the following:

[0046] S11. Acquire multiple images of the cabinet during the opening process, wherein the cabinet is located on the target side in the cabinet images.

[0047] Specifically, an image of the product cabinet can be captured by a camera installed on the openable side of the cabinet door (the side the user typically uses to open it). As the door opens, the camera rotates, changing the area of ​​the cabinet in the captured image, which can then be utilized. Furthermore, the camera can be electrically connected to the cabinet, triggering it to capture images when the door is detected opening. Multiple consecutive shots can be taken to obtain multiple images of the cabinet, capturing images from various angles from when the door closes to when it stops opening. In the captured images, the cabinet can be located on one side, the target side. For example, by fixing the bottom of the camera to the cabinet door, the upper area of ​​the captured image represents the background environment, and the lower area represents the cabinet; therefore, the lower part of the cabinet image is the target side. Optionally, acquiring multiple cabinet images during the opening process of the goods cabinet includes: continuously capturing 20 cabinet images during the opening process using a camera. That is, after detecting the opening, the camera can be controlled to continuously capture 20 images to obtain multiple cabinet images from different angles during the opening process.

[0048] S12. Perform edge detection and line detection on the cabinet images to obtain the line contours in each cabinet image.

[0049] Specifically, after obtaining the required multiple cabinet images, edge detection can be performed on the cabinet images to obtain their edge contours. Then, line detection can be performed on these edge contours to obtain their line contours. These line contours can specifically represent the area where the shelves inside the cabinet are located. The position of this line contour in the cabinet image can then characterize the opening angle of the cabinet door. As exemplified above, the shelves in the cabinet image can extend vertically, meaning the obtained line contours can also extend vertically upwards from the target side. Using this method of obtaining line contours for subsequent image selection is not sensitive to the actual position and color of the shelves inside the cabinet, making it more widely applicable.

[0050] Optionally, the step of performing edge detection and line detection on the cabinet images to obtain the line contours in each cabinet image includes: performing edge detection on the cabinet images based on the Sobel operator to obtain the edge contours in each cabinet image; and performing line detection on the edge contours using the Hough transform method to obtain the line contours. Specifically, the Sobel operator can be used for edge detection. The Sobel operator is a discrete differential operator used to calculate the approximate gradient of the image grayscale. The larger the gradient, the more likely it is to be an edge. The Sobel operator combines Gaussian smoothing and differential calculation, and is also known as a first-order differential operator or derivative operator. By differentiating in both the horizontal and vertical directions, the gradient images of the cabinet image in the X and Y directions can be obtained, thereby determining the edge contours in the cabinet image based on the gradient. Then, the Hough transform method can be used to find the straight line profile in the obtained edge profile. Specifically, for any edge point on the edge profile, all possible straight lines passing through that point can be found. Each of these straight lines corresponds to a point in the parameter space. The infinite number of straight lines corresponding to points in the parameter space will form a curve in the parameter space. Repeat the above process. Each edge point corresponds to a curve in the parameter space. Then, the intersection of all these curves in the parameter space must be the common straight line of all edge points. Thus, the straight line profile in the edge profile can be determined.

[0051] Optionally, before performing line detection on the edge contour using the Hough transform method to obtain the line contour, the method further includes: eroding the edge contour to shrink it inward. Specifically, erosion is a process of eliminating boundary points and shrinking the boundary inward, which can be used to eliminate small and meaningless object contours in an image. Specifically, a 3x3 structuring element can be used to scan each pixel on the cabinet image to obtain the edge contour. A bitwise AND operation is performed between the structuring element and the binary image it covers; if both results are 1, the pixel in the resulting image is 1; otherwise, it is 0. By first eroding the edge contour, unwanted edge contours in the cabinet image can be removed, and the desired edge contours can be refined, thus improving the accuracy of subsequent processing results.

[0052] Optionally, before performing edge detection and line detection on the cabinet images to obtain the line contours in each cabinet image, the method further includes: converting the cabinet images to grayscale to facilitate subsequent edge detection and other processing. Image grayscale conversion is the process of converting a color image into a grayscale image. A color image typically includes three components: R, G, and B, which respectively display various colors such as red, green, and blue. Grayscale conversion is the process of making the R, G, and B components of a color image equal. In a grayscale image, each pixel has only one sample color, and its grayscale value is a multi-level color depth between black and white. Pixels with larger grayscale values ​​are brighter, and vice versa. The maximum pixel value is 255, representing white, and the minimum is 0, representing black.

[0053] S13. Determine the first target distance between the target point closest to the opposite edge of the target side on the straight contour of each cabinet image and the opposite edge.

[0054] Specifically, after obtaining the straight line contours in each cabinet image, the first step is to find the target point on the straight line contour of each cabinet image that is closest to the opposite edge of the target side. This point serves as a fixed reference point for subsequent calculations. The meaning of this reference point remains largely unchanged as the cabinet door rotates; for example, it could be the point on the shelf closest to the top edge of the cabinet image. Then, the required first target distance can be determined based on the coordinates of the target point. For instance, using the top left corner of the cabinet image as the origin, the horizontal direction to the right as the X-axis, and the vertical direction downwards as the Y-axis, the Y-coordinate of the target point can be directly determined as the first target distance.

[0055] S14. Calculate the Magic threshold of each cabinet image based on the first target distance and the second target distance between the edge of the target side and the edge of the opposite side.

[0056] In this example, as described above, the second target distance can be the height of the cabinet image. Specifically, after determining the first and second target distances in each cabinet image, a Magic Threshold for each cabinet image can be calculated based on these distances. This threshold can be used to indicate the variation of the linear contour (i.e., the shelf) area within the cabinet image, thereby indicating the opening angle of the cabinet door. The Magic Threshold can specifically be equal to Y... min / Height, where Y min The first target distance is represented by 'Height', and the second target distance is represented by 'Height'. Based on this ratio and the corresponding empirical value, the opening angle of the cabinet door can be determined, and then the cabinet door image with a suitable angle can be selected as the best image.

[0057] Optionally, calculating the Magic threshold for each cabinet image based on the first target distance and the second target distance between the edge on the target side and the opposite edge includes:

[0058] Magic = Log(A*(Y) min / Height)+B)

[0059] Where Magic represents the Magic threshold, Y min Let Y represent the distance to the first target, Height represent the distance to the second target, A represent the amplitude coefficient, and B represent the displacement coefficient. Specifically, the Magic threshold can be scaled using Log, where Y = ... min When / Height changes significantly, the Magic threshold changes relatively little; when Y min When the height changes little, the Magic threshold changes much more, making it easier to reach the optimal value when the door is first opened. However, as the door opening widens, the Magic threshold changes less significantly, thus allowing for greater tolerance.

[0060] S15. Determine the best image among the cabinet images based on the Magic threshold, and upload the best image to the cloud for product recognition.

[0061] Specifically, after determining the Magic Threshold for each cabinet image, the target Magic Threshold for the best image can be determined based on the magnitude of each Magic Threshold. This target Magic Threshold can be selected from among the various Magic Thresholds based on an empirically set preset threshold range. The cabinet image corresponding to the target Magic Threshold is then used as the best image to obtain a cabinet image with an opening angle that meets certain conditions. After determining the best image, it can be uploaded to the cloud, specifically to an edge server, for SKU product recognition. Each door opening and closing triggers a product capture, and the best image is selected from the captured cabinet images for upload and recognition. The final selected image is determined based on the image content and does not vary significantly with the door opening speed.

[0062] Optionally, determining the optimal image among the cabinet images based on the Magic threshold includes: obtaining a threshold amplitude curve that changes over time based on the Magic threshold; performing a short-time Fourier transform (STFT) on the threshold amplitude curve to obtain a frequency domain spectrum; filtering the frequency domain spectrum using a preset bandpass filter; and determining the optimal image based on the filtering result. Specifically, since the Magic threshold changes continuously during the continuous door opening time, it can be depicted as a threshold amplitude curve that changes over time. By performing a short-time Fourier transform (STFT) on this threshold amplitude curve, the Magic threshold can be transformed from the time domain to the frequency domain, allowing for the selection of the target Magic threshold through filtering. This further improves the accuracy of the target Magic threshold selection and ultimately enhances the accuracy of product recognition. Specifically, the frequency domain spectrum obtained by the transformation can be filtered using a preset bandpass filter. The threshold of the preset bandpass filter can also be an empirical value obtained through multiple experiments. The filtered value is the frequency domain value of the target Magic threshold, which can then be used to determine the corresponding optimal image.

[0063] The technical solution provided by this invention first acquires multiple images of the display cabinet during the opening process, with the display cabinet located on the target side of the cabinet images. Then, edge detection and line detection are performed on the cabinet images to obtain the straight line contours in each image. Next, a first target distance is determined between the closest target point on the straight line contour to the opposite edge of the target side and the opposite edge. Based on the first target distance and a second target distance between the target side edge and the opposite edge, a Magic Threshold for each cabinet image is calculated. Finally, the best image is determined from each cabinet image based on the Magic Threshold and uploaded to the cloud for product recognition. By acquiring multiple consecutive cabinet images during the opening process and selecting the best image from the acquired cabinet images based on the straight line contour data for uploading and recognition, the quality of the captured images is improved, thereby increasing the accuracy of product recognition based on the captured images. Furthermore, it has a wide applicability, is not sensitive to the position and color of the shelves inside the display cabinet, and does not require additional markers to determine the required grasping angle.

[0064] Example 2

[0065] Figure 2 This is a schematic diagram of the structure of a product identification device in a merchandise cabinet provided in Embodiment 2 of the present invention. This device can be implemented in hardware and / or software, and is generally integrated into a computer device to execute the product identification method in a merchandise cabinet provided in any embodiment of the present invention. Figure 2 As shown, the device includes:

[0066] Image acquisition module 21 is used to acquire multiple images of the cabinet during the opening process of the goods cabinet, wherein the goods cabinet is located on the target side in the cabinet images;

[0067] The contour detection module 22 is used to perform edge detection and line detection on the cabinet images to obtain the straight line contours in each cabinet image;

[0068] The distance determination module 23 is used to determine the first target distance between the target point closest to the opposite edge of the target side on the straight contour of each cabinet image and the opposite edge;

[0069] Threshold calculation module 24 is used to calculate the Magic threshold of each cabinet image based on the first target distance and the second target distance between the edge of the target side and the opposite edge;

[0070] The image selection module 25 is used to determine the best image among the cabinet images according to the Magic threshold, and upload the best image to the cloud for product recognition.

[0071] The technical solution provided by this invention first acquires multiple images of the display cabinet during the opening process, with the display cabinet located on the target side of the cabinet images. Then, edge detection and line detection are performed on the cabinet images to obtain the straight line contours in each image. Next, a first target distance is determined between the closest target point on the straight line contour to the opposite edge of the target side and the opposite edge. Based on the first target distance and a second target distance between the target side edge and the opposite edge, a Magic Threshold for each cabinet image is calculated. Finally, the best image is determined from each cabinet image based on the Magic Threshold and uploaded to the cloud for product recognition. By acquiring multiple consecutive cabinet images during the opening process and selecting the best image from the acquired cabinet images based on the straight line contour data for uploading and recognition, the quality of the captured images is improved, thereby increasing the accuracy of product recognition based on the captured images. Furthermore, it has a wide applicability, is not sensitive to the position and color of the shelves inside the display cabinet, and does not require additional markers to determine the required grasping angle.

[0072] Based on the above technical solution, optionally, the image selection module 25 includes:

[0073] A curve plotting unit is used to obtain a threshold amplitude curve that changes over time based on the Magic threshold.

[0074] The frequency domain spectrum transformation unit is used to perform a short-time Fourier transform on the threshold amplitude curve to obtain a frequency domain spectrum.

[0075] The frequency domain spectrum filtering unit is used to filter the frequency domain spectrum using a preset bandpass filter and determine the optimal image based on the filtering result.

[0076] Based on the above technical solution, optionally, the threshold calculation module 24 is specifically used for:

[0077] Magic = Log(A*(Y) min / Height)+B)

[0078] Where Magic represents the Magic threshold, Y min The distance to the first target is represented by A, the distance to the second target is represented by Height, A represents the amplitude coefficient, and B represents the displacement coefficient.

[0079] Based on the above technical solution, optionally, the contour detection module 22 includes:

[0080] An edge contour determination unit is used to perform edge detection on the cabinet images based on the Sobel operator to obtain the edge contours in each cabinet image;

[0081] A straight profile determination unit is used to perform straight line detection in the edge profile using the Hough transform method to obtain the straight profile.

[0082] Based on the above technical solution, optionally, the contour detection module 22 also includes:

[0083] The erosion unit is used to erode the edge contour before the straight line contour is obtained by performing straight line detection on the edge contour using the Hough transform method, so as to shrink the edge contour inward.

[0084] Based on the above technical solution, optionally, the product identification device in the product cabinet also includes:

[0085] The grayscale module is used to grayscale the cabinet image before performing edge detection and line detection on the cabinet image to obtain the line contours in each cabinet image.

[0086] Based on the above technical solution, optionally, the image acquisition module 21 is specifically used for:

[0087] The camera continuously captures 20 images of the cabinet during the opening process.

[0088] The product identification device in the product cabinet provided in the embodiments of the present invention can execute the product identification method in the product cabinet provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.

[0089] It is worth noting that in the embodiments of the product identification device in the above-mentioned product cabinet, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.

[0090] Example 3

[0091] Figure 3 This is a schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention, showing a block diagram of an exemplary computer device suitable for implementing the embodiments of the present invention. Figure 3 The computer device shown is merely an example and should not be construed as limiting the functionality or scope of the embodiments of the present invention. Figure 3 As shown, the computer device includes a processor 31, a memory 32, an input device 33, and an output device 34; the number of processors 31 in the computer device can be one or more. Figure 3 Taking a processor 31 as an example, the processor 31, memory 32, input device 33, and output device 34 in a computer device can be connected via a bus or other means. Figure 3 Taking the example of a connection between China and Israel via a bus.

[0092] The memory 32, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the product identification method in the product cabinet in this embodiment of the invention (e.g., the image acquisition module 21, contour detection module 22, distance determination module 23, threshold calculation module 24, and image selection module 25 in the product identification device in the product cabinet). The processor 31 executes various functional applications and data processing of the computer device by running the software programs, instructions, and modules stored in the memory 32, thereby realizing the product identification method in the product cabinet described above.

[0093] The memory 32 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 32 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory, or other non-volatile solid-state storage device. In some instances, the memory 32 may further include memory remotely located relative to the processor 31, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0094] The input device 33 can be used to acquire multiple images of the display cabinet during the opening process, and to generate key signal inputs related to user settings and function control of the computer equipment. The output device 34 may include a display screen, which can be used for user interaction and to display recognition results, etc.

[0095] Example 4

[0096] Embodiment 4 of the present invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a product identification method in a merchandise cabinet, the method comprising:

[0097] Acquire multiple images of the cabinet during the opening process, wherein the cabinet is located on the target side in the cabinet images;

[0098] Edge detection and line detection are performed on the cabinet images to obtain the line contours in each cabinet image;

[0099] Determine the first target distance between the target point closest to the opposite edge of the target side on the straight contour of each cabinet image and the opposite edge;

[0100] The Magic threshold for each cabinet image is calculated based on the first target distance and the second target distance between the edge of the target side and the edge of the opposite side;

[0101] Based on the Magic threshold, the best image is determined from each of the cabinet images, and the best image is uploaded to the cloud for product recognition.

[0102] Storage media can be any type of memory device or storage device. The term "storage media" is intended to include: mounting media, such as CD-ROMs, floppy disks, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disks or optical storage); registers or other similar types of memory elements. Storage media may also include other types of memory or combinations thereof. Furthermore, storage media may reside in a computer system in which the program is executed, or may reside in a different second computer system connected to the computer system via a network (such as the Internet). The second computer system can provide program instructions to the computer for execution. The term "storage media" can include two or more storage media that may reside in different locations (e.g., in different computer systems connected via a network). Storage media may store program instructions (e.g., specifically implemented as a computer program) that can be executed by one or more processors.

[0103] Of course, the computer-executable instructions provided in the embodiments of the present invention are not limited to the method operations described above, but can also perform related operations in the product identification method in the merchandise cabinet provided in any embodiment of the present invention.

[0104] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0105] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0106] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0107] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.

Claims

1. A method for identifying goods in a merchandise display case, characterized in that, include: Acquire multiple images of the cabinet during the opening process, wherein the cabinet is located on the target side in the cabinet images; Edge detection and line detection are performed on the cabinet images to obtain the line contours in each cabinet image; Determine the first target distance between the target point closest to the opposite edge of the target side on the straight contour of each cabinet image and the opposite edge; The Magic threshold for each cabinet image is calculated based on the first target distance and the second target distance between the edge of the target side and the edge of the opposite side; The best image is determined from each of the cabinet images based on the Magic threshold, and the best image is uploaded to the cloud for product recognition. The calculation of the Magic threshold for each cabinet image based on the first target distance and the second target distance between the edge on the target side and the opposite edge includes: Magic=Log(A×(Y min / Height)+B); Where Magic represents the Magic threshold, Y min Height represents the distance to the first target, A represents the distance to the second target, and B represents the amplitude coefficient and displacement coefficient. The step of determining the best image among the cabinet images based on the Magic threshold includes: The threshold amplitude curve changing over time is obtained based on the Magic threshold. Perform a short-time Fourier transform on the threshold amplitude curve to obtain the frequency domain spectrum; The frequency domain spectrum is filtered using a preset bandpass filter, and the optimal image is determined based on the filtering result.

2. The product identification method in a merchandise cabinet according to claim 1, characterized in that, The step of performing edge detection and line detection on the cabinet images to obtain the line contours in each cabinet image includes: Edge detection is performed on the cabinet images based on the Sobel operator to obtain the edge contours in each cabinet image; The Hough transform method is used to detect straight lines in the edge contour to obtain the straight line contour.

3. The product identification method in a merchandise cabinet according to claim 2, characterized in that, Before performing line detection on the edge contour using the Hough transform method to obtain the line contour, the method further includes: The edge contour is eroded to cause it to shrink inward.

4. The product identification method in a merchandise cabinet according to claim 2, characterized in that, Before performing edge detection and line detection on the cabinet images to obtain the line contours in each cabinet image, the method further includes: The cabinet image is converted to grayscale.

5. The product identification method in a merchandise cabinet according to claim 1, characterized in that, The acquisition of multiple images of the cabinet during the opening process includes: The camera continuously captures 20 images of the cabinet during the opening process.

6. A product identification device for a merchandise cabinet, characterized in that, include: The image acquisition module is used to acquire multiple images of the cabinet during the opening process, wherein the cabinet is located on the target side in the cabinet images; The contour detection module is used to perform edge detection and line detection on the cabinet images to obtain the straight line contours in each cabinet image; The distance determination module is used to determine the first target distance between the target point closest to the opposite edge of the target side on the straight contour of each cabinet image and the opposite edge; The threshold calculation module is used to calculate the Magic threshold of each cabinet image based on the first target distance and the second target distance between the edge of the target side and the edge of the opposite side; The image selection module is used to determine the best image among the cabinet images according to the Magic threshold, and upload the best image to the cloud for product recognition; The threshold calculation module is specifically used for: Magic=Log(A×(Y min / Height)+B); Where Magic represents the Magic threshold, Y min Height represents the distance to the first target, A represents the distance to the second target, and B represents the amplitude coefficient and displacement coefficient. The image selection module includes: A curve plotting unit is used to obtain a threshold amplitude curve that changes over time based on the Magic threshold. The frequency domain spectrum transformation unit is used to perform a short-time Fourier transform on the threshold amplitude curve to obtain a frequency domain spectrum. The frequency domain spectrum filtering unit is used to filter the frequency domain spectrum using a preset bandpass filter and determine the optimal image based on the filtering result.

7. A computer device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the product identification method in the merchandise cabinet as described in any one of claims 1-5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the product identification method in the merchandise cabinet as described in any one of claims 1-5.