YOLOv5-based trellis type grape bagging identification and positioning method

Through the grape bag identification and positioning method based on YOLOv5, a three-dimensional grape model is constructed and its three-dimensional coordinate data is obtained, which solves the problem of grape target detection and positioning in complex dynamic environments, and improves the success rate of bagging actions.

CN119559379APending Publication Date: 2025-03-04SHENYANG AGRI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411601098.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

The prior art is difficult to accurately detect and locate grape targets in complex dynamic environments, resulting in difficulty in ensuring the accuracy and efficiency of mechanical bagging.

Method used

A method of fence-type grape bag recognition and positioning based on YOLOv5 is adopted. Through grape target detection in a dynamic environment, a three-dimensional model of the grape body surface is constructed, the three-dimensional coordinate data of the grape is obtained, and the bagging mechanism movement is guided.

Benefits of technology

It has achieved accurate positioning of grape targets in a dynamic environment, improved the success rate of bagging operations, and broken through the bottleneck problem of high-automated fence-type grape automatic bagging technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119559379A_ABST
    Figure CN119559379A_ABST
Patent Text Reader

Abstract

The invention discloses a YOLOv5-based hedge frame type grape bagging identification and positioning method, which is characterized in that grape target detection in a dynamic environment is carried out based on YOLOv5, a grape body surface three-dimensional model is constructed to acquire a grape space attitude and feed back three-dimensional coordinate value data of the grape space attitude, a bagging mechanism is guided to move, and the bagging mechanism can be used for bagging. Precise positioning of a target is achieved through fusion of depth information and image information, the feasibility of a bagging path and a bagging action is judged through a space volume calculation method, a bagging point and an opening binding point of the bagging action are estimated and analyzed, the success rate of the bagging action is increased, dynamic target detection is conducted through a YOLOv5 convolutional network, and the accuracy of the bagging action is improved. The grape target recognition accuracy and response speed are enhanced, the model is lightened through comparison of detection networks of the same type, dynamic detection is carried out faster and more accurately, and target operation is carried out in cooperation with a bagging mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of grape bagging recognition and positioning, and in particular relates to a trellis-type grape bagging recognition and positioning method based on YOLOv5. Background Art

[0002] Grapes, as a fruit with great economic value, are an important economic fruit in my country, and the quality of fruits is an important indicator for determining economic benefits. In the grape planting industry, grape bagging, as an important technical measure to improve fruit quality, reduce pests and diseases and pesticide residues, has always relied on traditional manual operation. However, the work efficiency and work quality of traditional manual bagging technology cannot meet the production needs. The current mechanical bagging technology is difficult to accurately analyze in a complex environment, especially in a changing natural environment, it is often difficult to ensure the accuracy and efficiency of bagging. Therefore, grape bagging technology with image recognition is extremely urgent, but how to accurately and dynamically detect grape targets in a dynamic environment, locate the detection target, construct the detection target space posture, and then guide the mechanical automation movement to specify the position is the technical bottleneck of the precise bagging movement of the grape bagging mechanism in a dynamic environment. Realizing visible automated trellis grape bagging and bagging without damaging the fruit and stems is also a technical problem for the grape bagging mechanism.

[0003] Chinese patent CN 115050021 A discloses a grape recognition method in an unstructured environment based on an improved YOLOv4. The improvement of YOLO v4 is to integrate the SimAM attention mechanism into the residual body of the backbone network, increase the feature fusion network connection path and assign weights, extract and fuse features, and remove useless features, thereby improving the shortcomings of the grape cylinder model created by the RANSAC algorithm in complex environments. However, it uses Focal loss to optimize the BCE loss algorithm, which is limited by the performance of Yolov4, the model structure is not perfect, the parameter adjustment accuracy is insufficient, the training model speed is slow, and its application and deployment are not flexible enough, which makes it difficult to meet the needs of precise operation of grape bagging.

[0004] Chinese patent CN 114494441 A discloses a method and device for synchronous identification and positioning of grapes and their picking points based on deep learning. The method uses the lightweight Backbone in the modified YOLOv4 model to extract grape frame features and picking point features, then strengthens the features through the neck, and then analyzes the features through the heads to obtain the grape frame position data and the coordinates of the picking points. The method can achieve rapid synchronous detection of the grape frame position data and the coordinates of the picking points, while having high accuracy and fast calculation speed. The method can guide the picking robot to complete the optimal grasping posture. However, due to the limitations of many steps and large amount of calculation, the method is difficult to achieve real-time detection. At the same time, occlusion, overlapping problems and weather influences will also cause problems for the segmentation of grapes.

