An obstacle recognition method, device, equipment, medium and weeding robot
By obtaining the chromaticity information of the image of the weeding area and the number of pixels in the exposure state, a chromaticity histogram is generated, and the obstacles in the weeding area are identified, which solves the problem of manpower and material resources in the traditional method of burying boundary lines, improves the recognition efficiency and accuracy, and reduces costs.
Patent Information
- Application Number
- CN202011553956.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-24
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2040-12-24
AI Technical Summary
In the prior art, the weeding robot consumes a lot of manpower and material resources by burying boundary lines to calibrate the weeding area, and the limitation of the boundary lines affects the shape of the weeding area.
By obtaining the chromaticity information of the candidate weeding area image and the number of pixels in the exposure state, a chromaticity histogram is generated, a mutation peak point and target pixel position information are determined, the number of effective chromaticity pixels is calculated, and whether there is a shadow area is present to identify obstacles.
The identification efficiency and accuracy of obstacles in the weeding area of candidate weeding robots has been improved, manpower and material investment has been reduced, costs have been reduced, and the phenomenon of misjudging obstacles due to robot shadows has been avoided.
Smart Images

Figure CN114677318B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to computer technology, and in particular, to an obstacle recognition method, device, equipment, medium, and weeding robot. Background Art
[0002] With the improvement of living standards, people are increasingly concerned about environmental construction, so the construction of urban greening gardens has received more and more attention. At the same time, efficient greening maintenance, such as daily weeding, has gradually become a need. However, since traditional weeders require manual operation, weeding robots with autonomous working functions have gradually emerged.
[0003] In the prior art, the boundary of the weeding area of the weeding robot is usually calibrated by burying a boundary line, which consumes a lot of manpower and material resources and increases the cost. And due to the limitations of burying the boundary line, for example, the angle of the corner cannot be less than 90 degrees, so to a certain extent, the shape of the weeding area is restricted. Summary of the Invention
[0004] Embodiments of the present invention provide an obstacle recognition method, device, equipment, medium, and weeding robot to achieve the effect of improving the recognition efficiency and accuracy of obstacles in the candidate weeding area of the weeding robot.
[0005] In a first aspect, an embodiment of the present invention provides an obstacle recognition method, which includes:
[0006] Obtain the chromaticity information and the number of pixels in the exposure state of the candidate weeding area image;
[0007] Generate a chromaticity histogram of the candidate weeding area image according to the chromaticity information, and obtain the peak information of the chromaticity histogram; the peak information includes: the chromaticity value of the mutation peak point and the peak of the mutation peak point;
[0008] Determine the target pixel position information and the target pixel brightness information of the candidate weeding area image according to the chromaticity value of the mutation peak point;
[0009] Determine the number of chromaticity effective pixels in the candidate weeding area image that are in a preset chromaticity interval;
[0010] Determine whether there is a shadow area in the candidate weeding area image according to the number of pixels in the exposure state, the peak of the mutation peak point, the target pixel position information, the target pixel brightness information, and the number of chromaticity effective pixels, 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, which includes:
[0012] An information acquisition module, configured to acquire the chromaticity information and the number of exposed state pixels of the candidate weeding area image;
[0013] A histogram generation module, configured to generate a chromaticity histogram of the candidate weeding area image according to the chromaticity information, and acquire peak information of the chromaticity histogram; the peak information includes: the chromaticity value of the mutation peak point and the peak of the mutation peak point;
[0014] An information determination module, configured to determine the target pixel position information and the target pixel brightness information of the candidate weeding area image according to the chromaticity value of the mutation peak point;
[0015] A pixel number determination module, configured to determine the number of chromaticity valid pixels in a preset chromaticity interval in the candidate weeding area image;
[0016] An obstacle determination module, configured to determine whether there is a shadow area in the candidate weeding area image according to the number of exposed state pixels, the peak of the mutation peak point, the target pixel position information, the target pixel brightness information, and the number of chromaticity valid pixels, 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, which includes:
[0018] One or more processors;
[0019] A storage device, configured to store 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, on which a computer program is stored, and when the program is executed by a processor, the obstacle recognition method as described above is implemented.
[0022] In a fifth aspect, an embodiment of the present invention further provides a weeding robot, which includes a robot body and also includes the above-mentioned electronic device.
[0023] In an embodiment of the present invention, chromaticity information and the number of pixels in the exposure state of a candidate weeding area image are obtained; a chromaticity histogram of the candidate weeding area image is generated based on the chromaticity information, and peak information of the chromaticity histogram is obtained; the peak information includes: the chromaticity value of the mutation peak point and the peak value of the mutation peak point; target pixel position information and target pixel brightness information of the candidate weeding area image are determined according to the chromaticity value of the mutation peak point; the number of chromaticity valid pixels in a preset chromaticity interval in the candidate weeding area image is determined; whether there is a shadow area in the candidate weeding area image is determined according to the number of pixels in the exposure state, the peak value of the mutation peak point, the target pixel position information, the target pixel brightness information, and the number of chromaticity valid pixels, so as to determine whether there is an obstacle in the candidate weeding area image. This solves the problem that in the prior art, the boundary of the weeding area of a weeding robot is usually calibrated by burying a boundary line, which consumes a lot of manpower and material resources and increases the cost. And because there are limitations in burying the boundary line, to a certain extent, the shape of the weeding area is restricted, 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 It is a flowchart of an obstacle recognition method provided in Embodiment 1 of the present invention;
[0025] Figure 2 It is a flowchart of an obstacle recognition method provided in Embodiment 2 of the present invention;
[0026] Figure 3 It is a schematic structural diagram of an obstacle recognition device provided in Embodiment 3 of the present invention;
[0027] Figure 4 It is a schematic structural diagram of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0028] The present invention will be further described in detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. Additionally, it should be noted that for the sake of description, only parts related to the present invention are shown in the drawings rather than all the structures.
[0029] Embodiment 1
[0030] Figure 1 It is a flowchart of an obstacle recognition method provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation where a weeding robot recognizes obstacles in a candidate weeding area. This method can be executed by the obstacle recognition device provided in the embodiments of the present invention, and the device can be implemented in a software and / or hardware manner. Refer to Figure 1, the obstacle recognition method provided in this embodiment includes:
[0031] Step 110, obtain the chromaticity information and the number of pixels in the exposure state of the candidate weeding area image.
[0032] Among them, the candidate weeding area is the possible working area of the weeding robot. It may be all weeds to be removed, that is, the weeding area; it may also be an obstacle or a boundary.
[0033] The candidate weeding area image can be captured 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 overall chromaticity feature of the candidate weeding area image. 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 point in the image, etc., and this embodiment does not limit this.
[0034] Among them, the number of pixels in the exposure state is the number of pixels in the candidate weeding area image that are in the exposure state. According to the brightness value of the pixels in the candidate weeding area image, the number of pixels in the exposure state is obtained. The obtaining method can be to obtain the brightness channel image of the candidate weeding area image and count the number of pixels whose brightness value is greater than or equal to a preset threshold, such as 255, as the number of pixels in the exposure state.
[0035] Step 120, generate a chromaticity histogram of the candidate weeding area image according to the chromaticity information, and obtain peak information of the chromaticity histogram; the peak information includes: the chromaticity value of the mutation peak point and the peak of the mutation peak point.
[0036] Among them, the chromaticity histogram is used to intuitively reflect the chromaticity information of the pixel points in the candidate weeding area image. The abscissa of the chromaticity histogram can be the chromaticity value, and the ordinate can be the frequency, that is, the number of pixel points at this chromaticity value in the candidate weeding area image, which is used to reflect the chromaticity distribution of the pixel points in the candidate weeding area image.
[0037] Among them, the mutation peak point is the point where the frequency in the chromaticity histogram changes suddenly. The peak 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.
[0038] Optionally in this embodiment, generating a chromaticity histogram of the candidate weeding area image according to the chromaticity information, and obtaining peak information of the chromaticity histogram includes:
[0039] Perform histogram statistics on the chromaticity information to generate a chromaticity histogram of the candidate weeding area image;
[0040] Determine the mutation peak point according to the difference between adjacent frequencies in the chromaticity histogram, and obtain the peak information of the mutation peak point.
[0041] Among them, the chromaticity histogram of the candidate weeding area image is obtained by performing histogram statistics on the chromaticity information of the pixels in the candidate weeding area image. Exemplarily, it can reflect the frequency of occurrence of the chromaticity values of all pixel points in the candidate weeding area image, and this embodiment does not limit this. Obtain the difference between adjacent frequencies in the chromaticity histogram, and determine the mutation peak point as the point with the largest frequency difference from both the left and right adjacent frequencies, that is, the frequency at this chromaticity value has mutated relative to the frequencies corresponding to similar chromaticity values. Obtain the chromaticity value and peak corresponding to this mutation peak point as the peak information of the chromaticity histogram.
[0042] Determine the mutation peak point according to the difference between adjacent frequencies in the chromaticity histogram, determine the point where mutation occurs in the chromaticity histogram, improve the accuracy of obtaining the mutation peak point, so as to improve the accuracy of determining whether there is a shadow area in the candidate weeding area image subsequently.
[0043] Step 130: Determine the target pixel position information and target pixel brightness information of the candidate weeding area image according to the chromaticity value of the mutation peak point.
[0044] Among them, the target pixel is the target pixel point determined according to the chromaticity value of the mutation peak point in the candidate weeding area image. The target pixel position information is the comprehensive position information obtained after processing the position information of all target pixel points, and the target pixel brightness information is the comprehensive brightness information obtained after processing the brightness information of all target pixel points.
[0045] In this embodiment, optionally, determining the target pixel position information and target pixel brightness information of the candidate weeding area image according to the chromaticity value of the mutation peak point includes:
[0046] Determine the target pixel point according to the chromaticity value of the mutation peak point;
[0047] Determine the target pixel position information of the candidate weeding area image according to the target pixel point and the position information of the target pixel point;
[0048] Determine the target pixel brightness information of the candidate weeding area image according to the target pixel point and the brightness information of the target pixel point.
[0049] Determining the target pixel point according to the chromaticity value of the mutation peak point can be to determine all pixel points with the chromaticity value of the mutation peak point in the candidate weeding area image as the target pixel points.
[0050] Determine the target pixel position information of the candidate weeding area image according to the target pixel and the position information of the target pixel. Exemplarily, if the position information is the coordinates of the target pixel, the target pixel position information can be the average position of the target pixels, that is, the average value of the sum of the y-axis coordinate values of all target pixels. This embodiment does not limit this.
[0051] Determine the target pixel brightness information of the candidate weeding area image according to the target pixel and the brightness information of the target pixel. Exemplarily, if the brightness information of the target pixel is the brightness value of the pixel, the target pixel brightness information can be the average brightness of the target pixels, that is, the average value of the sum of the brightness values of all target pixels. This embodiment does not limit this.
[0052] Determine the target pixel by the chromaticity value of the mutation peak point to determine the target pixel position information and the target pixel brightness information, improve the pertinence of obtaining the target pixel position information and the target pixel brightness information, and thus improve the accuracy of determining whether there is a shadow area in the candidate weeding area image subsequently.
[0053] Step 140: Determine the number of chromaticity valid pixels in the candidate weeding area image that are in a preset chromaticity interval.
[0054] Among them, the preset chromaticity interval can be [15, 95], and this embodiment does not limit this. The pixel points in the candidate weeding area image whose chromaticity values are in the preset chromaticity interval are used as chromaticity valid pixel points, and the number of chromaticity valid pixel points is the number of chromaticity valid pixels.
[0055] Step 150: Determine whether there is a shadow area in the candidate weeding area image according to the number of exposure state pixels, the peak value of the mutation peak point, the target pixel position information, the target pixel brightness information, and the number of chromaticity valid pixels, so as to determine whether there is an obstacle in the candidate weeding area image.
[0056] Compare the number of exposure state pixels, the number of chromaticity valid pixels, the target pixel position information, the target pixel brightness information of the candidate weeding area image, and the peak value of the mutation peak point of the chromaticity histogram with the preset information judgment conditions. Among them, the preset information judgment conditions are related to the number of exposure state pixels, the peak value of the mutation peak point, the target pixel position information, the target pixel brightness information, and the number of chromaticity valid pixels. If the preset information judgment conditions are met, it is determined that the suspected obstacle area existing in the candidate weeding area image is a shadow area rather than an obstacle area, so as to prevent the weeding robot from misjudging the grassland of its own shadow as an obstacle or a boundary.
[0057] The technical solution provided in this embodiment is to obtain the chromaticity information and the number of pixels in the exposure state of the candidate weeding area image; generate a chromaticity histogram of the candidate weeding area image according to the chromaticity information, and obtain the peak information of the chromaticity histogram; the peak information includes: the chromaticity value of the mutation peak point and the peak of the mutation peak point; determine the target pixel position information and the target pixel brightness information of the candidate weeding area image according to the chromaticity value of the mutation peak point; determine the number of chromaticity effective pixels in the candidate weeding area image that are in a preset chromaticity interval; determine whether there is a shadow area in the candidate weeding area image according to the number of pixels in the exposure state, the peak of the mutation peak point, the target pixel position information, the target pixel brightness information, and the number of chromaticity effective pixels, so as to determine whether there is an obstacle in the candidate weeding area image, which solves the problem that in the prior art, the boundary of the weeding area of the weeding robot is usually calibrated by burying a boundary line, which consumes a lot of manpower and material resources and increases the cost. And because there are limitations in burying the boundary line, to a certain extent, it restricts the shape of the weeding area, achieving the effect of improving the recognition efficiency and accuracy of obstacles in the candidate weeding area of the weeding robot.
[0058] Embodiment 2
[0059] Figure 2 The flowchart of an obstacle recognition method provided in Embodiment 2 of the present invention. This technical solution is a supplementary description of the process of determining whether there is a shadow area in the candidate weeding area image according to the number of pixels in the exposure state, the peak of the mutation peak point, the target pixel position information, the target pixel brightness information, and the number of chromaticity effective pixels. Compared with the above solution, this solution is specifically optimized as follows: determining whether there is a shadow area in the candidate weeding area image according to the number of pixels in the exposure state, the peak of the mutation peak point, the target pixel position information, the target pixel brightness information, and the number of chromaticity effective pixels includes:
[0060] If the peak of the mutation peak point is in a preset mutation peak point peak interval, and the average brightness of the target pixel is less than a preset average brightness threshold of the target pixel, and the average position of the target pixel is greater than a preset average position threshold of the target pixel, and the number of pixels in the exposure state is less than a preset number threshold of pixels in the exposure state, and the number of chromaticity effective pixels is greater than a preset number threshold of chromaticity effective pixels, then it is determined that there is a shadow area in the candidate weeding area image. Specifically, the flowchart of the obstacle recognition method is as Figure 2 shown:
[0061] Step 210, obtain the chromaticity information and the number of pixels in the exposure state of the candidate weeding area image.
[0062] Step 220: Generate a chromaticity histogram of the candidate weeding area image according to the chromaticity information, and obtain the peak information of the chromaticity histogram; the peak information includes: the chromaticity value of the mutation peak point and the peak of the mutation peak point.
[0063] Step 230: Determine the target pixel position information and target pixel brightness information of the candidate weeding area image according to the chromaticity value of the mutation peak point; the target pixel position information includes: the average position of the target pixel; the target pixel brightness information includes: the average brightness of the target pixel.
[0064] Step 240: Determine the number of chromaticity valid pixels in the candidate weeding area image that are within a preset chromaticity interval.
[0065] Step 250: If the peak of the mutation peak point is within a preset mutation peak point peak interval, and the average brightness of the target pixel is less than a preset target pixel average brightness threshold, and the average position of the target pixel is greater than a preset target pixel average position threshold, and the number of exposure state pixels is less than a preset exposure state pixel number threshold, and the number of chromaticity valid pixels is greater than a preset chromaticity valid pixel number threshold, then determine that there is a shadow area in the candidate weeding area image to determine whether there is an obstacle in the candidate weeding area image.
[0066] Exemplarily, the peak of the mutation peak point is denoted as singleV, the average brightness of the target pixel is denoted as Vs, the average position of the target pixel is denoted as is, the number of exposure state pixels is denoted as overbrightPix, and the number of chromaticity valid pixels is denoted as vaildPixels. If the preset mutation peak point peak interval is (500, 5500), the preset target pixel average brightness threshold is 30, the preset target pixel average position threshold is 88, the preset exposure state pixel number threshold is 300, and the preset chromaticity valid pixel number threshold is 15500.
[0067] Then the preset information judgment condition is 500 < singleV < 5500 and Vs < 30 and is > 88 and overbrightPix < 300 and vaildPixels > 15500. 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 a shadow area in the candidate weeding area image. Then the suspected obstacle area in the candidate weeding area image at this time is the shadow area generated by the weeding robot projecting itself on the grass when running backward under light, rather than the obstacle area.
[0068] In this embodiment, optionally, determining whether there is an obstacle in the candidate weeding area image includes:
[0069] If the shadow area exists, obtain the chromaticity segmentation image of the candidate weeding area image according to a preset chromaticity segmentation interval;
[0070] Determine whether there is an obstacle in the candidate weeding area image according to the chromaticity segmentation image.
[0071] Among them, the preset chromaticity segmentation interval can be [15, 95], and this embodiment does not limit this. To obtain the chromaticity segmentation image of the candidate weeding area image according to the preset chromaticity segmentation interval, for example, convert the pixel points in the candidate weeding area image whose chromaticity values are within the preset chromaticity segmentation interval into white, and convert other pixel points into black to obtain the chromaticity segmentation image. Then the white area is the grass area, and the black area is the non-grass area. To determine whether there is an obstacle in the candidate weeding area image according to the chromaticity segmentation image, it can be by comparing the non-grass area with the shadow area. If they are the same, it is determined that there is no obstacle in the candidate weeding area image, or directly use the shadow area as the non-obstacle area to improve the accuracy of image segmentation. This embodiment does not limit this. Avoid misjudging the shadow area as an obstacle area, thereby improving the accuracy of obstacle determination.
[0072] In the embodiment of the present invention, by the peak value of the mutation peak point, the average brightness of the target pixel, the average position of the target pixel, the number of exposure state pixels, and the number of chromaticity effective pixels, 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, effectively identifying the shadow area of the robot itself, preventing the grassland with the shadow of the robot itself from being misjudged as an obstacle or a boundary, and improving the accuracy of obstacle recognition. And it does not require the camera of the weeding robot to have its own light source, reducing the manufacturing cost of the robot. At the same time, it avoids the situation that the robot changes the camera position due to its own shadow in the blind area, affecting the visual range of the robot, and improving the weeding accuracy and efficiency of the robot.
[0073] Embodiment III
[0074] Figure 3 It is a schematic structural diagram of an obstacle recognition device provided in Embodiment III of the present invention. This device can be implemented in a hardware and / or software manner, and can execute an obstacle recognition method provided in any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method. As Figure 3 shown, this device includes:
[0075] An information acquisition module 310, configured to acquire the chromaticity information and the number of exposure state pixels of the candidate weeding area image;
[0076] A histogram generation module 320 is configured to generate a chromaticity histogram of the candidate weeding area image based on the chromaticity information, and obtain peak information of the chromaticity histogram; the peak information includes: a chromaticity value of a mutation peak point and a peak of the mutation peak point.
[0077] An information determination module 330 is configured to determine target pixel position information and target pixel brightness information of the candidate weeding area image according to the chromaticity value of the mutation peak point.
[0078] A pixel number determination module 340 determines the number of chromaticity valid pixels in a preset chromaticity interval in the candidate weeding area image.
[0079] An obstacle determination module 350 is configured to determine whether there is a shadow area in the candidate weeding area image according to the number of exposure state pixels, the peak of the mutation peak point, the target pixel position information, the target pixel brightness information, and the number of chromaticity valid pixels, so as to determine whether there is an obstacle in the candidate weeding area image.
[0080] In an embodiment of the present invention, by obtaining the chromaticity information and the number of exposure state pixels of the candidate weeding area image; generating a chromaticity histogram of the candidate weeding area image according to the chromaticity information, and obtaining peak information of the chromaticity histogram; the peak information includes: a chromaticity value of a mutation peak point and a peak of the mutation peak point; determining target pixel position information and target pixel brightness information of the candidate weeding area image according to the chromaticity value of the mutation peak point; determining the number of chromaticity valid pixels in a preset chromaticity interval in the candidate weeding area image; determining whether there is a shadow area in the candidate weeding area image according to the number of exposure state pixels, the peak of the mutation peak point, the target pixel position information, the target pixel brightness information, and the number of chromaticity valid pixels, so as to determine whether there is an obstacle in the candidate weeding area image. It solves the problem that in the prior art, the boundary of the weeding area of the weeding robot is usually calibrated by burying a boundary line, which consumes a lot of manpower and material resources and increases the cost. And because there are limitations in burying the boundary line, to a certain extent, it limits the shape of the weeding area, and realizes the effect of improving the recognition efficiency and accuracy of obstacles in the candidate weeding area of the weeding robot.
[0081] Based on the above technical solutions, optionally, the histogram generation module includes:
[0082] A histogram generation unit is configured to perform histogram statistics on the chromaticity information to generate a chromaticity histogram of the candidate weeding area image.
[0083] A mutation peak point determination unit is configured to determine a mutation peak point according to the difference between adjacent frequencies in the chromaticity histogram, and obtain peak information of the mutation peak point.
[0084] Based on the above technical solutions, optionally, the information determination module includes:
[0085] A target pixel point determination unit, configured to determine a target pixel point according to the chromaticity value of the mutation peak point;
[0086] A target pixel position information determination unit, configured to determine the target pixel position information of the candidate weeding area image according to the target pixel point and the position information of the target pixel point;
[0087] A target pixel brightness information determination unit, configured to determine the target pixel brightness information of the candidate weeding area image according to the target pixel point and the brightness information of the target pixel point.
[0088] Based on the above technical solutions, optionally, the number of pixels in the exposure state includes: the number of pixels in the exposure state; the target pixel position information includes: the average position of the target pixel; the target pixel brightness information includes: the average brightness of the target pixel;
[0089] The obstacle determination module includes:
[0090] A first obstacle determination unit, configured to determine that there is a shadow area in the candidate weeding area image if the peak of the mutation peak point is within a preset mutation peak point peak interval, and the average brightness of the target pixel is less than a preset target pixel average brightness threshold, and the average position of the target pixel is greater than a preset target pixel average position threshold, and the number of pixels in the exposure state is less than a preset number of pixels in the exposure state threshold, and the number of chromaticity effective pixels is greater than a preset number of chromaticity effective pixels threshold.
[0091] Based on the above technical solutions, optionally, the obstacle determination module includes:
[0092] A chromaticity segmentation image acquisition unit, configured to acquire a chromaticity segmentation image of the candidate weeding area image according to a preset chromaticity segmentation interval if there is the shadow area;
[0093] A second obstacle determination unit, configured to determine whether there is an obstacle in the candidate weeding area image according to the chromaticity segmentation image.
[0094] Embodiment 4
[0095] Figure 4 As shown in the schematic structural diagram of an electronic device provided in Embodiment 4 of the present invention, Figure 4 shown, the electronic device includes a processor 40, a memory 41, an input device 42, and an output device 43; the number of processors 40 in the electronic device can be one or more, Figure 4Taking a processor 40 as an example; the processor 40, the memory 41, the input device 42, and the output device 43 in the electronic device can be connected through a bus or other means. Figure 4 Taking the connection through the bus as an example.
[0096] As a computer-readable storage medium, the memory 41 can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the obstacle recognition method in the embodiments of the present invention. The processor 40 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 41, that is, implementing the above-mentioned obstacle recognition method.
[0097] The memory 41 may mainly include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the terminal, etc. In addition, the memory 41 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some instances, the memory 41 may further include a memory remotely set relative to the processor 40, and these remote memories can be connected to the electronic device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0098] Embodiment Five
[0099] Embodiment Five of the present invention further provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute an obstacle recognition method when executed by a computer processor. The method includes:
[0100] Obtaining the chromaticity information and the number of exposure state pixels of the candidate weeding area image;
[0101] Generating a chromaticity histogram of the candidate weeding area image according to the chromaticity information, and obtaining peak information of the chromaticity histogram; the peak information includes: the chromaticity value of the mutation peak point and the peak of the mutation peak point;
[0102] Determining the target pixel position information and the target pixel brightness information of the candidate weeding area image according to the chromaticity value of the mutation peak point;
[0103] Determining the number of chromaticity effective pixels in the candidate weeding area image that are in a preset chromaticity interval;
[0104] Based on the number of exposure state pixels, the peak value of the mutation peak point, the target pixel position information, the target pixel brightness information, and the number of chromaticity valid pixels, determine 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.
[0105] Certainly, for a storage medium containing computer-executable instructions provided in an embodiment of the present invention, the computer-executable instructions are not limited to the method operations described above, and can also execute related operations in the obstacle recognition method provided in any embodiment of the present invention.
[0106] From the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software and necessary general-purpose hardware. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk, or optical disc of a computer, including several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present invention.
[0107] It should be noted that in the embodiments 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 division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the present invention.
[0108] Embodiment Six
[0109] Embodiment Six of the present invention provides a weeding robot, including a robot body, and also including the electronic device described in any embodiment of the present invention.
[0110] Specifically, the electronic device installed on the weeding robot can execute related operations of an obstacle recognition method described in any embodiment of the present invention.
[0111] Among them, the robot body may include two active driving wheels on the left and right, which can be driven by motors respectively. The motors can be brushless motors with a reduction gearbox and Hall sensors. The robot body realizes driving operations such as forward, backward, turning, and arc by controlling the speeds and directions of the two active driving wheels. The robot body also includes a caster wheel, a camera, and a rechargeable battery. Among them, the caster wheel plays a role in supporting and balancing. The camera is installed at a specified position of the robot and forms a preset 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.
[0112] Note that the above is only a preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described here. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. An obstacle recognition method, characterized in that, Comprising: Obtaining the chromaticity information and the number of exposed state pixels of the candidate weeding area image; Generating a chromaticity histogram of the candidate weeding area image according to the chromaticity information, and obtaining peak information of the chromaticity histogram; The peak information includes: the chromaticity value of the mutation peak point and the peak of the mutation peak point; Determining the target pixel position information and the target pixel brightness information of the candidate weeding area image according to the chromaticity value of the mutation peak point; Determining the number of chromaticity valid pixels in the candidate weeding area image that are in a preset chromaticity interval; Determining whether there is a shadow area in the candidate weeding area image according to the number of exposed state pixels, the peak of the mutation peak point, the target pixel position information, the target pixel brightness information, and the number of chromaticity valid pixels, so as to determine whether there is an obstacle in the candidate weeding area image; The determining whether there is an obstacle in the candidate weeding area image includes: If there is the shadow area, converting the pixel points in the candidate weeding area image whose chromaticity values are in a preset chromaticity segmentation interval into white, and converting other pixel points into black to obtain a chromaticity segmentation image; wherein, the white area in the chromaticity segmentation image is the grass area, and the black area is the non-grass area; By comparing the non-grass area with the shadow area, if they are consistent, it is determined that there is no obstacle in the candidate weeding area image.
2. The method according to claim 1, wherein Generating a chromaticity histogram of the candidate weeding area image according to the chromaticity information, and obtaining peak information of the chromaticity histogram, including: Performing histogram statistics on the chromaticity information to generate a chromaticity histogram of the candidate weeding area image; Determining the mutation peak point according to the difference between adjacent frequencies in the chromaticity histogram, and obtaining the peak information of the mutation peak point.
3. The method according to claim 1, wherein Determining the target pixel position information and the target pixel brightness information of the candidate weeding area image according to the chromaticity value of the mutation peak point, including: Determining the target pixel point according to the chromaticity value of the mutation peak point; Determining the target pixel position information of the candidate weeding area image according to the target pixel point and the position information of the target pixel point; Determining the target pixel brightness information of the candidate weeding area image according to the target pixel point and the brightness information of the target pixel point.
4. The method according to any one of claims 1-3, characterized in that The target pixel position information includes: the average position of the target pixel; the target pixel brightness information includes: the average brightness of the target pixel; Determining whether there is a shadow area in the candidate weeding area image according to the number of exposed state pixels, the peak of the mutation peak point, the target pixel position information, the target pixel brightness information, and the number of chromaticity valid pixels, including: If the peak of the mutation peak point is in a preset mutation peak point peak interval, and the average brightness of the target pixel is less than a preset target pixel average brightness threshold, and the average position of the target pixel is greater than a preset target pixel average position threshold, and the number of exposed state pixels is less than a preset exposed state pixel number threshold, and the number of chromaticity valid pixels is greater than a preset chromaticity valid pixel number threshold, it is determined that there is a shadow area in the candidate weeding area image.
5. An obstacle recognition device, characterized in that, Comprising: An information acquisition module, configured to acquire the chromaticity information and the number of pixels with exposure status of the candidate weeding area image; A histogram generation module, configured to generate a chromaticity histogram of the candidate weeding area image according to the chromaticity information, and acquire the peak information of the chromaticity histogram; The peak information includes: the chromaticity value of the mutation peak point and the peak of the mutation peak point; An information determination module, configured to determine the target pixel position information and the target pixel brightness information of the candidate weeding area image according to the chromaticity value of the mutation peak point; A pixel number determination module, which determines the number of chromaticity valid pixels in the candidate weeding area image that are within a preset chromaticity interval; An obstacle determination module, configured to determine whether there is a shadow area in the candidate weeding area image according to the number of pixels with exposure status, the peak of the mutation peak point, the target pixel position information, the target pixel brightness information, and the number of chromaticity valid pixels, so as to determine whether there is an obstacle in the candidate weeding area image; The obstacle determination module includes: A chromaticity segmentation image acquisition unit, configured to, if there is the shadow area, convert the pixel points with chromaticity values within a preset chromaticity segmentation interval in the candidate weeding area image into white, and convert other pixel points into black, so as to obtain a chromaticity segmentation image; wherein, the white area in the chromaticity segmentation image is the grass area, and the black area is the non-grass area; A second obstacle determination unit, configured to compare the non-grass area with the shadow area, and if they are consistent, determine that there is no obstacle in the candidate weeding area image.
6. The device according to claim 5, characterized in that, The histogram generation module includes: A histogram generation unit, configured to perform histogram statistics on the chromaticity information to generate a chromaticity histogram of the candidate weeding area image; A mutation peak point determination unit, configured to determine a mutation peak point according to the difference between adjacent frequencies in the chromaticity histogram, and acquire the peak information of the mutation peak point.
7. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device, configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the obstacle recognition method according to any one of claims 1-4.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the obstacle recognition method according to any one of claims 1-4.
9. A weeding robot, comprising a robot body, characterized in that, It further includes the electronic device according to claim 7.
Citation Information
Patent Citations
Obstacle detection method and device, storage medium and mobile robot
CN112036210A
Obstacle recognition method and obstacle recognition device
JP2006040029A