Target detection method, device, storage medium and terminal for loading and unloading equipment

By using cameras and six-axis robotic arms on loading and unloading equipment, combining polynomial fitting and yolov5 target detection model, the precise positioning problem of positioning holes in large energy storage equipment is solved, and automated and intelligent loading and unloading control is realized.

CN118864600BActive Publication Date: 2025-03-04ALPHA ESS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411116584.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2025-03-04
Estimated Expiration
2044-08-14

AI Technical Summary

Technical Problem

During the loading and unloading of large energy storage equipment, how to accurately and quickly locate the positioning holes on the equipment to ensure that the grasping device can be accurately grasped and placed is a technical problem.

Method used

Using a target detection method for loading and unloading equipment, using the camera and a six-axis robotic arm, the relationship between pixel ratio and distance is calculated by acquiring the preset image and the image to be detected, the yolov5 object detection model is used for detection, and the offset of the image under the coordinate system is calculated to achieve accurate positioning.

Benefits of technology

It improves the accuracy of target detection, can maintain stable detection performance under different light conditions, and realizes automated and intelligent control of large-scale energy storage equipment loading and unloading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118864600B_ABST
    Figure CN118864600B_ABST
Patent Text Reader

Abstract

The present invention discloses a target detection method, device, storage medium and terminal for loading and unloading equipment. The target detection method comprises: obtaining a preset image and an image to be detected that meets preset requirements, obtaining the distance u between the camera and the energy storage device, obtaining a relationship between the pixel ratio and the distance u based on a polynomial fitting method, and using the relationship to respectively calculate the pixel ratio P2 of the image to be detected and the pixel ratio P1 of the preset image; using a trained yolov5 target detection model to respectively detect the image to be detected and the preset image, and obtaining a first detection result of the image to be detected and a second detection result of the preset image; constructing a coordinate system of the camera, and calculating the offset (Δx′, Δy′, 0) between the image to be detected and the preset image in the coordinate system based on the first detection result and the second detection result. The present invention improves the accuracy of target detection and maintains stable detection performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of target detection, and in particular to a target detection method, device, storage medium and terminal for loading and unloading equipment. Background Art

[0002] With the rapid development of new energy technologies, large energy storage devices such as battery packs and energy storage tanks play an important role in energy storage and supply systems. These devices need to be safely and efficiently loaded into containers and unloaded from containers during long-distance transportation or long-term storage. However, during the loading and unloading process of large energy storage devices, how to accurately and quickly locate the positioning holes on the equipment to ensure that the gripping device can accurately grasp and place is a technical problem.

[0003] The traditional loading and unloading method generally controls the grabbing and placement of external equipment by manually observing the position deviation between the energy storage equipment and the container. This is not only inefficient, but also poses safety risks and cannot meet the needs of modern industry for automation and intelligence. Although machine vision and robotics have made significant progress in recent years, their application in the field of loading and unloading of large energy storage equipment still faces many problems, such as the changing light conditions inside the container, and the change in the distance between the camera and the energy storage equipment, which will lead to differences in the image pixel ratio. These factors will affect the camera's recognition accuracy of the positioning hole, further increasing the difficulty of target detection.

[0004] Therefore, how to use effective target detection methods to achieve automated and intelligent control of the loading and unloading process of large-scale energy storage equipment, thereby solving the deficiencies and shortcomings of existing technologies, has become an important issue that researchers in this field need to solve urgently. Summary of the invention

[0005] The purpose of the present invention is to address the above-mentioned problems and to provide a method, device, storage medium and terminal for target detection of loading and unloading equipment.

[0006] The technical solution of the present invention is: a target detection method for loading and unloading equipment, the loading and unloading equipment is provided with a camera and a six-axis mechanical arm, the camera is used to collect images to be detected, the six-axis mechanical arm is used to load and unload energy storage equipment, the target detection method comprises the following steps: obtaining a preset image and an image to be detected that meets preset requirements, the preset image and the image to be detected both contain a positioning hole of an energy storage device, the preset image is a photo of the aligned hole position; obtaining the distance u between the camera and the energy storage device, and obtaining a relationship between the pixel ratio and the distance u based on a polynomial fitting method p=a 2u+bu+c, use the relationship to calculate the pixel ratio p2 of the image to be detected and the pixel ratio p1 of the preset image, where a, b, and c are all constants; use the trained yolov5 target detection model to detect the image to be detected and the preset image respectively, and obtain a first detection result of the image to be detected and a second detection result of the preset image; construct the camera's coordinate system (X′, Y′, Z′), and calculate the offset (Δx′, Δy′, 0) between the image to be detected and the preset image in the coordinate system (X′, Y′, Z′) based on the first detection result and the second detection result.

