Method, system, device and medium for identifying non-working area based on image
Through image recognition technology, the high cost and shape limitations of mobile robots when calibrating working areas are solved, accurate judgment and obstacle avoidance operations of non-working areas are achieved, and the robot's performance and work efficiency are improved.
Patent Information
- Application Number
- CN202110277128.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-15
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-03-15
AI Technical Summary
In the prior art, mobile robots such as mowing robots require a lot of manpower and material resources when calibrating the working area, and have certain restrictions on the shape of the lawn boundary, making it difficult to achieve low repetition and high coverage.
Using an image recognition method, by acquiring the original image, separating the H channel and V channel images, performing edge extraction and binarization processing, and obtaining rectangular contour parameters to determine the working area and non-working area, and then confirming whether the front of the robot is real. Non-working area and drives the robot to perform obstacle avoidance logic.
It realizes accurate judgment of non-working areas through image recognition, saves costs, improves robot performance, and improves work efficiency.
Smart Images

Figure CN115147713B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent control, and in particular to a method, system, device and medium for identifying a non-working area based on an image. Background Art
[0002] Low repetition rate and high coverage rate are the goals pursued by traversal robots such as vacuuming, mowing and pool cleaning. Taking the mobile robot as an intelligent mowing robot as an example, the mowing robot uses the lawn surrounded by the boundary as the working area for mowing operations, and the area outside the lawn is defined as the non-working area.
[0003] In the prior art, the boundaries of the lawn working area are usually calibrated by burying boundary lines. This method requires a lot of manpower and material resources, which increases the cost of using the mobile robot. In addition, this method has certain requirements for wiring, for example: the angle of the corner cannot be less than 90 degrees, thus limiting the shape of the lawn working area to a certain extent. Summary of the invention
[0004] In order to solve the above technical problems, the object of the present invention is to provide a method, system, device and medium for identifying non-working areas based on images.
[0005] In order to achieve one of the above-mentioned objects of the invention, an embodiment of the present invention provides a method for identifying a non-working area based on an image, the method comprising:
[0006] Get the original image;
[0007] Separate the H channel image and the V channel image from the original image;
[0008] Performing edge extraction on the V channel image to form an edge image and binarization processing to form a binarized image, wherein the binarized image includes at least one predicted working area having a first pixel value and / or includes at least one predicted non-working area having a second pixel value;
[0009] Based on the binary image, respectively obtaining a smallest rectangular outline enclosing each predicted working area in the binary image, and obtaining a smallest rectangular outline enclosing each predicted non-working area in the binary image;
[0010] Based on the binary image, a first parameter representing the size of each rectangular outline and a second parameter representing the position of the rectangular outline are obtained;
[0011] Acquire a third parameter representing image roughness based on the binary image and the edge image;
[0012] Acquire a fourth parameter representing the number of pixels based on the binary image and the H channel image;
[0013] Whether the area in front of the robot is a real non-working area is determined based on the magnitude relationship between the first parameter, the second parameter, the third parameter, the fourth parameter and the preset parameter value.
[0014] Through the above method, it is possible to accurately determine whether there is a non-working area in front of the robot through image recognition, thereby saving costs and improving the performance of the robot.
[0015] As a further improvement of an embodiment of the present invention, binarizing the V channel image to form a binary image includes:
[0016] Performing filtering and normalization processing on the V channel image in sequence to obtain a V channel preprocessed image;
[0017] Performing edge extraction on the V channel preprocessed image to form an edge image;
[0018] Performing Otsu threshold segmentation on the V channel preprocessed image to form a segmented image;
[0019] The segmented image is subjected to opening and closing operations to form a binary image.
[0020] Through the above preferred implementation manner, the process of forming a binary image is specifically described.
[0021] As a further improvement of an embodiment of the present invention, the method includes:
[0022] If the area enclosed by the current rectangular outline is the predicted non-working area, the first parameter A1 is configured as: the area of the rectangular outline, the length of the diagonal, the width of the rectangular outline, the height of the rectangular outline, and at least one of the number of pixels corresponding to the predicted non-working area enclosed in the rectangular outline; the second parameter A2 is configured as: the coordinate parameter value of the rectangular outline; the third parameter A3 is configured as: the ratio of the number of pixels covered by the predicted non-working area of the rectangular outline corresponding to the edge of the predicted non-working area of the edge image to the number of pixels covered by the predicted non-working area in the rectangular outline; the fourth parameter A4 is configured as: the ratio of the number of pixels of the predicted non-working area of the rectangular outline corresponding to the preset chromaticity coverage range of the H channel image to the number of pixels covered by the predicted non-working area in the rectangular outline;
[0023] If the area enclosed by the current rectangular outline is the pre-judgment working area, the first parameter A1 is configured as: the area of the rectangular outline, the length of the diagonal line, the width of the rectangular outline, the height of the rectangular outline, and at least one of the number of pixels corresponding to the pre-judgment working area enclosed in the rectangular outline; the second parameter A2 is configured as: the coordinate parameter value of the rectangular outline; the third parameter A3 is configured as: the ratio of the number of pixels covered by the pre-judgment working area of the rectangular outline corresponding to the edge of the pre-judgment working area of the edge image to the number of pixels covered by the pre-judgment working area within the rectangular outline; the fourth parameter A4 is configured as: the ratio of the number of pixels of the pre-judgment working area of the rectangular outline corresponding to the preset chromaticity coverage range of the H channel image to the number of pixels covered by the pre-judgment working area within the rectangular outline;
[0024] Confirming whether the front of the robot is a real non-working area according to the relationship between the first parameter, the second parameter, the third parameter, the fourth parameter and the preset parameter value includes:
[0025] If both of them are met:
[0026] If A1 is greater than the preset size threshold, A2 is greater than the preset coordinate threshold, A3 is less than the preset roughness threshold, and A4 is less than the preset quantity threshold, it is confirmed that the area in front of the robot is a real non-working area.
[0027] Through the above preferred implementation manner, the first parameter, the second parameter, the third parameter, and the fourth parameter are specifically defined, and the current position of the robot is accurately identified through specific rules.
[0028] As a further improvement of an embodiment of the present invention, if it is confirmed that the area in front of the robot is a real non-working area, the method further includes:
[0029] Drive the robot to execute obstacle avoidance logic.
[0030] In the above implementation mode, the robot is confirmed to have encountered an obstacle through image recognition, and an obstacle avoidance operation is performed to improve work efficiency.
[0031] In order to achieve one of the above-mentioned objects of the invention, an embodiment of the present invention provides a system for identifying a non-working area based on an image, the system comprising: an acquisition module for acquiring an original image;
[0032] A conversion module, used for separating an H channel image and a V channel image from an original image;
[0033] Performing edge extraction on the V channel image to form an edge image and binarization processing to form a binarized image, wherein the binarized image includes at least one predicted working area having a first pixel value and / or includes at least one predicted non-working area having a second pixel value;
[0034] The analysis module, based on the binary image, respectively obtains the smallest rectangular outline enclosing each predicted working area in the binary image, and obtains the smallest rectangular outline enclosing each predicted non-working area in the binary image;
[0035] Based on the binary image, a first parameter representing the size of each rectangular outline and a second parameter representing the position of the rectangular outline are obtained;
[0036] Acquire a third parameter representing image roughness based on the binary image and the edge image;
[0037] Acquire a fourth parameter representing the number of pixels based on the binary image and the H channel image;
[0038] Whether the area in front of the robot is a real non-working area is determined based on the magnitude relationship between the first parameter, the second parameter, the third parameter, the fourth parameter and the preset parameter value.
[0039] Through the above system, it is possible to accurately determine whether there is a non-working area in front of the robot through image recognition, saving costs and improving the robot's performance.
[0040] As a further improvement of an embodiment of the present invention, the conversion module is used to: sequentially perform filtering processing and normalization processing on the V channel image to obtain a V channel preprocessed image;
[0041] Performing edge extraction on the V channel preprocessed image to form an edge image;
[0042] Performing Otsu threshold segmentation on the V channel preprocessed image to form a segmented image;
[0043] The segmented images are sequentially processed by opening and closing operations to form a binary image.
[0044] Through the above preferred implementation manner, the formation process of the first binary image is specifically described.
[0045] As a further improvement of an embodiment of the present invention, the parsing module is used for: if the area enclosed by the current rectangular outline is a predicted non-working area, then the first parameter A1 is configured as: the area of the rectangular outline, the length of the diagonal, the width of the rectangular outline, the height of the rectangular outline, and at least one of the number of pixels corresponding to the predicted non-working area enclosed in the rectangular outline; the second parameter A2 is configured as: the coordinate parameter value of the rectangular outline; the third parameter A3 is configured as: the ratio of the number of pixels covered by the predicted non-working area of the rectangular outline corresponding to the edge of the predicted non-working area of the edge image to the number of pixels covered by the predicted non-working area in the rectangular outline; the fourth parameter A4 is configured as: the ratio of the number of pixels of the predicted non-working area of the rectangular outline corresponding to the preset chromaticity coverage range of the H channel image to the number of pixels covered by the predicted non-working area in the rectangular outline;
[0046] If the area enclosed by the current rectangular outline is the pre-judgment working area, the first parameter A1 is configured as: the area of the rectangular outline, the length of the diagonal line, the width of the rectangular outline, the height of the rectangular outline, and at least one of the number of pixels corresponding to the pre-judgment working area enclosed in the rectangular outline; the second parameter A2 is configured as: the coordinate parameter value of the rectangular outline; the third parameter A3 is configured as: the ratio of the number of pixels covered by the pre-judgment working area of the rectangular outline corresponding to the edge of the pre-judgment working area of the edge image to the number of pixels covered by the pre-judgment working area within the rectangular outline; the fourth parameter A4 is configured as: the ratio of the number of pixels of the pre-judgment working area of the rectangular outline corresponding to the preset chromaticity coverage range of the H channel image to the number of pixels covered by the pre-judgment working area within the rectangular outline;
[0047] Confirming whether the front of the robot is a real non-working area according to the relationship between the first parameter, the second parameter, the third parameter, the fourth parameter and the preset parameter value includes:
[0048] If both:
[0049] If A1 is greater than the preset size threshold, A2 is greater than the preset coordinate threshold, A3 is less than the preset roughness threshold, and A4 is less than the preset quantity threshold, it is confirmed that the area in front of the robot is a real non-working area.
[0050] The above system specifically defines the first parameter, the second parameter, the third parameter and the fourth parameter, and accurately identifies the current position of the robot through specific rules.
[0051] As a further improvement of an embodiment of the present invention, if it is confirmed that the area in front of the robot is a real non-working area, the parsing module is further used to: drive the robot to execute obstacle avoidance logic.
[0052] The above system uses image recognition to confirm that the robot encounters an obstacle, performs obstacle avoidance operations, and improves work efficiency.
[0053] In order to achieve one of the above-mentioned purposes of the invention, one embodiment of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the method of identifying non-working areas based on images as described above are implemented.
[0054] In order to achieve one of the above-mentioned objects of the invention, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-mentioned method for identifying a non-working area based on an image.
[0055] Compared with the prior art, the method, system, device and medium based on image recognition of non-working areas of the present invention can accurately identify non-working areas through image recognition, save costs and improve the performance of the robot. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 is a structural schematic diagram of the lawn mowing robot system provided by the present invention;
[0057] Figure 2 It is a flow chart of a method for identifying a non-working area based on an image provided by the present invention;
[0058] Figure 3 It is a module schematic diagram of the system based on image recognition of non-working areas provided by the present invention. DETAILED DESCRIPTION
[0059] The present invention will be described in detail below in conjunction with the various embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional changes made by a person skilled in the art based on these embodiments are all within the scope of protection of the present invention.
[0060] The robot system of the present invention can be a lawn mowing robot system, a sweeping robot system, a snow sweeper system, a leaf vacuum system, a golf course ball picker system, etc. Each system can automatically walk in the working area and perform corresponding work. In the specific example of the present invention, the robot system is a lawn mowing robot system as an example for specific description. Accordingly, the working area can be a lawn.
[0061] like Figure 1 As shown, the lawn mowing robot system of the present invention comprises: a lawn mowing robot (RM).
[0062] The lawn mowing robot comprises: a body 10, a walking unit, an image acquisition unit and a control unit arranged on the body 10. The walking unit comprises: a driving wheel 111, a passive wheel 113 and a motor for driving the driving wheel 111; the motor can be a brushless motor with a reduction gearbox and a Hall sensor; after the motor is started, the driving wheel 111 can be driven to walk through the reduction gearbox, and the driving movements such as forward and backward straight-line running, turning on the spot and circular running can be realized by controlling the speed and direction of the two wheels; the passive wheel 113 can be a universal wheel, which is usually set to one or two, and it mainly plays a role of supporting balance.
[0063] The image acquisition unit is used to acquire scenes within its viewing angle within a certain range. In a specific embodiment of the present invention, it is a camera 12. The camera 12 is installed on the upper part of the main body 10 and forms a certain angle with the horizontal direction. It can capture scenes within a certain range of the lawn mower robot; the camera 12 usually captures scenes within a certain range in front of the lawn mower robot.
[0064] The control unit is a main controller 13 for performing image processing, such as an MCU or a DSP.
[0065] Furthermore, the lawn mowing robot also includes: a working mechanism for working, and a power supply 14; in this embodiment, the working mechanism is a lawn mowing disc, and various sensors for sensing the walking state of the walking robot, such as: tipping, lifting off the ground, collision sensors, geomagnetism, gyroscopes, etc., which are not described in detail here.
[0066] like Figure 2 As shown, the first embodiment of the present invention provides a method for identifying a non-working area based on an image, and the method comprises the following steps:
[0067] S1, obtain the original image;
[0068] S2, separating an H channel image and a V channel image from the original image;
[0069] Performing edge extraction on the V channel image to form an edge image and binarization processing to form a binarized image, wherein the binarized image includes at least one predicted working area having a first pixel value and / or includes at least one predicted non-working area having a second pixel value;
[0070] S3, based on the binary image, respectively obtaining a smallest rectangular outline enclosing each predicted working area in the binary image, and obtaining a smallest rectangular outline enclosing each predicted non-working area in the binary image;
[0071] Based on the binary image, a first parameter representing the size of each rectangular outline and a second parameter representing the position of the rectangular outline are obtained;
[0072] Acquire a third parameter representing image roughness based on the binary image and the edge image;
[0073] Acquire a fourth parameter representing the number of pixels based on the binary image and the H channel image;
[0074] Whether the area in front of the robot is a real non-working area is determined based on the magnitude relationship between the first parameter, the second parameter, the third parameter, the fourth parameter and the preset parameter value.
[0075] In a specific implementation of the present invention, for step S1, a camera installed on the mowing robot captures the scene in front of the robot in real time to form an original image; the scene is an image of the ground in the robot's forward direction; further, after the main controller receives the original image, it parses the original image; thus, the robot can be judged through the original image to obtain the working position of the robot when the original image is captured, which will be described in detail in the following content. In this specific example, the format of the original image is not specifically limited, for example: a color image in RGB format or HSV format.
[0076] For step S2, if the original image is in RGB format, the format of the original image in RGB format is converted to form an HSV image. If the original image is in HSV format, no conversion is required, and the H channel image and the V channel image are directly separated from the HSV image. This implementation method is all existing technology, and there are many implementation methods, which will not be repeated here.
[0077] The V channel image is binarized to form a binary image. It can be seen that the V channel image is a grayscale image, and the converted binary image is: the pixels in the image have only two grayscale values, for example, the two grayscale values are 0 and 255 respectively, and the binarization process is a process of presenting an obvious black and white effect on the entire original image.
[0078] In a preferred embodiment of the present invention, the V channel image is binarized to form a binarized image, including: filtering and normalizing the V channel image in sequence to obtain a V channel preprocessed image to remove noise in the V channel image; edge extraction is performed on the V channel preprocessed image to form an edge image for calculating roughness, for example: the edge detection method used is the canny algorithm; the V channel preprocessed image is segmented by the Otsu threshold method to form a segmented image, and there are many segmentation methods, not limited to the Otsu threshold method, such as a fixed threshold method; the segmented image is opened and closed to form the binarized image. Here, the opening and closing operations are conventional image processing methods, which are also prior art and will not be further described here.
[0079] Preferably, for step S3, the method includes: if the area enclosed by the current rectangular outline is the predicted non-working area, then configuring the first parameter A1 to be at least one of: the area of the rectangular outline, the length of the diagonal, the width of the rectangular outline, the height of the rectangular outline, and the number of pixels corresponding to the predicted non-working area enclosed in the rectangular outline; configuring the second parameter A2 to be: the coordinate parameter value of the rectangular outline; configuring the third parameter A3 to be: the ratio of the number of pixels covered by the predicted non-working area of the rectangular outline corresponding to the edge of the predicted non-working area of the edge image to the number of pixels covered by the predicted non-working area in the rectangular outline; configuring the fourth parameter A4 to be: the ratio of the number of pixels of the predicted non-working area of the rectangular outline corresponding to the preset chromaticity coverage range of the H channel image to the number of pixels covered by the predicted non-working area in the rectangular outline;
[0080] If the area enclosed by the current rectangular outline is the pre-judgment working area, the first parameter A1 is configured as: the area of the rectangular outline, the length of the diagonal line, the width of the rectangular outline, the height of the rectangular outline, and at least one of the number of pixels corresponding to the pre-judgment working area enclosed in the rectangular outline; the second parameter A2 is configured as: the coordinate parameter value of the rectangular outline; the third parameter A3 is configured as: the ratio of the number of pixels covered by the pre-judgment working area of the rectangular outline corresponding to the edge of the pre-judgment working area of the edge image to the number of pixels covered by the pre-judgment working area within the rectangular outline; the fourth parameter A4 is configured as: the ratio of the number of pixels of the pre-judgment working area of the rectangular outline corresponding to the preset chromaticity coverage range of the H channel image to the number of pixels covered by the pre-judgment working area within the rectangular outline;
[0081] Confirming whether the front of the robot is a real non-working area according to the relationship between the first parameter, the second parameter, the third parameter, the fourth parameter and the preset parameter value includes:
[0082] If both:
[0083] If A1 is greater than the preset size threshold, A2 is greater than the preset coordinate threshold, A3 is less than the preset roughness threshold, and A4 is less than the preset quantity threshold, it is confirmed that the area in front of the robot is a real non-working area.
[0084] Here, it should be noted that based on the binary image, the predicted working area and the predicted non-working area contained therein independently form rectangular contours, and there is no special distinction between the rectangular contours corresponding to the predicted working area and the rectangular contours corresponding to the predicted non-working area.
[0085] Here, when the first parameter A1 is the area corresponding to the rectangular outline, the preset size threshold is also the corresponding area threshold; correspondingly, when the first parameter A1 is at least one of the diagonal length, the rectangular outline width, the rectangular outline height, and the number of pixels in the predicted working area / predicted non-working area in the rectangular outline, the first parameter A1 also changes accordingly. Specifically, the preset size threshold is one of the diagonal length threshold, the rectangular outline width threshold, the rectangular outline height threshold, and the pixel number threshold for the predicted working area in the rectangular outline / the pixel number threshold for the predicted non-working area in the rectangular outline;
[0086] In a specific example of the present invention, the configuration area threshold is 5%*the area of the original image, the diagonal length threshold is 22%*the diagonal length of the original image, the pixel number threshold for predicting the working area in the rectangular outline is 5%*the number of pixels in the original image, the pixel number threshold for predicting the non-working area in the rectangular outline is 5%*the number of pixels in the original image, the rectangular outline width threshold is 19%*the width of the original image, and the rectangular outline height is 26% of the height of the original image.
[0087] The second parameter A2 is configured as the coordinate parameter value of the rectangular outline. The coordinate parameter value can be the y-axis coordinate of the lower right corner of the rectangular outline, or the center position coordinate of the rectangular outline, or the average Y value of the pixel coordinate in the rectangular outline, etc. No further details are given here. Correspondingly, in a specific example of the present invention, the upper left corner is taken as the coordinate origin, and the Y-axis is downward as the positive direction of the Y-axis, then the preset coordinate threshold is 62.6%*the coordinate value of the height of the original image.
[0088] The third parameter A3 is configured as the roughness of the rectangular outline, that is, the ratio of the number of pixels covered by the predicted non-working area of the rectangular outline corresponding to the edge of the predicted non-working area of the edge image to the number of pixels covered by the predicted non-working area in the rectangular outline. Preferably, the value of configuration A3 is 0.26;
[0089] The fourth parameter A4 is configured as the ratio of effective pixel values in the rectangular outline, that is, the ratio of the number of pixels in the predicted working area of the rectangular outline corresponding to the preset chromaticity coverage range of the H channel image to the number of pixels covered in the predicted working area in the rectangular outline, wherein the preset chromaticity coverage range of the H channel image is usually the chromaticity value range of the common color of the lawn, such as the green chromaticity range. Preferably, the configuration A4 takes a value of 0.8.
[0090] Furthermore, if it is confirmed that the area in front of the robot is a real non-working area, the method further includes: driving the robot to execute obstacle avoidance logic, such as backward steering, which will not be elaborated here.
[0091] Combination Figure 3As shown, a system for identifying non-working areas based on images is provided, and the system includes: an acquisition module 100, a conversion module 200 and a parsing module 300.
[0092] The acquisition module 100 is used to acquire the original image;
[0093] The conversion module 200 is used to separate the H channel image and the V channel image from the original image;
[0094] Performing edge extraction on the V channel image to form an edge image and binarization processing to form a binarized image, wherein the binarized image includes at least one predicted working area having a first pixel value and / or includes at least one predicted non-working area having a second pixel value;
[0095] The analysis module 300 is used to obtain, based on the binary image, a minimum rectangular outline enclosing each predicted working area in the binary image, and to obtain a minimum rectangular outline enclosing each predicted non-working area in the binary image;
[0096] Based on the binary image, a first parameter representing the size of each rectangular outline and a second parameter representing the position of the rectangular outline are obtained;
[0097] Acquire a third parameter representing image roughness based on the binary image and the edge image;
[0098] Acquire a fourth parameter representing the number of pixels based on the binary image and the H channel image;
[0099] Whether the area in front of the robot is a real non-working area is determined based on the magnitude relationship between the first parameter, the second parameter, the third parameter, the fourth parameter and the preset parameter value.
[0100] Specifically, the acquisition module 100 is used to implement step S1; the conversion module 200 is used to implement step S2; the analysis module 300 is used to implement step S3, and execute the calculation of the obstacle avoidance logic for driving the robot; technicians in the relevant field can clearly understand that for the convenience and conciseness of description, the specific working process of the system described above can refer to the corresponding process in the aforementioned method implementation method, and will not be repeated here.
[0101] Preferably, an embodiment of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the method of identifying non-working areas based on images as described above are implemented.
[0102] Preferably, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps in the method for identifying a non-working area based on an image as described above.
[0103] In summary, the method, system equipment and medium for identifying non-working areas based on image recognition of the present invention can accurately identify non-working areas through image recognition, save costs and improve the performance of the robot.
[0104] In the several embodiments provided in this application, it should be understood that the disclosed modules, systems and methods can be implemented in other ways. The system implementation described above is only illustrative, and the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0105] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or may be distributed on multiple network modules, and some or all of the modules may be selected according to actual needs to achieve the purpose of this implementation scheme.
[0106] In addition, each functional module in each embodiment of the present application can be integrated into one analysis module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0107] Finally, it should be noted that the above implementation modes are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned implementation modes, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned implementation modes, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various implementation modes of the present application.
Claims
1. A method for identifying a non-working area based on an image, characterized in that: The method comprises: Get the original image; Separate the H channel image and the V channel image from the original image; Performing edge extraction on the V channel image to form an edge image and binarization processing to form a binarized image, wherein the binarized image includes at least one predicted working area having a first pixel value and / or includes at least one predicted non-working area having a second pixel value; Based on the binary image, respectively obtain a smallest rectangular outline that encloses each predicted working area in the binary image, and obtain a smallest rectangular outline that encloses each predicted non-working area in the binary image; Based on the binary image, a first parameter representing the size of each rectangular outline and a second parameter representing the position of the rectangular outline are obtained; Acquire a third parameter representing image roughness based on the binary image and the edge image; Acquire a fourth parameter representing the number of pixels based on the binary image and the H channel image; If the area enclosed by the current rectangular outline is the predicted non-working area, the first parameter A1 is configured as: the area of the rectangular outline, the length of the diagonal, the width of the rectangular outline, the height of the rectangular outline, and at least one of the number of pixels corresponding to the predicted non-working area enclosed in the rectangular outline; the second parameter A2 is configured as: the coordinate parameter value of the rectangular outline; the third parameter A3 is configured as: the ratio of the number of pixels covered by the predicted non-working area of the rectangular outline corresponding to the edge of the predicted non-working area of the edge image to the number of pixels covered by the predicted non-working area in the rectangular outline; the fourth parameter A4 is configured as: the ratio of the number of pixels of the predicted non-working area of the rectangular outline corresponding to the preset chromaticity coverage range of the H channel image to the number of pixels covered by the predicted non-working area in the rectangular outline; If the area enclosed by the current rectangular outline is the pre-judgment working area, the first parameter A1 is configured as: the area of the rectangular outline, the length of the diagonal line, the width of the rectangular outline, the height of the rectangular outline, and at least one of the number of pixels corresponding to the pre-judgment working area enclosed in the rectangular outline; the second parameter A2 is configured as: the coordinate parameter value of the rectangular outline; the third parameter A3 is configured as: the ratio of the number of pixels covered by the pre-judgment working area of the rectangular outline corresponding to the edge of the pre-judgment working area of the edge image to the number of pixels covered by the pre-judgment working area within the rectangular outline; the fourth parameter A4 is configured as: the ratio of the number of pixels of the pre-judgment working area of the rectangular outline corresponding to the preset chromaticity coverage range of the H channel image to the number of pixels covered by the pre-judgment working area within the rectangular outline; Determine whether the area in front of the robot is a real non-working area according to the relationship between the first parameter, the second parameter, the third parameter, the fourth parameter and the preset parameter value; If both of them are met: If A1 is greater than the preset size threshold, A2 is greater than the preset coordinate threshold, A3 is less than the preset roughness threshold, and A4 is less than the preset quantity threshold, it is confirmed that the area in front of the robot is a real non-working area.
2. The method for identifying non-working areas based on images according to claim 1, characterized in that: Binarizing the V channel image to form a binary image includes: Performing filtering and normalization processing on the V channel image in sequence to obtain a V channel preprocessed image; Performing edge extraction on the V channel preprocessed image to form an edge image; Performing Otsu threshold segmentation on the V channel preprocessed image to form a segmented image; The segmented image is subjected to opening and closing operations to form a binary image.
3. The method for identifying a non-working area based on an image according to any one of claims 1 to 2, characterized in that: If it is confirmed that the area in front of the robot is a real non-working area, the method further includes: Drive the robot to execute obstacle avoidance logic.
4. A system for identifying non-working areas based on images, characterized in that: The system comprises: An acquisition module, used for acquiring the original image; A conversion module, used for separating an H channel image and a V channel image from an original image; Performing edge extraction on the V channel image to form an edge image and binarization processing to form a binarized image, wherein the binarized image includes at least one predicted working area having a first pixel value and / or includes at least one predicted non-working area having a second pixel value; The analysis module, based on the binary image, respectively obtains the smallest rectangular outline that encloses each predicted working area in the binary image, and obtains the smallest rectangular outline that encloses each predicted non-working area in the binary image; Based on the binary image, a first parameter representing the size of each rectangular outline and a second parameter representing the position of the rectangular outline are obtained; Acquire a third parameter representing image roughness based on the binary image and the edge image; Acquire a fourth parameter representing the number of pixels based on the binary image and the H channel image; Determine whether the area in front of the robot is a real non-working area according to the relationship between the first parameter, the second parameter, the third parameter, the fourth parameter and the preset parameter value; The parsing module is used to: If the area enclosed by the current rectangular outline is the predicted non-working area, the first parameter A1 is configured as: the area of the rectangular outline, the length of the diagonal, the width of the rectangular outline, the height of the rectangular outline, and at least one of the number of pixels corresponding to the predicted non-working area enclosed in the rectangular outline; the second parameter A2 is configured as: the coordinate parameter value of the rectangular outline; the third parameter A3 is configured as: the ratio of the number of pixels covered by the predicted non-working area of the rectangular outline corresponding to the edge of the predicted non-working area of the edge image to the number of pixels covered by the predicted non-working area in the rectangular outline; the fourth parameter A4 is configured as: the ratio of the number of pixels of the predicted non-working area of the rectangular outline corresponding to the preset chromaticity coverage range of the H channel image to the number of pixels covered by the predicted non-working area in the rectangular outline; If the area enclosed by the current rectangular outline is the pre-judgment working area, the first parameter A1 is configured as: the area of the rectangular outline, the length of the diagonal line, the width of the rectangular outline, the height of the rectangular outline, and at least one of the number of pixels corresponding to the pre-judgment working area enclosed in the rectangular outline; the second parameter A2 is configured as: the coordinate parameter value of the rectangular outline; the third parameter A3 is configured as: the ratio of the number of pixels covered by the pre-judgment working area of the rectangular outline corresponding to the edge of the pre-judgment working area of the edge image to the number of pixels covered by the pre-judgment working area within the rectangular outline; the fourth parameter A4 is configured as: the ratio of the number of pixels of the pre-judgment working area of the rectangular outline corresponding to the preset chromaticity coverage range of the H channel image to the number of pixels covered by the pre-judgment working area within the rectangular outline; Confirming whether the front of the robot is a real non-working area according to the relationship between the first parameter, the second parameter, the third parameter, the fourth parameter and the preset parameter value includes: If both of them are met: If A1 is greater than the preset size threshold, A2 is greater than the preset coordinate threshold, A3 is less than the preset roughness threshold, and A4 is less than the preset quantity threshold, it is confirmed that the area in front of the robot is a real non-working area.
5. The system for identifying non-working areas based on images according to claim 4, characterized in that: The conversion module is used to: perform filtering and normalization processing on the V channel image in sequence to obtain a V channel preprocessing image; Performing edge extraction on the V channel preprocessed image to form an edge image; Performing Otsu threshold segmentation on the V channel preprocessed image to form a segmented image; The segmented image is subjected to opening and closing operations to form a binary image.
6. The system for identifying non-working areas based on images according to any one of claims 4 to 5, characterized in that: If it is confirmed that the area in front of the robot is a real non-working area, the parsing module is also used to: drive the robot to execute obstacle avoidance logic.
7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the program, the steps in the method for identifying a non-working area based on an image according to any one of claims 1 to 3 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method for identifying a non-working area based on an image according to any one of claims 1 to 3 are implemented.
