Shelf identification method, device, storage medium and robot
By setting anchor points on the edges of the shelf panels, and utilizing the YOLOv5 algorithm and image processing technology, the problem of traditional shelf recognition methods being unable to distinguish side-by-side shelves was solved, achieving accurate shelf recognition and segmentation.
Patent Information
- Application Number
- CN202110969831.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-23
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-08-23
AI Technical Summary
Traditional methods cannot effectively distinguish between multiple side-by-side shelves, leading to inaccurate shelf identification.
Anchor points are set at the edges of the shelf panels. The shelves are divided by identifying the coordinate information of the anchor points. The YOLOv5 algorithm is used to improve the recognition accuracy, and Gaussian white noise and image data stitching are used to enhance robustness.
It achieves accurate identification and division of side-by-side shelves, improves the accuracy and robustness of image recognition, and adapts to complex scenes and changes in lighting.
Smart Images

Figure CN113705416B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of shelf identification, and in particular, relates to a shelf identification method, device, storage medium and robot. Background Art
[0002] In recent years, smart retail has been an important application field of artificial intelligence. Shelf detection through computer vision algorithms is an important part of realizing smart retail. Intelligent shelf detection through algorithms can effectively provide supermarket customers with the current shelf display situation, that is, it can clearly distinguish the shelf merchandise display information and identify the content of electronic price tags.
[0003] At present, robots inspecting supermarket shelves can flexibly and effectively collect data on supermarket shelves and effectively protect customer privacy. While taking into account the effective completion of character recognition by algorithms, it also makes supermarkets more organized and intelligent.
[0004] However, in reality, supermarkets have complex placement of goods, various complex changing scenes and lighting. If you want to get complete product display information, you must first identify the shelf. Traditionally, the shelf is identified by image recognition of shelf framing photos. When multiple side-by-side shelves or a large shelf is divided into multiple side-by-side small shelves, the traditional method cannot distinguish and identify the side-by-side shelves. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a shelf identification method, which aims to solve the problem that the traditional technical solution cannot distinguish and identify multiple shelves arranged side by side.
[0006] A first aspect of an embodiment of the present invention provides a shelf identification method, which is applied to N shelves arranged side by side, where N is an integer greater than or equal to 2, and includes:
[0007] Anchor points are respectively set at the left edges of all the layers of the N shelves, and anchor points are set at the right edges of all the layers of the Nth shelf;
[0008] Acquire shelf images of the N shelves;
[0009] All the anchor points of the shelf image are identified, and the N shelves are divided according to all the anchor points.
[0010] In one embodiment, dividing the N shelves by all the anchor points includes:
[0011] constructing a coordinate system based on the shelf image;
[0012] Obtaining coordinate information of all the anchor points;
[0013] The N shelves are divided according to the coordinate information of all the anchor points.
[0014] In one embodiment, dividing the N shelves according to the coordinate information of all the anchor points includes:
[0015] All the anchor points whose differences in the vertical coordinates are less than a first preset value are classified as the same column of anchor points to obtain N+1 columns of anchor points;
[0016] All the anchor points whose horizontal coordinate differences are less than a second preset value are classified as anchor points in the same row, so as to obtain K rows of anchor points;
[0017] The left and right edge information of the Mth shelf is obtained by using the Mth column anchor point and the M+1th column anchor point, and the layer information of the Mth shelf is obtained by using the Kth row anchor points of the Mth shelf;
[0018] Dividing the Mth shelf according to the left and right edge information of the Mth shelf and the layering information of the Mth shelf;
[0019] Wherein, M includes a positive integer less than or equal to N, K is an integer greater than 1, and L includes a positive integer less than or equal to K.
[0020] In one embodiment, obtaining left and right edge information of the Mth shelf using the Mth column anchor point and the M+1th column anchor point, and obtaining layer information of the Mth shelf using the Kth row anchor points of the Mth shelf includes:
[0021] The average of the vertical coordinates of all anchor points in the Mth column is used as the vertical coordinate of the anchor point in the Mth column to obtain the vertical coordinate of the anchor point in the N+1th column;
[0022] The ordinate of the anchor point in the Mth column and the ordinate of the anchor point in the M+1th column are the left edge coordinates of the Mth shelf and the right edge coordinates of the Mth shelf respectively;
[0023] The average value of the horizontal coordinates of all anchor points in the Lth row is taken as the horizontal coordinate of the anchor point in the Lth row to obtain the horizontal coordinate of the anchor point in the Kth row;
[0024] The horizontal coordinate of the anchor point of the Lth row of the Mth shelf is the coordinate of the Lth layer of the Mth shelf.
[0025] In one embodiment, obtaining the coordinate information of the anchor point includes:
[0026] Get the horizontal coordinate of the upper left corner of the anchor point and the vertical coordinate of the upper left corner of the anchor point;
[0027] Get the width of the anchor point and the height of the anchor point;
[0028] The horizontal coordinate of the anchor point and the vertical coordinate of the anchor point are calculated according to a preset rule according to the horizontal coordinate of the upper left corner of the anchor point, the vertical coordinate of the upper left corner of the anchor point, the width of the anchor point and the height of the anchor point.
[0029] In one embodiment, the identifying of all the anchor points of the shelf image and dividing the N shelves by all the anchor points is implemented based on the yolov5 algorithm.
[0030] In one embodiment, the yolov5 algorithm includes at least one data addition method of adding Gaussian white noise, horizontal inversion and image data splicing.
[0031] A second aspect of an embodiment of the present invention provides a shelf identification device, which is applied to N shelves arranged side by side, where N is an integer greater than or equal to 2, and includes:
[0032] A setting module, used to set anchor points on the left edges of all the layers of the N shelves, and set anchor points on the right edges of all the layers of the Nth shelf;
[0033] An image acquisition module, used to acquire shelf images of the N shelves; and
[0034] The recognition module is used to recognize all the anchor points of the shelf image and divide the N shelves according to all the anchor points.
[0035] A third aspect of an embodiment of the present invention provides a robot, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the shelf identification method as described in any one of the first aspects when executing the computer program.
[0036] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the shelf identification method as described in any one of the first aspects is implemented.
[0037] The above-mentioned shelf recognition method sets anchor points on the left edges of all the shelves of N shelves, sets anchor points on the right edges of all the shelves of the Nth shelf, obtains shelf images of N shelves, identifies all the anchor points of the shelf images, and divides N shelves by all the anchor points, so that the anchor points correspond to the edge information and shelf information of the N shelves respectively. Therefore, by identifying all the anchor points of the N shelves, multiple side-by-side shelves can be identified and divided. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0039] Figure 1 A schematic diagram of a flow chart of a shelf identification method provided by an embodiment of the present invention;
[0040] Figure 2 A schematic diagram of the structure of a shelf identification device provided by an embodiment of the present invention;
[0041] Figure 3 A schematic diagram of the structure of a robot provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0043] See also Figure 1 , a flowchart of a shelf identification method provided by an embodiment of the present invention is shown. For the sake of convenience, only the part related to the present embodiment is shown, which is described in detail as follows:
[0044] A shelf identification method is applied to N shelves arranged side by side, where N is an integer greater than or equal to 2, and includes steps S1 to S3.
[0045] The N shelves can be physically independent shelves arranged in pairs; the N shelves can also be N shelves artificially divided from an entire shelf.
[0046] S1: Anchor points are set at the left edges of all the shelves of N shelves, and anchor points are set at the right edges of all the shelves of the Nth shelf.
[0047] The number of shelves of a shelf is equal to the number of shelves plus 1. For example, when the number of shelves is 1, the number of shelves of the shelf is 2; when the number of shelves is 2, the number of shelves of the shelf is 3, and so on. Anchor points are set at the left edges of all shelves included in the N shelves, and anchor points are set at the right edges of all shelves of the Nth shelf. Therefore, all anchor points correspond to the edge information and shelf information of the N shelves respectively. Therefore, it is possible to identify all anchor points of the N shelves, thereby forming N shelves based on all these anchor points. By setting anchor points, subsequent image recognition processing can specifically identify anchor points, improve the accuracy of image recognition anchor points and reduce the difficulty. Because anchor points are specific to shelves, even if the scene where the shelf is located is complex or the light is abnormal, the distinction between the anchor point and the shelf itself is relatively high, so the anchor point can be easily identified through image recognition; in addition, when the shape of the shelf is irregular, it will not affect the recognition of the anchor point.
[0048] The anchor points may all be independently set labels with identification function, or all be existing electronic price tags of the goods, or some of the anchor points may be independently set labels with identification function and the rest may be existing electronic price tags of the goods.
[0049] All the shelves of the N shelves here refer to valid shelves. When the shelves of the shelves are not used, that is, when statistics are not needed, there is no need to set anchor points on these shelves.
[0050] S2: Obtain shelf images of N shelves.
[0051] N shelves are framed by a device having an image acquisition function to acquire shelf images, wherein the N shelves may be framed once to acquire shelf images of the N shelves, or the N shelves may be framed multiple times to acquire multiple images respectively, and then the multiple images are synthesized to obtain shelf images of the N shelves.
[0052] S3: Identify all anchor points of the shelf image and divide N shelves according to all anchor points.
[0053] All anchor points on the shelf image are identified. Since the anchor points are set on the left edge of all the shelves of N shelves and the right edge of the Nth shelf, the left and right edge information of the first shelf can be determined based on the left edge anchor point of the first shelf and the left edge anchor point of the second shelf, and all the shelf information of the first shelf can be determined based on the left edge anchor point of the first shelf. By analogy, the left and right edge information and shelf information of the second to N-1th shelves and the shelf information of the Nth shelf can be determined; and the left and right edge information of the Nth shelf is confirmed by the left edge anchor point of the Nth shelf and the right edge anchor point of the Nth shelf. Then, N shelves can be constructed and divided based on the left and right edge information and shelf information of the first to Nth shelves.
[0054] In one embodiment, dividing N shelves by all anchor points includes steps S31 and S32.
[0055] S31: Construct a coordinate system based on the shelf image.
[0056] The coordinate system is formed by taking the first anchor point at the upper left corner of the shelf image as the coordinate origin (0,0), the first anchor point at the upper left corner of the shelf image as the y-axis, and the first anchor point at the top of the shelf image to the right as the x-axis.
[0057] S32: Obtain the coordinate information of all anchor points.
[0058] The coordinate information of all anchor points in the above-constructed coordinate system is obtained, and the coordinate information of the anchor points includes the horizontal coordinate (y-axis coordinate) and the vertical coordinate (x-axis coordinate) of the anchor points.
[0059] S33: Divide N shelves according to the coordinate information of all anchor points.
[0060] By processing the coordinate information of all anchor points, the edge confidence and shelf information corresponding to N shelves can be obtained, thereby dividing the N shelves.
[0061] In one embodiment, dividing N shelves according to the coordinate information of all anchor points includes steps S331 to S334.
[0062] S331: All anchor points whose vertical coordinate differences are less than a first preset value are classified as the same column of anchor points to obtain N+1 columns of anchor points.
[0063] The theoretical values of the vertical coordinates of the anchor points in the same column are the same, but due to inaccurate anchor point settings or errors in recognition, the vertical coordinates of the anchor points in the same column may have deviations, and the deviation is smaller than the vertical coordinate difference of the anchor points in different columns, and the deviation is smaller than the first preset value, and the first preset value is smaller than the vertical coordinate difference of the anchor points in different columns. Therefore, multiple vertical coordinate differences smaller than the first preset value are classified as the same column anchor points to obtain N+1 columns of anchor points.
[0064] The first preset value is set by those skilled in the art according to actual needs.
[0065] S332: All anchor points whose horizontal coordinate differences are less than a second preset value are classified as anchor points in the same row, so as to obtain K rows of anchor points.
[0066] The theoretical values of the horizontal coordinates of the anchor points in the same row are the same, but due to inaccurate anchor point settings or errors in recognition, the horizontal coordinates of the anchor points in the same row may deviate, and the deviation may be smaller than the horizontal coordinate difference of the anchor points in different rows, and the deviation may be smaller than the second preset value, and the second preset value may be smaller than the horizontal coordinate difference of the anchor points in different rows. Therefore, multiple horizontal coordinate differences smaller than the second preset value are classified as the same row of anchor points to obtain K rows of anchor points.
[0067] In one specific embodiment, the above process is based on obtaining K rows of anchor points about a shelf. Because different shelves may have different numbers of layers, or some layers of some shelves are not used, no anchor points are set for the layers that are not used by those shelves, and no detection is required.
[0068] The second preset value is set accordingly by those skilled in the art according to actual needs.
[0069] S333: Obtain the left and right edge information of the Mth shelf using the Mth column anchor point and the M+1th column anchor point, and obtain the layer information of the Mth shelf using the Kth row anchor points of the Mth shelf.
[0070] The Mth column anchor point is located at the left edge of the Mth shelf, and the M+1th column anchor point is located at the right edge of the Mth shelf. Therefore, the left and right edge information of the Mth shelf can be obtained through the Mth column anchor point and the M+1th column anchor point.
[0071] At the same time, the layer information of the Mth shelf can be obtained through the K rows of anchor points of the Mth shelf. Among them, the Lth row of anchor points is the Lth layer of the Mth shelf.
[0072] S334: Divide the Mth shelf according to the left and right edge information of the Mth shelf and the layer information of the Mth shelf.
[0073] The Mth shelf can be divided out using the left and right edge information of the Mth shelf and the layering information of the Mth shelf. By dividing each shelf, N divided shelves can be obtained.
[0074] Wherein, M includes a positive integer less than or equal to N, K is an integer greater than 1, and L includes a positive integer less than or equal to K.
[0075] In one embodiment, obtaining the left and right edge information of the Mth shelf using the Mth column anchor point and the M+1th column anchor point, and obtaining the layer information of the Mth shelf using the Kth row anchor point of the Mth shelf includes steps S3341 to S3344.
[0076] S3341: Take the average of the vertical coordinates of all anchor points of the Mth column as the vertical coordinate of the anchor point of the Mth column to obtain the vertical coordinate of the anchor point of the N+1th column.
[0077] S3342: The vertical coordinates of the anchor point in the Mth column and the vertical coordinates of the anchor point in the M+1th column are the left edge coordinates of the Mth shelf and the right edge coordinates of the Mth shelf respectively.
[0078] S3343: Taking the average of the horizontal coordinates of all anchor points of the Lth row as the horizontal coordinate of the anchor point of the Kth row, so as to obtain the horizontal coordinate of the anchor point of the Kth row.
[0079] S3344: The horizontal coordinate of the anchor point of the Lth row of the Mth shelf is taken as the coordinate of the Lth layer of the Mth shelf.
[0080] The ordinate of the anchor point in the Mth column and the ordinate of the anchor point in the M+1th column are respectively the left edge coordinates and the right edge coordinates of the Mth shelf, thereby obtaining the left and right sides of the Mth shelf; the horizontal coordinate of the anchor point in the Lth row of the Mth shelf is the Lth layer coordinate of the Mth shelf, thereby obtaining the Kth row of layers of the Mth shelf; the complete Mth shelf is constructed through the data of the left side, right side, and K rows of layers of the Mth shelf.
[0081] In one embodiment, obtaining the coordinate information of the anchor point includes steps S321 to S323.
[0082] S321: Obtain the horizontal coordinate of the upper left corner of the anchor point and the vertical coordinate of the upper left corner of the anchor point.
[0083] S322: Obtain the width and height of the anchor point.
[0084] S323: Calculate the horizontal coordinate and the vertical coordinate of the anchor point according to a preset rule according to the horizontal coordinate of the upper left corner of the anchor point, the vertical coordinate of the upper left corner of the anchor point, the width of the anchor point, and the height of the anchor point.
[0085] The anchor point is identified by comparing with the preset model by identifying the horizontal coordinate of the upper left corner of the anchor point, the vertical coordinate of the upper left corner of the anchor point, the width of the anchor point and the height of the anchor point. And the horizontal coordinate and the vertical coordinate of the anchor point are obtained according to the preset rules based on the horizontal coordinate of the upper left corner of the anchor point, the vertical coordinate of the upper left corner of the anchor point, the width of the anchor point and the height of the anchor point. The horizontal coordinate of the upper left corner of the anchor point and the vertical coordinate of the upper left corner of the anchor point can be used as the horizontal coordinate and vertical coordinate of the anchor point respectively, or the coordinates of other corners of the anchor point can be calculated by the horizontal coordinate of the upper left corner of the anchor point, the vertical coordinate of the upper left corner of the anchor point, the width of the anchor point and the height of the anchor point, and then the horizontal coordinate and vertical coordinate of the other corners are used as the horizontal coordinate and vertical coordinate of the anchor point.
[0086] In one embodiment, all anchor points of the shelf image are identified, and N shelves are divided according to all anchor points based on the yolov5 algorithm.
[0087] Through the yolov5 algorithm, data classification and regression are performed to detect all anchor points in the shelf image and obtain the coordinate information of all anchor points. Specifically, the above process is implemented through the yolov5 algorithm, including setting real label data (such as real anchor point position coordinates and anchor point categories) during training, extracting anchor point features through a neural network model, and then obtaining the category of the detected anchor point box target through a softmax classification function, and then subtracting it from the real label category to calculate the focal loss loss, thereby optimizing the detected category. At the same time, the neural network will predict the position coordinates of a real anchor point, and calculate an IOU (intersection-over-union ratio) between the real position coordinates marked by the label and the predicted box, and calculate the GIOUloss, thereby optimizing the position of the predicted box. Through continuous training, the category and position of the anchor point detection are optimized, so as to obtain a more accurate anchor point detection result.
[0088] Among them, the deep learning framework used by the yolov5 algorithm can be trained for pytorch.
[0089] In one embodiment, the yolov5 algorithm includes at least one data addition method of adding Gaussian white noise, horizontal inversion and image data splicing.
[0090] Because when the shelf is actually framed to obtain a shelf image, the shelf image may have a problem of reduced anchor point resolution due to reflection or motion framing. By adding at least one of Gaussian white noise, horizontal inversion and image data splicing, the robustness of anchor point detection of the shelf image can be increased, thereby being able to adapt to various scenarios of complex shelf framing.
[0091] The embodiment of the present application further provides a shelf identification device, which is applied to N shelves arranged side by side, where N is an integer greater than or equal to 2. The shelf identification device includes a setting module 21, an image acquisition module 22 and a recognition module 23.
[0092] The setting module 21 is used to set anchor points on the left edges of all the layers of the N shelves, and to set anchor points on the right edges of all the layers of the Nth shelf.
[0093] The image acquisition module 22 is used to acquire shelf images of N shelves. The image acquisition module may be a Kinect camera.
[0094] The recognition module 23 is used to recognize all anchor points of the shelf image and divide N shelves according to all anchor points.
[0095] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0096] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional elements and circuits is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional elements and circuits as needed, that is, the internal structure of the circuit is divided into different functional elements or circuits to complete all or part of the functions described above. The functional elements and circuits in the embodiments can be integrated into a processing element, or each element can exist physically alone, or two or more elements can be integrated into one element. The above-mentioned integrated elements can be implemented in the form of hardware or in the form of software functional elements. In addition, the specific names of the functional elements and circuits are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the elements and circuits in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0097] See also Figure 3 An embodiment of the present invention also provides a robot, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the shelf identification method of any of the above embodiments when executing the computer program.
[0098] Those skilled in the art will understand that Figure 3This is only an example of the robot 3 and does not constitute a limitation on the robot 3. The specific hardware, software and firmware of the robot may be set in a variety of ways. The robot 3 may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input devices, output devices, network access devices, etc. Among them, the above-mentioned input devices may include a touch panel, a fingerprint collection sensor (for collecting the user's fingerprint information and fingerprint direction information), a microphone, a camera, etc., and the output device may include a display, a speaker, etc.
[0099] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware circuits, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0100] The memory 31 may be an internal storage element of the robot 3, such as a hard disk or memory of the robot 3. The memory 31 may also be an external storage device of the robot 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the robot 3. Further, the memory 61 may also include both internal storage elements and external storage devices of the robot 3. The memory 31 is used to store the computer program and other programs and data required by the robot 3. The memory 31 may also be used to temporarily store data that has been output or is to be output.
[0101] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned embodiments of the shelf identification method are implemented.
[0102] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or circuit that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0103] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0104] Those of ordinary skill in the art will appreciate that the elements and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0105] In the embodiments provided by the present invention, it should be understood that the disclosed circuits / terminal devices and methods can be implemented in other ways. For example, the circuit / terminal device embodiments described above are only schematic. For example, the division of the circuits or components is only a logical function division. There may be other division methods in actual implementation, such as multiple components or circuits 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 interfaces, indirect coupling or communication connection of circuits or components, which can be electrical, mechanical or other forms.
[0106] The components described as separate components may or may not be physically separated, and the components shown as components may or may not be physical components, that is, they may be located in one place or distributed on multiple network components. Some or all of the components may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0107] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some of the technical features therein by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A shelf identification method, applied to N shelves arranged side by side, N being an integer greater than or equal to 2, characterized in that: include: Anchor points are respectively set at the left edges of all the layers of the N shelves, and anchor points are set at the right edges of all the layers of the Nth shelf; Acquire shelf images of the N shelves; Identify all the anchor points of the shelf image, and divide the N shelves by all the anchor points; The dividing the N shelves by all the anchor points comprises: constructing a coordinate system based on the shelf image; Obtaining coordinate information of all the anchor points; Divide the N shelves according to the coordinate information of all the anchor points; The dividing the N shelves according to the coordinate information of all the anchor points comprises: All the anchor points whose differences in the vertical coordinates are less than a first preset value are classified as the same column of anchor points to obtain N+1 columns of anchor points; All the anchor points whose horizontal coordinate differences are less than a second preset value are classified as anchor points in the same row, so as to obtain K rows of anchor points; The left and right edge information of the Mth shelf is obtained by using the Mth column anchor point and the M+1th column anchor point, and the layer information of the Mth shelf is obtained by using the Kth row anchor points of the Mth shelf; Dividing the Mth shelf according to the left and right edge information of the Mth shelf and the layering information of the Mth shelf; Wherein, M includes a positive integer less than or equal to N, and K is an integer greater than 1.
2. The shelf identification method according to claim 1, characterized in that: The obtaining of left and right edge information of the Mth shelf by using the Mth column anchor point and the M+1th column anchor point, and obtaining the layering information of the Mth shelf by using the Kth row anchor points of the Mth shelf includes: The average of the vertical coordinates of all anchor points in the Mth column is used as the vertical coordinate of the anchor point in the Mth column to obtain the vertical coordinate of the anchor point in the N+1th column; The ordinate of the anchor point in the Mth column and the ordinate of the anchor point in the M+1th column are the left edge coordinates of the Mth shelf and the right edge coordinates of the Mth shelf respectively; The average value of the horizontal coordinates of all anchor points in the Lth row is taken as the horizontal coordinate of the anchor point in the Lth row to obtain the horizontal coordinate of the anchor point in the Kth row; The horizontal coordinate of the anchor point of the Lth row of the Mth shelf is the coordinate of the Lth layer of the Mth shelf, where L is a positive integer less than or equal to K.
3. The shelf identification method according to claim 1, characterized in that: Acquiring the coordinate information of the anchor point includes: Get the horizontal coordinate of the upper left corner of the anchor point and the vertical coordinate of the upper left corner of the anchor point; Get the width of the anchor point and the height of the anchor point; The horizontal coordinate of the anchor point and the vertical coordinate of the anchor point are calculated according to a preset rule according to the horizontal coordinate of the upper left corner of the anchor point, the vertical coordinate of the upper left corner of the anchor point, the width of the anchor point and the height of the anchor point.
4. The shelf identification method according to claim 1, characterized in that: The identifying of all the anchor points of the shelf image and dividing the N shelves by all the anchor points is implemented based on the yolov5 algorithm.
5. The shelf identification method according to claim 4, characterized in that: The yolov5 algorithm includes at least one data increasing method of adding Gaussian white noise, horizontal inversion and image data splicing.
6. A shelf identification device, applied to N shelves arranged side by side, N being an integer greater than or equal to 2, characterized in that: The method for implementing the shelf identification method according to any one of claims 1 to 5 comprises: A setting module, used to set anchor points on the left edges of all the layers of the N shelves, and set anchor points on the right edges of all the layers of the Nth shelf; An image acquisition module, used to acquire shelf images of the N shelves; and The recognition module is used to recognize all the anchor points of the shelf image and divide the N shelves according to all the anchor points.
7. A robot comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the shelf identification method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the shelf identification method according to any one of claims 1 to 5 is implemented.