[0007] As an improvement of an embodiment of the present invention, the "obtaining an image to be detected that meets the preset requirements" specifically includes: obtaining the image to be detected, graying the image to be detected, sharpening the grayed image to be detected using the Laplace algorithm, and calculating the average value and standard deviation of the sharpened image to be detected; when the standard deviation is ≥ the first preset threshold, the first image meets the preset requirements; when the standard deviation is < the first preset threshold, the edge information in the horizontal and vertical directions of the sharpened image to be detected is extracted using the Sobel operator, and the fused image is obtained by denoising the fused image, and the denoised fused image is sharpened using the Laplace algorithm. If the standard deviation of the sharpened fused image is ≥ the first preset threshold, the sharpened fused image is an image to be detected that meets the preset requirements.

[0008] As an improvement of an embodiment of the present invention, the "using the trained yolov5 target detection model to detect the image to be detected and the preset image respectively, and obtain a first detection result of the preset image and a second detection result of the image to be detected" specifically includes: using the trained yolov5 target detection model to detect the image to be detected and the preset image respectively, and obtain several feature maps and several candidate boxes corresponding to the image to be detected and the preset image, as well as information of each candidate box; screening the several candidate boxes to obtain a first detection result of the preset image and a second detection result of the image to be detected.

[0009] As an improvement of an embodiment of the present invention, the “screening the plurality of candidate frames” specifically includes: screening the plurality of candidate frames using a non-maximum suppression algorithm.

[0010] As an improvement of an embodiment of the present invention, the first detection result is the coordinates (x′1, y′1) of the center point of the detection frame of the image to be detected; the second detection result is the coordinates (x′2, y′2) of the center point of the preset image detection frame.

[0011] As an improvement of an embodiment of the present invention, the "calculating the offset between the first detection result and the second detection result based on the first detection result and the second detection result" specifically includes: calculating the offset Δx′ between the horizontal coordinate x′1 of the center point of the detection frame of the image to be detected and the horizontal coordinate y′1 of the center point of the detection frame of the preset image, and the offset Δy′ between the vertical coordinate y1 of the center point of the detection frame of the image to be detected and the vertical coordinate y2 of the center point of the detection frame of the preset image.

[0012] As an improvement of the embodiment of the present invention, Δx′=x′ dis *p, Δy′=y′ dis *p,x′ dis =(x′1-x′2*p) / p1,y′ dis =(y′1-y′2*p) / p1, p=p1 / p2.

[0013] To achieve one of the above-mentioned purposes of the invention, an embodiment of the present invention provides a target detection device for loading and unloading equipment, wherein the loading and unloading equipment is provided with a camera and a six-axis robotic arm, wherein the camera is used to collect images to be detected, and the six-axis robotic arm is used to load and unload energy storage equipment, and the target detection device includes the following modules:

[0014] An image acquisition module, used to acquire a preset image and an image to be detected that meets preset requirements, wherein both the preset image and the image to be detected contain a positioning hole for an energy storage device, and the preset image is an aligned photo;

[0015] The first processing module is used to obtain the distance u between the camera and the energy storage device, and obtain the relationship between the pixel ratio and the distance u based on the polynomial fitting method. 2 u+bu+c, using the relationship to calculate the pixel ratio p2 of the image to be detected and the pixel ratio p1 of the preset image respectively;

[0016] A detection module is used to detect the image to be detected and the preset image respectively using the trained yolov5 target detection model to obtain a first detection result of the preset image and a second detection result of the image to be detected;

[0017] The second processing module is used to construct a coordinate system (X′, Y′, Z′) of the camera, and calculate the offset (Δx′, Δy′, 0) between the image to be detected and the preset image in the coordinate system (X′, Y′, Z′) based on the first detection result and the second detection result.

