OBSTACLE DETECTION METHOD FOR AUTOMATIC DRIVING DEVICE AND AUTOMATIC DRIVING DEVICE
Patent Information
- Application Number
- DE602020055276
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-11-03
- Filing Date
- 2020-11-20
- Publication Date
- 2025-07-23
- Estimated Expiration
- 2040-11-20
AI Technical Summary
Existing collision prevention methods for automatic traveling devices, such as unmanned lawn mowers, are costly, time-consuming, and prone to missed determinations due to the need for building boundary systems and environmental interference, posing safety risks and inefficiencies.
An obstacle recognition method that separates luminance and chrominance channels from captured images, performs filtration and normalization, and uses contour detection to identify non-lawn regions based on statistical feature values, minimizing missed determinations by comparing these values against preset conditions.
Effectively recognizes non-lawn regions and obstacles, reducing the risk of collisions by enabling precise obstacle avoidance measures, thus enhancing safety and efficiency.
Description
Field of the Invention
[0001] The present application relates to obstacle recognition methods applied to an automatic traveling devices and an automatic traveling device having a processor configured to implement obstacle recognition methods.Background of the Invention
[0002] With the gradual acceleration of urban greening and the rapid development of lawn industry, grasses at urban lawns, golf courses, airports, private gardens, parks, playgrounds, and the like need to be regularly trimmed to ensure aesthetics. However, annual trimming requires a large amount of time, funds, and manpower.
[0003] At present, automatic traveling devices are usually used instead of manual labor for trimming. Unmanned lawn mowers can liberate labor from highly repetitive and boring mowing operations, and have become an inevitable trend in social development. Cutting blades of the unmanned lawn mowers are sharp and uncontrollable in safety. During unmanned operation, the unmanned lawn mowers may encounter stationary or moving obstacles, which damage cutting tools or bodies and are highly likely to cause accidents and unnecessary losses.
[0004] There are three conventional collision prevention methods for automatic traveling devices: i. Wires are manually laid around obstacles before mowing, and the mower turns around once it detects an electromagnetic signal during travel. However, the wires are prone to aging and require regular testing and maintenance; ii. A variety of sensors such as ultrasonic and infrared sensors are used for detection. This method is costly and susceptible to environmental influence; and iii. Coordinate information of obstacles is positioned in advance by GPS positioning. This method is prone to signal interference and internal components are prone to failure.
[0005] The foregoing methods are prone to missed determination. Existing collision prevention methods require building of boundary systems and consequently much time and labor are consumed and costs are high.
[0006] US 2012 / 170808 A1 discloses obstacle detection devices for use in automobiles to reduce the risk of collisions, and particularly relates to a device which can more accurately detect obstacles in images having contrasting bright / dark sections.
[0007] CN 111538034 A discloses self-moving devices which include a laser transmitter and an image acquisition component. The laser transmitter is configured to emit a beam, and reflections are identified in the acquired image and used to determine the presence of obstacles.Summary of the Invention
[0008] The present invention provides an obstacle recognition method applied to an automatic traveling device and an automatic traveling device to solve problems in the prior art that collision prevention methods for automatic traveling devices require building of boundary systems and consequently much time and labor are consumed and costs are high.
[0009] A first aspect of embodiments of the present invention provides an obstacle recognition method applied to an automatic traveling device, including: obtaining an image of an environment in a traveling direction of an automatic traveling device; separating out a chrominance channel image and a luminance channel image according to the image; performing filtration and normalization pre-processing steps and edge processing on the luminance channel image to obtain an edge image; performing histogram statistics on the chrominance channel image to obtain the number of pixels with a maximum color proportion within a preset chrominance interval range of 15-180, denoted as maxH; performing segmentation and contour processing on the chrominance channel image to obtain a chrominance segmentation threshold and a contour image; performing contour detection on the contour image to obtain a contour block; collecting statistics on feature values corresponding to the contour block in the edge image and the contour image by: obtaining position information of the contour block; comparing the position information of the contour block with a preset position threshold to obtain a target contour block; and collecting statistics on the feature values corresponding to the target contour block in the edge image and the contour image, wherein the feature values comprise a contour size feature value, an average roughness value, a proportion of black pixel points contained in the contour block, and optionally a proportion of pixels within a chrominance segmentation threshold range; and comparing the maxH and the feature values with a plurality of different preset obstacle recognition and determination conditions, wherein if the maxH and the feature values satisfy one or more of the plurality of different preset obstacle recognition and determination conditions, the method further comprises recognizing that the image has an obstacle region; and if the maxH and the feature values do not satisfy any of the plurality of different preset obstacle recognition and determination conditions, the method further comprises recognizing that the image is an image to be filtered.
[0010] According to the obstacle avoidance method in this solution, images of a chrominance channel and a luminance channel are separated out, the luminance channel and the chrominance channel are processed separately, a contour block is obtained through contour detection, and non-lawn regions may be effectively recognized according to statistical feature values of the contour block and preset obstacle recognition and determination conditions, thereby minimizing missed determination.
[0011] A second aspect of the embodiments of the present invention provides an automatic traveling device, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the obstacle recognition method applied to an automatic traveling device in the first aspect of the embodiments of the present invention when executing the computer program.
[0012] According to the automatic traveling device in this solution, images of a chrominance channel and a luminance channel are separated from a captured image of an environment ahead in a traveling direction, the luminance channel and the chrominance channel are processed separately, a contour block is obtained through contour detection, and non-lawn regions may be effectively recognized according to statistical feature values of the contour block and preset obstacle recognition and determination conditions, thereby minimizing missed determination.
[0013] A third aspect of the embodiments of the present invention provides a readable storage medium storing a computer program. When the computer program is executed by a processor, the steps of the obstacle recognition method applied to an automatic traveling device in the first aspect of the embodiments of the present invention are implemented.Brief Description of the Drawings
[0014] The technical solution of the present application will be further illustrated below with reference to accompanying drawings and embodiments. FIG. 1 is a flowchart of a method according to an embodiment of the present application; FIG. 2(a) to FIG. 2(c) show an RGB image, a segmented image, and a contour processed image in front of an automatic traveling device in a specific implementation; and FIG. 3(a) to FIG. 3(c) show an RGB image, a segmented image, and a contour processed image in front of an automatic traveling device in another specific implementation. Detailed Description of the Embodiments
[0015] It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other on a non-conflict basis.
[0016] The technical solution of the present application will be described in detail below with reference to the accompanying drawings and embodiments.Embodiment 1
[0017] Embodiment 1 of the present invention provides an obstacle recognition method for an automatic traveling device, as shown in FIG. 1, including: S1: Obtain an image of an environment in a traveling direction of an automatic traveling device; S2: Separate out a chrominance channel image and a luminance channel image according to the image; S3: Perform pre-processing and edge processing on the luminance channel image to obtain an edge image; S4: Perform histogram statistics on the chrominance channel image to obtain the number of pixels with a maximum color proportion within a preset chrominance interval range, denoted as maxH; S5: Perform segmentation and contour processing on the chrominance channel image to obtain a chrominance segmentation threshold and a contour image; S6: Perform contour detection on the contour image to obtain a contour block; S7: Collect statistics on feature values corresponding to the contour block in the edge image and the contour image; and S8: Compare the maxH and the feature values with preset obstacle recognition and determination conditions to obtain recognition results.
[0018] The automatic traveling device in the embodiment of the present invention may be a robot cleaner, a robot mower, or the like. Through image recognition in the obstacle recognition method according to the embodiment of the present invention, the automatic traveling device can effectively recognize non-lawn regions during operation, recognize distance information of obstacles ahead, and take reasonable obstacle avoidance measures.
[0019] In this embodiment, a camera is disposed in the front of the automatic traveling device. During the operation of the automatic traveling device, the camera captures an image of an environment in front, denoted as orgMat, and the captured image orgMat is an RGB image. The captured image orgMat is converted from an RGB (red, green, blue) space to an HSV (chrominance, saturation, luminance) space, and a chrominance component (H) and a luminance component (V) are extracted. The conversion of the image from the RGB space to the HSV space is a widely-known technology for those skilled in the art, so details are not repeated here.
[0020] The luminance channel (V) image is first pre-processed, including filtration and normalization, to obtain a pre-processed image, denoted as normVMat. Edge extraction is then performed on the pre-processed image normVMat. The edge processing may use but is not limited to a canny operator edge detection algorithm, to obtain an edge image, denoted as cannyMat. The edge extraction can effectively reflect roughness of the image.
[0021] Histogram statistics are performed on the chrominance channel (H) image to obtain a chrominance component histogram, denoted as orgLabelsMat. Horizontal coordinates of the chrominance component histogram represent the chrominance component of the image in front of the automatic traveling device, and vertical coordinates represent the number of pixel points. The obtained chrominance component histogram orgLabelsMat is filtered to obtain a de-noised smooth histogram LabelsMat. From the de-noised smooth histogram LabelsMat, statistics on the number of pixels with a maximum color proportion within a preset chrominance interval range is collected, denoted as maxH. The preset chrominance interval range is 15-180.
[0022] The chrominance channel (H) image may be segmented through a dynamic segmentation method to obtain a chrominance segmentation threshold [lowValue, highValue]. The chrominance segmentation threshold [lowValue, highValue] may alternatively be obtained through a fixed threshold segmentation method, such as an Otsu threshold method.
[0023] The segmented image obtained after image segmentation is denoted as dstMat, and the image obtained by inversion and open / close operations on dstMat is denoted as obstacleMat.
[0024] Contour processing is performed on the image obstacleMat to obtain a contour image, and contour detection is performed on the contour image to obtain a contour block.
[0025] Statistics on feature values corresponding to the contour block in the edge image and the contour image are collected, and the features, the maxH, and preset obstacle recognition and determination conditions are compared to determine whether there are non-lawn regions in the environmental image in front of the automatic traveling device, that is, whether there are obstacles in front of the automatic traveling device.
[0026] The feature values include a contour size feature value AContours i .X, an average roughness value HContours i , and a proportion of black pixel points BContours i contained in the contour block; and optionally a proportion of pixels SContours i within the chrominance segmentation threshold range.
[0027] Specifically, in the contour size feature value AContours i .X, X may be represented as area, diagonal, width, height, and number of contained pixels, and i represents a contour number.
[0028] In this embodiment, the image is segmented through the chrominance segmentation threshold [lowValue, highValue] to generate a first image region and a second image region. The proportion of pixels SContours i within the chrominance segmentation threshold [lowValue, highValue] range in this embodiment refers to a proportion of pixels in the first image region and the second image region.
[0029] The chrominance value corresponding to the first image region is within the preset chrominance interval range and the segmentation threshold [lowValue, highValue] range; and the chrominance value corresponding to the second image region is within the preset chrominance interval range, but not within the segmentation threshold [lowValue, highValue] range. For example, the preset chrominance interval is [15, 95], the chrominance segmentation threshold is [15, li], the first image region is a region with chrominance values [15, li], and the second image region is a region with chrominance values [li, 95].
[0030] The preset obstacle recognition and determination conditions include a plurality of different preset obstacle recognition and determination conditions, and the step of comparing the maxH and the feature values with preset obstacle recognition and determination conditions to obtain recognition results includes: comparing the maxH and the feature values with the preset obstacle recognition and determination conditions, and if comparison results that the maxH and the feature values satisfy one or more of the plurality of different preset obstacle recognition and determination conditions are obtained, recognizing that the image has an obstacle region; and if comparison results that the maxH and the feature values do not satisfy any of the plurality of different preset obstacle recognition and determination conditions are obtained, recognizing that the image is an image to be filtered.
[0031] Specifically, based on the selected feature values mentioned above, the preset obstacle recognition and determination conditions in this embodiment may be: If AContours i .diagonal>105 or AContoursi.height>80, maxH>300 and HContours i <0.24, and one of the following two conditions a and b is satisfied, it is determined that there is an obstacle in the image: a. 300<maxH≤400, AContours i .pixels>3500, and BContours i <0.01; and b. 400<maxH<550, AContours;.pixels>4000, and BContours i <0.03.
[0032] The work of a robot mower is used as an example. As shown in FIG. 2(a) to FIG. 2(c), FIG. 2(a) shows a captured RGB image in front of the automatic traveling device, FIG. 2(b) shows a segmented image obtained after image segmentation, and FIG. 2(c) shows a contour image numbered 8. maxH=467, the feature values corresponding to the contour block numbered 8 are as follows: AContourss.diagonal=92.135, AContourss.height=83, BContours 8 =0.012, AContourss.pixels=7060, and HContours 8 =0.176.
[0033] Through determination, the above conditions satisfy AContoursi.height>80, maxH>300, HContours i <0.24, and condition b, indicating that there is a non-lawn region in the image.
[0034] Specifically, the preset obstacle recognition and determination conditions in this embodiment may alternatively be: If AContours i .diagonal>105 or AContoursi.height>80, YContours i >75, maxH>300 and HContours i < 0.24, and one of the following two conditions c and d is satisfied, it is determined that the distance between the obstacle in the image and the automatic traveling device is within a preset collision prevention range, and the automatic traveling device executes obstacle avoidance measures: c. maxH≥550, SContours i <0.4, and BContours i <0.11; and d. maxH≥550, SContours i >0.4, and BContours i <0.06.
[0035] The preset obstacle recognition and determination conditions in the above implementation are only a preferred example listed in this embodiment, and may be adjusted according to actual situations in other implementations.
[0036] In a feasible implementation of this embodiment, in S7, the collecting statistics on feature values corresponding to the contour block in the edge image and the contour image includes: S71: Obtain position information of the contour block; S72: Compare the position information of the contour block with a preset position threshold to obtain a target contour block; and S73: Collect statistics on the feature values corresponding to the target contour block in the edge image and the contour image.
[0037] As a feasible embodiment, optionally, S7 further includes collecting statistics on a y-axis coordinate value YContours i at a bottom right corner of the contour block, and selecting a reasonable obstacle avoidance time according to a size of the YContours i . YContours i represents the position relationship between the contour position of the image in front of the automatic traveling device and the automatic traveling device.
[0038] Specifically, a distance parameter between the contour position of the image and the automatic traveling device, namely, a y-axis coordinate value YContours i at the bottom right corner of the contour, may be further set in this embodiment. The position relationship between the contour position, obtained during the image contour detection, of the image in front of the automatic traveling device and the automatic traveling device may be used as an auxiliary determination element to select an obstacle avoidance time reasonably.
[0039] If an obstacle is detected in the image and an image contour block contains an obstacle image or a partial obstacle image, the position relationship between the corresponding contour block and the automatic traveling device is determined, so as to take reasonable obstacle avoidance measures.
[0040] In the case of including the feature value YContours i , the preset obstacle recognition and determination conditions in this embodiment may be: If AContours i .diagonal>105 or AContoursi.height>80, YContours i >75, maxH>300 and HContours i < 0.24, and one of a and b or one of c and d is satisfied, it is determined that the distance between the obstacle in the image and the automatic traveling device is within a preset collision prevention range, and the automatic traveling device executes obstacle avoidance measures: a. 300<maxH≤400, AContours i .pixels>3500, and BContours i <0.01; b. 400<maxH<550, AContours i .pixels>4000, and BContours i <0.03; c. maxH≥550, SContours i <0.4, and BContours i <0.11; and d. maxH≥550, SContours i >0.4, and BContours i <0.06.
[0041] If the y-axis coordinate value YContours i at the bottom right corner of the contour is set in the obstacle recognition parameters, after the obstacle is recognized according to full image information, whether the automatic traveling device has executes obstacle avoidance measures further needs to be determined according to the size of the YContours i .
[0042] In a specific implementation scheme, as shown in FIG. 3(a) to FIG. 3(c), FIG. 3(a) shows a captured RGB image in front of the automatic traveling device, FIG. 3(b) shows a segmented image obtained after image segmentation, and FIG. 3(c) shows a contour image numbered 18. maxH=576, the obstacle recognition parameters corresponding to the contour image numbered 18 are as follows: AContours 18 .diagonal=164.07, YContours 18 =114, SContours 18 =0.28, HContours 18 =0.218, and BContours 18 =0.
[0043] Through determination, the above conditions satisfy AContours 18 .height>80, maxH> 300, HContours i <0.24, and condition c, so there is a non-lawn region in the image. Because YContours 18 =114 satisfies YContours 18 >75, so it may be determined that the distance between the obstacle and the automatic traveling device is within the obstacle avoidance distance range, and obstacle avoidance measures need to be taken.Embodiment 2:
[0044] This embodiment provides an automatic traveling device, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the obstacle recognition method applied to an automatic traveling device in Embodiment 1 when executing the computer program.
[0045] Specifically, the automatic traveling device in this embodiment may be a robot cleaner, a robot mower, or the like. The automatic traveling device can effectively recognize obstacles and take reasonable obstacle avoidance measures during travel.Embodiment 3:
[0046] This embodiment provides a readable storage medium storing a computer program. When the computer program is executed by a processor, the steps of the obstacle recognition method applied to an automatic traveling device in Embodiment 1 are implemented.
[0047] Related workers may be inspired by the foregoing ideal embodiments of the present application to make diverse changes and modifications through the foregoing description without deviating from the scope of technical ideas of the present application. The technical scope of the present application is not limited to the content in the specification, and should be determined according to the scope of claims.
[0048] Those skilled in the art should understand that the embodiments of the present application may be provided as a method, a system, or a computer program product. Therefore, the present application may be in the form of a full hardware embodiment, a full software embodiment, or an embodiment combining software and hardware. In addition, the present application may be in the form of a computer program product implemented on one or more computer available storage media (including but not limited to a disk memory, a CD-ROM, an optical memory, and the like) including computer available program code.
[0049] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system), and the computer program product in the embodiments of the present application. It should be understood that computer program instructions may be used to implement each process and / or each block in the flowcharts and / or the block diagrams, or a combination of a process and / or a block in the flowcharts and / or the block diagrams. These computer program instructions may be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or a processor of another programmable data processing device to generate a machine, so that the instructions executed by the computer or the processor of the another programmable data processing device generate an apparatus for implementing a specified function in one or more processes in the flowcharts and / or in one or more blocks in the block diagrams.
[0050] These computer program instructions may also be stored in a computer-readable memory that can guide a computer or another programmable data processing device to work in a particular manner, so that the instructions stored in the computer-readable memory generate a product including an instruction apparatus, where the instruction apparatus implements functions specified in one or more processes in the flowcharts and / or one or more blocks in the block diagrams.
[0051] These computer program instructions may also be loaded into a computer or another programmable data processing device, so that a series of operation steps are performed on the computer or programmable data processing device to generate processing implemented by a computer, and instructions executed on the computer or programmable data processing device provide steps for implementing functions specified in one or more processes in the flowcharts and / or one or more blocks in the block diagrams.
Claims
1. An obstacle recognition method applied to an automatic traveling device, comprising: obtaining an image of an environment in a traveling direction of an automatic traveling device; separating out a chrominance channel image and a luminance channel image according to the image; performing filtration and normalization pre-processing steps and edge processing on the luminance channel image to obtain an edge image; performing histogram statistics on the chrominance channel image to obtain the number of pixels with a maximum color proportion within a preset chrominance interval range of 15-180, denoted as maxH; performing segmentation and contour processing on the chrominance channel image to obtain a chrominance segmentation threshold and a contour image; performing contour detection on the contour image to obtain a contour block; collecting statistics on feature values corresponding to the contour block in the edge image and the contour image by: obtaining position information of the contour block; comparing the position information of the contour block with a preset position threshold to obtain a target contour block; and collecting statistics on the feature values corresponding to the target contour block in the edge image and the contour image, wherein the feature values comprise a contour size feature value, an average roughness value, a proportion of black pixel points contained in the contour block, and optionally a proportion of pixels within a chrominance segmentation threshold range; and comparing the maxH and the feature values with a plurality of different preset obstacle recognition and determination conditions, wherein if the maxH and the feature values satisfy one or more of the plurality of different preset obstacle recognition and determination conditions, the method further comprises recognizing that the image has an obstacle region; and if the maxH and the feature values do not satisfy any of the plurality of different preset obstacle recognition and determination conditions, the method further comprises recognizing that the image is an image to be filtered.
2. The obstacle recognition method applied to an automatic traveling device according to claim 1, wherein the contour size feature value comprises contour area, contour diagonal length, contour width, contour height, or the number of pixels in a region to be recognized in the contour block.
3. The obstacle recognition method applied to an automatic traveling device according to claim 1, wherein the performing histogram statistics on the chrominance channel image to obtain the number of pixels with a maximum color proportion within a preset chrominance interval range specifically comprises: performing histogram statistics on the chrominance channel image to obtain a chrominance component histogram; filtering the chrominance component histogram to obtain a de-noised smooth histogram; and collecting statistics on the number of pixels with the most colors within the preset chrominance interval range from the de-noised smooth histogram.
4. The obstacle recognition method applied to an automatic traveling device according to claim 1, further comprising collecting statistics on a y-axis coordinate value at a bottom right corner of the contour block, and selecting an obstacle avoidance time according to a size of the y-axis coordinate value, wherein the y-axis coordinate value represents a position relationship between the corresponding contour block and the automatic traveling device which is an unmanned mower.
5. An automatic traveling device, comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the obstacle recognition method applied to an automatic traveling device according to any one of claims 1-4 when executing the computer program.
6. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the steps of an obstacle recognition method according to any one of claims 1-4 applied to an automatic traveling device according to claim 5 are implemented.