[0005] In view of the above factors, a trellis grape bagging recognition and positioning method based on YOLOv5 is provided, which can not only accurately locate the grape target in a dynamic environment, but also feedback its three-dimensional coordinate value data to guide the positioning method of the bagging mechanism movement. Summary of the invention

[0006] The object of the present invention is to provide a method for identifying and locating trellis-type grape bagging based on YOLOv5 to solve the problems raised in the above-mentioned background technology.

[0007] The purpose of the present invention is to achieve this through the following technical solutions: a YOLOv5-based identification and positioning method for trellis-type grape bagging, which detects grape targets in a dynamic environment based on YOLOv5, constructs a three-dimensional model of the grape surface to collect the spatial posture of the grapes and feeds back its three-dimensional coordinate value data to guide the movement of the bagging mechanism;

[0008] The target is accurately positioned through the fusion of depth information and image information. The feasibility of the bagging path and bagging action is determined by calculating the spatial volume method. The bagging point and the constriction point of the bagging action are estimated and analyzed to improve the success rate of the bagging action.

[0009] Furthermore, the YOLOv5-based method for identifying and locating trellis-type grape bagging specifically includes the following steps:

[0010] Step S01, constructing a trellis grape image dataset;

[0011] Step S02: Based on the data set in step S01, a feature map with rich semantic information is constructed through a spatial attention mechanism and a channel attention mechanism, and the feature map is input into an image feature intelligent recognition model for training to obtain an image feature intelligent recognition target detection network model;

[0012] Step S03: based on the training result of the target detection network model in step S02, the YOLOv5 detection algorithm is used to realize the recognition of grapes and obtain the image pixel position information of the grapes;

[0013] Step S04, calculating the three-dimensional coordinates of the grapes based on the depth information and pixel position information of the depth camera;

[0014] Step S05, based on S04, determine the movement path of the bagging mechanism, plan the movement of the bagging mechanism, and move the three-axis platform to achieve grape bagging.

[0015] Furthermore, constructing the trellis grape image dataset in S01 specifically includes the following steps:

[0016] Step S11, using a timer shooting device placed on a multifunctional traveling vehicle to collect data, taking pictures of grape images in a natural environment at different time periods, different lighting angles, and different viewing angles;

[0017] Step S12, pre-processing the collected data by methods such as rotation, cropping, contrast adjustment, Gaussian blur, affine transformation, mirror flipping, and raining processing to form a grape training data set in a complex dynamic environment, and then enhancing and augmenting the data to improve robustness;

[0018] Step S13: labeling the collected trellis grape photos.

[0019] Furthermore, obtaining the image feature intelligent recognition target detection network model in step S02 includes the following steps:

[0020] Step S21, taking the data set as input, using a convolutional layer of size 3×3 to enrich the channel information of the input image, and obtaining an output feature map;

[0021] Step S22, setting the grape feature image in the first part of the intelligent recognition model, adding the CBAM attention mechanism to the backbone network structure of the YOLOv5 model;

[0022] Step S23: setting the second part of the grape feature image intelligent recognition model to introduce a depthwise separable convolution into the intelligent recognition Neck network.

[0023] Step S24: input the feature map in step S21 into the Neck module, and use a bidirectional feature pyramid network in the Neck module to replace the original path aggregation network for multi-feature fusion; then sample the feature map and input it into the Detect layer of the Head module;

[0024] Step S25: Use the verification set in step S01 to verify the existing model to obtain the YOLOv5 target detection network model.

[0025] Furthermore, the acquisition of grape image pixel position information / calculation of grape three-dimensional coordinates in step S03 / S04 includes the following steps:

[0026] Step S31: firstly, according to step S02, a highly robust model is established to detect the grape target and obtain the center coordinates of the target image;

[0027] Step S32, mapping the image three-dimensional coordinate information by fusing the depth information of the depth camera image with the image coordinate information, and constructing a three-dimensional point cloud model based on multi-scale grape fruit biological visual characteristics;

[0028] Further, based on the step S05, the movement path of the bagging mechanism is determined.

[0029] Step S33, using the working range of the actuator as a threshold, filtering the detection targets that are greater than the threshold, screening the executable detection targets, and avoiding the working range of the actuator at the end of the bagging from failing to cover the entire visual image mapping range;