[0018] To achieve one of the above-mentioned objects of the invention, an embodiment of the present invention provides a storage medium storing program instructions, wherein the program instructions, when executed, implement the target detection method as described in any one of the above items.

[0019] To achieve one of the above objects of the invention, an embodiment of the present invention provides a terminal, including a processor and a memory, wherein the memory stores program instructions, and the processor executes the program instructions to implement the target detection method as described in any one of the above items.

[0020] The target detection method, device, storage medium and terminal for loading and unloading equipment provided by the embodiments of the present invention have the following advantages: the present invention obtains the distance between the camera and the energy storage device, and obtains the relationship between the pixel ratio and the distance based on the polynomial fitting method, so as to accurately correct the pixel ratio of the image to be detected, thereby improving the accuracy of target detection; the yolov5 target detection model has strong generalization ability and robustness, and can cope with complex and changeable changes in light inside containers, etc., to ensure stable detection performance under different conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a schematic flow chart of a target detection method for loading and unloading equipment according to the present invention;

[0022] Figure 2 It is the structure diagram of the Focus module of the yolov5 model described in the present invention;

[0023] Figure 3 It is the backbone structure diagram of the yolov5 model described in the present invention;

[0024] Figure 4 It is a CBL structure diagram of the yolov5 model described in the present invention;

[0025] Figure 5 It is the CSP1_X structure diagram of the yolov5 model described in the present invention;

[0026] Figure 6 It is the SPP structure diagram of the yolov5 model described in the present invention;

[0027] Figure 7 It is a Neck structure diagram of the yolov5 model described in the present invention;

[0028] Figure 8 It is the CSP2_X structure diagram of the yolov5 model described in the present invention. DETAILED DESCRIPTION

[0029] The present invention will be described in detail below in conjunction with the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional changes made by a person skilled in the art based on these embodiments are all within the scope of protection of the present invention.

[0030] If the present invention involves directions (for example, up, down, left, right, front, back, outside, inside, etc.) when describing, it is necessary to define the directions involved.

[0031] The scope of the embodiments herein includes the entire scope of the claims, and all available equivalents of the claims.Herein, the terms "first", "second", etc. are only used to distinguish one element from another, without requiring or implying any actual relationship or order between these elements.In fact, the first element can also be called the second element, and vice versa.Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the structure, device or equipment including a series of elements not only include those elements, but also include other elements not clearly listed, or also include elements inherent to such structure, device or equipment.In the absence of more restrictions, the elements limited by the statement "include one..." do not exclude the existence of other identical elements in the structure, device or equipment including the elements.Each embodiment herein is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same similar parts between each embodiment can be referred to each other.

[0032] The terms "longitudinal", "lateral", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc. in this document indicate the orientation or position relationship based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing this document and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In the description of this document, unless otherwise specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a mechanical connection or an electrical connection, it can also be the internal communication of two elements, it can be a direct connection, or it can be indirectly connected through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0033] Embodiment 1 of the present invention provides a target detection method for loading and unloading equipment, wherein the loading and unloading equipment is provided with a camera and a six-axis robotic arm, wherein the camera is used to collect images to be detected, and the six-axis robotic arm is used to load and unload energy storage equipment. Here, the loading and unloading equipment is provided with two cameras on the same horizontal line. Optionally, a HiSilicon industrial camera and a Hikvision light source controller can be combined to realize the collection of the images to be detected. The HiSilicon industrial camera has a pixel of 25 million, and the size of the captured image is 5120*5120. The Hikvision light source controller can fill in the light of the photographed object according to different light conditions. It can be understood that the combination of the two can make the images to be detected clearer. The six-axis robotic arm has six degrees of freedom, which are driven by six motors respectively, so that the robotic arm can move and load and unload in three-dimensional space.

[0034] like Figure 1 As shown, the target detection method comprises the following steps:

[0035] Step 101: obtaining a preset image and an image to be detected that meets preset requirements, wherein both the preset image and the image to be detected contain a positioning hole of an energy storage device, and the preset image is a photo of the aligned hole position;

