A method for detecting seeding of air-suction seeder based on machine vision
Using machine vision technology to detect the missed sowing rate of air-suction seeders, using cameras to obtain pictures and perform image processing, this solves the problems of low detection accuracy and frequent misjudgments of missed sowing rates in the existing technology, achieving high accuracy and intuitiveness sexual test results.
Patent Information
- Application Number
- CN202010869573.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-28
- Publication Date
- 2024-09-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing methods for detecting the missed seeding rate of air-suction seeders have low accuracy, are easily affected by the environment, have frequent misjudgments, and are not intuitive.
Using a detection method based on machine vision, a camera is installed to obtain pictures of the seeder's suction holes and process troughs, the sampling point set is calibrated, the appearance of new suction holes is judged based on the gray value distribution, and cropping, histogram equalization and adaptive thresholding are performed Operation to calculate the missed broadcast rate.
The accuracy and intuitiveness of the detection results are improved, misjudgments are reduced, and the reliability of the detection is enhanced.
Smart Images

Figure CN112102258B
Abstract
Description
Technical Field
[0001] The invention relates to a seeding inspection method for a seeder, in particular to a seeding inspection method for an air-suction seeder based on machine vision. Background Art
[0002] For air-suction seeders, the missed seeding rate is an important parameter, and how to detect seeding and calculate the missed seeding rate is an important proposition. At present, in existing air-suction seeder systems, eddy current, photoelectric, infrared and other sensors are usually used for missed seeding detection. The accuracy of this method is affected by the environment, which is prone to misjudgment, the accuracy of the detection results is low, and the intuitiveness is poor. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a method for detecting seeding of an air-suction seeder based on machine vision. The method is not easily affected by the environment, is not prone to misjudgment, has high accuracy of detection results, and is more intuitive.
[0004] In order to solve the above problems, the following technical solutions are provided:
[0005] The method for detecting the seeding of an air-suction seeder based on machine vision of the present invention is characterized in that it comprises the following steps:
[0006] Step 1: Install a camera on the seeder, which can obtain a picture that includes both the suction hole and the process tank of the seeder.
[0007] Step 2: calibrate the position of the process tank in the image and obtain the sampling point set {P i}, sampling point P i The x and y coordinates represent the pixel coordinates in the image.
[0008] Step 3, the seeder is working, the suction holes and process slots rotate with the seeding disc of the seeder, and according to the sampling point set {P i} to determine whether a new suction hole appears. When a new suction hole appears, it is recorded as a pulse. Specifically, the following steps are included:
[0009] Step 301, convert the image into a grayscale image I grey .
[0010] Step 302: each sampling point P i (x i ,y i ) can correspond to the grayscale image I grey The gray value G of a point in i , then we get the gray value set {G i}, where G i (x i ,y i )=Igrey (x=x i , y=y i ).
[0011] Step 303: Set the sampling point set {P i} is divided into a point set with low gray value in the process tank {P in} and the point set {P out},Right now
[0012] if G i ≤T tr P i ∈{P in}
[0013] if G i >T tr P i ∈{P out}
[0014] Among them, T tr It is a preset threshold to distinguish high and low gray values.
[0015] Step 304, initially set a pulse state S pulse = False and a hole state S empty = False, when {P in} has a number of points greater than λN P When S pulse = True, then when {P out} is greater than γN P When S pulse = False, and the pulse number N pusle Add one. If the suction hole is judged to be a hole at this time, the number of holes is N. empty Plus one, that is
[0016] St.S pulse = False, S empty = False, N pulse =0,N empty =0
[0017] if S pulse =False and N in >λN P
[0018] {S pulse =True
[0019] if S pulse =True and N out >γN P
[0020]
[0021] Among them, N in 、N out 、N P They are point sets {P in}、{P out}、{P i} is the number of midpoints, λ and γ are two preset thresholds.
[0022] Step 4: perform cropping, histogram equalization, and adaptive thresholding operations on the image to obtain a binary image, specifically:
[0023] When S pulse = True and {P in} has a number of points greater than λN P When the grayscale image I grey Crop to get the region of interest I ROI , and then perform histogram equalization to obtain the contrast-enhanced image I hist Finally, an adaptive thresholding operation is performed to obtain the binary image I bin ,
[0024] That is, I ROI =Rect(I grey ), I hist =equalizeHist(I ROI ), I bin = adaptiveThreshold(I hist ).
[0025] When S pulse = True and {P in} is less than λN P , then return to step 301.
[0026] Step 5: Based on the binary image I bin The pixels and whether the suction hole is a hole are judged, that is:
[0027] if sum(I bin )>T e
[0028] S empty =True
[0029] Among them, sum(I bin ) is I bin The pixel and T e The preset threshold for determining whether it is a hole.
[0030] Step 6: Mark the image with different colors and display the outer disk according to whether the suction hole is empty or not
[0031] Step 7, according to the pulse number N pulse and the number of holes N empty Calculate the missed broadcast rate ρ, the calculation formula is:
[0032]
[0033] Step 8, repeat steps 3 to 7 until the air-suction seeder stops operating, thereby completing the seeding detection of the air-suction seeder for this operation.
[0034] Wherein, in the step 2, the position of the process tank in the image is manually calibrated.
[0035] The above solution has the following advantages:
[0036] Since the air-suction seeder seeding detection method based on machine vision of the present invention uses a camera to obtain a picture that includes both the suction holes and process slots of the seeder; then calibrate the position of the process slot in the picture; then, when the seeder is working, determine whether a new suction hole appears based on the gray value distribution of the sampling point set, and record a pulse when a new suction hole appears; then, perform cropping, histogram equalization, and adaptive thresholding operations on the picture to obtain a binary image; then, determine whether the suction hole is a hole based on the binary image; then, use different colors to mark the picture and display it according to whether the suction hole is a hole; finally, calculate the missed seeding rate. This detection method is based on machine vision, is less affected by the environment, and is not prone to misjudgment, thereby greatly improving the accuracy of the detection result. Moreover, using different colors to mark the picture and display it according to whether the suction hole is a hole is more intuitive. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a structural schematic diagram of a seeding plate in a method for detecting seeding of an air-suction seeding machine based on machine vision of the present invention;
[0038] Figure 2 It is an enlarged schematic diagram of a picture captured by a camera in the method for detecting seeding of an air-suction seeder based on machine vision of the present invention;
[0039] Figure 3 The present invention is a flowchart of a software program of a method for detecting seeding of an air-suction seeder based on machine vision. DETAILED DESCRIPTION
[0040] The present invention is further described in detail below in conjunction with the accompanying drawings.
[0041] like Figures 1 to 3 As shown, the method for detecting seeding of an air-suction seeder based on machine vision of the present invention comprises the following steps:
[0042] Step 1, install a camera on the seeder, the camera can obtain a picture 5 including the suction hole 2 and the process tank 1 of the seeder. The seeding tray 3 of the seeder is located on the outer tray 4 of the seeder, and the outer tray 4 serves as the background of the seeding tray 3. In order to facilitate the distinction of the color of the picture 5, the outer tray 4 of the seeder is black.
[0043] Step 2: manually calibrate the position of process tank 1 in image 5 to obtain the sampling point set {P i}, sampling point P i The coordinates x and y represent the pixel coordinates in picture 5.
[0044] Step 3, the seeder is working, the suction hole 2 and the process slot 1 rotate with the seeding disc 3 of the seeder, according to the sampling point set {P i} to determine whether a new suction hole 2 appears, and when a new suction hole 2 appears, it is recorded as a pulse, which specifically includes the following steps:
[0045] Step 301, converting image 5 into grayscale image I grey .
[0046] Step 302: each sampling point P i (x i ,y i ) can correspond to the grayscale image I grey The gray value G of a point in i , then we get the gray value set {G i}, where G i (x i ,y i )=I grey (x=x i , y=y i ).
[0047] Step 303: Set the sampling point set {P i} is divided into a point set {P in} and the point set {P out},Right now
[0048] if G i ≤T tr P i ∈{P in}
[0049] if G i >T tr P i ∈{P out}
[0050] Among them, T trIt is a preset threshold to distinguish high and low gray values.
[0051] Step 304, initially set a pulse state S pulse = False and a hole state S empty = False, when {P in} has a number of points greater than λN P When S pulse = True, then when {P out} is greater than γN P When S pulse = False, and the pulse number N pusle Add one. If the suction hole 2 is judged to be empty at this time, then the number of holes N empty Plus one, that is
[0052] St.S pulse = False, S empty = False, N pulse =0,N empty =0
[0053] if S pulse =False and N in >λN P
[0054] {S pulse =True
[0055] if S pulse =True and N out >γN P
[0056]
[0057] Among them, N in 、N out 、N P They are point sets {P in}、{P out}、{P i} is the number of midpoints, λ and γ are two preset thresholds.
[0058] Step 4, perform cropping, histogram equalization, and adaptive thresholding operations on image 5 to obtain a binary image, specifically:
[0059] When S pulse = True and {P in} has a number of points greater than λN P When the grayscale image I grey Crop to get the region of interest I ROI, and then perform histogram equalization to obtain the contrast-enhanced image I hist Finally, an adaptive thresholding operation is performed to obtain the binary image I bin ,
[0060] That is, I ROI =Rect(I grey ), I hist =equalizeHist(I ROI ), I bin = adaptiveThreshold(I hist );
[0061] When S pulse = True and {P in} is less than λN p , then return to step 301.
[0062] Step 5: Based on the binary image I bin The pixels and judge whether the suction hole 2 is a hole, that is:
[0063] if sum(I bin )>T e
[0064] S empty =True
[0065] Among them, sum(I bin ) is I bin The pixel and T e The preset threshold for determining whether it is a hole.
[0066] Step 6: Mark the picture 5 with different colors and display it according to whether the suction hole 2 is a hole.
[0067] Step 7, according to the pulse number N pulse and the number of holes N empty Calculate the missed broadcast rate ρ, the calculation formula is:
[0068]
[0069] Step 8, repeat steps 3 to 7 until the air-suction seeder stops operating, thereby completing the seeding detection of the air-suction seeder for this operation.
[0070] The above Rect, equalizeHist, and adaptiveThreshold are all commonly used algorithms for image processing, and their corresponding implementations can be found in related libraries.
[0071] The method for detecting the seeding of an air-suction seeder based on machine vision of the present invention marks the pores with different colors according to whether they are empty, and directly displays pictures at the same time, which is highly intuitive. Moreover, it is less affected by the environment and is not prone to misjudgment, thereby greatly improving the accuracy of the detection result.
Claims
1. A method for detecting seeding of an air-suction seeder based on machine vision, characterized in that The steps include: Step 1, install a camera on the seeder, the camera can obtain a picture including the suction hole and process slot of the seeder; Step 2: calibrate the position of the process tank in the image and obtain the sampling point set {P i }, sampling point P i The coordinates x and y represent the pixel coordinates in the image; Step 3, the seeder is working, the suction holes and process slots rotate with the seeding disc of the seeder, and according to the sampling point set {P i } determines whether a new suction hole appears, and when a new suction hole appears, it is recorded as a pulse, which specifically includes the following steps: Step 301, convert the image into a grayscale image I grey ; Step 302: each sampling point P i (x i ,y i ) corresponds to grayscale image I grey The gray value G of a point in i , then we get the gray value set {G i }, where G i (x i ,y i )=I grey (x=x i , y=y i ); Step 303: Set the sampling point set {P i } is divided into a point set with low gray value in the process tank {P in } and the point set {P out },Right now if G i ≤T tr P i ∈{P in } if G i >T tr P i ∈{P out } Among them, T tr It is a preset threshold value to distinguish high and low gray values; Step 304, initially set a pulse state S pulse = False and a hole state S empty = False, when {P in } is greater than λN P When S pulse = True, then when {P out } has a number greater than γN P When S pulse = False, and the number of pulses N pusle Add one. If the suction hole is judged to be a hole at this time, the number of holes is N. empty Plus one, that is St.S puls and=False,S empty =False,N pulse =0,N empty =0 if S pulse =False and N in >λN P {S pulse =True if S puise =True and N out >γN P Among them, N in 、N out 、N P They are point sets {P in }、{P out }、{P i }The number of midpoints, λ and γ are two preset thresholds; Step 4: perform cropping, histogram equalization, and adaptive thresholding operations on the image to obtain a binary image, specifically: When S pulse = True and {P in } has a number of points greater than λN P When the grayscale image I grey Crop to get the region of interest I ROI , and then perform histogram equalization to obtain the contrast enhanced image I hist Finally, an adaptive thresholding operation is performed to obtain the binary image I bin , That is, I ROI = Rect(I grey ), I hist = equalizeHist(I ROI ), I bin = adaptiveThreshold(1 hist ); When S pulse = True and {P in } is less than λN P When , return to step 301; Step 5: Based on the binary image I bin The pixels and whether the suction hole is a hole are judged, that is: if sum(I bin )>T e S empty =True Among them, sum(I bin ) is I bin The pixel and T e A preset threshold for determining whether it is a hole; Step 6, marking the image with different colors according to whether the suction hole is a hole and displaying it; Step 7, according to the pulse number N pulse and the number of holes N empty Calculate the missed broadcast rate ρ, the calculation formula is: Step 8, repeat steps 3 to 7 until the air-suction seeder stops operating, thereby completing the seeding detection of the air-suction seeder for this operation.
2. The method for detecting seeding of an air-suction seeder based on machine vision as claimed in claim 1, characterized in that In the step 2, the position of the process tank in the image is manually calibrated.