[0030] Step S34: According to the growth posture of the grapes, the principal component analysis method is used to fit the minimum external cuboid of the grapes, and the coordinates of each vertex on the top surface of the cuboid are calculated. Then, the coordinates of the center point of the top surface of the cuboid are obtained by the average value of the vertices, and this point is used as the execution point of the grape bagging mechanism.

[0031] Furthermore, the operation of the grape bagging mechanism at the tie-mouth execution point in step S34 specifically includes the following:

[0032] First, the principal component analysis method is used to screen out the three main directions of the grape 3D point cloud, namely the x, y, and z directions, and the covariance matrix of the 3D graphics center and covariance is calculated; specifically:

[0033]

[0034] Where P C represents the center coordinates of the 3D point cloud; n represents the number of 3D point clouds; (x i ,y i , z i ) represents the three-dimensional coordinates of the i-th point;

[0035] Where C p Represents the covariance matrix of the three-dimensional point cloud;

[0036] Then, the covariance matrix is ​​subjected to singular value decomposition to obtain eigenvalues ​​and eigenvectors. The specific formula is:

[0037] Where U p Denotes the covariance matrix C P C P T The eigenvector matrix of C P C P T The diagonal matrix of the square roots of the non-zero eigenvalues ​​of ; Represents a C P C P T The eigenvector matrix of

[0038] The direction of the eigenvector corresponding to the maximum eigenvalue is the main axis direction of the cuboid. Project the coordinate point onto the direction vector and calculate the position coordinates P of each vertex. i The inner product with the unit vector of the coordinate point is used to obtain the maximum and minimum values ​​in each direction. Let a, b, and c decibels be the average of the maximum and minimum values ​​on x, y, and z, and the center point o and length L of the cuboid are obtained to generate a cuboid with the most suitable bagging position for grape bagging and the upper end face of the optimal bagging tie mouth.

[0039] Furthermore, the specific calculation operations of the grape bagging position and bagging opening are as follows:

[0040] The specific formula is:

[0041]

[0042] 0 = ax + by + cz;

[0043]

[0044] In the formula, X is the unit vector of the coordinate point in the x direction; Y is the unit vector of the coordinate point in the y direction; Z is the unit vector of the coordinate point in the z direction; Lx, Ly, and Lz are the lengths of the cuboid in the x direction, y direction, and z direction respectively;

[0045] By determining the coordinates of the four smallest points in the y direction of the cuboid, the coordinates are taken as the coordinates of the four vertices of the bottom surface of the cuboid;

[0046] The coordinates of the center point of the bottom surface of the cuboid and the coordinates of the center point of the top surface, namely the bagging point and the tie point, are obtained by taking the average value of the coordinates of the four vertices.

[0047] Compared with the prior art, the present invention has the following beneficial effects:

[0048] The present invention combines the characteristics of trellis grape planting, collects data through an automated method, and then performs specific image enhancement processing on the collected data to enhance the network's generalization ability to the environment. Dynamic target detection is performed through the convolutional network of YOLOv5, which enhances the accuracy of identifying grape targets and the response speed. By comparing with the same type of detection network, the model is lightweight, and faster and more accurate dynamic detection is achieved, and the bagging mechanism is cooperated to perform target operations. The present invention realizes accurate target positioning through the fusion of depth information and image information, determines the feasibility of the bagging path and bagging action through the calculation space volume method, and estimates and analyzes the bagging points and the tie points of the bagging action to improve the success rate of the bagging action.

[0049] The present invention mainly detects grape targets in dynamic environments based on YOLOv5, constructs a three-dimensional model of the grape surface to collect the spatial posture of the grapes and feeds back its three-dimensional coordinate value data to guide the movement of the bagging mechanism. It can achieve accurate and efficient positioning of the detection target, thereby breaking through the bottleneck problem of high-automation trellis grape automatic bagging technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 It is a schematic diagram of the method steps of the present invention;

[0051] Figure 2 It is a schematic diagram of a data set of the present invention;

[0052] Figure 3 This is a schematic diagram of the model training of the present invention;

[0053] Figure 4 A coordinate information acquisition diagram for the present invention;

[0054] Figure 5 It is a schematic diagram of the comparison process of ordinary convolution and depth-wise separable convolution of the present invention;

[0055] Figure 6 This is a comparison diagram of the effects of the present invention and the prior art method;

[0056] Figure 7 It is a working schematic diagram of the present invention. DETAILED DESCRIPTION