[0036] Here, in order to adapt to the input conditions of the target detection method for the surface of the energy storage box, when the first image of RGB arrangement is received from the camera interface, it needs to be converted to BGR arrangement. In order to facilitate the detection of brightness and fuzzy values, the image data of BGR arrangement needs to be converted into a grayscale image. Optionally, the image color space conversion function in the opencv image library can be used to convert the first image of RGB arrangement into BGR arrangement image data, and the BGR arrangement image data is converted into a grayscale image. After obtaining the image to be detected that meets the preset requirements, the image to be detected needs to be scaled proportionally to the size of the model input. It can be understood that this can help maintain image quality, improve model compatibility, reduce computing resource consumption, and improve detection accuracy.

[0037] Step 102: Obtain the distance u between the camera and the energy storage device, and obtain the relationship between the pixel ratio and the distance u based on the polynomial fitting method: p=a 2 u+bu+c, using the relationship to calculate the pixel ratio p2 of the image to be detected and the pixel ratio p1 of the preset image, where a, b, and c are all constants;

[0038] In practice, the relationship between the focal length f, object distance u, and image distance v of a camera can be expressed by the Gaussian imaging formula 1 / f=1 / u+1 / v. The longer the focal length of the camera, the clearer the distant scene that the camera can capture, but it will also reduce the depth of field, making the background blurred. The shorter the focal length, the wider the close range of the camera that can clearly image, but it cannot capture distant details well. Therefore, the present invention needs to fix the focal length of the camera during actual operation. It can be understood that this can not only quickly locate the shooting position, but also ensure that the image captured by the camera contains a clear target object, which is convenient for subsequent detection of the target object.

[0039] The present invention uses left and right cameras to collect images of a tempered ruler with clear scales in the horizontal and vertical directions under different object distance conditions, and calculates the pixel ratios of the left and right images in the horizontal and vertical directions respectively. It can be understood that simultaneously acquiring the pixel ratios of the left and right images can increase the richness of the data and reduce subsequent fitting problems. In order to prevent the camera lens from being distorted, it is necessary to move the camera in the horizontal and vertical directions at the same object distance so that the tempered ruler reaches the edge of the picture and collects the image, then calculate the pixel ratio in the horizontal and vertical directions and take the average value, and finally, make a difference with the pixel ratio of the tempered ruler at the center of the image at the same object distance. If the difference is between two and three pixels, it means that the lens is not distorted, otherwise, correction is required.

[0040] The object distance u is used as the horizontal coordinate and the pixel ratio P is used as the vertical coordinate for function fitting. Due to the different structures and parameters of industrial cameras, it is necessary to select a suitable fitting function, such as least squares fitting, polynomial fitting and custom function fitting. In the present invention, the pixel ratio and the object distance have a nonlinear relationship p=a 2 u+bu+c, where a, b, and c are all constants.

[0041] Step 103: Use the trained yolov5 target detection model to detect the image to be detected and the preset image respectively, and obtain a first detection result of the image to be detected and a second detection result of the preset image;

[0042] Here, preferably, the present invention uses the 5s version of yolov5, which is a model optimized for real-time and lightweight requirements in the YOLO series, and can significantly improve the processing speed while maintaining high detection accuracy. The data input size of the model is 640*640*3, and the output image feature size is 80*80*255, 40*40*255, and 20*20*255, which can cover a wide range of receptive fields of large, medium and small targets at the same time. By outputting feature maps of different sizes, the model can more effectively capture multi-scale information in the image, making the model more flexible and accurate in detecting targets of different sizes.

[0043] When the image to be detected or the preset image is input into the yolov5 target detection model, the backbone network will first use the following Figure 2 The Focus module shown in the figure divides the image to be detected into 320*320*12 images, and then obtains a 320*320*32 feature map through a convolution operation. It can be understood that this can improve the computing power without losing information. The feature map is then used as Figure 3 In the backbone structure shown in the figure, Figure 4 The CBL structure shown and Figure 5 The CSP 1_X modules shown in the figure are combined to extract the features of the image to be detected, and then the features of the image to be detected are extracted by using the following method: Figure 6 The SPP module shown in FIG. performs multi-scale downsampling on the image features to generate several image feature maps. Figure 7 The Neck network structure shown in FIG. 1 performs multi-scale feature extraction on the plurality of image feature maps. The Neck network structure includes: Figure 8 The CSP2_X structure shown in Figure 4 The CBL structure shown finally obtains several feature maps and several candidate frames corresponding to the image to be detected and the preset image, as well as information of each candidate frame; the several candidate frames are screened to obtain a first detection result of the preset image and a second detection result of the image to be detected.

