Obstacle recognition method, device, equipment, medium and weeding robot
By using image processing technology in the weeding robot, obstacles in candidate weeding areas are automatically identified, and the problems of large human and material investment in the prior art are solved, the recognition efficiency and accuracy are improved, and the boundary shape limitations are lifted.
Patent Information
- Application Number
- CN202011241002.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-09
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2040-11-09
AI Technical Summary
In the prior art, the weeding robot uses a lot of manpower and material resources to calibrate the boundary line, which increases the cost, and the shape of the weeding area is limited due to the limitations of the boundary line burial.
By determining the candidate obstacle area based on the color information of the candidate weeding area image, obtaining contour information and brightness information, determining whether there are obstacles, and automatic recognition is achieved.
The identification efficiency and accuracy of obstacles in candidate weeding areas of the weeding robot are improved, reducing manpower and material investment, reducing costs, and lifting boundary shape restrictions.
Smart Images

Figure CN114494839B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to image processing technology, and more particularly to an obstacle recognition method, device, equipment, medium and weeding robot. Background Art
[0002] With the improvement of living standards, people are paying more and more attention to 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 demand. However, since traditional weeders require manual control, weeding robots with autonomous working functions are gradually emerging.
[0003] In the prior art, the boundary of the weeding area of the weeding robot is usually calibrated by burying boundary lines, which consumes a lot of manpower and material resources and increases costs. In addition, since there are restrictions on burying boundary lines, such as the angle of the corner cannot be less than 90 degrees, the shape of the weeding area is limited to a certain extent. Summary of the invention
[0004] The embodiments of the present invention provide an obstacle recognition method, device, equipment, medium and a weeding robot, so as to achieve the effect of improving the recognition efficiency and accuracy of obstacles in a candidate weeding area of the weeding robot.
[0005] In a first aspect, an embodiment of the present invention provides an obstacle recognition method, the method comprising:
[0006] Determine a candidate obstacle area in the candidate weeding area image according to color information of the candidate weeding area image;
[0007] Acquire contour information of the candidate obstacle area and brightness information of the candidate weeding area image;
[0008] It is determined whether there is an obstacle in the candidate weeding area image according to the contour information and the brightness information.
[0009] In a second aspect, an embodiment of the present invention further provides an obstacle recognition device, the device comprising:
[0010] A candidate obstacle region determination module, configured to determine a candidate obstacle region in the candidate weeding region image according to color information of the candidate weeding region image;
[0011] An information acquisition module, used to acquire the contour information of the candidate obstacle area and the brightness information of the candidate weeding area image;
[0012] The obstacle determination module is used to determine whether there is an obstacle in the candidate weeding area image according to the contour information and the brightness information.
[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0014] one or more processors;
[0015] a storage device for storing 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 having a computer program stored thereon, which implements the obstacle recognition method as described above when executed by a processor.
[0018] In a fifth aspect, an embodiment of the present invention further provides a weeding robot, comprising a robot body and the above-mentioned electronic device.
[0019] The embodiment of the present invention 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 of the candidate obstacle area and the brightness 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 and the brightness information, thereby solving the problem that the boundary of the weeding area of the weeding robot is usually calibrated by burying the boundary line in the prior art, which consumes a lot of manpower and material resources and increases the cost. In addition, since there are restrictions on the burying of the boundary line, the shape of the weeding area is limited to a certain extent, thereby achieving 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 A flowchart of an obstacle identification method provided in Embodiment 1 of the present invention;
[0021] Figure 2 A flowchart of an obstacle identification method provided in Embodiment 2 of the present invention;
[0022] Figure 3 A schematic diagram of the structure of an obstacle recognition device provided in Embodiment 3 of the present invention;
[0023] Figure 4 A schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0024] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease 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 This is a flowchart of an obstacle identification method provided in the first embodiment of the present invention. This embodiment is applicable to the situation where a weeding robot identifies obstacles in a candidate weeding area. The method can be executed by the obstacle identification device provided in the embodiment of the present invention, and the device can be implemented in software and / or hardware. Figure 1 The obstacle recognition method provided in this embodiment includes:
[0027] Step 110: Determine a candidate obstacle region in the candidate weeding region image according to color information of the candidate weeding region image.
[0028] The candidate weeding area is a possible working area of the weeding robot, which may be entirely filled with weeds to be removed, i.e., the weeding area; or it may be an obstacle or boundary area with grass covered on the surface, or a weeding area that is difficult to identify due to mottled light and other reasons.
[0029] The candidate weeding area image may 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 may be information such as the hue, saturation, and brightness of the image, and this embodiment does not limit this. The area that may be an obstacle is determined from the candidate weeding area image by the color information. For example, the area in the image that is significantly different from the surrounding color is determined as the candidate obstacle area according to the color information.
[0030] In this embodiment, optionally, determining the candidate obstacle area in the candidate weeding area image according to the color information of the candidate weeding area image includes:
[0031] Acquire a color segmentation image of the candidate weeding area image according to color information of the candidate weeding area image;
[0032] Morphological processing is performed on the color segmentation image, and a region of a preset color is determined as a candidate obstacle region from the color segmentation image after the morphological processing.
[0033] Wherein, the color segmentation image of the candidate weeding area image is obtained according to the color information of the candidate weeding area image, and the color segmentation can be performed according to the color dynamic segmentation, edge texture method segmentation, fixed threshold segmentation, Otsu threshold segmentation and other methods to obtain the color segmentation image of the candidate weeding area image. Wherein, the color segmentation image can be a binary image. Then, the color segmentation image is subjected to morphological processing, where the morphological processing can be a negation operation, an opening operation, a closing operation and the like, which is not limited in this embodiment.
[0034] The area of 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, so as to further identify the candidate obstacle area. The candidate weeding area is preliminarily classified by obtaining the color segmentation image, and the color segmentation image is morphologically processed to improve the accuracy of determining the candidate obstacle area.
[0035] Step 120: Obtain contour information of the candidate obstacle area and brightness information of the candidate weeding area image.
[0036] The contour information is the contour information of a single candidate obstacle region, and the acquisition method may be to perform contour detection on the candidate obstacle region. The contour information may include chromaticity information, roughness information, range information, etc. of the contour, which is not limited in this embodiment. The roughness information is used to display the roughness of the edge of the candidate obstacle region, and may be the average roughness. The average roughness may be calculated by dividing the sum of the roughness of all pixels in the obstacle region in the contour of a single candidate obstacle region by the total number of pixels in the obstacle region in the contour.
[0037] In this embodiment, optionally, determining the roughness information includes:
[0038] Acquire a brightness channel image of the candidate weeding area image;
[0039] Obtaining an edge image by performing edge extraction on the brightness channel image;
[0040] The roughness information is determined according to the grayscale value of the pixel in the edge information of the edge image.
[0041] By performing channel separation on the candidate weeding area image, a brightness channel image of the candidate weeding area image is obtained. Optionally, the brightness channel image is preprocessed, and the preprocessing may include filtering processing, normalization processing, etc., which is not limited in this embodiment. Edge extraction is performed on the preprocessed brightness channel image to obtain an edge image. The canny operator may be used for edge extraction to improve the accuracy of edge information acquisition in the edge image.
[0042] The roughness information of the candidate obstacle region is determined by edge information in the edge image at the corresponding position of the candidate obstacle region, and the edge information includes the grayscale value of the pixels in the outline of the candidate obstacle region. When the roughness information is the average roughness, the average roughness of the edge of the candidate obstacle region can be obtained by dividing the number of pixels in the outline with a grayscale value of 255 in the obstacle region by the total number of pixels in the obstacle region in the outline.
[0043] The roughness information is determined by the gray value of the pixel in the edge information of the edge image, so as to improve the accuracy of obtaining the roughness information and thus improve the accuracy of obstacle recognition.
[0044] The brightness information of the candidate weeding area image is the brightness information of the entire candidate weeding area image, and the brightness-related information in the image can be obtained by obtaining the brightness channel image of the candidate weeding area image. The relationship between the candidate obstacle area and the illumination is determined by the brightness information.
[0045] In this embodiment, optionally, the brightness information of the candidate weeding area image includes: the number of pixels in an exposed state and the number of white pixels in a non-exposed state;
[0046] Accordingly, obtaining brightness information of the candidate weeding area image includes:
[0047] According to the brightness values of the pixels in the candidate weeding area image, obtaining the number of pixels in the exposure state;
[0048] The number of white pixels in the non-exposed state is obtained according to the brightness value and the chromaticity value of the pixels in the candidate weeding area image.
[0049] The number of exposed pixels is the number of pixels in the candidate weeding area image that are in an exposed state. The number of non-exposed white pixels is the number of pixels in the candidate weeding area image that are not in an exposed state but appear white, such as pixels of white obstacles in the candidate weeding area image.
[0050] 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 acquisition 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.
[0051] According to the brightness and chromaticity of the pixels in the candidate weeding area image, the number of white pixels in the non-exposed state is obtained. The acquisition 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 value in the brightness channel image is less than a preset threshold value, such as 255, and whose chromaticity value in the chromaticity channel image is less than or equal to a preset threshold value, such as 0, as the number of white pixels in the non-exposed state.
[0052] By dividing the brightness information into the number of pixels in the exposed state and the number of white pixels in the non-exposed state, and determining the brightness information according to the brightness value and / or chromaticity value of the pixel, the accuracy of distinguishing the mottled weeding area caused by lighting and other reasons and the obstacle area that is white in itself in the candidate obstacle area can be improved.
[0053] Step 130: Determine whether there is an obstacle in the candidate weeding area image according to the contour information and the brightness information.
[0054] The contour information of the candidate obstacle area and the brightness information of the candidate weeding area image are compared with the preset information judgment condition. The preset information judgment condition is related to the contour information and the brightness information. If the preset information condition is met, the candidate obstacle area is determined to be an obstacle area, that is, it is determined 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.
[0055] Exemplarily, the identified obstacle is an obstacle where the surface of the area is covered with grass.
[0056] 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 of the candidate obstacle area and the brightness 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 and the brightness information, thereby solving the problem that the boundary of the weeding area of the weeding robot is usually calibrated by burying boundary lines in the prior art, which consumes a lot of manpower and material resources and increases costs. In addition, since there are restrictions on the burying of boundary lines, the shape of the weeding area is limited to a certain extent, thereby achieving the effect of improving the recognition efficiency and accuracy of obstacles in the candidate weeding area of the weeding robot.
[0057] Embodiment 2
[0058] Figure 2 This is a flowchart of an obstacle identification method provided in the second embodiment of the present invention. This technical solution is to supplement the process of determining whether there are obstacles in the candidate weeding area image based on the contour information and the brightness information. Compared with the above solution, this solution is specifically optimized as follows: the contour information of the candidate obstacle area includes: at least one of the number of chromaticity effective pixels, the proportion of chromaticity effective pixels, roughness information and range information; the brightness information includes: the number of pixels in the exposed state and / or the number of white pixels in the non-exposed state; then, based on the contour information and the brightness information, determining whether there are obstacles in the candidate weeding area image includes:
[0059] If the number of chroma effective pixels is greater than a preset effective pixel number threshold and the range information is greater than a preset first range threshold, determining whether the chroma effective pixel ratio is less than a preset first chroma effective pixel ratio threshold;
[0060] If yes, determining whether there is an obstacle in the candidate weeding area image according to the contour information, the brightness information and a preset first information judgment condition;
[0061] If not, it is determined whether there is an obstacle in the candidate weeding area image according to the contour information, the brightness information and the preset second information judgment condition. Specifically, the flowchart of obstacle recognition is as follows Figure 2 As shown:
[0062] Step 210: Determine a candidate obstacle area in the candidate weeding area image according to color information of the candidate weeding area image.
[0063] Step 220, obtaining contour information of the candidate obstacle area and brightness information of the candidate weeding area image; the contour information of the candidate obstacle area includes: at least one of the number of chromaticity effective pixels, the proportion of chromaticity effective pixels, roughness information and range information; the brightness information includes: the number of pixels in the exposed state and / or the number of white pixels in the non-exposed state.
[0064] The number of effective chromaticity pixels is the number of pixels in the obstacle area in the outline of a single candidate obstacle area that are in the effective pixel value chromaticity range. The effective chromaticity pixel ratio is the ratio of pixels in the obstacle area in the outline of a single candidate obstacle area that are in the effective pixel value chromaticity range to all pixels in the obstacle area in the outline. The range information is used to indicate the size of the candidate obstacle area, which can be the area, diagonal length, width, height, number of pixels included, etc., which is not limited in this embodiment.
[0065] In this embodiment, optionally, obtaining the number of chrominance effective pixels and / or the chrominance effective pixel ratio includes:
[0066] Determining a chromaticity segmentation threshold interval of the candidate weeding area image according to color information of the candidate weeding area image;
[0067] The number of chromaticity effective pixels and / or the proportion of chromaticity effective pixels are obtained according to the chromaticity segmentation threshold interval and the chromaticity values of the pixels in the candidate obstacle area.
[0068] Among them, a color segmentation image of the candidate weeding area image is obtained according to the color information of the candidate weeding area image, and color segmentation can be performed according to color dynamic segmentation, edge texture method segmentation, fixed threshold segmentation, Otsu threshold segmentation, etc. to obtain the chromaticity segmentation threshold interval of the candidate weeding area image, so as to convert the candidate weeding area image into a color segmentation image according to the chromaticity segmentation threshold interval.
[0069] The chromaticity segmentation threshold interval is taken as the chromaticity range of the valid pixel value, and the pixels whose chromaticity values are within the chromaticity segmentation threshold interval are taken as the chromaticity valid pixels. The number of chromaticity valid pixels in the obstacle area in the outline of a single candidate obstacle area is taken as the number of chromaticity valid pixels, and the ratio of chromaticity valid pixels in the obstacle area in the outline of a single candidate obstacle area to all pixels in the obstacle area in the outline is taken as the chromaticity valid pixel ratio.
[0070] By determining the chromaticity segmentation threshold interval based on the candidate weeding area image, the number of chromaticity effective pixels and / or the proportion of chromaticity effective pixels are obtained, and the correlation between the number of effective pixels and / or the proportion of chromaticity effective pixels and the candidate weeding area image itself is improved, thereby improving the recognition accuracy of obstacles in subsequent candidate weeding areas.
[0071] Step 230: If the number of chroma effective pixels is greater than a preset effective pixel number threshold and the range information is greater than a preset first range threshold, determine whether the chroma effective pixel ratio is less than a preset first chroma effective pixel ratio threshold.
[0072] The preset first effective pixel number threshold may be an empirical value, which is not limited in this embodiment. When the chromaticity effective pixel number is greater than the preset effective pixel number threshold, it indicates that the possibility that the candidate obstacle area is a weeding area image becomes greater, and it is necessary to further determine whether the candidate obstacle area is a weeding area or an obstacle area with a color similar to the weeding area, and the range information is greater than the preset first range threshold, so as to avoid processing too small candidate obstacle areas.
[0073] When the above conditions are met, it is determined whether the chromaticity effective pixel ratio is less than the preset chromaticity effective pixel ratio threshold, that is, the candidate obstacle area with a relatively high probability of being an obstacle is determined among the candidate obstacle areas with a relatively high probability of being a weeding area.
[0074] Optionally, the contour information also includes position information. The position information is used to display the distance between the candidate obstacle area and the weeding robot, for example, the y-axis coordinate value of the lower right corner of the minimum circumscribed rectangle of the candidate obstacle area. Of course, other representative coordinate values can also be selected, and this embodiment does not limit this. On the basis of judging the candidate obstacle area by the number of effective chromatic pixels and range information, further judgment is made by position information to avoid processing candidate obstacle areas that are too far away, reduce the processed data, and improve the efficiency of obstacle recognition.
[0075] For example, if the number of chromaticity effective pixels is greater than the preset effective pixel number threshold, the range information exceeds the preset first range threshold, and the position information is greater than the preset position threshold, then it is determined whether the chromaticity effective pixel ratio is within the range of the preset chromaticity effective pixel ratio threshold.
[0076] For example, the number of effective chrominance pixels is SContours i , where i is the number of the candidate obstacle area, and the percentage of effective chromaticity pixels is SPContours i , the range information is the diagonal length of the candidate obstacle area AContours i .diagonal or the height of the candidate obstacle area AContours i .height, the location information is the y-axis coordinate value of the lower right corner of the minimum enclosing rectangle of the candidate obstacle area YContours i , the larger the coordinate value, the closer the candidate obstacle area is to the robot. If the preset chromaticity threshold is a, the preset chromaticity effective pixel ratio threshold is 0.4, the preset diagonal threshold of the first range threshold is 105, the height threshold is 70, and the preset position threshold is 75, then the judgment condition is: if SContours i >a and AContours i .diagonal>105 and YContours i >75; or SContours i >a and AContours i .height>70 and YContoursi>75. Then determine whether SPContours i <0.4
[0077] Step 240: If yes, determine whether there is an obstacle in the candidate weeding area image according to the contour information, the brightness information and a preset first information judgment condition.
[0078] When the number of effective chromaticity pixels is greater than the preset effective pixel number threshold, and the range information is greater than the preset first range threshold, and the proportion of effective chromaticity pixels is less than the preset first effective chromaticity pixel proportion threshold, it is determined whether there are obstacles in the candidate weeding area image based on the contour information, brightness information and the preset first information judgment condition. That is, the candidate obstacle area with a relatively high probability of being an obstacle determined from the candidate obstacle area with a high probability of being a weeding area is further analyzed. Among them, the preset first information judgment condition can be adjusted according to the specific judgment scenario, and this embodiment does not limit this.
[0079] In this embodiment, optionally, determining whether there is an obstacle in the candidate weeding area image according to the contour information, the brightness information and a preset first information judgment condition includes:
[0080] If the number of pixels in the exposure state is less than a preset first threshold value of the number of pixels in the exposure state and greater than a preset second threshold value of the number of pixels in the exposure state, and the roughness information is less than a preset first roughness threshold value, it is determined that there is an obstacle in the candidate weeding area image;
[0081] If the number of pixels in the exposure state is greater than a preset third threshold of the number of pixels in the exposure state, and the chromaticity effective pixel ratio is less than a preset second threshold of the chromaticity effective pixel ratio, and the range information is greater than a preset second range threshold, it is determined that there is an obstacle in the candidate weeding area image;
[0082] If the number of pixels in the exposure state is greater than the preset fourth exposure state pixel number threshold, and the number of white pixels in the non-exposed state is greater than the preset first non-exposed state white pixel threshold, and the roughness information is less than the preset second roughness threshold, and the range information is greater than the preset third range threshold, it is determined that there are obstacles in the candidate weeding area image.
[0083] If the contour information and the brightness information meet the preset first information judgment condition, it is determined that there is an obstacle in the candidate weeding area image.
[0084] For example, the roughness information is the average roughness HContours of the candidate obstacle area contour i The smaller the average roughness, the smoother the candidate obstacle area. The range information is the number of pixels in the candidate obstacle area AContours i .pixels, the number of pixels in the exposed state overbrightPix and the number of white pixels in the non-exposed state zeroPix.
[0085] Exemplarily, the preset threshold for the number of pixels in the first exposure state is 200, the preset threshold for the number of pixels in the second exposure state is 2500, and the preset first roughness threshold is 0.25. Then the preset first information judgment condition is 200 < overbrightPix < 2500 and HContours i < 0.25. 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 painted stone road covered with grass.
[0086] For example, the preset threshold for the number of pixels in the third exposure state is 500, the preset threshold for the proportion of valid chromaticity pixels in the second is 0.29, and the preset second range threshold is 7700. Then the preset first information judgment condition is 500 < overbrightPix and SPContours i < 0.29 and AContours i .pixels > 7700. 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 leaf or wood chips.
[0087] For example, the preset threshold for the number of pixels in the fourth exposure state is 400, the preset threshold for the number of white pixels in the first non-exposure state is 80, the preset second roughness threshold is 0.27, and the preset third range threshold is 6900. Then the preset first information judgment condition is 400 < overbrightPix and zeroPix > 80 and HContours i < 0.27 and AContours i .pixels > 6900. When this condition is met, it is determined that there is an obstacle in the candidate weeding area image.
[0088] Step 250: If not, determine whether there is an obstacle in the candidate weeding area image according to the contour information, the brightness information, and the preset second information judgment condition.
[0089] When the number of valid chromaticity pixels is greater than the preset threshold for the number of valid pixels, and the proportion of valid chromaticity pixels is greater than the preset threshold for the proportion of valid chromaticity pixels, determine whether there is an obstacle in the candidate weeding area image according to the contour information, the brightness information, and the preset second information judgment condition. That is, further analyze the candidate obstacle areas with relatively low possibility of being obstacles determined from the candidate obstacle areas with relatively high possibility in the weeding area. Among them, the preset second information judgment condition can be adjusted according to the specific judgment scenario, and this embodiment does not limit this.
[0090] Optionally, in this embodiment, determining whether there is an obstacle in the candidate weeding area image according to the contour information, the brightness information, and the preset second information judgment condition includes:
[0091] If the number of pixels in the exposure state is less than a preset fifth threshold for the number of pixels in the exposure state and greater than a preset sixth threshold for the number of pixels in the exposure state, and the proportion of chrominance valid pixels is less than a preset third threshold for the proportion of chrominance valid pixels, and the range information is greater than a preset fourth range threshold, and the roughness information is less than a preset third roughness threshold, and the number of white pixels in the non-exposure state is greater than a preset second threshold for the number of white pixels in the non-exposure state, then 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 less than a preset seventh threshold for the number of pixels in the exposure state and greater than a preset eighth threshold for the number of pixels in the exposure state, and the proportion of chrominance valid pixels is less than a preset fourth threshold for the proportion of chrominance valid pixels, and the roughness information is less than a preset fourth roughness threshold, then it is determined that there is an obstacle in the candidate weeding area image.
[0093] If the contour information and the brightness information meet the preset second information judgment condition, then it is determined that there is an obstacle in the candidate weeding area image.
[0094] Exemplarily, the preset fifth threshold for the number of pixels in the exposure state is 300, the preset sixth threshold for the number of pixels in the exposure state is 400, the preset third threshold for the proportion of chrominance valid pixels is 0.6, the preset fourth range threshold is 8000, the preset third roughness threshold is 0.26, and the preset second threshold for the number of white pixels in the non-exposure state is 100. Then the preset second information judgment condition is 300 < overbrightPix < 400 and SPContours i < 0.6 and AContours i .pixels > 8000 and HContours i < 0.26 and zeroPix > 100. 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 stone path with grass growing out of the gaps.
[0095] For example, the preset seventh threshold for the number of pixels in the exposure state is 200, the preset eighth threshold for the number of pixels in the exposure state is 2500, the preset fourth threshold for the proportion of chrominance valid pixels is 0.6, and the preset fourth roughness threshold is 0.23. Then the preset second information judgment condition is 200 < overbrightPix < 2500 and SPContours i < 0.6 and HContours i < 0.23. When this condition is met, it is determined that there is an obstacle in the candidate weeding area image.
[0096] The embodiments of the present invention determine whether there are obstacles in the candidate weeding area image based on contour information and brightness information such as the number of chromaticity effective pixels, the proportion of chromaticity effective pixels, roughness information, range information, etc., thereby improving the accuracy of identifying candidate obstacle areas such as obstacles or boundary areas where the surface of the area is covered with grass, or candidate obstacle areas that are difficult to determine whether they are obstacle areas due to mottled light and other reasons.
[0097] Embodiment 3
[0098] Figure 3 This is a schematic diagram of the structure of an obstacle identification device provided in the third embodiment of the present invention. The device can be implemented by hardware and / or software, can execute an obstacle identification method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. Figure 3 As shown, the device comprises:
[0099] A candidate obstacle region determination module 310 is used to determine a candidate obstacle region in the candidate weeding region image according to color information of the candidate weeding region image;
[0100] An information acquisition module 320 is used to acquire the contour information of the candidate obstacle area and the brightness information of the candidate weeding area image;
[0101] The obstacle determination module 330 is used to determine whether there is an obstacle in the candidate weeding area image according to the contour information and the brightness information.
[0102] 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 of the candidate obstacle area and the brightness 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 and the brightness information, thereby solving the problem that the boundary of the weeding area of the weeding robot is usually calibrated by burying boundary lines in the prior art, which consumes a lot of manpower and material resources and increases costs. In addition, since there are restrictions on the burying of boundary lines, the shape of the weeding area is limited to a certain extent, thereby achieving the effect of improving the recognition efficiency and accuracy of obstacles in the candidate weeding area of the weeding robot.
[0103] On the basis of the above technical solutions, optionally, the candidate obstacle area determination module includes:
[0104] A color segmentation image acquisition unit, used for acquiring a color segmentation image of the candidate weeding area image according to the color information of the candidate weeding area image;
[0105] The candidate obstacle region determining unit is used to perform morphological processing on the color segmentation image, and determine a region of a preset color from the color segmentation image after the morphological processing as a candidate obstacle region.
[0106] Based on the above technical solutions, optionally, the contour information of the candidate obstacle area includes: at least one of: the number of chromaticity effective pixels, the proportion of chromaticity effective pixels, roughness information and range information; the brightness information includes: the number of pixels in the exposed state and / or the number of white pixels in the non-exposed state;.
[0107] Accordingly, the obstacle determination module includes:
[0108] A proportion judgment unit, configured to judge whether the proportion of chroma effective pixels is less than a preset first chroma effective pixel proportion threshold value if the number of chroma effective pixels is greater than a preset effective pixel number threshold value and the range information is greater than a preset first range threshold value;
[0109] A first obstacle determination unit, configured to determine whether there is an obstacle in the candidate weeding area image according to the contour information, the brightness information and a preset first information judgment condition if the proportion judgment unit determines that there is an obstacle;
[0110] The second obstacle determination unit is configured to determine whether there is an obstacle in the candidate weeding area image according to the contour information, the brightness information and a preset second information judgment condition if the proportion judgment unit determines that there is no obstacle.
[0111] On the basis of the above technical solutions, optionally, the first obstacle determination unit includes: a first obstacle determination subunit, configured to determine that an obstacle exists in the candidate weeding area image if the number of pixels in the exposure state is less than a preset first exposure state pixel number threshold and greater than a preset second exposure state pixel number threshold, and the roughness information is less than a preset first roughness threshold;
[0112] A second obstacle determination subunit is configured to determine that an obstacle exists in the candidate weeding area image if the number of pixels in the exposure state is greater than a preset third exposure state pixel number threshold, the chroma effective pixel ratio is less than a preset second chroma effective pixel ratio threshold, and the range information is greater than a preset second range threshold;
[0113] The third obstacle determination subunit is used 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 exposure state pixel number threshold, and the number of white pixels in the non-exposed state is greater than a preset first non-exposed state white pixel threshold, and the roughness information is less than a preset second roughness threshold, and the range information is greater than a preset third range threshold.
[0114] Based on the above technical solutions, optionally, the second obstacle determination unit includes:
[0115] a fourth obstacle determination subunit, configured to determine that an obstacle exists in the candidate weeding area image if the number of pixels in the exposure state is less than a preset fifth exposure state pixel number threshold and greater than a preset sixth exposure state pixel number threshold, and the chroma effective pixel ratio is less than a preset third chroma effective pixel ratio threshold, and the range information is greater than a preset fourth range threshold, and the roughness information is less than a preset third roughness threshold, and the number of white pixels in the non-exposed state is greater than a preset second white pixel threshold in the non-exposed state;
[0116] The fifth obstacle determination subunit is used to determine that there is an obstacle in the candidate weeding area image if the number of exposure state pixels is less than a preset seventh exposure state pixel number threshold and greater than a preset eighth exposure state pixel number threshold, and the chromaticity effective pixel ratio is less than a preset fourth chromaticity effective pixel ratio threshold, and the roughness information is less than a preset fourth roughness threshold.
[0117] Embodiment 4
[0118] Figure 4 A schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention is shown in FIG. Figure 4 As 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 4 A processor 40 is taken as an example; the processor 40, the memory 41, the input device 42 and the output device 43 in the electronic device can be connected by a bus or other means. Figure 4 The example of connecting through bus is taken in the following.
[0119] The memory 41 is a computer-readable storage medium that can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the obstacle recognition method in the embodiment 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, implements the above-mentioned obstacle recognition method.
[0120] The memory 41 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 41 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 41 may further include a memory remotely arranged relative to the processor 40, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0121] Embodiment 5
[0122] Embodiment 5 of the present invention further provides a storage medium including computer executable instructions, wherein the computer executable instructions are used to execute an obstacle identification method when executed by a computer processor, the method comprising:
[0123] Determine a candidate obstacle area in the candidate weeding area image according to color information of the candidate weeding area image;
[0124] Acquire contour information of the candidate obstacle area and brightness information of the candidate weeding area image;
[0125] It is determined whether there is an obstacle in the candidate weeding area image according to the contour information and the brightness information.
[0126] Of course, the computer executable instructions of a storage medium containing computer executable instructions provided in an embodiment of the present invention are not limited to the operations of the method described above, and can also execute related operations in the obstacle identification method provided in any embodiment of the present invention.
[0127] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. 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, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0128] It is worth noting that in the embodiment of the above-mentioned obstacle recognition device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0129] Embodiment 6
[0130] Embodiment 6 of the present invention provides a weeding robot, comprising a robot body and the electronic device described in any embodiment of the present invention.
[0131] Specifically, the electronic device installed on the lawn mowing robot can perform relevant operations of an obstacle recognition method described in any embodiment of the present invention.
[0132] The robot body may include two active driving wheels on the left and right, which may be driven by motors respectively. The motors may be brushless motors with reduction gears and Hall sensors. The robot body realizes driving operations such as forward, backward, turning and arc by controlling the speed and direction of the two active driving wheels. The robot body also includes universal wheels, cameras and rechargeable batteries, wherein the universal wheels play a supporting and balancing role. The camera is installed at a designated position of the robot and forms a preset angle with the horizontal direction to capture images of the candidate weeding area. The rechargeable battery is used to provide power for the robot to work.
[0133] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection 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, and may include more other equivalent embodiments without departing from the concept of the present invention, 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: include: Determine a candidate obstacle area in the candidate weeding area image according to color information of the candidate weeding area image; The candidate weeding area image is captured by a camera installed on the weeding robot; Acquire contour information of the candidate obstacle area and brightness information of the candidate weeding area image; Determining whether there is an obstacle in the candidate weeding area image according to the contour information and the brightness information; The contour information of the candidate obstacle area includes: at least one of: the number of chromaticity effective pixels, the proportion of chromaticity effective pixels, roughness information and range information, and the range information is used to indicate the size of the candidate obstacle area; the brightness information includes: the number of pixels in the exposed state and / or the number of white pixels in the non-exposed state; The brightness information is obtained in the following manner: According to the brightness values of the pixels in the candidate weeding area image, obtaining the number of pixels in the exposure state; According to the brightness value and chromaticity value of the pixels in the candidate weeding area image, the number of white pixels in the non-exposed state is obtained; The determining whether there is an obstacle in the candidate weeding area image according to the contour information and the brightness information includes: If the number of chroma effective pixels is greater than a preset effective pixel number threshold and the range information is greater than a preset first range threshold, determining whether the chroma effective pixel ratio is less than a preset first chroma effective pixel ratio threshold; If yes, determining whether there is an obstacle in the candidate weeding area image according to the contour information, the brightness information and a preset first information judgment condition; If not, determining whether there is an obstacle in the candidate weeding area image according to the contour information, the brightness information and a preset second information judgment condition; The determining whether there is an obstacle in the candidate weeding area image according to the contour information, the brightness information and a preset first information judgment condition includes: If the number of pixels in the exposure state is less than a preset first threshold value of the number of pixels in the exposure state and greater than a preset second threshold value of the number of pixels in the exposure state, and the roughness information is less than a preset first roughness threshold value, it is determined 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 threshold value of the number of pixels in the exposure state, and the ratio of the effective chromaticity pixels is less than a preset second threshold value of the ratio of effective chromaticity pixels, and the range information is greater than a preset second threshold value of the range, it is determined that there are obstacles in the candidate weeding area image; if the number of pixels in the exposure state is greater than a preset fourth threshold value of the number of pixels in the exposure state, and the number of white pixels in the non-exposed state is greater than a preset first threshold value of white pixels in the non-exposed state, and the roughness information is less than a preset second threshold value of the roughness, and the range information is greater than a preset third threshold value of the range, it is determined that there are obstacles in the candidate weeding area image; The determining whether there is an obstacle in the candidate weeding area image according to the contour information, the brightness information and a preset second information judgment condition includes: If the number of pixels in the exposure state is less than the preset fifth threshold value of the number of pixels in the exposure state and greater than the preset sixth threshold value of the number of pixels in the exposure state, and the chromaticity effective pixel ratio is less than the preset third threshold value of the chromaticity effective pixel ratio, and the range information is greater than the preset fourth range threshold value, and the roughness information is less than the preset third roughness threshold value, and the number of white pixels in the non-exposed state is greater than the preset second threshold value of white pixels in the non-exposed state, it is determined that there are obstacles in the candidate weeding area image; If the number of exposure state pixels is less than the preset seventh exposure state pixel number threshold and greater than the preset eighth exposure state pixel number threshold, and the chromaticity effective pixel ratio is less than the preset fourth chromaticity effective pixel ratio threshold, and the roughness information is less than the preset fourth roughness 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 color information of the candidate weeding area image includes: Acquire a color segmentation image of the candidate weeding area image according to color information of the candidate weeding area image; Morphological processing is performed on the color segmentation image, and a region of a preset color is determined as a candidate obstacle region from the color segmentation image after the morphological processing.
3. An electronic device, characterized in that: The electronic device comprises: 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 as described in any one of claims 1-2.
4. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the obstacle recognition method as described in any one of claims 1-2 is implemented.
5. A weeding robot, comprising a robot body, characterized in that: Also included is an electronic device as claimed in claim 3.
Citation Information
Patent Citations
Automatic walking equipment and obstacle detection method thereof
CN104111460A
Obstacle-crossing identification system and method
CN107139666A