[0057] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0058] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected or indirectly connected through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0059] In the description of the present invention, it should be understood that the terms "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside" and "outside" etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.

[0060] like Figure 1-7 As shown, a YOLOv5-based identification and positioning method for trellis-type grape bagging is characterized in that: the identification and positioning method performs grape target detection in a dynamic environment based on YOLOv5, constructs a three-dimensional model of the grape surface to collect the spatial posture of the grape and feeds back its three-dimensional coordinate value data to guide the movement of the bagging mechanism;

[0061] The target is accurately positioned through the fusion of depth information and image information. The feasibility of the bagging path and bagging action is determined by calculating the spatial volume method. The bagging point and the constriction point of the bagging action are estimated and analyzed to improve the success rate of the bagging action.

[0062] The specific steps include:

[0063] Step S01, constructing a trellis grape image dataset;

[0064] The step of constructing the trellis grape image dataset in S01 specifically includes the following steps:

[0065] Step S11, using a timer shooting device placed on a multifunctional traveling vehicle to collect data, taking pictures of grape images in a natural environment at different time periods, different lighting angles, and different viewing angles;

[0066] Step S12, pre-processing the collected data by methods such as rotation, cropping, contrast adjustment, Gaussian blur, affine transformation, mirror flipping, and raining processing to form a grape training data set in a complex dynamic environment, and then enhancing and augmenting the data to improve robustness;

[0067] Step S13: labeling the collected trellis grape photos.

[0068] Step S02: Based on the data set in step S01, a feature map with rich semantic information is constructed through a spatial attention mechanism and a channel attention mechanism, and the feature map is input into an image feature intelligent recognition model for training to obtain an image feature intelligent recognition target detection network model;

[0069] The step S02 of obtaining the image feature intelligent recognition target detection network model includes the following steps:

[0070] Step S21, taking the data set as input, using a convolutional layer of size 3×3 to enrich the channel information of the input image, and obtaining an output feature map;

[0071] Step S22, setting the grape feature image in the first part of the intelligent recognition model, adding the CBAM attention mechanism to the backbone network structure of the YOLOv5 model;

[0072] Step S23: setting the second part of the grape feature image intelligent recognition model to introduce a depthwise separable convolution into the intelligent recognition Neck network.

[0073] Step S24: input the feature map in step S21 into the Neck module, and use a bidirectional feature pyramid network in the Neck module to replace the original path aggregation network for multi-feature fusion; then sample the feature map and input it into the Detect layer of the Head module;

[0074] Step S25: Use the verification set in step S01 to verify the existing model to obtain the YOLOv5 target detection network model.

[0075] Step S03: based on the training result of the target detection network model in step S02, the YOLOv5 detection algorithm is used to realize the recognition of grapes and obtain the image pixel position information of the grapes;

[0076] Step S04, calculating the three-dimensional coordinates of the grapes based on the depth information and pixel position information of the depth camera;

[0077] The step S03 / S04 of obtaining the image pixel position information of the grapes / calculating the three-dimensional coordinates of the grapes comprises the following steps:

[0078] Step S31: First, according to step S02, a highly robust model is established to detect the grape target, and the center coordinates of the target image are obtained, specifically:

[0079] Where {x, y} represents the coordinates of the center point of the ideal target image, {x 1 ,y 1} is the image coordinate of the upper left corner of the detection box, {x 2 ,y2} is the image coordinate of the lower right corner of the detection box.

[0080] Step S32, by fusing the depth information of the depth camera image with the image coordinate information, mapping the image three-dimensional coordinate information, and constructing a three-dimensional point cloud model based on multi-scale grape fruit biological visual characteristics; specifically:

[0081]

[0082] In the formula Represents the three-dimensional space coordinates of the target; represents the image coordinates, D represents the depth value, and f x 、f y Indicates the focal length of the camera.

[0083] Step S05, based on S04, determine the movement path of the bagging mechanism, plan the movement of the bagging mechanism, and move the three-axis platform to achieve grape bagging.

[0084] Based on the step S05, the movement path of the bagging mechanism is determined.

[0085] Step S33, using the working range of the actuator as a threshold, filtering the detection targets that are greater than the threshold, screening the executable detection targets, and avoiding the working range of the actuator at the end of the bagging from failing to cover the entire visual image mapping range;

[0086] Step S34: According to the growth posture of the grapes, the principal component analysis method is used to fit the minimum external cuboid of the grapes, and the coordinates of each vertex on the top surface of the cuboid are calculated. Then, the coordinates of the center point of the top surface of the cuboid are obtained by the average value of the vertices, and this point is used as the execution point of the grape bagging mechanism.