[0044] Step 104: construct a coordinate system (X′, Y′, Z′) of the camera, and calculate an offset (Δx′, Δy′, 0) between the image to be detected and the preset image in the coordinate system (X′, Y′, Z′) based on the first detection result and the second detection result.

[0045] In practice, the optical center of the camera can be taken as the origin, the optical axis as the Z′ axis, the X′ axis and the Y′ axis respectively represent the horizontal direction and the vertical direction of the image to construct the coordinate system (X′, Y′, Z′) of the camera, and the offset Δx′ between the horizontal coordinate x′1 of the center point of the detection frame of the image to be detected and the horizontal coordinate x′2 of the center point of the detection frame of the preset image, and the offset Δy′ between the vertical coordinate y′1 of the center point of the detection frame of the image to be detected and the vertical coordinate y′2 of the center point of the detection frame of the preset image are calculated based on the first detection result and the second detection result, where Δx′=x′ dis *p, Δy′=y′ dis *p,x′ dis =(x′1-x′2*p) / p1,y′ dis =(y′1-y′2*p) / p1, p=p1 / p2.

[0046] In this embodiment, the "obtaining an image to be detected that meets the preset requirements" specifically includes: obtaining the image to be detected, gray-scaling the image to be detected, sharpening the gray-scaled image to be detected using the Laplace algorithm, and calculating the average value and standard deviation of the sharpened image to be detected; when the standard deviation is ≥ the first preset threshold, the first image meets the preset requirements; when the standard deviation is < the first preset threshold, the edge information of the sharpened image to be detected in the horizontal and vertical directions is extracted using the Sobel operator, and the fused image is obtained by denoising the fused image, and the denoised fused image is sharpened using the Laplace algorithm. If the standard deviation of the sharpened fused image is ≥ the first preset threshold, the sharpened fused image is an image to be detected that meets the preset requirements.

[0047] Here, the Laplace algorithm is a differential algorithm. Its application can enhance the grayscale mutation area in the image, weaken the grayscale slow change area, enhance the edge and detail information in the image, and make the blurred area more obvious. The Sobel operator is a commonly used edge detection algorithm. In actual operation, the Sobel operator corresponds each pixel in the image to the three directions of -1, 0, and +1, and sums the grayscale values ​​in these three directions and takes the absolute value. Finally, the relationship between this absolute value and the preset threshold is compared to obtain the edge information and fuse these edge information to remove noise.

[0048] After graying the image to be detected, it is also necessary to detect whether the first image meets the brightness requirement. First, the pixel value corresponding to each pixel point in the grayed first image is counted and recorded as a set P = {p1, p2, ..., p n}, where p i ∈[0,255], and p i is an integer; n is the number of pixels of the first image, for any element p in P i Subtract the fixed value m from each of them to get the set P′, P′={p′1,p′2,...,p′ n}, where p′ i =p i -m, 75≤m≤160, and then calculate the average value p″ of all elements in P′;

[0049] Define the set Q = {q1,q2,...,q 256}, where q i =|amp″|*n, a=0,1,2,...,255 Then calculate the average value q″ of all elements in the set Q; Then calculate the brightness statistics R of the first image after grayscale processing, where If p″ is less than the preset mean threshold and the brightness statistic R of the grayscale image is less than the preset brightness threshold, the grayscale first image is sharpened using the Laplace algorithm. Optionally, the value range of the preset mean threshold can be -20 to 20, and the value range of the preset brightness threshold can be -15 to 15.

[0050] In this embodiment, the "using the trained yolov5 target detection model to detect the image to be detected and the preset image respectively, and obtain a first detection result of the preset image and a second detection result of the image to be detected" specifically includes: using the trained yolov5 target detection model to detect the image to be detected and the preset image respectively, and obtain several feature maps and several candidate frames corresponding to the image to be detected and the preset image, as well as information of each candidate frame; screening the several candidate frames to obtain a first detection result of the preset image and a second detection result of the image to be detected.

