Obstacle recognition method, device, equipment, medium and weeding robot
By performing chromaticity analysis and feature extraction on the images of candidate weeding areas of the weeding robot, identifying obstacles, solving the high cost and shape limitation problems of traditional burying boundary lines, and achieving more efficient and accurate obstacle recognition.
Patent Information
- Application Number
- CN202011553859.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-24
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2040-12-24
AI Technical Summary
Existing weeding robots calibrate by burying boundary lines, which consumes a lot of manpower and material resources, increasing costs, and there are restrictions on the burying boundary lines, limiting the shape of the weeding area.
By obtaining the chromaticity information of the candidate weeding area image, a chromaticity histogram is generated to process, peak information and chromaticity segmentation information are determined, and whether there is a shadowed area is identified, thereby determining the existence of obstacles.
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 the limitations of boundary shapes.
Smart Images

Figure CN114677581B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to computer 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] Acquire chromaticity information of the candidate weeding area image, and generate a to-be-processed chromaticity histogram of the candidate weeding area image according to the chromaticity information, so as to acquire first peak information of the to-be-processed chromaticity histogram;
[0007] Generate a target chromaticity histogram according to the chromaticity histogram to be processed, and determine second peak information and chromaticity segmentation information of the target chromaticity histogram;
[0008] Determining brightness information of the candidate weeding area image according to the chromaticity segmentation information and the brightness image of the candidate weeding area image;
[0009] Determining roughness information of the candidate weeding area image according to the chromaticity segmentation information and the edge image of the brightness image;
[0010] According to the first peak information, the second peak information, the brightness information and the roughness information, it is determined whether there is a shadow area in the candidate weeding area image, so as to determine whether there is an obstacle in the candidate weeding area image.
[0011] In a second aspect, an embodiment of the present invention further provides an obstacle recognition device, the device comprising:
[0012] A histogram generation module, used for acquiring chromaticity information of the candidate weeding area image, and generating a to-be-processed chromaticity histogram of the candidate weeding area image according to the chromaticity information, so as to acquire first peak information of the to-be-processed chromaticity histogram;
[0013] An information determination module, used to generate a target chromaticity histogram according to the chromaticity histogram to be processed, and determine the second peak information and chromaticity segmentation information of the target chromaticity histogram;
[0014] a brightness information determination module, configured to determine the brightness information of the candidate weeding area image according to the chromaticity segmentation information and the brightness image of the candidate weeding area image;
[0015] A roughness information determination module, used to determine the roughness information of the candidate weeding area image according to the chromaticity segmentation information and the edge image of the brightness image;
[0016] The obstacle determination module is used to determine whether there is a shadow area in the candidate weeding area image according to the first peak information, the second peak information, the brightness information and the roughness information, so as to determine whether there is an obstacle in the candidate weeding area image.
[0017] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0018] one or more processors;
[0019] a storage device for storing one or more programs,
[0020] 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.
[0021] 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.
[0022] 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.
[0023] The embodiment of the present invention obtains the chromaticity information of the candidate weeding area image, and generates the to-be-processed chromaticity histogram of the candidate weeding area image according to the chromaticity information, so as to obtain the first peak information of the to-be-processed chromaticity histogram; generates the target chromaticity histogram according to the to-be-processed chromaticity histogram, and determines the second peak information and chromaticity segmentation information of the target chromaticity histogram; determines the brightness information of the candidate weeding area image according to the chromaticity segmentation information and the brightness image of the candidate weeding area image; determines the roughness information of the candidate weeding area image according to the chromaticity segmentation information and the edge image of the brightness image; determines whether there is a shadow area in the candidate weeding area image according to the first peak information, the second peak information, the brightness information and the roughness information, so as to determine whether there is an obstacle in the candidate weeding area image. The invention solves 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. Furthermore, since there are restrictions on the burying of the boundary line, the shape of the weeding area is restricted 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
[0024] Figure 1 A flowchart of an obstacle identification method provided in Embodiment 1 of the present invention;
[0025] Figure 2 A flowchart of an obstacle identification method provided in Embodiment 2 of the present invention;
[0026] Figure 3 A schematic diagram of the structure of an obstacle recognition device provided in Embodiment 3 of the present invention;
[0027] Figure 4 A schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0028] 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.
[0029] Embodiment 1
[0030] Figure 1This 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:
[0031] Step 110: Acquire chromaticity information of the candidate weeding area image, and generate a to-be-processed chromaticity histogram of the candidate weeding area image according to the chromaticity information, so as to acquire first peak information of the to-be-processed chromaticity histogram.
[0032] The candidate weeding area is the possible working area of the weeding robot, which may be full of weeds to be removed, that is, the weeding area; it may also be an obstacle or boundary with a color similar to the lawn, but with weaker reflection and smoother surface, which will form a certain degree of brightness contrast with the surrounding grass.
[0033] The candidate weeding area image can be taken by a camera installed on the weeding robot, and this embodiment does not limit this. The chromaticity information of the candidate weeding area image is the chromaticity characteristics of the entire candidate weeding area image, and the chromaticity-related information in the image can be obtained by obtaining the chromaticity channel image of the candidate weeding area image, such as the chromaticity value of each pixel in the image, and this embodiment does not limit this.
[0034] By performing histogram statistics on the chromaticity information, a chromaticity histogram to be processed of the candidate weeding area image can be generated, which reflects the specified chromaticity information of the pixels in the candidate weeding area image. For example, the chromaticity value distribution statistics of all pixels in the candidate weeding area image are generated, and this embodiment does not limit this. The horizontal coordinate of the chromaticity histogram to be processed can be the chromaticity value, and the vertical coordinate can be the frequency, that is, the number of pixels at the chromaticity value in the candidate weeding area image, which is used to reflect the chromaticity distribution of the pixels in the candidate weeding area image.
[0035] The first peak information is designated peak information in the chrominance histogram to be processed, and may be peak information with the largest frequency difference corresponding to the left and right adjacent chrominances, which is not limited in this embodiment.
[0036] Step 120: Generate a target chromaticity histogram according to the chromaticity histogram to be processed, and determine second peak information and chromaticity segmentation information of the target chromaticity histogram.
[0037] The target chromaticity histogram is used to intuitively reflect the chromaticity distribution information in the candidate weeding area image. The generation process of the target chromaticity histogram based on the chromaticity histogram to be processed can be: smoothing the chromaticity histogram to be processed to obtain a smoothed chromaticity histogram; determining the target peak point set and the target valley point set in the preset chromaticity interval of the smoothed chromaticity histogram according to the preset screening rules; generating the target chromaticity histogram based on the target peak point set and the target valley point set.
[0038] The chromaticity histogram to be processed is smoothed to remove noise in the chromaticity histogram to be processed, thereby improving the accuracy of obtaining peak information in the target chromaticity histogram subsequently generated according to the smoothed chromaticity histogram. The smoothing process may be a filtering process, which is not limited in this embodiment.
[0039] The data in the smooth chromaticity histogram is filtered according to the preset filtering rules, and a target peak point set and a target valley point set that may be closely related to obstacle identification are filtered out from all peak points and valley points in the preset chromaticity interval in the smooth chromaticity histogram, and optionally, the preset chromaticity interval is 15-95, which is not limited in this embodiment. Then, a target chromaticity histogram is generated according to the target peak point set and the target valley point set.
[0040] The preset screening rules may include: each peak in the target peak point set is greater than a preset multiple of each valley in the target valley point; the distance between the target peak points is greater than a preset distance threshold; the peak value of the target peak point is greater than a preset peak threshold, and this embodiment does not impose any restrictions on this.
[0041] Exemplarily, the peak value of the target peak point is greater than K*the valley value of the target valley point, where K is a preset multiple. The distance between the target peak points is greater than a preset distance threshold D, and the peak value of the target peak point is greater than a preset peak threshold C.
[0042] The second peak information of the target chromaticity histogram is information related to the peak in the target chromaticity histogram, which can be a specific value of a specified peak in the target chromaticity histogram, and this embodiment does not limit this. The chromaticity segmentation information is used to divide the target chromaticity histogram into two left and right regions according to the chromaticity value to obtain information in each of the two regions.
[0043] In this embodiment, optionally, determining the second peak information and chromaticity segmentation information of the target chromaticity histogram includes:
[0044] Acquire peak point information and valley point information in a preset chromaticity interval of the target chromaticity histogram; the peak point information includes: the number of peak points, the peak point peak value and the peak point chromaticity value; the valley point information includes: the valley point valley value and the valley point chromaticity value;
[0045] The second peak information and the chromaticity segmentation information of the target chromaticity histogram are determined according to the peak point information and / or the valley point information.
[0046] Get the number of peak points, peak point peak value and peak point chromaticity value of the peak points in the preset chromaticity interval in the target chromaticity histogram, as well as the valley point valley value and valley point chromaticity value of the valley point. The number of peak points is the number of peak points in the preset chromaticity interval in the target chromaticity histogram, the peak point peak value is the frequency corresponding to the peak point, the peak point chromaticity value is the chromaticity value corresponding to the peak point, the valley point valley value is the frequency corresponding to the valley point, and the valley point chromaticity value is the chromaticity value corresponding to the valley point.
[0047] The second peak information and chromaticity segmentation information of the target chromaticity histogram are determined according to the peak point information and / or valley point information. Different second peak information and chromaticity segmentation information can be determined according to different numbers of peak points in combination with other peak point information and / or valley point information.
[0048] The second peak information and chromaticity segmentation information of the target chromaticity histogram are determined according to the peak point information and / or the valley point information, thereby improving the accuracy and pertinence of determining the second peak information and the chromaticity segmentation information.
[0049] In this embodiment, optionally, determining the second peak information and chromaticity segmentation information of the target chromaticity histogram according to the peak point information and / or the valley point information includes:
[0050] If the number of the peak points is less than two, determining the second peak information and the chromaticity segmentation information of the target chromaticity histogram according to whether there is a minimum demarcation point and the number of the peak points;
[0051] If the number of the peak points is greater than or equal to two, the second peak information and the chroma segmentation information are acquired according to the peak point peak value, the peak point chroma value, the valley point valley value and the valley point chroma value.
[0052] Among them, the second peak information may include the maximum peak point chromaticity value of the first area and the maximum peak point chromaticity value of the second area. This embodiment is not limited to this. The first area and the second area of the target chromaticity histogram can be jointly determined by the chromaticity segmentation information and the preset chromaticity interval.
[0053] When the number of peak points is less than two, the segmentation threshold of the candidate weeding area image can be determined by the Otsu threshold method or the like, and the segmentation threshold is used as the chromaticity segmentation value of the target chromaticity histogram.
[0054] Determine whether there is a minimum dividing point in the preset chromaticity interval, where the minimum dividing point can be a point with the smallest chromaticity value among the points whose frequency at the point is greater than the frequencies at the two adjacent points on the right side of the point. For example, starting from the left end point in the preset chromaticity interval and moving to the right in sequence, determine whether the point meets the dividing point requirement. If the chromaticity value corresponding to the point is mi, then when there is a frequency corresponding to mi that is greater than the frequencies corresponding to mi+1 and mi+2, the point corresponding to the smallest mi is determined as the minimum dividing point.
[0055] If there is a minimum dividing point, when the number of peak points is 0, the chromaticity value corresponding to the minimum dividing point is determined as the chromaticity value of the maximum peak point in the first area, and the chromaticity value of the right endpoint in the preset chromaticity interval is determined as the chromaticity value of the maximum peak point in the second area.
[0056] When the number of peak points is 1, the chromaticity value corresponding to the minimum demarcation point is determined as the maximum peak point chromaticity value of the first region, and the peak point chromaticity value is determined as the maximum peak point chromaticity value of the second region.
[0057] If there is no minimum dividing point, when the number of peak points is 0, the left endpoint chromaticity value in the preset chromaticity interval is determined as the maximum peak point chromaticity value of the first area, and the right endpoint chromaticity value in the preset chromaticity interval is determined as the maximum peak point chromaticity value of the second area.
[0058] When the number of peak points is 1, the peak point chromaticity values are determined as the maximum peak point chromaticity value of the first region and the maximum peak point chromaticity value of the second region.
[0059] If the number of peak points is greater than or equal to 2, the second peak information and chromaticity segmentation information are obtained according to the peak point peak value, the peak point chromaticity value, the valley point valley value and the valley point chromaticity value. The specific steps may include: 1) According to the peak point peak value and the valley value of the valley point adjacent to the peak point, determine a pair of peak points and valley points with the largest peak-to-valley ratio, and record the valley point as m. 2) Find the largest peak to the left of point m, and use the chromaticity value corresponding to the peak as the chromaticity value of the maximum peak point in the first area; use the chromaticity value corresponding to the largest peak to the right of point m as the chromaticity value of the maximum peak point in the second area. 3) Use the chromaticity value corresponding to the value with the smallest frequency between the chromaticity value of the maximum peak point in the first area and the chromaticity value of the maximum peak point in the second area as the chromaticity segmentation value.
[0060] Different second peak information and chromaticity segmentation information are determined according to the number of peak points, so as to obtain corresponding second peak information and chromaticity segmentation information in all cases, thereby improving the accuracy of obstacle recognition in subsequent cases.
[0061] Step 130: Determine the brightness information of the candidate weeding area image according to the chromaticity segmentation information and the brightness image of the candidate weeding area image.
[0062] The brightness image can be a brightness channel image obtained by performing channel separation on the candidate weeding area image, and the brightness channel image can be preprocessed, and the preprocessing can include filtering processing, normalization processing, etc., which is not limited in this embodiment. The brightness value of each pixel in the candidate weeding area image can be obtained based on the brightness channel image, and the brightness information of the pixels in different chromaticity areas can be obtained based on the chromaticity segmentation information as the brightness information of the candidate weeding area image.
[0063] Step 140: Determine the roughness information of the candidate weeding area image according to the chromaticity segmentation information and the edge image of the brightness image.
[0064] The preprocessed brightness image can be subjected to edge extraction to obtain an edge image, and the canny operator can be used for edge extraction to improve the accuracy of obtaining edge information in the edge image.
[0065] The roughness information is determined by edge information in the edge image, and the edge information includes the grayscale value of the edge pixel. The roughness information may be an average roughness. When the roughness information is the average roughness, the average roughness of the edge may be obtained by dividing the number of pixels in the edge image whose grayscale value is equal to 255 by the total number of pixels in the edge image.
[0066] According to the chromaticity segmentation information, the roughness information of the pixel points in different chromaticity areas can be obtained as the roughness information of the candidate weeding area image.
[0067] 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.
[0068] Step 150: Determine whether there is a shadow area in the candidate weeding area image according to the first peak information, the second peak information, the brightness information and the roughness information, so as to determine whether there is an obstacle in the candidate weeding area image.
[0069] The first peak information of the chromaticity histogram to be processed, the second peak information of the target chromaticity histogram, the brightness information of the candidate weeding area image, and the roughness information of the candidate weeding area image are compared with the preset information judgment condition. Among them, the preset information judgment condition is related to the first peak information, the second peak information, the brightness information and the roughness information. If the preset information judgment condition is met, it is determined that there is no shadow area in the candidate weeding area image. At this time, if a suspected obstacle area is identified in the candidate weeding area, it is determined that there is an obstacle in the candidate weeding area, so that the weeding robot can perform subsequent obstacle processing.
[0070] For example, when it is determined that there is no shadow area in the candidate weeding area image, a dynamic segmentation method can be used to segment the candidate weeding area image. In this case, black areas can be used to represent dark obstacles instead of shadow areas in the segmented image, and white areas can be used to represent weeding areas.
[0071] Exemplarily, the identified obstacle is an obstacle that is similar in color to the grass, but has a weaker reflection and a smoother surface, and forms a certain degree of brightness contrast with the surrounding grass.
[0072] The technical solution provided in this embodiment obtains the chromaticity information of the candidate weeding area image, and generates the to-be-processed chromaticity histogram of the candidate weeding area image according to the chromaticity information, so as to obtain the first peak information of the to-be-processed chromaticity histogram; generates the target chromaticity histogram according to the to-be-processed chromaticity histogram, and determines the second peak information and chromaticity segmentation information of the target chromaticity histogram; determines the brightness information of the candidate weeding area image according to the chromaticity segmentation information and the brightness image of the candidate weeding area image; determines the roughness information of the candidate weeding area image according to the chromaticity segmentation information and the edge image of the brightness image; determines whether there is a shadow area in the candidate weeding area image according to the first peak information, the second peak information, the brightness information and the roughness information, so as to determine whether there is an obstacle in the candidate weeding area image. 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. Furthermore, since there are restrictions on the burying of the boundary line, the shape of the weeding area is restricted 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.
[0073] Embodiment 2
[0074] Figure 2 A flowchart of an obstacle identification method provided for Embodiment 2 of the present invention, this technical solution is to supplement the process of determining whether there is a shadow area in the candidate weeding area image based on the first peak information, the second peak information, the brightness information and the roughness information, so as to determine whether there is an obstacle in the candidate weeding area image. Compared with the above solution, this solution is specifically optimized to, before determining whether there is a shadow area in the candidate weeding area image based on the first peak information, the second peak information, the brightness information and the roughness information, so as to determine whether there is an obstacle in the candidate weeding area image, it also includes:
[0075] Determine a first peak point chromaticity value difference according to the mutation peak point chromaticity value and the maximum peak point chromaticity value of the first region;
[0076] A second peak point chromaticity value difference is determined according to the sudden change peak point chromaticity value and the second region maximum peak point chromaticity value.
[0077] And, determining whether there is a shadow area in the candidate weeding area image according to the first peak information, the second peak information, the brightness information and the roughness information, so as to determine whether there is an obstacle in the candidate weeding area image, including:
[0078] If the average brightness of the first region is within the preset first average brightness interval, and the average brightness of the second region is within the preset second average brightness interval, and the average brightness difference is within the preset average brightness difference interval, and the roughness of the first region or the roughness of the second region is less than the preset roughness threshold, and the peak value of the mutation peak point is greater than the preset mutation peak point peak threshold, and the chromaticity value difference of the first peak point is greater than the preset first peak point chromaticity value difference threshold, and the chromaticity value difference of the second peak point is greater than the preset second peak point chromaticity value difference threshold, then it is determined that there is no shadow area in the candidate weeding area image. Specifically, the flowchart of the obstacle recognition method is as follows Figure 2 As shown:
[0079] Step 210, obtaining chromaticity information of the candidate weeding area image, and generating a chromaticity histogram to be processed of the candidate weeding area image according to the chromaticity information, so as to obtain first peak information of the chromaticity histogram to be processed; the first peak information includes: a peak value of a mutation peak point and a chromaticity value of the mutation peak point.
[0080] The mutation peak point is the point in the chromaticity histogram to be processed with the largest frequency difference between the left and right adjacent points. The peak value of the mutation peak point is the frequency corresponding to the mutation peak point, and the chromaticity value of the mutation peak point is the chromaticity value corresponding to the mutation peak point.
[0081] Step 220, generating a target chromaticity histogram according to the chromaticity histogram to be processed, and determining the second peak information and chromaticity segmentation information of the target chromaticity histogram; the second peak information includes the chromaticity value of the maximum peak point of the first region and the chromaticity value of the maximum peak point of the second region.
[0082] Among them, the chromaticity value of the maximum peak point of the first region is the chromaticity value corresponding to the maximum peak point of the first chromaticity region in the target chromaticity histogram, and the chromaticity value of the maximum peak point of the second region is the chromaticity value corresponding to the maximum peak point of the second chromaticity region in the target chromaticity histogram. The first chromaticity region and the second chromaticity region of the target chromaticity histogram can be determined by the chromaticity segmentation information and the preset chromaticity interval. Exemplarily, the preset chromaticity interval is [15,95], and the chromaticity segmentation value is li, then the first chromaticity interval corresponding to the first chromaticity region can be [15,li], and the pixel points whose chromaticity values in the candidate weeding area image are in the first chromaticity interval are the first region pixels; the chromaticity interval corresponding to the second chromaticity region can be (li,95], and the pixel points whose chromaticity values are in the second chromaticity interval are the second region pixels.
[0083] Step 230: determine the brightness information of the candidate weeding area image according to the chromaticity segmentation information and the brightness image of the candidate weeding area image; the brightness information includes the average brightness of the first area, the average brightness of the second area, and the average brightness difference between the average brightness of the first area and the average brightness of the second area.
[0084] Among them, the average brightness of the first area is the average brightness of all pixels in the first area, the average brightness of the second area is the average brightness of all pixels in the second area, and the average brightness difference is the absolute value of the difference between the average brightness of the first area and the average brightness of the second area.
[0085] Step 240: Determine the roughness information of the candidate weeding area image according to the chromaticity segmentation information and the edge image of the brightness image; the roughness information includes the first area roughness and the second area roughness.
[0086] The first area roughness is the roughness information of the pixels in the first area, which may be the average roughness of the pixels in the first area; the second area roughness is the roughness information of the pixels in the first area, which may be the average roughness of the pixels in the second area.
[0087] Step 250, determining a first peak point chromaticity value difference according to the mutation peak point chromaticity value and the first region maximum peak point chromaticity value; determining a second peak point chromaticity value difference according to the mutation peak point chromaticity value and the second region maximum peak point chromaticity value.
[0088] Determine the first peak chromaticity value difference based on the chromaticity value of the mutation peak point and the chromaticity value of the maximum peak point in the first region. Exemplarily, the chromaticity value of the mutation peak point is singleP, and the chromaticity value of the maximum peak point in the first region is h1. Since the mutation peak point is often between the maximum peak point in the first region and the maximum peak point in the second region, the first peak chromaticity value difference is sh1 = singleP - h1. Determine the second peak chromaticity value difference based on the chromaticity value of the mutation peak point and the chromaticity value of the maximum peak point in the second region. Exemplarily, the chromaticity value of the maximum peak point in the second region is h2, then the second peak chromaticity value difference is sh2 = h2 - singleP.
[0089] Step 260: If the average lightness of the first region is within the preset first average lightness interval, and the average lightness of the second region is within the preset second average lightness interval, and the average lightness difference is within the preset average lightness difference interval, and the roughness of the first region or the roughness of the second region is less than the preset roughness threshold, and the peak value of the mutation peak point is greater than the preset mutation peak point peak threshold, and the first peak chromaticity value difference is greater than the preset first peak chromaticity value difference threshold, and the second peak chromaticity value difference is greater than the preset second peak chromaticity value difference threshold, then determine that there is no shadow region in the candidate weeding region image to determine whether there is an obstacle in the candidate weeding region image.
[0090] Exemplarily, the average lightness of the first region is denoted as Va, the average lightness of the second region is denoted as Vb, the average lightness difference is denoted as Dv, the roughness of the first region is denoted as Sa, the roughness of the second region is denoted as Sb, the peak value of the mutation peak point is denoted as singleV, the first peak chromaticity value difference is denoted as sh1, and the second peak chromaticity value difference is denoted as sh2. If the preset first average lightness interval is (100, 140), the preset second average lightness interval is (37, 72), the preset average lightness difference interval is [0, 80), the preset roughness threshold is 0.25, the preset mutation peak point peak threshold is 133, the preset first peak chromaticity value difference threshold is 10, and the preset second peak chromaticity value difference threshold is 10.
[0091] Then the preset information judgment condition is 100 < Va < 140 and 37 < Vb < 72 and 0 ≤ Dv < 80 and Sa < 0.25 and singleV > 133 and sh1 > 10 and sh2 > 10, or 100 < Va < 140 and 37 < Vb < 72 and 0 ≤ Dv < 80 and Sb < 0.25 and singleV > 133 and sh1 > 10 and sh2 > 10. The preset information judgment condition can be adjusted according to the specific judgment scenario, and this embodiment does not limit this. When this condition is met, it is determined that there is no shadow region in the candidate weeding region image. If there is an obstacle, the obstacle may be a dark object with a color similar to that of the lawn and a smooth surface.
[0092] The embodiment of the present invention determines whether there is an obstacle in the image of the candidate weeding area through the average brightness of the first area, the average brightness of the second area, the average brightness difference, the roughness of the first area or the roughness of the second area, the peak value of the mutation peak point, the chromaticity value difference of the first peak point, and the chromaticity value difference of the second peak point, so as to solve the problem that sometimes there are obstacles or boundaries on the grass that are similar in color to the grass but have weak reflection and smooth surface, and form a certain degree of brightness contrast with the surrounding grass. The obstacles or boundaries are similar in characteristics to shaded grass and are prone to misidentifying shaded grass as obstacles. The recognition efficiency and accuracy of dark and smooth obstacles that are similar in color to the grass in the candidate weeding area of the weeding robot are improved.
[0093] Embodiment 3
[0094] 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:
[0095] The histogram generation module 310 is used to obtain the chromaticity information of the candidate weeding area image, and generate a to-be-processed chromaticity histogram of the candidate weeding area image according to the chromaticity information, so as to obtain the first peak information of the to-be-processed chromaticity histogram;
[0096] An information determination module 320, configured to generate a target chromaticity histogram according to the chromaticity histogram to be processed, and determine second peak information and chromaticity segmentation information of the target chromaticity histogram;
[0097] A brightness information determination module 330, configured to determine the brightness information of the candidate weeding area image according to the chromaticity segmentation information and the brightness image of the candidate weeding area image;
[0098] A roughness information determination module 340, configured to determine the roughness information of the candidate weeding area image according to the chromaticity segmentation information and the edge image of the brightness image;
[0099] The obstacle determination module 350 is used to determine whether there is a shadow area in the candidate weeding area image according to the first peak information, the second peak information, the brightness information and the roughness information, so as to determine whether there is an obstacle in the candidate weeding area image.
[0100] The technical solution provided in this embodiment obtains the chromaticity information of the candidate weeding area image, and generates the to-be-processed chromaticity histogram of the candidate weeding area image according to the chromaticity information, so as to obtain the first peak information of the to-be-processed chromaticity histogram; generates the target chromaticity histogram according to the to-be-processed chromaticity histogram, and determines the second peak information and chromaticity segmentation information of the target chromaticity histogram; determines the brightness information of the candidate weeding area image according to the chromaticity segmentation information and the brightness image of the candidate weeding area image; determines the roughness information of the candidate weeding area image according to the chromaticity segmentation information and the edge image of the brightness image; determines whether there is a shadow area in the candidate weeding area image according to the first peak information, the second peak information, the brightness information and the roughness information, so as to determine whether there is an obstacle in the candidate weeding area image. 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. Furthermore, since there are restrictions on the burying of the boundary line, the shape of the weeding area is restricted 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.
[0101] On the basis of the above technical solutions, optionally, the information determination module includes:
[0102] An information acquisition unit, used to acquire peak point information and valley point information in a preset chromaticity interval of the target chromaticity histogram; the peak point information includes: the number of peak points, the peak point peak value and the peak point chromaticity value; the valley point information includes: the valley value of the valley point and the valley point chromaticity value;
[0103] An information determination unit is used to determine the second peak information and chromaticity segmentation information of the target chromaticity histogram according to the peak point information and / or the valley point information.
[0104] On the basis of the above technical solutions, optionally, the information determination unit includes:
[0105] A first information determination subunit, configured to determine the second peak information and chromaticity segmentation information of the target chromaticity histogram according to whether a minimum dividing point exists and the number of peak points if the number of peak points is less than two;
[0106] The second information determination subunit is used to obtain the second peak information and the chroma segmentation information according to the peak point peak value, the peak point chroma value, the valley point valley value and the valley point chroma value if the number of the peak points is greater than or equal to two.
[0107] Based on the above technical solutions, optionally, the first peak information includes: a peak value of a sudden change peak point and a chromaticity value of a sudden change peak point; the second peak information includes a chromaticity value of a maximum peak point in the first region and a chromaticity value of a maximum peak point in the second region; the brightness information includes an average brightness of the first region, an average brightness of the second region, and an average brightness difference between the average brightness of the first region and the average brightness of the second region; the roughness information includes a roughness of the first region and a roughness of the second region;
[0108] The device also includes:
[0109] A chromaticity value difference determination module is used before the obstacle determination module to determine the first peak point chromaticity value difference according to the mutation peak point chromaticity value and the first area maximum peak point chromaticity value; and to determine the second peak point chromaticity value difference according to the mutation peak point chromaticity value and the second area maximum peak point chromaticity value.
[0110] On the basis of the above technical solutions, optionally, the obstacle determination module includes:
[0111] An obstacle determination unit is used to determine whether there is no shadow area in the candidate weeding area image if the average brightness of the first area is in a preset first average brightness interval, and the average brightness of the second area is in a preset second average brightness interval, and the average brightness difference is in a preset average brightness difference interval, and the roughness of the first area or the roughness of the second area is less than a preset roughness threshold, and the peak value of the mutation peak point is greater than the preset mutation peak point peak threshold, and the chromaticity value difference of the first peak point is greater than the preset first peak point chromaticity value difference threshold, and the chromaticity value difference of the second peak point is greater than the preset second peak point chromaticity value difference threshold, so as to determine whether there is an obstacle in the candidate weeding area image.
[0112] Embodiment 4
[0113] 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.
[0114] 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.
[0115] 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.
[0116] Embodiment 5
[0117] 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:
[0118] Acquire chromaticity information of the candidate weeding area image, and generate a to-be-processed chromaticity histogram of the candidate weeding area image according to the chromaticity information, so as to acquire first peak information of the to-be-processed chromaticity histogram;
[0119] Generate a target chromaticity histogram according to the chromaticity histogram to be processed, and determine second peak information and chromaticity segmentation information of the target chromaticity histogram;
[0120] Determining brightness information of the candidate weeding area image according to the chromaticity segmentation information and the brightness image of the candidate weeding area image;
[0121] Determining roughness information of the candidate weeding area image according to the chromaticity segmentation information and the edge image of the brightness image;
[0122] According to the first peak information, the second peak information, the brightness information and the roughness information, it is determined whether there is a shadow area in the candidate weeding area image, so as to determine whether there is an obstacle in the candidate weeding area image.
[0123] 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.
[0124] 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.
[0125] 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.
[0126] Embodiment 6
[0127] 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.
[0128] 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.
[0129] 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.
[0130] 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: Acquire chromaticity information of the candidate weeding area image, and generate a to-be-processed chromaticity histogram of the candidate weeding area image according to the chromaticity information, so as to acquire first peak information of the to-be-processed chromaticity histogram; Generate a target chromaticity histogram according to the chromaticity histogram to be processed, and determine second peak information and chromaticity segmentation information of the target chromaticity histogram; Determining brightness information of the candidate weeding area image according to the chromaticity segmentation information and the brightness image of the candidate weeding area image; Determining roughness information of the candidate weeding area image according to the chromaticity segmentation information and the edge image of the brightness image; Determine whether there is a shadow area in the candidate weeding area image according to the first peak information, the second peak information, the brightness information and the roughness information, so as to determine whether there is an obstacle in the candidate weeding area image; The first peak information includes: a peak value of a sudden change peak point and a chromaticity value of a sudden change peak point; the second peak information includes a chromaticity value of a maximum peak point of a first region and a chromaticity value of a maximum peak point of a second region; the brightness information includes an average brightness of a first region, an average brightness of a second region, and an average brightness difference between the average brightness of the first region and the average brightness of the second region; the roughness information includes a first region roughness and a second region roughness; wherein the chromaticity value of the maximum peak point of the first region is a chromaticity value corresponding to a maximum peak point of a first chromaticity region in the target chromaticity histogram, and the chromaticity value of the maximum peak point of the second region is a chromaticity value corresponding to a maximum peak point of a second chromaticity region in the target chromaticity histogram, and the first chromaticity region and the second chromaticity region of the target chromaticity histogram are jointly determined by the chromaticity segmentation information and a preset chromaticity interval; Before determining whether there is a shadow area in the candidate weeding area image according to the first peak information, the second peak information, the brightness information and the roughness information, so as to determine whether there is an obstacle in the candidate weeding area image, the method further includes: Determine a first peak point chromaticity value difference according to the mutation peak point chromaticity value and the maximum peak point chromaticity value of the first region; Determine a second peak point chromaticity value difference according to the mutation peak point chromaticity value and the second region maximum peak point chromaticity value; Determining whether there is a shadow area in the candidate weeding area image according to the first peak information, the second peak information, the brightness information, and the roughness information includes: If the average brightness of the first region is within a preset first average brightness interval, and the average brightness of the second region is within a preset second average brightness interval, and the average brightness difference is within a preset average brightness difference interval, and the roughness of the first region or the roughness of the second region is less than a preset roughness threshold, and the peak value of the mutation peak point is greater than a preset mutation peak point peak value threshold, and the chromaticity value difference of the first peak point is greater than a preset first peak point chromaticity value difference threshold, and the chromaticity value difference of the second peak point is greater than a preset second peak point chromaticity value difference threshold, it is determined that there is no shadow area in the candidate weeding region image; The process of determining whether there is an obstacle in the candidate weeding area image according to the judgment result that there is no shadow area in the candidate weeding area image includes: When it is determined that the candidate weeding area image currently does not have a shadow area, a dynamic segmentation method is used to segment the candidate weeding area image, wherein the black area represents an obstacle and the white area represents a weeding area; If there is a black area, it is determined that there is an obstacle in the candidate weeding area.
2. The method according to claim 1, characterized in that Determining second peak information and chroma segmentation information of the target chroma histogram includes: Acquire peak point information and valley point information in a preset chromaticity interval of the target chromaticity histogram; the peak point information includes: the number of peak points, the peak point peak value and the peak point chromaticity value; the valley point information includes: the valley point valley value and the valley point chromaticity value; The second peak information and the chromaticity segmentation information of the target chromaticity histogram are determined according to the peak point information and / or the valley point information.
3. The method according to claim 2, characterized in that Determining second peak information and chromaticity segmentation information of the target chromaticity histogram according to the peak point information and / or the valley point information includes: If the number of the peak points is less than two, determining the second peak information and the chromaticity segmentation information of the target chromaticity histogram according to whether there is a minimum demarcation point and the number of the peak points; If the number of the peak points is greater than or equal to two, the second peak information and the chroma segmentation information are acquired according to the peak point peak value, the peak point chroma value, the valley point valley value and the valley point chroma value.
4. An obstacle recognition device, characterized in that: include: A histogram generation module, used for acquiring chromaticity information of the candidate weeding area image, and generating a to-be-processed chromaticity histogram of the candidate weeding area image according to the chromaticity information, so as to acquire first peak information of the to-be-processed chromaticity histogram; An information determination module, used to generate a target chromaticity histogram according to the chromaticity histogram to be processed, and determine the second peak information and chromaticity segmentation information of the target chromaticity histogram; a brightness information determination module, configured to determine the brightness information of the candidate weeding area image according to the chromaticity segmentation information and the brightness image of the candidate weeding area image; A roughness information determination module, used to determine the roughness information of the candidate weeding area image according to the chromaticity segmentation information and the edge image of the brightness image; an obstacle determination module, configured to determine whether there is a shadow area in the candidate weeding area image according to the first peak information, the second peak information, the brightness information and the roughness information, so as to determine whether there is an obstacle in the candidate weeding area image; The first peak information includes: a peak value of a sudden change peak point and a chromaticity value of a sudden change peak point; the second peak information includes a chromaticity value of a maximum peak point of a first region and a chromaticity value of a maximum peak point of a second region; the brightness information includes an average brightness of a first region, an average brightness of a second region, and an average brightness difference between the average brightness of the first region and the average brightness of the second region; the roughness information includes a first region roughness and a second region roughness; wherein the chromaticity value of the maximum peak point of the first region is a chromaticity value corresponding to a maximum peak point of a first chromaticity region in the target chromaticity histogram, and the chromaticity value of the maximum peak point of the second region is a chromaticity value corresponding to a maximum peak point of a second chromaticity region in the target chromaticity histogram, and the first chromaticity region and the second chromaticity region of the target chromaticity histogram are jointly determined by the chromaticity segmentation information and a preset chromaticity interval; A chromaticity value difference determination module is used before the obstacle determination module to determine the first peak point chromaticity value difference according to the mutation peak point chromaticity value and the first area maximum peak point chromaticity value; and to determine the second peak point chromaticity value difference according to the mutation peak point chromaticity value and the second area maximum peak point chromaticity value; The obstacle determination module comprises: an obstacle determination unit, configured to determine that there is no shadow area in the candidate weeding area image if the average brightness of the first area is in a preset first average brightness interval, the average brightness of the second area is in a preset second average brightness interval, the average brightness difference is in a preset average brightness difference interval, the roughness of the first area or the roughness of the second area is less than a preset roughness threshold, the peak value of the mutation peak point is greater than a preset mutation peak point peak threshold, the chromaticity value difference of the first peak point is greater than a preset first peak point chromaticity value difference threshold, and the chromaticity value difference of the second peak point is greater than a preset second peak point chromaticity value difference threshold; The process of determining whether there is an obstacle in the candidate weeding area image according to the judgment result that there is no shadow area in the candidate weeding area image includes: When it is determined that the candidate weeding area image currently does not have a shadow area, a dynamic segmentation method is used to segment the candidate weeding area image, where the black area represents an obstacle and the white area represents a weeding area; If there is a black area, it is determined that there is an obstacle in the candidate weeding area.
5. The device according to claim 4, characterized in that The information determination module comprises: An information acquisition unit, used to acquire peak point information and valley point information in a preset chromaticity interval of the target chromaticity histogram; the peak point information includes: the number of peak points, the peak point peak value and the peak point chromaticity value; the valley point information includes: the valley value of the valley point and the valley point chromaticity value; An information determination unit is used to determine the second peak information and chromaticity segmentation information of the target chromaticity histogram according to the peak point information and / or the valley point information.
6. 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 to 3.
7. 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 to 3 is implemented.
8. A weeding robot, comprising a robot body, characterized in that: Also included is an electronic device as claimed in claim 6.
Citation Information
Patent Citations
Object recognition method, device and system based on image
CN111354018A
Method and apparatus for discriminating material of waste
JP2010038689A