[0087] The operation of the grape bagging mechanism at the tie-end execution point in step S34 specifically includes the following:

[0088] First, the principal component analysis method is used to screen out the three main directions of the grape 3D point cloud, namely the x, y, and z directions, and the covariance matrix of the 3D graphics center and covariance is calculated; specifically:

[0089]

[0090] Where P C represents the center coordinates of the 3D point cloud; n represents the number of 3D point clouds; (x i ,y i , z i ) represents the three-dimensional coordinates of the i-th point;

[0091] Where C p Represents the covariance matrix of the three-dimensional point cloud;

[0092] Then, the covariance matrix is ​​subjected to singular value decomposition to obtain eigenvalues ​​and eigenvectors. The specific formula is:

[0093] Where U p Denotes the covariance matrix C P C P T The eigenvector matrix of C P C P T The diagonal matrix of the square roots of the non-zero eigenvalues ​​of ; Represents a C P C P T The eigenvector matrix of

[0094] The direction of the eigenvector corresponding to the maximum eigenvalue is the main axis direction of the cuboid. Project the coordinate point onto the direction vector and calculate the position coordinates P of each vertex. i The inner product with the unit vector of the coordinate point is used to obtain the maximum and minimum values ​​in each direction. Let a, b, and c decibels be the average of the maximum and minimum values ​​on x, y, and z, and the center point o and length L of the cuboid are obtained to generate a cuboid with the most suitable bagging position for grape bagging and the upper end face of the optimal bagging tie mouth.

[0095] The specific calculation operation of the grape bagging position and bagging opening is as follows:

[0096] The specific formula is:

[0097]

[0098] 0 = ax + by + cz;

[0099]

[0100] In the formula, X is the unit vector of the coordinate point in the x direction; Y is the unit vector of the coordinate point in the y direction; Z is the unit vector of the coordinate point in the z direction; Lx, Ly, and Lz are the lengths of the cuboid in the x direction, y direction, and z direction respectively;

[0101] By determining the coordinates of the four smallest points in the y direction of the cuboid, the coordinates are taken as the coordinates of the four vertices of the bottom surface of the cuboid;

[0102] The coordinates of the center point of the bottom surface of the cuboid and the coordinates of the center point of the top surface, namely the bagging point and the tie point, are obtained by taking the average value of the coordinates of the four vertices.

[0103] The above-mentioned target detection network model is constructed through YOLOv5, and an efficient algorithm is integrated with computer vision technology and deep information image processing technology to determine the bagging target, analyze the target spatial posture, obtain the three-dimensional coordinates of the target grapes, and estimate and analyze the bagging points and the binding points of the bagging action. The movement of the bagging mechanism is guided, the success rate of the bagging action is improved, and the intelligent recognition of the trellis grape bagging image is realized.

[0104] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

[0105] In addition, it should be understood that although the present 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 embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. A method for identifying and locating trellis-type grape bagging based on YOLOv5, characterized in that: The recognition and positioning method detects grape targets in a dynamic environment based on YOLOv5, constructs a three-dimensional model of the grape surface to collect the spatial posture of the grapes and feeds back its three-dimensional coordinate value data to guide the movement of the bagging mechanism. The target is accurately positioned through the fusion of depth information and image information. The feasibility of the bagging path and bagging action is determined by calculating the spatial volume method. The bagging point and the constriction point of the bagging action are estimated and analyzed to improve the success rate of the bagging action.

2. The YOLOv5-based method for identifying and locating trellis-type grape bags according to claim 1, characterized in that: The specific steps include: Step S01, constructing a trellis grape image dataset; Step S02: Based on the data set in step S01, a feature map with rich semantic information is constructed through a spatial attention mechanism and a channel attention mechanism, and the feature map is input into an image feature intelligent recognition model for training to obtain an image feature intelligent recognition target detection network model; Step S03: based on the training result of the target detection network model in step S02, the YOLOv5 detection algorithm is used to realize the recognition of grapes and obtain the image pixel position information of the grapes; Step S04, calculating the three-dimensional coordinates of the grapes based on the depth information and pixel position information of the depth camera; Step S05, based on S04, determine the movement path of the bagging mechanism, plan the movement of the bagging mechanism, and move the three-axis platform to achieve grape bagging.