[0051] In this embodiment, the “screening the plurality of candidate frames” specifically includes: screening the plurality of candidate frames using a non-maximum suppression algorithm.

[0052] Here, the non-maximum suppression algorithm is a commonly used target detection algorithm, which is used in computer vision to filter out the final detection frame from multiple target detection frames output, thereby improving the detection effect. Its basic principle is that for each detection frame, it is compared with other detection frames. If the overlap rate of two detection frames exceeds the specified threshold, the detection frame with lower confidence is suppressed, and finally only the detection frame with the highest confidence is retained.

[0053] In this embodiment, the first detection result is the coordinates (x′1, y′1) of the center point of the detection frame of the image to be detected; the second detection result is the coordinates (x′2, y′2) of the center point of the preset image detection frame.

[0054] In this embodiment, the “calculating the offset between the first detection result and the second detection result based on the first detection result and the second detection result” specifically includes: calculating the offset Δx′ between the horizontal coordinate x′1 of the center point of the detection frame of the image to be detected and the horizontal coordinate x′2 of the center point of the detection frame of the preset image, and the offset Δy′ between the vertical coordinate y′1 of the center point of the detection frame of the image to be detected and the vertical coordinate y′2 of the center point of the detection frame of the preset image.

[0055] In this embodiment, Δx′=x′ dis *p, Δy′=y′ dis *p,x′ dis =(x′1-x′2*p) / p1,y′ dis=(y′1-y′2*p) / p1, p=p1 / p2.

[0056] Embodiment 2 of the present invention provides a target detection device for loading and unloading equipment, wherein the loading and unloading equipment is provided with a camera and a six-axis robotic arm, wherein the camera is used to collect images to be detected, and the six-axis robotic arm is used to load and unload energy storage equipment, and the target detection device includes the following modules:

[0057] An image acquisition module, used to acquire a preset image and an image to be detected that meets preset requirements, wherein both the preset image and the image to be detected contain a positioning hole for an energy storage device, and the preset image is an aligned photo;

[0058] The first processing module is used to obtain the distance u between the camera and the energy storage device, and obtain the relationship between the pixel ratio and the distance u based on the polynomial fitting method. 2 u+bu+c, using the relationship to calculate the pixel ratio p2 of the image to be detected and the pixel ratio p1 of the preset image respectively;

[0059] A detection module is used to detect the image to be detected and the preset image respectively using the trained yolov5 target detection model to obtain a first detection result of the preset image and a second detection result of the image to be detected;

[0060] The second processing module is used to construct a coordinate system (X′, Y′, Z′) of the camera, and calculate the offset (Δx′, Δy′, 0) between the image to be detected and the preset image in the coordinate system (X′, Y′, Z′) based on the first detection result and the second detection result.

[0061] Embodiment 3 of the present invention provides a storage medium storing program instructions, which implement the target detection method as described in any one of the above items when executed.

[0062] Embodiment 4 of the present invention provides a terminal, including a processor and a memory, wherein the memory stores program instructions, and the processor executes the program instructions to implement the target detection method as described in any one of the above items.

[0063] The present invention may be a system, a method and / or a computer program product. The computer program product may include a readable storage medium carrying computer readable program instructions for causing a processor to implement various aspects of the present invention.

[0064] Storage medium can be a tangible device that keeps and stores the instructions used by the instruction execution device. Storage medium can include, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a protruding structure in a groove on which instructions are stored, and any suitable combination thereof.

[0065] It should be understood that although this specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each implementation mode may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

[0066] The series of detailed descriptions listed above are only specific descriptions of feasible implementation methods of the present invention. They are not intended to limit the scope of protection of the present invention. Any equivalent implementation methods or changes that do not deviate from the technical spirit of the present invention should be included in the scope of protection of the present invention.

Claims

