A method and device for detecting picking points of tomatoes on a bunch
By presetting the Y-shaped feature area and key point detection model, combined with color RGB and depth images, the 3D coordinates of the bunch tomato picking points are calculated, which solves the problems of high computing power and background interference in the existing technology, and improves the identification of picking points. Accuracy and harvesting efficiency.
Patent Information
- Application Number
- CN202311821103.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2043-12-27
AI Technical Summary
The existing technology requires high computing power in bunch tomato picking and the recognition effect is greatly affected by the fruit leaves and fruit stems in the image background, making it difficult to guarantee the recognition accuracy.
Using the preset Y-shaped feature area detection model and the preset key point detection model, the 3D coordinates of the picking points of the bunch tomatoes are detected through the color RGB image and depth image for visual guidance of picking.
It improves the identification accuracy of bunch tomato picking points and improves the efficiency of mechanical automatic bunch harvesting.
Smart Images

Figure CN117975441B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of agricultural picking methods, and in particular to a method and device for detecting picking points of bunch tomatoes. Background Art
[0002] As the level of social science and technology continues to improve, agricultural production is gradually developing in the direction of mechanization, automation, and intelligence. The picking of bunched tomatoes has always relied on manual harvesting, which requires personnel to use scissors to cut and harvest the tomatoes one by one in the greenhouse. The greenhouse environment is humid and hot, and the picking work consumes a lot of manpower and progresses slowly, which affects the harvest progress and subsequent development. Therefore, machines are gradually being used to replace manual picking, thereby effectively reducing labor costs and increasing fruit and vegetable profits.
[0003] At present, the method of using machines to replace manual picking of bunched tomatoes is to use the system to obtain the whole bunch of tomatoes through detection means, then segment the fruit stalks through semantic segmentation, and finally cluster the segmented fruit stalk pixels to obtain the cutting point, and complete the picking of the bunched tomatoes based on the cutting point.
[0004] However, the above picking method has high requirements on computing power and the recognition effect is greatly affected by the fruit leaves and fruit stems in the image background, which makes it difficult to ensure the recognition accuracy. Summary of the invention
[0005] In view of the above problems, the present invention provides a method and device for detecting a picking point of a bunch of tomatoes, the main purpose of which is to improve the recognition accuracy of the picking point of the bunch of tomatoes.
[0006] In order to solve the above technical problems, the present invention proposes the following solutions:
[0007] In a first aspect, the invention provides a method for detecting a picking point of a bunch of tomatoes, the method comprising:
[0008] Acquire a target picking image; wherein the target picking image includes a color RGB image and a corresponding depth image, and the target picking image includes at least one bunch of tomatoes to be picked;
[0009] Based on the color RGB image, a preset Y-shaped feature region detection model is used to obtain the coordinates of the bounding box of the Y-shaped feature region; wherein the Y-shaped feature region refers to a region that takes the intersection of the platycodon trunk and the main vine of the tomato bunch, the upper part of the platycodon trunk of the tomato bunch, and the two tomatoes on the left and right at the top as dominant features; the preset Y-shaped feature region detection model at least includes a backbone network, a classification head, and a regression head;
[0010] Based on the color RGB image and the bounding box coordinates of the Y-shaped feature area, the image coordinates of the picking point of the bunch of tomatoes in the Y-shaped feature area are obtained using a preset key point detection model; wherein the preset key point detection model includes at least a backbone network, a main node detector, a secondary node detector and a cutting point detector;
[0011] Based on the image coordinates of the picking point and the depth image, the 3D coordinates of the picking point are calculated for visually guided picking.
[0012] In a second aspect, the present invention provides a device for detecting a picking point of tomatoes on a bunch, comprising:
[0013] An acquisition unit, configured to acquire a target picking image; wherein the target picking image includes a color RGB image and a corresponding depth image, and the target picking image includes at least one bunch of tomatoes to be picked;
[0014] A first detection unit is used to obtain the coordinates of a bounding box of a Y-shaped feature region based on the color RGB image using a preset Y-shaped feature region detection model; wherein the Y-shaped feature region refers to a region that uses the intersection of the platycodon trunk and the main vine of the tomato bunch, the upper part of the platycodon trunk of the tomato bunch, and the two tomatoes on the left and right at the top as dominant features; the preset Y-shaped feature region detection model at least includes a backbone network, a classification head, and a regression head;
[0015] A second detection unit is used to obtain the image coordinates of the picking point of the bunch of tomatoes in the Y-shaped feature area by using a preset key point detection model based on the color RGB image and the bounding box coordinates of the Y-shaped feature area; wherein the preset key point detection model includes at least a backbone network, a main node detector, a secondary node detector and a cutting point detector;
[0016] A calculation unit is used to calculate the 3D coordinates of the picking point based on the image coordinates of the picking point and the depth image, so as to guide picking with vision.
[0017] In order to achieve the above-mentioned purpose, according to a third aspect of the present invention, a storage medium is provided, wherein the storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the method for detecting picking points of tomatoes on a bunch according to the first aspect.
[0018] In order to achieve the above-mentioned purpose, according to a fourth aspect of the present invention, there is provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, all or part of the steps of the device for detecting picking points of tomatoes on a bunch as described in the second aspect are implemented.
[0019] By means of the above technical scheme, the present invention provides a method and device for detecting the picking point of tomato bunches. The method and device are because the current picking method has high requirements on computing power and the recognition effect is greatly affected by the fruit leaves and fruit stems in the image background, which makes it difficult to ensure the recognition accuracy. To this end, the present invention first detects the custom Y-shaped feature area and the bounding box coordinates of the Y-shaped feature area from the color RGB image of the tomato bunches to be picked by using a preset Y-shaped feature area detection model, wherein the custom Y-shaped feature area refers to the area with the intersection of the platycodon trunk and the main vine of the tomato bunches, the upper part of the platycodon trunk of the tomato bunches, and the two tomatoes on the left and right at the top as dominant features; then the picking point of the tomato bunches is detected from the Y-shaped feature area by using a preset key point detection model, and the image coordinates of the picking point are obtained according to the Y-shaped feature area bounding box coordinates and the color RGB image. Finally, based on the image coordinates of the picking point and the depth image of the tomato bunches to be picked, the 3D coordinates of the picking point are calculated for visually guided picking. The present invention can improve the recognition accuracy of the picking points of bunch tomatoes, and improve the recognition accuracy of the picking points of bunch tomatoes, thereby improving the efficiency of mechanical automatic bunch harvesting.
[0020] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0022] Figure 1 A flow chart of a method for detecting picking points of tomatoes on a bunch provided by an embodiment of the present invention is shown;
[0023] Figure 2 A flow chart of another method for detecting picking points of tomatoes on a vine provided by an embodiment of the present invention is shown;
[0024] Figure 3 A block diagram showing a component of a tomato picking point detection device provided by an embodiment of the present invention;
[0025] Figure 4 A block diagram showing another device for detecting picking points of tomatoes on a bunch provided by an embodiment of the present invention is shown;
[0026] Figure 5A schematic diagram showing the structure of a preset Y-shaped feature region detection model provided by an embodiment of the present invention is shown;
[0027] Figure 6 A schematic diagram of a Y-shaped characteristic region provided by an embodiment of the present invention is shown;
[0028] Figure 7 A schematic diagram of the structure of a preset key point detection model provided by an embodiment of the present invention is shown; DETAILED DESCRIPTION
[0029] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0030] The current picking method requires high computing power and the recognition effect is greatly affected by the fruit leaves and fruit stems in the image background, making it difficult to ensure recognition accuracy. To address this problem, the inventors came up with the idea of using a preset Y-shaped feature area detection model, a preset key point detection model, and a custom Y-shaped feature area to obtain the 3D coordinates of the picking points of the tomato bunches to be picked for visual guidance.
[0031] To this end, an embodiment of the present invention provides a method for detecting a picking point of a bunch of tomatoes, by which the recognition accuracy of the picking point of a bunch of tomatoes can be improved. The specific execution steps are as follows: Figure 1 As shown, including:
[0032] 101. Obtain a target picking image.
[0033] The target picking image includes a color RGB image and a corresponding depth image, and the target picking image includes at least one bunch of tomatoes to be picked; the depth image and the color RGB image are two images simultaneously acquired by an RGBD camera, the depth image pixels correspond to the RGB image pixels one-to-one, and the pixel values of the depth image can reflect the target depth information in the actual image.
[0034] In the actual application scenario, during the picking process of bunched tomatoes, the movement of the camera-fixed chassis or the movement of the camera-fixed mechanical arm is used to assist the visual module in acquiring the target picking image. The visual module may include a depth camera, a binocular stereo camera, etc., and has the ability to simultaneously acquire RGB images and depth images; for example, the visual module selects a depth camera, and can simultaneously acquire a color RGB image and a single-channel depth image; the acquisition cycle can be set to acquire the target picking image. Each cycle acquires the target picking image, and the color RGB image is input into the preset Y-shaped feature area detection model.
[0035] It should be noted that: since not every frame of the image will contain the tomato bunch to be picked, if the tomato bunch to be picked cannot be detected by the preset Y-shaped feature area detection model, the visual module can be controlled by moving the camera fixed to the chassis or the camera fixed to the robotic arm to re-acquire the target picking image until the target picking image detects that it contains at least one tomato bunch to be picked.
[0036] 102. Based on the color RGB image, the coordinates of the Y-shaped feature area bounding box are obtained using a preset Y-shaped feature area detection model.
[0037] The Y-shaped feature area is a special definition for the picking scene of bunch tomatoes, which refers to the area with the intersection of the platycodon trunk and the main vine of the bunch tomatoes, the upper part of the platycodon trunk of the bunch tomatoes, and the two tomatoes on the left and right at the top as dominant features; it is named the Y-shaped feature area because the upper part of the platycodon trunk of the bunch tomatoes and the two tomatoes on the left and right at the top form a Y shape. This definition can improve the accuracy of picking point recognition, and a clearer feature definition can accelerate the model convergence speed to a certain extent.
[0038] The preset Y-shaped feature region detection model at least includes a backbone network, a classification head and a regression head; the backbone network is responsible for extracting features from the image and forming a high-dimensional feature map for subsequent functions. Currently, the more commonly used backbone network structures include VGG (Visual Geometry Group), ResNet (Residual Neural Network), RepVGG (Re-parameterization Visual Geometry Group), etc.; the classification head is responsible for classifying the features in the anchor frame output by the feature map to determine the target category and confidence; the regression head is responsible for regressing the position of the target bounding box, that is, the Y-shaped feature region bounding box coordinates. For example: the preset Y-shaped feature region detection model can be as follows Figure 5 The convolutional neural network detector shown.
[0039] 103. Based on the color RGB image and the bounding box coordinates of the Y-shaped feature area, the image coordinates of the picking points of the bunched tomatoes in the Y-shaped feature area are obtained using a preset key point detection model.
[0040] Among them, the picking point is the cutting point of the bunch of tomatoes, and the cutting point is the midpoint of the main node and the secondary node; the main node is the intersection of the main vine trunk and the main vine of the bunch of tomatoes; the secondary node is the intersection of the main vine trunk and the first tomato.
[0041] The preset key point detection model at least includes a backbone network, a main node detector, a sub-node detector and a cutting point detector. The backbone network is the same as the backbone network in the preset Y-shaped feature region detection model, which is responsible for extracting features in the image and forming a high-dimensional feature map for subsequent functions. The currently more commonly used backbone network structures include VGG (Visual Geometry Group), ResNet (Residual Neural Network), RepVGG (Re-parameterization Visual Geometry Group), etc. The main node detector, sub-node detector and cutting point detector respectively detect the main node, sub-node and cutting point of the bunch of tomatoes.
[0042] After obtaining the color RGB image from step 101 and the coordinates of the bounding box of the Y-shaped feature area from step 102, the backbone network of the preset key point detection model is used to extract features in the image to form a high-dimensional feature map, and then the positions of the main node and the sub-node are obtained based on the main node detector and the sub-node detector of the preset key point detection model. Then, the image coordinates of the cutting point of the bunched tomatoes in the Y-shaped feature area are obtained based on the positions of the main node and the sub-node through the cutting point detector of the preset key point detection model, which are the image coordinates of the picking point.
[0043] 104. Calculate the 3D coordinates of the picking point based on the image coordinates of the picking point and the depth image.
[0044] The 3D coordinates of the picking points are used for visually guided picking.
[0045] After obtaining the depth image from step 101 and the image coordinates of the picking point from step 103, the 3D coordinates of the picking point can be calculated based on the image coordinates of the picking point and the depth image using an imaging model. The imaging model can be a pinhole imaging model, which can calculate the horizontal and vertical coordinates of the pixel point in the world coordinate system according to the position, depth and focal length information of the pixel point, and can obtain the 3D coordinates by combining the depth image.
[0046] Based on the above Figure 1It can be seen from the implementation of the embodiment that the present invention provides a method for detecting the picking point of a bunch of tomatoes. The present invention first detects a custom Y-shaped feature area and the coordinates of the bounding box of the Y-shaped feature area from the color RGB image of the bunch of tomatoes to be picked by a preset Y-shaped feature area detection model, wherein the custom Y-shaped feature area refers to the area with the intersection of the platycodon trunk and the main vine of the bunch of tomatoes, the upper part of the platycodon trunk of the bunch of tomatoes, and the two tomatoes on the left and right at the top as dominant features; then the picking point of the bunch of tomatoes is detected from the Y-shaped feature area by a preset key point detection model, and the image coordinates of the picking point are obtained according to the bounding box coordinates of the Y-shaped feature area and the color RGB image. Finally, based on the image coordinates of the picking point and the depth image of the bunch of tomatoes to be picked, the 3D coordinates of the picking point are calculated for visually guided picking. The present invention can improve the recognition accuracy of the picking point of bunch tomatoes and improve the recognition accuracy of the picking point of bunch tomatoes, thereby improving the efficiency of mechanical automatic bunch harvesting.
[0047] In order to improve the detection speed, the detection steps of the two models are refined as Figure 1 The embodiment shown in the figure is refined and expanded. The embodiment of the present invention also provides another method for detecting the picking point of tomatoes on a bunch, such as Figure 2 As shown, the specific steps are as follows:
[0048] 201. Obtain a target picking image.
[0049] This step is combined with the description of step 101 in the above method, and the same contents are not repeated here.
[0050] 202. Based on the color RGB image, the coordinates of the Y-shaped feature region bounding box are obtained using a preset Y-shaped feature region detection model.
[0051] This step is combined with the description of step 102 in the above method, and the same contents are not repeated here.
[0052] Among them, the Y-shaped characteristic area is roughly as follows Figure 6 As shown, 1 is the main vine of the bunch tomatoes; 2 is a Y-shaped characteristic area, which includes an inverted Y-shape defined by five key points 3. The five key points of the Y-shape are the main node where the platycodon trunk 4 of the bunch tomatoes intersects with the main vine 1, the intersection of the first tomato and the platycodon trunk 4 of the bunch tomatoes, i.e., the secondary node, the shear point (i.e., the midpoint of the main node and the secondary node), the top left tomato node and the top right tomato node; 5 represents a single tomato in the bunch tomatoes.
[0053] After the color RGB image is obtained from step 201, the color RGB image is preprocessed using a preset image preprocessing method to obtain a preprocessed image. The preset image preprocessing method at least includes filtering image noise, brightness equalization and image scaling, and adjusting the brightness equalization can avoid overexposure or underexposure of local areas; based on the preprocessed image, the Y-shaped feature area corresponding to each bunch of tomatoes in the preprocessed image and the multiple bounding box coordinates corresponding to the Y-shaped feature area are detected using a preset Y-shaped feature area detection model; based on the multiple bounding box coordinates corresponding to the Y-shaped feature area, a target bounding box coordinate is screened out as the Y-shaped feature area bounding box coordinate using a non-maximum suppression method.
[0054] Specifically,
[0055] Step 1: using the classification head of the preset Y-shaped feature region detection model to obtain the confidence of each bounding box corresponding to the Y-shaped feature region;
[0056] Step 2: sorting each of the bounding boxes corresponding to the Y-shaped feature area from high to low according to the confidence, and recording the bounding box corresponding to the maximum confidence;
[0057] Step 3: Based on the bounding box corresponding to the maximum confidence and other remaining bounding boxes whose confidences are less than the maximum confidence, calculate the intersection-over-union ratio of each remaining bounding box to the bounding box corresponding to the maximum confidence;
[0058] Step 4: Delete the bounding boxes whose intersection-over-union ratio is greater than a preset threshold, and based on the remaining bounding boxes after deletion, repeat steps 2 and 3 until only one target bounding box remains, and determine the coordinates of the target packaging box as the coordinates of the Y-shaped feature area bounding box.
[0059] 203. Based on the color RGB image and the bounding box coordinates of the Y-shaped feature area, the image coordinates of the picking point of the bunched tomatoes in the Y-shaped feature area are obtained using a preset key point detection model.
[0060] This step is combined with the description of step 103 in the above method, and the same contents are not repeated here.
[0061] After obtaining the color RGB image from step 201 and the Y-type feature area bounding box coordinates from step 202, a Y-type feature area sub-image is cut out from the color RGB image based on the Y-type feature area bounding box coordinates. The Y-type feature area sub-image is scaled to a preset size to obtain a scaled Y-type feature area sub-image in order to adapt to the size required by the preset key point detection model. The preset size is set according to the required size of the input image of the preset key point detection model. Based on the scaled Y-type feature area sub-image, the preset key point detection model is used to obtain the position of the shearing point. Among them, the cutting point is the midpoint between the main node and the sub-node; the main node is the intersection of the platycodon trunk and the main vine of the bunch of tomatoes; the sub-node is the intersection of the platycodon trunk and the first tomato; the preset key point detection model includes at least a trunk network, a main node detector, a sub-node detector and a cutting point detector; based on the position of the cutting point in the scaled Y-type feature area sub-map, the scaling ratio and the position of the Y-type feature area sub-map in the color RGB image, the image coordinates of the cutting point in the color RGB image are obtained as the image coordinates of the picking point.
[0062] It should be noted that the preset key point detection model can also include a left tomato detector and a right tomato detector, such as Figure 7 As shown, this can further improve the detection accuracy of the main node and the secondary node, and can also further ensure that the shearing point is within the Y-shaped feature area.
[0063] Specifically, based on the scaled Y-shaped feature area subgraph, the preset key point detection model is used to obtain the positions of five key points; wherein the five key points are respectively a main node, a sub-node, a cutting point, a top left tomato node and a top right tomato node; based on the positions of the five key points in the Y-shaped feature area subgraph and the position of the Y-shaped feature area subgraph in the color RGB image, the image coordinates of the five key points in the color RGB image are obtained, and the image coordinates of the cutting point are determined as the image coordinates of the picking point.
[0064] 204. Perform regional expansion on the image coordinates of the picking point to obtain a picking point expansion region.
[0065] After the image coordinates of the picking point are obtained in step 203, a rectangular or square pixel area is expanded outward with the picking point as the center as the picking point expansion area. For example, a square pixel area of 20*20 pixels is expanded outward with the picking point as the center as the picking point expansion area.
[0066] 205. Based on the expansion area of the picking point and the depth image, calculate an average depth of the expansion area of the picking point as the picking point depth.
[0067] After obtaining the dilated area of the picking point from step 204 and the depth image from step 201, based on the dilated area of the picking point and the depth image, obtain the depth corresponding to the dilated area of the picking point in the depth image; record the depth that meets the preset recording requirement; wherein the preset recording requirement is that the depth is not empty or infinite; perform singular value elimination on the recorded depth to obtain the depth to be calculated, eliminating the interference of non-foreground depth in the dilated area; and calculate the average value of the depth to be calculated as the depth of the picking point.
[0068] 206. Based on the depth of the picking point, the 3D coordinates of the picking point are calculated using the camera imaging model.
[0069] The 3D coordinates of the picking points are used for visually guided picking.
[0070] After the depth of the picking point is obtained from step 205, the 3D coordinates of the shearing point are calculated according to the camera imaging model. The calculation formula is as follows:
[0071]
[0072]
[0073] The 3D coordinates of the picking point are (x, y, z), z is the depth of the picking point, x is the i and i are the x-coordinate and y-coordinate of the picking point in the camera imaging model coordinate system, respectively, x and f y are the focal lengths of the camera in the X-axis and Y-axis directions respectively.
[0074] It should be noted that: if the image contains multiple bunches of tomatoes, then the 3D coordinates of all picking points in the image are obtained in turn, and the robotic arm is used to complete visual guidance and bunch tomato picking. When there are no bunches of tomatoes to be picked in the target picking image, the next cycle is entered.
[0075] Based on the above Figure 2 It can be seen from the implementation method that the present invention provides a method for detecting the picking point of bunch tomatoes. The present invention obtains the picking shearing point of bunch tomatoes through two-level detection, namely, a preset Y-shaped feature area detection model and a preset key point detection model. The method is simple and effective and can be applied to visual recognition and visually guided picking of picking robots.
[0076] Furthermore, as a response to the above Figure 1 In order to realize the method shown in the figure, the embodiment of the present invention also provides a tomato picking point detection device for detecting the above-mentioned Figure 1The device embodiment corresponds to the aforementioned method embodiment. For ease of reading, this device embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment. Figure 3 As shown, the device comprises:
[0077] An acquisition unit 31 is used to acquire a target picking image; wherein the target picking image includes a color RGB image and a corresponding depth image, and the target picking image includes at least one bunch of tomatoes to be picked;
[0078] A first detection unit 32 is used to obtain the coordinates of the bounding box of the Y-shaped feature region by using a preset Y-shaped feature region detection model based on the color RGB image obtained from the acquisition unit 31; wherein the Y-shaped feature region refers to a region that uses the intersection of the platycodon trunk and the main vine of the bunch of tomatoes, the upper part of the platycodon trunk of the bunch of tomatoes, and the two tomatoes on the left and right at the top as dominant features; the preset Y-shaped feature region detection model at least includes a backbone network, a classification head, and a regression head;
[0079] A second detection unit 33 is configured to obtain the image coordinates of the picking point of the bunch of tomatoes in the Y-shaped feature area by using a preset key point detection model based on the color RGB image obtained from the acquisition unit 31 and the Y-shaped feature area bounding box coordinates obtained from the first detection unit 32; wherein the preset key point detection model includes at least a backbone network, a main node detector, a secondary node detector, and a cutting point detector;
[0080] The calculation unit 34 is used to calculate the 3D coordinates of the picking point based on the image coordinates of the picking point obtained from the second detection unit 33 and the depth image obtained from the acquisition unit 31, for visually guided picking.
[0081] Furthermore, as a response to the above Figure 2 In order to realize the method shown in the figure, the embodiment of the present invention also provides another tomato picking point detection device for detecting the above-mentioned Figure 2 The device embodiment corresponds to the aforementioned method embodiment. For ease of reading, this device embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment. Figure 4 As shown, the device comprises:
[0082] An acquisition unit 31 is used to acquire a target picking image; wherein the target picking image includes a color RGB image and a corresponding depth image, and the target picking image includes at least one bunch of tomatoes to be picked;
[0083] A first detection unit 32 is used to obtain the coordinates of the bounding box of the Y-shaped feature region by using a preset Y-shaped feature region detection model based on the color RGB image obtained from the acquisition unit 31; wherein the Y-shaped feature region refers to a region that uses the intersection of the platycodon trunk and the main vine of the bunch of tomatoes, the upper part of the platycodon trunk of the bunch of tomatoes, and the two tomatoes on the left and right at the top as dominant features; the preset Y-shaped feature region detection model at least includes a backbone network, a classification head, and a regression head;
[0084] A second detection unit 33 is configured to obtain the image coordinates of the picking point of the bunch of tomatoes in the Y-shaped feature area by using a preset key point detection model based on the color RGB image obtained from the acquisition unit 31 and the Y-shaped feature area bounding box coordinates obtained from the first detection unit 32; wherein the preset key point detection model includes at least a backbone network, a main node detector, a secondary node detector, and a cutting point detector;
[0085] The calculation unit 34 is used to calculate the 3D coordinates of the picking point based on the image coordinates of the picking point obtained from the second detection unit 33 and the depth image obtained from the acquisition unit 31, for visually guided picking.
[0086] Furthermore, the first detection unit 32 includes:
[0087] The preprocessing module 321 is used to preprocess the color RGB image using a preset image preprocessing rule to obtain a preprocessed image; wherein the preset image preprocessing rule at least includes filtering image noise, brightness equalization and image scaling;
[0088] A detection module 322 is configured to detect, based on the preprocessed image obtained from the preprocessing module 321, a Y-shaped feature region corresponding to each bunch of tomatoes in the preprocessed image and a plurality of bounding box coordinates corresponding to the Y-shaped feature region using the preset Y-shaped feature region detection model;
[0089] The screening module 323 is used to screen out a target bounding box coordinate as the bounding box coordinate of the Y-shaped feature area based on the multiple bounding box coordinates corresponding to the Y-shaped feature area obtained from the detection module 322 by using a non-maximum suppression method.
[0090] Furthermore, the screening module 323 includes:
[0091] An acquisition submodule 3231 is used to acquire the confidence of each of the bounding boxes corresponding to the Y-shaped feature region using the classification head of the preset Y-shaped feature region detection model;
[0092] A recording submodule 3232 is used to sort each of the bounding boxes corresponding to the Y-shaped feature area from high to low according to the confidence obtained from the acquisition submodule 3231, and record the bounding box corresponding to the maximum confidence;
[0093] A calculation submodule 3233 is used to calculate the intersection-and-union ratio of each remaining bounding box with the bounding box corresponding to the maximum confidence obtained from the recording submodule 3232 and other remaining bounding boxes whose confidences are less than the maximum confidence;
[0094] The determination submodule 3234 is used to delete the bounding boxes whose intersection-and-union ratio is greater than a preset threshold value obtained from the calculation submodule 3233, and based on the remaining bounding boxes after deletion, repeatedly execute the recording submodule 3232 and the calculation submodule 3233 until only one target bounding box is left, and determine the coordinates of the target packaging box as the coordinates of the Y-shaped feature area bounding box.
[0095] Furthermore, the second detection unit 33 includes:
[0096] A cropping module 331 is used to crop a Y-shaped feature region sub-image from the color RGB image based on the Y-shaped feature region bounding box coordinates;
[0097] A scaling module 332 is used to scale the Y-shaped feature region sub-image obtained from the cropping module 331 to a preset size to obtain a scaled Y-shaped feature region sub-image; wherein the preset size is set according to the required size of the input image of the preset key point detection model;
[0098] The detection module 333 is used to obtain the position of the shearing point by using the preset key point detection model based on the scaled Y-shaped feature region sub-graph obtained from the scaling module 332; wherein the shearing point is the midpoint between the main node and the secondary node; the main node is the intersection point where the main stem of the platycodon and the main vine of the bunch tomato intersect; and the secondary node is the intersection point of the main stem of the platycodon and the first tomato;
[0099] The acquisition module 334 is used to acquire the image coordinates of the cutting point in the color RGB image as the image coordinates of the picking point based on the position of the cutting point in the Y-type feature area sub-image obtained from the detection module 333 and the position of the Y-type feature area sub-image in the color RGB image.
[0100] Furthermore, the calculation unit 34 includes:
[0101] An expansion module 341 is used to perform regional expansion on the image coordinates of the picking point to obtain an expansion area of the picking point;
[0102] A first calculation module 342 is used to calculate an average depth of the expansion area of the picking point as the picking point depth based on the expansion area of the picking point obtained from the expansion module 341 and the depth image;
[0103] The second calculation module 343 is used to calculate the 3D coordinates of the picking point based on the picking point depth obtained from the first calculation module 342 using a camera imaging model.
[0104] Furthermore, the expansion module 341 is also used to expand a rectangular or square pixel area outward with the picking point as the center as the picking point expansion area;
[0105] Furthermore, the first calculation module 342 includes:
[0106] An acquisition submodule 3421 is used to acquire the depth corresponding to the expansion area of the picking point in the depth image based on the expansion area of the picking point and the depth image;
[0107] The recording submodule 3422 is used to record the depth obtained from the acquisition submodule 3421 that meets the preset recording requirement; wherein the preset recording requirement is that the depth is not empty or infinite;
[0108] The elimination submodule 3423 is used to eliminate singular values from the depth recorded by the recording submodule 3422 to obtain a depth to be calculated;
[0109] The calculation submodule 3424 is used to calculate the average value of the depths to be calculated obtained from the elimination submodule 3423 as the depth of the picking point.
[0110] Furthermore, an embodiment of the present invention further provides a processor, the processor is used to run a program, wherein the program executes the above Figure 1-2 The method for detecting the picking point of tomatoes on a bunch described in.
[0111] Furthermore, an embodiment of the present invention further provides a storage medium, wherein the storage medium is used to store a computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the above Figure 1-2 The method for detecting the picking point of tomatoes on a bunch described in.
[0112] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0113] It is understandable that the related features in the above methods and devices can be referenced to each other. In addition, the "first", "second" and the like in the above embodiments are used to distinguish the embodiments, but do not represent the advantages and disadvantages of the embodiments.
[0114] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0115] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific languages is for disclosing the best mode of the present invention.
[0116] In addition, the memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0117] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0118] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0119] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0120] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0121] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0122] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0123] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0124] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0125] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0126] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for detecting the picking point of tomatoes on a bunch, It is characterized in that The method comprises: Acquire a target picking image; wherein the target picking image includes a color RGB image and a corresponding depth image, and the target picking image includes at least one bunch of tomatoes to be picked; Based on the color RGB image, a preset Y-shaped feature region detection model is used to obtain the coordinates of the bounding box of the Y-shaped feature region; wherein the Y-shaped feature region refers to a region that uses the intersection of the platycodon trunk and the main vine of the tomato bunch, the upper part of the platycodon trunk of the tomato bunch, and the two tomatoes on the left and right at the top as dominant features; the preset Y-shaped feature region detection model includes at least a backbone network, a classification head, and a regression head; Based on the color RGB image and the bounding box coordinates of the Y-shaped feature area, the image coordinates of the picking point of the bunch of tomatoes in the Y-shaped feature area are obtained using a preset key point detection model; wherein the preset key point detection model includes at least a backbone network, a main node detector, a secondary node detector and a cutting point detector; Calculating the 3D coordinates of the picking point based on the image coordinates of the picking point and the depth image for visually guided picking; The method of obtaining the image coordinates of the picking point of the bunch of tomatoes in the Y-shaped feature area by using a preset key point detection model based on the color RGB image and the Y-shaped feature area bounding box coordinates includes: Based on the coordinates of the Y-shaped feature region bounding box, cutting out a Y-shaped feature region sub-image from the color RGB image; Scaling the Y-shaped feature region sub-image to a preset size to obtain a scaled Y-shaped feature region sub-image; wherein the preset size is set according to a required size of an input image of the preset key point detection model, and the preset key point detection model further includes a left tomato detector and a right tomato detector; Based on the scaled Y-shaped feature region subgraph, the preset key point detection model is used to obtain the position of the shearing point; wherein the shearing point is the midpoint between the main node and the secondary node; the main node is the intersection point where the main vine of the tomato bunch intersects with the main vine; the secondary node is the intersection point of the main vine of the tomato bunch and the first tomato; Based on the position of the cutting point in the Y-type feature region sub-image and the position of the Y-type feature region sub-image in the color RGB image, the image coordinates of the cutting point in the color RGB image are acquired as the image coordinates of the picking point.
2. The method according to claim 1, It is characterized in that The method of obtaining the coordinates of the bounding box of the Y-shaped feature area based on the color RGB image by using a preset Y-shaped feature area detection model includes: Preprocessing the color RGB image using a preset image preprocessing method to obtain a preprocessed image; wherein the preset image preprocessing method at least includes filtering image noise, brightness equalization and image scaling; Based on the preprocessed image, the preset Y-shaped feature region detection model is used to detect the Y-shaped feature region corresponding to each bunch of tomatoes in the preprocessed image and the multiple bounding box coordinates corresponding to the Y-shaped feature region; Based on the multiple bounding box coordinates corresponding to the Y-shaped feature area, a target bounding box coordinate is screened out using a non-maximum suppression method as the bounding box coordinates of the Y-shaped feature area.
3. The method according to claim 2, It is characterized in that The method of selecting a target bounding box coordinate as the bounding box coordinate of the Y-shaped feature region based on the multiple bounding box coordinates corresponding to the Y-shaped feature region by using a non-maximum suppression method includes: Step 1: using the classification head of the preset Y-shaped feature region detection model to obtain the confidence of each bounding box corresponding to the Y-shaped feature region; Step 2: sorting each of the bounding boxes corresponding to the Y-shaped feature area from high to low according to the confidence, and recording the bounding box corresponding to the maximum confidence; Step 3: Based on the bounding box corresponding to the maximum confidence and other remaining bounding boxes whose confidences are less than the maximum confidence, calculate the intersection-over-union ratio of each remaining bounding box to the bounding box corresponding to the maximum confidence; Step 4: Delete the bounding boxes whose intersection-over-union ratio is greater than a preset threshold, and repeat steps 2 and 3 based on the remaining bounding boxes after deletion until only one target bounding box remains, and determine the coordinates of the target bounding box as the coordinates of the Y-shaped feature area bounding box.
4. The method according to claim 1, It is characterized in that The calculating the 3D coordinates of the picking point based on the image coordinates of the picking point and the depth image includes: Performing regional expansion on the image coordinates of the picking point to obtain an expansion region of the picking point; Based on the expansion area of the picking point and the depth image, calculating an average depth of the expansion area of the picking point as the picking point depth; Based on the depth of the picking point, the 3D coordinates of the picking point are calculated using a camera imaging model.
5. The method according to claim 4, It is characterized in that The step of performing regional expansion on the image coordinates of the picking point to obtain the expanded region of the picking point includes: Taking the picking point as the center, a rectangular or square pixel area is expanded outward as the picking point expansion area.
6. The method according to claim 5, It is characterized in that The step of calculating the average depth of the expansion area of the picking point as the picking point depth based on the expansion area of the picking point and the depth image includes: Based on the picking point expansion area and the depth image, acquiring a depth corresponding to the picking point expansion area in the depth image; Recording a depth that meets a preset recording requirement; wherein the preset recording requirement is that the depth is not empty or infinite; Eliminate singular values of the recorded depth to obtain a depth to be calculated; The average value of the depths to be calculated is calculated as the depth of the picking point.
7. A device for detecting the picking point of tomatoes on a bunch, It is characterized in that include: An acquisition unit, configured to acquire a target picking image; wherein the target picking image includes a color RGB image and a corresponding depth image, and the target picking image includes at least one bunch of tomatoes to be picked; A first detection unit is used to obtain the coordinates of a bounding box of a Y-shaped feature region based on the color RGB image using a preset Y-shaped feature region detection model; wherein the Y-shaped feature region refers to a region that uses the intersection of the platycodon trunk and the main vine of the tomato bunch, the upper part of the platycodon trunk of the tomato bunch, and the two tomatoes on the left and right at the top as dominant features; the preset Y-shaped feature region detection model at least includes a backbone network, a classification head, and a regression head; A second detection unit is used to obtain the image coordinates of the picking point of the bunch of tomatoes in the Y-shaped feature area by using a preset key point detection model based on the color RGB image and the bounding box coordinates of the Y-shaped feature area; wherein the preset key point detection model includes at least a backbone network, a main node detector, a secondary node detector and a cutting point detector; A calculation unit, for calculating the 3D coordinates of the picking point based on the image coordinates of the picking point and the depth image, for visually guided picking; The second detection unit comprises: A cropping module, used for cropping a Y-shaped feature region sub-image from the color RGB image based on the Y-shaped feature region bounding box coordinates; A scaling module, used for scaling the Y-shaped feature region sub-image obtained from the cropping module to a preset size to obtain a scaled Y-shaped feature region sub-image; wherein the preset size is set according to a required size of an input image of the preset key point detection model, and the preset key point detection model further includes a left tomato detector and a right tomato detector; A detection module, configured to obtain the position of a shearing point using the preset key point detection model based on the scaled Y-shaped feature region subgraph obtained from the scaling module; wherein the shearing point is the midpoint between a primary node and a secondary node; the primary node is the intersection point where the main stem of the platycodon and the main vine of the bunch tomato intersect; and the secondary node is the intersection point of the main stem of the platycodon and the first tomato; An acquisition module is used to acquire the image coordinates of the cutting point in the color RGB image as the image coordinates of the picking point based on the position of the cutting point in the Y-shaped feature area sub-image obtained from the detection module and the position of the Y-shaped feature area sub-image in the color RGB image.
8. A storage medium comprising a stored program, It is characterized in that When the program is running, the device where the storage medium is located is controlled to execute the method for detecting the picking point of tomatoes on a bunch as described in any one of claims 1 to 6.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the method for detecting the picking point of tomatoes on a bunch as claimed in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Fruit tree fruiting branch shearing point positioning method for picking based on deep convolutional neural network
CN112115885A
Intelligent agricultural fruit picking identification and positioning method, system and device
CN114431005A
Pickup pose information determination method, device and equipment and computer readable medium
CN114638846A
Tea bud picking point positioning method and device based on machine vision and picking system
CN115082815A
Target detection method based on multi-modal data fusion and in-vivo fruit picking method based on target detection model
CN115376125A
