An obstacle recognition method, device, equipment, medium and weeding robot

By using obstacle recognition technology in the weeding robot and using image processing technology to identify obstacles in candidate weeding areas, the problem of the boundary calibration of the weeding area in the prior art is solved, and a more efficient and flexible weeding operation is achieved.

CN114494840BActive Publication Date: 2025-06-17SUZHOU CLEVA PRECISION MACHINERY & TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011242357.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-09
Publication Date
2025-06-17
Estimated Expiration
2040-11-09

AI Technical Summary

Technical Problem

Existing weeding robots need to bury boundary lines when calibrating the boundary of the weeding area, which consumes a lot of manpower and material resources and increases costs. There are restrictions on the burial of the boundary lines, which limits the shape of the weeding area.

Method used

By identifying obstacles in the image of the candidate weeding area, color information, outline information, chromaticity information and brightness information are used to determine whether there are obstacles, thereby improving the recognition efficiency and accuracy of the weeding robot for obstacles in the candidate weeding area.

Benefits of technology

Reduces physical calibration of the boundaries of the weeding area, reduces costs, and removes the limitations of boundary shapes, improving the flexibility and efficiency of the weeding robot.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114494840B_ABST
    Figure CN114494840B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention discloses an obstacle recognition method, device, equipment, medium and weeding robot. The method includes: determining a candidate obstacle area in a candidate weeding area image according to the color information of the candidate weeding area image; obtaining the contour information of the candidate obstacle area and the chromaticity information and lightness information of the candidate weeding area image; determining whether there is an obstacle in the candidate weeding area image according to the contour information, chromaticity information or also according to the lightness information. By running the technical solution provided by the embodiment of the present invention, it is possible to solve the problem that usually the boundary of the weeding area of the weeding robot is calibrated by burying a boundary line, which consumes a large amount of manpower and material resources. And because there are limitations in burying the boundary line, to a certain extent, the shape of the weeding area is restricted, and the effect of improving the recognition efficiency and accuracy of obstacles in the candidate weeding area of the weeding robot is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to image processing technology, and in particular to an obstacle recognition method, device, equipment, medium and weeding robot. Background Art

[0002] With the improvement of living standards, people are increasingly concerned about environmental construction, so the construction of urban greening gardens has received more and more attention. At the same time, efficient greening maintenance, such as daily weeding, has gradually become a need. However, since traditional weeders require manual operation, weeding robots with autonomous working functions have gradually emerged.

[0003] In the prior art, the boundary of the weeding area of the weeding robot is usually calibrated by burying a boundary line, which consumes a lot of manpower and material resources and increases the cost. And due to the limitations of burying the boundary line, for example, the angle of the corner cannot be less than 90 degrees, so to a certain extent, the shape of the weeding area is restricted. Summary of the Invention

[0004] Embodiments of the present invention provide an obstacle recognition method, device, equipment, medium and weeding robot to achieve the effect of improving the recognition efficiency and accuracy of obstacles in the candidate weeding area of the weeding robot.

[0005] In a first aspect, embodiments of the present invention provide an obstacle recognition method, the method comprising:

[0006] Determining a candidate obstacle area in the candidate weeding area image according to the color information of the candidate weeding area image;

[0007] Obtaining the contour information of the candidate obstacle area and the chromaticity information and lightness information of the candidate weeding area image;

[0008] Determining whether there is an obstacle in the candidate weeding area image according to the contour information, the chromaticity information or according to the contour information, the chromaticity information and the lightness information.

[0009] In a second aspect, embodiments of the present invention further provide an obstacle recognition device, the device comprising:

[0010] A candidate obstacle area determination module, configured to determine a candidate obstacle area in the candidate weeding area image according to the color information of the candidate weeding area image;

[0011] An information acquisition module, configured to acquire the contour information of the candidate obstacle area and the chromaticity information and lightness information of the candidate weeding area image;

[0012] An obstacle determination module, configured to determine whether there is an obstacle in the candidate weeding area image according to the contour information, the chromaticity information, or according to the contour information, the chromaticity information, and the lightness information.