1. A target detection method for loading and unloading equipment, wherein the loading and unloading equipment is provided with a camera and a six-axis robotic arm, wherein the camera is used to collect images to be detected, and the six-axis robotic arm is used to load and unload energy storage equipment, characterized in that: The following steps are involved: Acquire a preset image and an image to be detected that meets preset requirements, wherein acquiring the image to be detected that meets preset requirements specifically includes: acquiring the image to be detected, graying the image to be detected, sharpening the grayed image to be detected using the Laplace algorithm, and calculating the average value and standard deviation of the sharpened image to be detected; when the standard deviation is ≥ a first preset threshold, the image to be detected meets the preset requirements; when the standard deviation is < the first preset threshold, extracting edge information in the horizontal and vertical directions of the sharpened image to be detected using the Sobel operator, and fusing the images to obtain a fused image, denoising the fused image, and sharpening the denoised fused image using the Laplace algorithm; if the standard deviation of the sharpened fused image is ≥ the first preset threshold, the sharpened fused image is an image to be detected that meets the preset requirements; the preset image and the image to be detected both contain a positioning hole for an energy storage device, and the preset image is a photo of an aligned hole position; Obtain the distance u between the camera and the energy storage device, and obtain the relationship between the pixel ratio and the distance u based on the polynomial fitting method. 2 u+bu+c, using the relationship to calculate the pixel ratio p2 of the image to be detected and the pixel ratio p1 of the preset image, where a, b, and c are all constants; The image to be detected and the preset image are detected respectively by using the trained yolov5 target detection model, and a plurality of feature maps and a plurality of candidate frames corresponding to the image to be detected and the preset image, as well as information of each candidate frame are obtained; the plurality of candidate frames are screened to obtain a first detection result of the preset image and a second detection result of the image to be detected; The first detection result is the coordinates (x′1, y′1) of the center point of the detection frame of the image to be detected; the second detection result is the coordinates (x′2, y′2) of the center point of the detection frame of the preset image; Construct a coordinate system (X′, Y′, Z′) of the camera, and calculate the offset (Δx′, Δy′, 0) between the image to be detected and the preset image in the coordinate system (X′, Y′, Z′) based on the first detection result and the second detection result: calculate the offset Δx′ between the horizontal coordinate x′1 of the center point of the detection frame of the image to be detected and the horizontal coordinate x′2 of the center point of the detection frame of the preset image, and the offset Δy′ between the vertical coordinate y′1 of the center point of the detection frame of the image to be detected and the vertical coordinate y′2 of the center point of the detection frame of the preset image, Δx′=x′ dis *p, Δy′=y′ dis *p,x′ dis =(x′1-x′2*p) / p1,y′ dis =(y′1-y′2*p) / p1, p=p1 / p2.

2. The target detection method according to claim 1, characterized in that: The screening of the plurality of candidate frames specifically includes: screening the plurality of candidate frames using a non-maximum suppression algorithm.

3. A target detection device for loading and unloading equipment, the target detection device is used to perform the target detection method according to any one of claims 1 to 2, the loading and unloading equipment is provided with a camera and a six-axis robotic arm, the camera is used to collect images to be detected, and the six-axis robotic arm is used to load and unload energy storage equipment, characterized in that: Includes the following modules: An image acquisition module, used to acquire a preset image and an image to be detected that meets preset requirements, wherein both the preset image and the image to be detected contain a positioning hole for an energy storage device, and the preset image is an aligned photo; The first processing module is used to obtain the distance u between the camera and the energy storage device, and obtain the relationship between the pixel ratio and the distance u based on the polynomial fitting method. 2 u+bu+c, using the relationship to calculate the pixel ratio p2 of the image to be detected and the pixel ratio p1 of the preset image respectively; A detection module is used to detect the image to be detected and the preset image respectively using the trained yolov5 target detection model to obtain a first detection result of the preset image and a second detection result of the image to be detected; The second processing module is used to construct a coordinate system (X′, Y′, Z′) of the camera, and calculate the offset (Δx′, Δy′, 0) between the image to be detected and the preset image in the coordinate system (X′, Y′, Z′) based on the first detection result and the second detection result.

4. A storage medium storing program instructions, characterized in that: When the program instructions are executed, the target detection method according to any one of claims 1 to 2 is implemented.

5. A terminal, characterized in that: It includes a processor and a memory, the memory stores program instructions, and the processor runs the program instructions to implement the target detection method according to any one of claims 1 to 2.

Citation Information

Patent Citations

  • DETR-YOLO-based target detection method and device and storage medium

    CN114067124A

  • Safety helmet detection method and device based on YOLOv5 optimization model and medium

    CN117058517A