3. The YOLOv5-based identification and positioning method for trellis-type grape bagging according to claim 2 is characterized in that: The construction of the trellis grape image dataset in S01 specifically includes the following steps: Step S11, using a timer shooting device placed on a multifunctional traveling vehicle to collect data, taking pictures of grape images in a natural environment at different time periods, different lighting angles, and different viewing angles; Step S12, pre-processing the collected data by rotating, cropping, contrast adjustment, Gaussian blur, affine transformation, mirror flipping, and raining processing methods to form a grape training data set in a complex dynamic environment, and then enhancing and augmenting the data to improve robustness; Step S13: labeling the collected trellis grape photos.

4. The YOLOv5-based identification and positioning method for trellis-type grape bagging according to claim 3 is characterized in that: The step S02 of obtaining the image feature intelligent recognition target detection network model includes the following steps: Step S21, taking the data set as input, using the convolution layer to enrich the channel information of the input image, and obtaining the output feature map; Step S22, setting the grape feature image in the first part of the intelligent recognition model, adding the CBAM attention mechanism to the backbone network structure of the YOLOv5 model; Step S23, setting in the second part of the grape feature image intelligent recognition model, introducing a deep separable convolution into the intelligent recognition Neck network; Step S24: input the feature map in step S21 into the Neck module, and use a bidirectional feature pyramid network in the Neck module to replace the original path aggregation network for multi-feature fusion; then sample the feature map and input it into the Detect layer of the Head module; Step S25: Use the verification set in step S01 to verify the existing model to obtain the YOLOv5 target detection network model.

5. The YOLOv5-based method for identifying and locating trellis-type grape bags according to claim 4, characterized in that: The step S03 / S04 of obtaining the image pixel position information of the grapes / calculating the three-dimensional coordinates of the grapes comprises the following steps: Step S31: firstly, according to step S02, a highly robust model is established to detect the grape target and obtain the center coordinates of the target image; Step S32: fusing the depth information of the depth camera image with the image coordinate information, mapping the image three-dimensional coordinate information, and constructing a three-dimensional point cloud model based on multi-scale grape fruit biological visual characteristics.

6. The YOLOv5-based identification and positioning method for trellis-type grape bagging according to claim 5, characterized in that: Based on the step S05, the movement path of the bagging mechanism is determined. Step S33, using the working range of the actuator as a threshold, filtering the detection targets that are greater than the threshold, screening the executable detection targets, and avoiding the working range of the actuator at the end of the bagging from failing to cover the entire visual image mapping range; Step S34: According to the growth posture of the grapes, the principal component analysis method is used to fit the minimum circumscribed cuboid of the grapes, and the coordinates of each vertex on the top surface of the cuboid are calculated. Then, the coordinates of the center point of the top surface of the cuboid are obtained by the average value of the vertices, and this point is used as the execution point of the grape bagging mechanism.

7. The YOLOv5-based identification and positioning method for trellis-type grape bagging according to claim 6 is characterized in that: The operation of the grape bagging mechanism at the tie-end execution point in step S34 specifically includes the following: Firstly, the principal component analysis method is used to screen out the three main directions of the grape three-dimensional point cloud, namely the x, y, and z directions, and the covariance and center of the three-dimensional figure are calculated to obtain the covariance matrix. The covariance matrix is ​​subjected to singular value decomposition to obtain the eigenvalues ​​and eigenvectors. The direction of the eigenvector corresponding to the maximum eigenvalue is the main axis direction of the cuboid. Project the coordinate point onto the direction vector and calculate the position coordinates P of each vertex. i The inner product with the unit vector of the coordinate point is used to obtain the maximum and minimum values ​​in each direction, the center point and length of the cuboid are obtained, and a cuboid with the most suitable bagging position for grape bagging and the upper end face of the optimal bagging tie mouth is generated.

8. The YOLOv5-based method for identifying and locating trellis-type grape bags according to claim 7, characterized in that: The grape bagging position and bagging opening specifically include the following contents: By determining the coordinates of the four smallest points in the y direction of the cuboid, the coordinates are taken as the coordinates of the four vertices of the bottom surface of the cuboid; The coordinates of the center point of the bottom surface of the cuboid and the coordinates of the center point of the top surface, namely the bagging point and the tie point, are obtained by taking the average value of the coordinates of the four vertices.

Citation Information

Patent Citations

  • Method and device for synchronously identifying and positioning grapes and picking points thereof based on deep learning

    CN114494441A

  • Grape identification method in non-structural environment based on improved YOLOv4

    CN115050021A