[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, which includes:

[0014] One or more processors;

[0015] A storage device, configured to store one or more programs,

[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the obstacle recognition method as described above.

[0017] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the obstacle recognition method as described above is implemented.

[0018] In a fifth aspect, an embodiment of the present invention further provides a weeding robot, including a robot body and the above-mentioned electronic device.

[0019] In the embodiment of the present invention, a candidate obstacle area in the candidate weeding area image is determined according to the color information of the candidate weeding area image; the contour information of the candidate obstacle area, the chromaticity information, and the lightness information of the candidate weeding area image are obtained; according to the contour information, the chromaticity information, or according to the contour information, the chromaticity information, and the lightness information, it is determined whether there is an obstacle in the candidate weeding area image. It solves the problem that in the prior art, the boundary of the weeding area of the weeding robot is usually calibrated by burying a boundary line, which consumes a lot of manpower and material resources and increases the cost. And because there are limitations in burying the boundary line, to a certain extent, it restricts the shape of the weeding area, and realizes the effect of improving the recognition efficiency and accuracy of obstacles in the candidate weeding area of the weeding robot. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a flowchart of an obstacle recognition method provided in Embodiment 1 of the present invention;

[0021] Figure 2 It is a flowchart of an obstacle recognition method provided in Embodiment 2 of the present invention;

[0022] Figure 3 It is a schematic structural diagram of an obstacle recognition device provided in Embodiment 3 of the present invention;

[0023] Figure 4Schematic structural diagram of an electronic device provided in Embodiment 4 of the present invention. Detailed implementation manners

[0024] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. Additionally, it should be noted that for the sake of convenience of description, only parts related to the present invention rather than all structures are shown in the accompanying drawings.

[0025] Embodiment 1

[0026] Figure 1 Flowchart of an obstacle recognition method provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation where a weeding robot recognizes obstacles in a candidate weeding area. This method can be executed by the obstacle recognition device provided in the embodiments of the present invention, and this device can be implemented in a software and / or hardware manner. Refer to Figure 1 The obstacle recognition method provided in this embodiment includes:

[0027] Step 110: Determine a candidate obstacle area in the candidate weeding area image according to the color information of the candidate weeding area image.

[0028] Among them, the candidate weeding area is the possible working area of the weeding robot. It may be all weeds to be removed, that is, the weeding area; or it may be an obstacle area with an insignificant color difference from the grassland or very small and disorderly obstacles.

[0029] The candidate weeding area image can be captured by a camera installed on the weeding robot, and this embodiment does not limit this. The color information of the candidate weeding area image can be information such as the hue, saturation, and value of the image, and this embodiment does not limit this. By using the color information, the area that may be an obstacle is determined from the candidate weeding area image. Exemplarily, the area in the image with a large color difference from the surrounding area is determined as the candidate obstacle area according to the color information.

[0030] In this embodiment, optionally, determining a candidate obstacle area in the candidate weeding area image according to the color information of the candidate weeding area image includes:

[0031] Obtain a color segmentation image of the candidate weeding area image according to the color information of the candidate weeding area image;

[0032] Perform morphological processing on the color segmentation image, and determine the area of a preset color in the morphologically processed color segmentation image as the candidate obstacle area.

[0033] Among them, a color segmentation image of the candidate weeding area image can be obtained according to the color information of the candidate weeding area image. Color segmentation can be performed in ways such as dynamic color segmentation, edge texture method segmentation, fixed threshold segmentation, Otsu threshold segmentation, etc. to obtain the color segmentation image of the candidate weeding area image. Among them, the color segmentation image can be a binary image. Then, morphological processing is performed on the color segmentation image. Among them, the morphological processing can be an inversion operation, an opening operation, a closing operation, etc., and this embodiment does not limit this.

[0034] The area of the preset color is determined as the candidate obstacle area from the color segmentation image after morphological processing. For example, the black area is used as the weeding area, and the white area is used as the candidate obstacle area to further identify the candidate obstacle area. The candidate weeding area is initially segmented by obtaining the color segmentation image, and morphological processing is performed on the color segmentation image to improve the accuracy of determining the candidate obstacle area.

[0035] Step 120: Obtain the contour information of the candidate obstacle area and the chromaticity information and lightness information of the candidate weeding area image.

[0036] Among them, the contour information is the contour information of a single candidate obstacle area, and the acquisition method can be contour detection of the candidate obstacle area. The contour information can include position information and range information.

[0037] The range information is used to represent the size of the candidate obstacle area, which can be the area, diagonal length, width, height, number of pixels included, etc., and this embodiment does not limit this.

[0038] The position information is used to show the distance between the candidate obstacle area and the weeding robot. For example, it is the y-axis coordinate value of the lower right corner of the minimum bounding rectangle of the candidate obstacle area. Of course, other representative coordinate values can also be selected, and this embodiment does not limit this. The position information and range information can be used to avoid processing candidate obstacle areas that are too far or too small.

[0039] The chromaticity information of the candidate weeding area image is the overall chromaticity feature of the candidate weeding area image. By combining the chromaticity information of the candidate weeding area with the contour information of the candidate obstacle area, it is jointly determined whether the candidate obstacle area is an obstacle area.

[0040] The lightness information of the selected weeding area image is the overall lightness information of the candidate weeding area image. The lightness-related information in the image can be obtained by acquiring the lightness channel image of the candidate weeding area image. The relationship between the candidate obstacle area and the illumination is judged through the lightness information.

[0041] In this embodiment, optionally, the contour information includes: roughness information;

[0042] Determine the roughness information, including:

[0043] Obtain the brightness channel image of the candidate weeding area image;

[0044] Obtain an edge image by performing edge extraction on the brightness channel image;

[0045] Determine the roughness information according to the gray values of the pixels in the edge information of the edge image.

[0046] Among them, the roughness information is used to display the roughness degree of the edge of the candidate obstacle area, which can be the average roughness. The calculation method of the average roughness can be to divide the sum of the roughness of the pixels in the obstacle area in the contour by the total number of pixels in the obstacle area in the contour. This embodiment does not limit this.

[0047] By performing channel separation on the candidate weeding area image, obtain the brightness channel image of the candidate weeding area image. Optionally, perform preprocessing on the brightness channel image. The preprocessing can include filtering processing, normalization processing, etc. This embodiment does not limit this. Perform edge extraction on the preprocessed brightness channel image to obtain an edge image. The canny operator can be used for edge extraction to improve the accuracy of obtaining edge information in the edge image.

[0048] Determine the roughness information of the candidate obstacle area through the edge information in the edge image at the corresponding position of the candidate obstacle area. The edge information includes the gray values of the pixels in the contour of the candidate obstacle area. When the roughness information is the average roughness, the average roughness of the edge of the candidate obstacle area can be obtained by dividing the number of pixels with a gray value of 255 in the obstacle area in the contour by the total number of pixels in the obstacle area in the contour.

[0049] Determine the roughness information through the gray values of the pixels in the edge information of the edge image, improve the accuracy of obtaining the roughness information, and thus improve the accuracy of obstacle recognition.

[0050] Step 130: Determine whether there is an obstacle in the candidate weeding area image according to the contour information, the chromaticity information, or according to the contour information, the chromaticity information, and the brightness information.

[0051] Compare the contour information of the candidate obstacle area and the chromaticity information of the candidate weeding area image with the preset information judgment conditions, or compare the contour information, chromaticity information, and brightness information with the preset information judgment conditions. Among them, the preset information judgment conditions are related to the contour information and the chromaticity information. If the preset information judgment conditions are met, determine that the candidate obstacle area is an obstacle area, that is, determine that there is an obstacle in the candidate weeding area image where the obstacle area is located, so that the weeding robot can perform subsequent obstacle processing.

[0052] Exemplarily, the identified obstacle is an obstacle with a color similar to that of the grass.

[0053] In this embodiment, optionally, the brightness information includes the number of pixels in the exposure state and the number of white pixels in the non-exposure state;

[0054] Among them, the number of pixels in the exposure state is the number of pixels in the exposure state in the candidate weeding area image. The white pixels in the non-exposure state are the number of pixels that are not in the exposure state but appear white in the candidate weeding area image, such as the pixels of an obstacle that is itself white in the candidate weeding area image.

[0055] According to the brightness values of the pixels in the candidate weeding area image, the number of pixels in the exposure state is obtained. The obtaining method can be to obtain the brightness channel image of the candidate weeding area image and count the number of pixels whose brightness values are greater than or equal to a preset threshold, such as 255, as the number of pixels in the exposure state.

[0056] According to the brightness and chromaticity of the pixels in the candidate weeding area image, the number of white pixels in the non-exposure state is obtained. The obtaining method can be to obtain the brightness channel image and the chromaticity channel image of the candidate weeding area image and count the number of pixels whose brightness values are less than a preset threshold, such as 255, and whose chromaticity values are less than or equal to a preset threshold, such as 0, in the brightness channel image as the number of white pixels in the non-exposure state.

[0057] By combining the brightness information with the contour information and the chromaticity information, it is jointly determined whether there is an obstacle in the candidate weeding area image, improving the accuracy of obstacle recognition.

[0058] The technical solution provided in this embodiment determines the candidate obstacle area in the candidate weeding area image according to the color information of the candidate weeding area image; obtains the contour information, the chromaticity information and the brightness information of the candidate obstacle area; and determines whether there is an obstacle in the candidate weeding area image according to the contour information, the chromaticity information or according to the contour information, the chromaticity information and the brightness information. It solves the problem that in the prior art, the boundary of the weeding area of the weeding robot is usually calibrated by burying a boundary line, which consumes a lot of manpower and material resources and increases the cost. And because there are limitations in burying the boundary line, to a certain extent, it restricts the shape of the weeding area, achieving the effect of improving the recognition efficiency and accuracy of obstacles in the candidate weeding area of the weeding robot.

[0059] Embodiment Two

[0060] Figure 2The figure is a flowchart of an obstacle recognition method provided in the second embodiment of the present invention. This technical solution supplements the process of determining whether there are obstacles in the candidate weeding area image according to the contour information, the chromaticity information, or according to the contour information, the chromaticity information, and the lightness information. Compared with the above solution, this solution is specifically optimized as follows: determining whether there are obstacles in the candidate weeding area image according to the contour information, the chromaticity information, or according to the contour information, the chromaticity information, and the lightness information includes:

[0061] If the lowest chromaticity segmentation value is less than a preset first chromaticity segmentation threshold, and the highest chromaticity segmentation value is greater than a preset second chromaticity segmentation threshold, then determine whether there are obstacles in the candidate weeding area image according to the contour information and a preset first information judgment condition, or according to the contour information, the lightness information, and the preset first information judgment condition;

[0062] If the lowest chromaticity segmentation value is greater than or equal to the preset first chromaticity segmentation threshold, or the highest chromaticity segmentation value is less than or equal to the preset second chromaticity segmentation threshold, then determine whether there are obstacles in the candidate weeding area image according to the contour information and a preset second information judgment condition, or according to the lightness information and the preset second information judgment condition. Specifically, the flowchart of the obstacle recognition method is as Figure 2 shown:

[0063] Step 210: Determine the candidate obstacle area in the candidate weeding area image according to the color information of the candidate weeding area image.

[0064] Step 220: Obtain the contour information of the candidate obstacle area, the lightness information of the candidate weeding area image, and obtain the lowest chromaticity segmentation value and the highest chromaticity segmentation value of the candidate weeding area image according to the color information of the candidate weeding area image.

[0065] Among them, the contour information includes at least one of range information, roughness information, grass pixel ratio, and chromaticity effective pixel ratio; the lightness information includes the number of exposed state pixels and / or the number of non-exposed state white pixels.

[0066] Among them, the number of chromaticity effective pixels is the number of pixels in the obstacle area within the effective pixel value chromaticity range in the contour of a single candidate obstacle area. The chromaticity effective pixel ratio is the ratio of the number of pixels in the obstacle area within the effective pixel value chromaticity range in the contour of a single candidate obstacle area to all pixels in the contour.

[0067] The interval formed by the lowest chromaticity segmentation value and the highest chromaticity segmentation value can be used as the chromaticity range of valid pixel values, and pixels with chromaticity values within the chromaticity segmentation threshold interval are regarded as chromaticity valid pixels. The number of chromaticity valid pixels in the contour of a single candidate obstacle area is used as the chromaticity valid pixel quantity, and the ratio of the chromaticity valid pixels in the obstacle area in the contour of a single candidate obstacle area to all pixels in the contour is used as the chromaticity valid pixel ratio.

[0068] The proportion of grass pixels is the ratio of the pixels estimated to be grass within the contour to all pixels. For example, if black pixels are estimated to be grass pixels, then the ratio of black pixels to the whole is used as the proportion of grass pixels.

[0069] The lowest chromaticity segmentation value and the highest chromaticity segmentation value of the candidate weeding area image can be obtained according to the color information of the candidate weeding area image by means of color dynamic segmentation, edge texture method segmentation, fixed threshold segmentation, Otsu threshold segmentation, etc. The lowest chromaticity segmentation value and the highest chromaticity segmentation value of different candidate weeding area images may be different, and the lowest chromaticity segmentation value and the highest chromaticity segmentation value are used as the chromaticity information of the candidate weeding area image.

[0070] The candidate weeding area image can be converted into a color segmentation image according to the chromaticity segmentation threshold interval formed by the lowest chromaticity segmentation value and the highest chromaticity segmentation value. Exemplarily, pixels in the candidate weeding area image with chromaticity greater than or equal to the lowest chromaticity segmentation value and less than or equal to the highest chromaticity segmentation value are converted into white, and other pixels are converted into black to obtain the color segmentation image.

[0071] The lowest chromaticity segmentation value and the highest chromaticity segmentation value of the candidate weeding area image are obtained through the color information of the candidate weeding area image, and the chromaticity distribution of the candidate weeding area image is determined, so as to determine whether there are obstacles in the candidate weeding area image according to the chromaticity information, and improve the accuracy of identifying obstacles with an unclear color difference from the grass.

[0072] Step 230: If the lowest chromaticity segmentation value is less than the preset first chromaticity segmentation threshold and the highest chromaticity segmentation value is greater than the preset second chromaticity segmentation threshold, then determine whether there are obstacles in the candidate weeding area image according to the contour information and the preset first information judgment condition or according to the contour information, the lightness information and the preset first information judgment condition.

[0073] When the lowest chromaticity segmentation value is less than the preset first chromaticity segmentation threshold and the highest chromaticity segmentation value is greater than the preset second chromaticity segmentation threshold, at this time the chromaticity segmentation threshold range is relatively large. If it is simply determined whether there are obstacles through chromaticity segmentation, most areas of the entire candidate weeding area image may be regarded as grass, resulting in a decrease in the recognition accuracy.

[0074] Compare the contour information of the candidate obstacle area with the preset first information judgment condition, or compare the contour information, brightness information with the preset first information judgment condition to determine whether there is an obstacle in the candidate weeding area image. Exemplarily, the preset first chromaticity segmentation threshold is 20, and the preset second chromaticity segmentation threshold is 90. This embodiment does not limit this. The preset first information judgment condition can be adjusted according to the specific judgment scenario, and this embodiment does not limit this.

[0075] Optionally, before judging the relationship between the lowest chromaticity segmentation value and the highest chromaticity segmentation value of the candidate weeding area image corresponding to the candidate obstacle area and the threshold, the candidate obstacle area can also be preliminarily judged through the contour information of the candidate obstacle area to avoid processing candidate obstacle areas that are too far or too small.

[0076] Exemplarily, the contour information of the candidate obstacle area includes position information and range information. The range information is the diagonal length AContours i .diagonal or the height AContours i .height of the candidate obstacle area, where i is the number of the candidate obstacle area; the position information is the y-axis coordinate value YContours of the lower right corner of the minimum circumscribed rectangle of the candidate obstacle area i . The larger the coordinate value, the closer the candidate obstacle area is to the robot. The diagonal threshold of the preset range threshold is 105, the height threshold is 70, and the preset position threshold is 75. Then, when the condition AContours i .diagonal>105 and YContours i >75; or AContours i .height>70 and YContoursi>75 are satisfied, then judge the relationship between the lowest chromaticity segmentation value and the highest chromaticity segmentation value of the candidate weeding area image corresponding to the candidate obstacle area and the threshold.

[0077] In this embodiment. Optionally, determining whether there is an obstacle in the candidate weeding area image according to the contour information and the preset first information judgment condition or according to the contour information, the brightness information and the preset first information judgment condition includes:

[0078] If the range information is less than the preset first range threshold, the grass pixel point ratio is less than the preset first grass pixel point ratio threshold, and the roughness information is less than the preset first roughness threshold, it is determined that there is an obstacle in the candidate weeding area image;

[0079] If the ratio of chromaticity valid pixels is less than a preset first chromaticity valid pixel ratio threshold, and the roughness information is less than a preset second roughness threshold, it is determined that there is an obstacle in the candidate weeding area image;

[0080] If the number of exposure state pixels is greater than a preset first exposure state pixel number threshold, and the number of non-exposure state white pixels is greater than a preset first non-exposure state white pixel threshold, and the ratio of chromaticity valid pixels is less than a preset second chromaticity valid pixel ratio threshold, and the roughness information is less than a preset third roughness threshold, it is determined that there is an obstacle in the candidate weeding area image;

[0081] If the range information is less than a preset second range threshold, and the ratio of grassland pixel points is less than a preset second grassland pixel point ratio threshold, and the roughness information is less than a preset fourth roughness threshold, and the number of exposure state pixels is greater than a preset second exposure state pixel number threshold, and the number of non-exposure state white pixels is greater than a preset second non-exposure state white pixel threshold, it is determined that there is an obstacle in the candidate weeding area image.

[0082] Exemplarily, the roughness information is the average roughness HContours of the contour of the candidate obstacle area i , the smaller the average roughness, the smoother the candidate obstacle area. The range information is the number of pixels AContours i .pixels, and the ratio of grassland pixel points is BContours i . The number of chromaticity valid pixels is SContours i , where i is the number of the candidate obstacle area, and the ratio of chromaticity valid pixels is SPContours i .

[0083] Exemplarily, if the preset first range threshold is 900, the preset first grassland pixel point ratio threshold is 0.001, and the preset first roughness threshold is 0.27. Then the preset first information judgment condition is AContours i .pixels < 900 and BContours i < 0.001 and HContours i < 0.27. When this condition is met, it is determined that there is an obstacle in the candidate weeding area image, and the obstacle may be a wire mesh separating the grassland.

[0084] Exemplarily, if the preset first chromaticity valid pixel ratio threshold is 0.2 and the preset second roughness threshold is 0.251, then the preset first information judgment condition is SPContours i < 0.2 and HContours i<0.251, when this condition is met, it is determined that there is an obstacle in the candidate weeding area image, and the obstacle may be a rusty pillar surrounded by grass; if the preset first chromaticity effective pixel ratio threshold is 0.14 and the preset second roughness threshold is 0.27. Then the preset first information judgment condition is SPContours i <0.14 and HContours i <0.27, when this condition is met, it is determined that there is an obstacle in the candidate weeding area image, and the obstacle may be the flower bed boundary.

[0085] Exemplarily, the number of exposure state pixels is denoted as overbrightPix, and the number of non-exposure state white pixels is denoted as zeroPix. If the preset first exposure state pixel number threshold is 100, the preset first non-exposure state white pixel threshold is 50, the preset second chromaticity effective pixel ratio threshold is 0.5, and the preset third roughness threshold is 0.28, then the preset first information judgment condition is overbrightPix > 100 and zeroPix > 50 and SPContours i <0.5 and HContours i <0.28, when this condition is met, it is determined that there is an obstacle in the candidate weeding area image.

[0086] Exemplarily, if the preset second range threshold is 2600, the preset second grass pixel point ratio threshold is 0.001, the preset fourth roughness threshold is 0.18, the preset second exposure state pixel number threshold is 100, and the preset second non-exposure state white pixel threshold is 10, then the preset first information judgment condition is AContours i .pixels < 2600 and BContours i <0.001 and HContours i <0.18 and overbrightPix > 100 and zeroPix > 10, when this condition is met, it is determined that there is an obstacle in the candidate weeding area image.

[0087] Step 240, if the lowest chromaticity segmentation value is greater than or equal to the preset first chromaticity segmentation threshold, or the highest chromaticity segmentation value is less than or equal to the preset second chromaticity segmentation threshold, then determine whether there is an obstacle in the candidate weeding area image according to the contour information and the preset second information judgment condition or according to the lightness information and the preset second information judgment condition.

[0088] When the lowest chromaticity segmentation value is greater than or equal to a preset first chromaticity segmentation threshold, and the highest chromaticity segmentation value is less than or equal to a preset second chromaticity segmentation threshold, compare the contour information of the candidate obstacle area with the preset second information judgment condition, or compare the lightness information with the preset second information judgment condition to determine whether there is an obstacle in the candidate weeding area image.

[0089] The preset second information judgment condition can be adjusted according to the specific judgment scenario, and this embodiment does not limit it.

[0090] In this embodiment, optionally, determining whether there is an obstacle in the candidate weeding area image according to the contour information and the preset second information judgment condition or according to the lightness information and the preset second information judgment condition includes:

[0091] If the roughness information is less than a preset fifth roughness threshold, it is determined that there is an obstacle in the candidate weeding area image;

[0092] If the number of pixels in the exposure state is greater than a preset third exposure state pixel number threshold, it is determined that there is an obstacle in the candidate weeding area image;

[0093] If the number of pixels in the exposure state is greater than a preset fourth exposure state pixel number threshold, and the number of white pixels in the non-exposure state is greater than a preset third non-exposure state white pixel threshold, it is determined that there is an obstacle in the candidate weeding area image.

[0094] Exemplarily, if the preset fifth roughness threshold is 0.25, the preset second information judgment condition is HContours i <0.26, and when this condition is met, it is determined that there is an obstacle in the candidate weeding area image.

[0095] Exemplarily, if the preset third exposure state pixel number threshold is 100, the preset second information judgment condition is overbrightPix>100, and when this condition is met, it is determined that there is an obstacle in the candidate weeding area image.

[0096] Exemplarily, if the preset fourth exposure state pixel number threshold is 20 and the preset third non-exposure state white pixel threshold is 10, the preset second information judgment condition is overbrightPix>20 and zeroPix>10, and when this condition is met, it is determined that there is an obstacle in the candidate weeding area image.

[0097] In the embodiment of the present invention, by using the minimum chromaticity segmentation value, the maximum chromaticity segmentation value, the contour information, the chromaticity information, and the lightness information, it is determined whether there is an obstacle in the candidate weeding area image, which improves the recognition accuracy of obstacles in the candidate weeding area image when the range of the chromaticity segmentation value is large, or when the chromaticity distinction between the grassland and the non-grassland area is not obvious, and the recognition of obstacles by chromaticity segmentation alone does not achieve the expected effect.

[0098] Embodiment III

[0099] Figure 3 FIG. is a schematic structural diagram of an obstacle recognition device provided in Embodiment III of the present invention. This device can be implemented in a hardware and / or software manner, and can execute an obstacle recognition method provided in any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method. As Figure 3 shown, the device includes:

[0100] A candidate obstacle area determination module 310, configured to determine a candidate obstacle area in the candidate weeding area image according to the color information of the candidate weeding area image;

[0101] An information acquisition module 320, configured to acquire the contour information of the candidate obstacle area and the chromaticity information and lightness information of the candidate weeding area image;

[0102] An obstacle determination module 330, configured to determine whether there is an obstacle in the candidate weeding area image according to the contour information, the chromaticity information, or according to the contour information, the chromaticity information, and the lightness information.

[0103] The technical solution provided in this embodiment determines a candidate obstacle area in the candidate weeding area image according to the color information of the candidate weeding area image; acquires the contour information of the candidate obstacle area and the chromaticity information and lightness information of the candidate weeding area image; and determines whether there is an obstacle in the candidate weeding area image according to the contour information, the chromaticity information, or according to the contour information, the chromaticity information, and the lightness information. It solves the problem that in the prior art, the boundary of the weeding area of the weeding robot is usually calibrated by burying a boundary line, which consumes a large amount of manpower and material resources and increases the cost. And because there are limitations in burying the boundary line, to a certain extent, it restricts the shape of the weeding area, and achieves the effect of improving the recognition efficiency and accuracy of obstacles in the candidate weeding area of the weeding robot.

[0104] Based on the above technical solutions, optionally, the candidate obstacle area determination module includes:

[0105] A color segmentation image acquisition unit, configured to obtain a color segmentation image of the candidate weeding area image according to the color information of the candidate weeding area image;

[0106] A candidate obstacle area determination unit, configured to perform morphological processing on the color segmentation image, and determine an area of a preset color in the color segmentation image after morphological processing as a candidate obstacle area.

[0107] Based on the above technical solutions, optionally, the information acquisition module includes:

[0108] A chromaticity segmentation value acquisition unit, configured to obtain the lowest chromaticity segmentation value and the highest chromaticity segmentation value of the candidate weeding area image according to the color information of the candidate weeding area image.

[0109] Based on the above technical solutions, optionally, the contour information includes at least one of range information, roughness information, grass pixel ratio, and chromaticity effective pixel ratio; the brightness information includes the number of pixels in the exposure state and / or the number of white pixels in the non-exposure state;

[0110] The obstacle determination module includes:

[0111] A first obstacle determination unit, configured to determine whether there is an obstacle in the candidate weeding area image according to the contour information and a preset first information judgment condition or according to the contour information, the brightness information, and the preset first information judgment condition if the lowest chromaticity segmentation value is less than a preset first chromaticity segmentation threshold and the highest chromaticity segmentation value is greater than a preset second chromaticity segmentation threshold;

[0112] A second obstacle determination unit, configured to determine whether there is an obstacle in the candidate weeding area image according to the contour information and a preset second information judgment condition or according to the brightness information and the preset second information judgment condition if the lowest chromaticity segmentation value is greater than or equal to the preset first chromaticity segmentation threshold, or the highest chromaticity segmentation value is less than or equal to the preset second chromaticity segmentation threshold.

[0113] Based on the above technical solutions, optionally, the first obstacle determination unit includes:

[0114] A first obstacle determination subunit, configured to determine that there is an obstacle in the candidate weeding area image if the range information is less than a preset first range threshold, the grass pixel ratio is less than a preset first grass pixel ratio threshold, and the roughness information is less than a preset first roughness threshold;

[0115] A second obstacle determination subunit, configured to determine that there is an obstacle in the candidate weeding area image if the ratio of chromaticity valid pixels is less than a preset first chromaticity valid pixel ratio threshold and the roughness information is less than a preset second roughness threshold;

[0116] A third obstacle determination subunit, configured to determine that there is an obstacle in the candidate weeding area image if the number of pixels in the exposure state is greater than a preset first number threshold of pixels in the exposure state, the number of white pixels in the non-exposure state is greater than a preset first white pixel threshold in the non-exposure state, the ratio of chromaticity valid pixels is less than a preset second chromaticity valid pixel ratio threshold, and the roughness information is less than a preset third roughness threshold;

[0117] A fourth obstacle determination subunit, configured to determine that there is an obstacle in the candidate weeding area image if the range information is less than a preset second range threshold, the ratio of grass pixels is less than a preset second grass pixel ratio threshold, the roughness information is less than a preset fourth roughness threshold, the number of pixels in the exposure state is greater than a preset second number threshold of pixels in the exposure state, and the number of white pixels in the non-exposure state is greater than a preset second white pixel threshold in the non-exposure state.

[0118] Based on the above technical solutions, optionally, the second obstacle determination unit includes:

[0119] A fifth obstacle determination subunit, configured to determine that there is an obstacle in the candidate weeding area image if the roughness information is less than a preset fifth roughness threshold;

[0120] A sixth obstacle determination subunit, configured to determine that there is an obstacle in the candidate weeding area image if the number of pixels in the exposure state is greater than a preset third number threshold of pixels in the exposure state;

[0121] A seventh obstacle determination subunit, configured to determine that there is an obstacle in the candidate weeding area image if the number of pixels in the exposure state is greater than a preset fourth number threshold of pixels in the exposure state and the number of white pixels in the non-exposure state is greater than a preset third white pixel threshold in the non-exposure state.

[0122] Embodiment 4

[0123] Figure 4 A schematic structural diagram of an electronic device provided in Embodiment 4 of the present invention is shown as Figure 4 shown. The electronic device includes a processor 40, a memory 41, an input device 42, and an output device 43; the number of processors 40 in the electronic device can be one or more. Figure 4Taking a processor 40 as an example; the processor 40, memory 41, input device 42, and output device 43 in the electronic device can be connected through a bus or other means. Figure 4 Taking the connection through a bus as an example.

[0124] The memory 41, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the obstacle recognition method in the embodiments of the present invention. The processor 40 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 41, that is, implementing the above-mentioned obstacle recognition method.

[0125] The memory 41 may mainly include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the terminal, etc. In addition, the memory 41 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices. In some instances, the memory 41 may further include a memory remotely set relative to the processor 40, and these remote memories can be connected to the electronic device through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and their combinations.

[0126] Embodiment Five

[0127] Embodiment Five of the present invention further provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute an obstacle recognition method when executed by a computer processor. The method includes:

[0128] Determining a candidate obstacle area in the candidate weeding area image according to the color information of the candidate weeding area image;

[0129] Obtaining the contour information of the candidate obstacle area and the chromaticity information and lightness information of the candidate weeding area image;

[0130] Determining whether there is an obstacle in the candidate weeding area image according to the contour information, the chromaticity information, or according to the contour information, the chromaticity information, and the lightness information.

[0131] Of course, for a storage medium containing computer-executable instructions provided by the embodiments of the present invention, the computer-executable instructions are not limited to the method operations as described above, and can also execute related operations in the obstacle recognition method provided by any embodiment of the present invention.

[0132] Through the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software and necessary general-purpose hardware. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk, or optical disc of a computer, etc., including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.

[0133] It should be noted that in the embodiments of the above obstacle recognition device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the present invention.

[0134] Embodiment Six

[0135] Embodiment Six of the present invention provides a weeding robot, including a robot body, and also including the electronic device described in any embodiment of the present invention.

[0136] Specifically, the electronic device installed on the weeding robot can perform the related operations of an obstacle recognition method described in any embodiment of the present invention.

[0137] Among them, the robot body can include two active wheels on the left and right, which can be driven by motors respectively. The motors can be brushless motors with a reduction box and a Hall sensor. The robot body realizes driving operations such as forward, backward, turning, and arc by controlling the speeds and directions of the two active wheels. The robot body also includes a caster wheel, a camera, and a rechargeable battery. Among them, the caster wheel plays a role in supporting and balancing. The camera is installed at a specified position of the robot and forms a preset included angle with the horizontal direction to capture an image of the candidate weeding area. The rechargeable battery is used to provide power for the robot to work.

[0138] Note that the above is only the preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments only. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. An obstacle recognition method, characterized in that, Including: Determining a candidate obstacle area in the candidate weeding area image according to the color information of the candidate weeding area image; Obtaining the contour information of the candidate obstacle area and the chromaticity information and lightness information of the candidate weeding area image; Determining whether there is an obstacle in the candidate weeding area image according to the contour information, the chromaticity information, or according to the contour information, the chromaticity information and the lightness information; The obtaining the chromaticity information of the candidate weeding area image includes: Obtaining the lowest chromaticity segmentation value and the highest chromaticity segmentation value of the candidate weeding area image according to the color information of the candidate weeding area image; The contour information includes at least one of range information, roughness information, grass pixel ratio, and chromaticity effective pixel ratio; the lightness information includes the number of exposed state pixels and / or the number of non-exposed state white pixels; Determining whether there is an obstacle in the candidate weeding area image according to the contour information, the chromaticity information, or according to the contour information, the chromaticity information and the lightness information includes: If the lowest chromaticity segmentation value is greater than or equal to a preset first chromaticity segmentation threshold, or the highest chromaticity segmentation value is less than or equal to a preset second chromaticity segmentation threshold, then determining whether there is an obstacle in the candidate weeding area image according to the contour information and a preset second information judgment condition or according to the lightness information and the preset second information judgment condition; The determining whether there is an obstacle in the candidate weeding area image according to the contour information and a preset first information judgment condition or according to the contour information, the lightness information and the preset first information judgment condition includes: If the roughness information is less than a preset fifth roughness threshold, it is determined that there is an obstacle in the candidate weeding area image; If the number of exposed state pixels is greater than a preset third exposed state pixel number threshold, it is determined that there is an obstacle in the candidate weeding area image; If the number of exposed state pixels is greater than a preset fourth exposed state pixel number threshold and the number of non-exposed state white pixels is greater than a preset third non-exposed state white pixel threshold, it is determined that there is an obstacle in the candidate weeding area image.

2. The method according to claim 1, characterized in that, Determining a candidate obstacle area in the candidate weeding area image according to the color information of the candidate weeding area image includes: Obtaining the color segmentation image of the candidate weeding area image according to the color information of the candidate weeding area image; Performing morphological processing on the color segmentation image, and determining the area of a preset color in the morphologically processed color segmentation image as the candidate obstacle area.

3. The method according to claim 1 further includes, if the lowest chromaticity segmentation value is less than a preset first chromaticity segmentation threshold, and the highest chromaticity segmentation value is greater than a preset second chromaticity segmentation threshold, then determining whether there is an obstacle in the candidate weeding area image according to the contour information and a preset first information judgment condition or according to the contour information, the lightness information and the preset first information judgment condition; The determining whether there is an obstacle in the candidate weeding area image according to the contour information and a preset first information judgment condition or according to the contour information, the lightness information and the preset first information judgment condition includes: If the range information is less than a preset first range threshold, the grass pixel ratio is less than a preset first grass pixel ratio threshold, and the roughness information is less than a preset first roughness threshold, it is determined that there is an obstacle in the candidate weeding area image; If the proportion of chromaticity valid pixels is less than a preset first chromaticity valid pixel proportion threshold, and the roughness information is less than a preset second roughness threshold, it is determined that there is an obstacle in the candidate weeding area image; If the number of exposed state pixels is greater than a preset first exposed state pixel number threshold, the number of non-exposed state white pixels is greater than a preset first non-exposed state white pixel threshold, the proportion of chromaticity valid pixels is less than a preset second chromaticity valid pixel proportion threshold, and the roughness information is less than a preset third roughness threshold, it is determined that there is an obstacle in the candidate weeding area image; If the range information is less than a preset second range threshold, the proportion of grassland pixel points is less than a preset second grassland pixel point proportion threshold, the roughness information is less than a preset fourth roughness threshold, the number of exposed state pixels is greater than a preset second exposed state pixel number threshold, and the number of non-exposed state white pixels is greater than a preset second non-exposed state white pixel threshold, it is determined that there is an obstacle in the candidate weeding area image.

4. An obstacle recognition device, characterized in that, Including: A candidate obstacle area determination module, configured to determine a candidate obstacle area in the candidate weeding area image according to the color information of the candidate weeding area image; An information acquisition module, configured to acquire the contour information of the candidate obstacle area, the chromaticity information, and the lightness information of the candidate weeding area image; An obstacle determination module, configured to determine whether there is an obstacle in the candidate weeding area image according to the contour information, the chromaticity information, or according to the contour information, the chromaticity information, and the lightness information; The information acquisition module includes: A chromaticity segmentation value acquisition unit, configured to acquire the lowest chromaticity segmentation value and the highest chromaticity segmentation value of the candidate weeding area image according to the color information of the candidate weeding area image; The contour information includes at least one of range information, roughness information, proportion of grassland pixel points, and proportion of chromaticity valid pixels; the lightness information includes the number of exposed state pixels and / or the number of non-exposed state white pixels; The obstacle determination module includes: A second obstacle determination unit, configured to, if the lowest chromaticity segmentation value is greater than or equal to a preset first chromaticity segmentation threshold, or the highest chromaticity segmentation value is less than or equal to a preset second chromaticity segmentation threshold, determine whether there is an obstacle in the candidate weeding area image according to the contour information and a preset second information judgment condition or according to the lightness information and the preset second information judgment condition; The second obstacle determination unit includes: A fifth obstacle determination subunit, configured to determine that there is an obstacle in the candidate weeding area image if the roughness information is less than a preset fifth roughness threshold; A sixth obstacle determination subunit, configured to determine that there is an obstacle in the candidate weeding area image if the number of exposed state pixels is greater than a preset third exposed state pixel number threshold; A seventh obstacle determination subunit, configured to determine that there is an obstacle in the candidate weeding area image if the number of pixels in the exposure state is greater than a preset fourth threshold for the number of pixels in the exposure state, and the number of white pixels in the non-exposure state is greater than a preset third threshold for white pixels in the non-exposure state.

5. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the obstacle recognition method according to any one of claims 1-3.

6. A computer-readable storage medium, on which a computer program is stored, characterized in that, When the program is executed by the processor, it implements the obstacle recognition method according to any one of claims 1-3.

7. A weeding robot, comprising a robot body, characterized in that, It further includes the electronic device according to claim 5.

Citation Information

Patent Citations

  • Automatic walking equipment and obstacle detection method thereof

    CN104111460A

  • Obstacle-crossing identification system and method

    CN107139666A