Cliff detection method, device, electronic device and computer-readable storage medium
Through multiple image analysis methods based on plane images in mobile robots, combined with deep learning models, cliff detection is achieved, which solves the problem that robots that can only collect plane images cannot detect cliffs, and improves robot safety and cost-effectiveness.
Patent Information
- Application Number
- CN202110772726.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-08
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-07-08
AI Technical Summary
The existing technology is difficult to effectively detect cliff areas in mobile robots, especially in robots that can only collect plane images and lack depth images and motion sensors, cliff detection cannot be achieved.
Through edge detection, pixel clustering, image area classification and optical flow field analysis based on plane images, combined with deep learning models, cliff detection is achieved without additional hardware. Cliff areas can be detected using only plane images.
It realizes that the mobile robot can effectively detect the cliff area without the need for depth images and motion sensors, improves the robot's anti-fall function, reduces the cost, and is suitable for various mobile robot scenarios.
Smart Images

Figure CN113486811B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of intelligent robot technology, and in particular to a cliff detection method, device, electronic device, and computer-readable storage medium. Background Art
[0002] With the development of science and technology, more and more intelligent mobile robots are being manufactured and applied in various industries. For example, a sweeping robot can move and automatically perform cleaning work, and a food delivery robot can move and deliver food. In the mobile environment of the mobile robot, there are often some areas with height differences, such as the edge of stairs, desktops, etc. These areas can be called cliff areas. In order to prevent the mobile robot from falling off the cliff, cliff detection is required during the movement of the mobile robot. Summary of the invention
[0003] The embodiments of the present application provide a cliff detection method, device, electronic device, and computer-readable storage medium, which can detect cliffs based on plane images collected by a mobile robot. For a mobile robot that can only collect plane images, cliff detection can be achieved without adding additional hardware. The technical solution is as follows:
[0004] In one aspect, a cliff detection method is provided, the method comprising:
[0005] Acquire a first plane image to be detected, where the first plane image is an image captured by a mobile robot;
[0006] Performing image analysis on the area to be detected in the first plane image to obtain an image analysis result;
[0007] Based on the image analysis result, a cliff detection result of the area to be detected is determined.
[0008] Optionally, the image analysis method includes an edge detection method, and the image analysis result includes an analysis result corresponding to the edge detection method;
[0009] The performing image analysis on the area to be detected in the first plane image to obtain an image analysis result includes:
[0010] Performing edge detection on the area to be detected to determine a plurality of edge pixel points;
[0011] Performing connected domain analysis on the plurality of edge pixels to obtain a plurality of edge regions;
[0012] If the proportion of the pixels included in the plurality of edge regions to the area to be detected is greater than a first threshold, it is determined that the analysis result corresponding to the edge detection method is that a cliff exists.
[0013] Optionally, the image analysis method includes a pixel clustering method, and the image analysis result includes an analysis result corresponding to the pixel clustering method;
[0014] The performing image analysis on the area to be detected in the first plane image to obtain an image analysis result includes:
[0015] Clustering the pixel points in the area to be detected to obtain labeling information of a plurality of pixel points, wherein the labeling information indicates whether the corresponding pixel point is a cliff point or a non-cliff point;
[0016] Determine the cliff side area and the non-cliff side area in the area to be detected based on the marking information of the multiple pixels;
[0017] If the proportion of the cliff side area to the to-be-detected area is greater than a second threshold, it is determined that the analysis result corresponding to the pixel clustering method is that a cliff exists.
[0018] Optionally, the image analysis method includes an image region classification method, and the image analysis result includes an analysis result corresponding to the image region classification method;
[0019] The performing image analysis on the area to be detected in the first plane image to obtain an image analysis result includes:
[0020] The image information of the area to be detected is input into a cliff detection model to obtain an analysis result corresponding to the image area classification method output by the cliff detection model, where the cliff detection model is a deep learning model.
[0021] Optionally, the image analysis method includes a method based on an optical flow field, and the image analysis result includes an analysis result corresponding to the optical flow field method;
[0022] The performing image analysis on the area to be detected in the first plane image to obtain an image analysis result includes:
[0023] Acquire a second plane image, where the second plane image is a previous frame image of the first plane image;
[0024] Based on the first plane image and the second plane image, performing optical flow field calculation on a plurality of feature points in the to-be-detected area to obtain movement speeds of the plurality of feature points;
[0025] If the proportion of feature points whose moving speed is less than the third threshold among the multiple feature points is greater than the fourth threshold, it is determined that the detection result corresponding to the optical flow field-based method is that there is a cliff.
[0026] Optionally, the image analysis method includes one or more methods of edge detection, pixel clustering, image region classification and optical flow field, the one or more methods correspond to one or more analysis results one by one, and the image analysis result includes the one or more analysis results;
[0027] The determining, based on the image analysis result, a cliff detection result in the area to be detected, comprises:
[0028] If the one or more analysis results all indicate the existence of a cliff, determining the cliff detection result as the existence of a cliff; or,
[0029] If the total number of analysis results indicating the existence of a cliff in the one or more analysis results is greater than a specified number, then the cliff detection result is determined to be the existence of a cliff.
[0030] In another aspect, a cliff detection device is provided, the device comprising:
[0031] An acquisition module, used for acquiring a first plane image to be detected, where the first plane image is an image collected by a mobile robot;
[0032] An analysis module, used for performing image analysis on the area to be detected in the first plane image to obtain an image analysis result;
[0033] A determination module is used to determine the cliff detection result of the area to be detected based on the image analysis result.
[0034] Optionally, the image analysis method includes an edge detection method, and the image analysis result includes an analysis result corresponding to the edge detection method;
[0035] The analysis module comprises:
[0036] A first determination submodule is used to perform edge detection on the area to be detected and determine a plurality of edge pixel points;
[0037] An analysis submodule, configured to perform a connected domain analysis on the plurality of edge pixels to obtain a plurality of edge regions;
[0038] The second determination submodule is used to determine that the analysis result corresponding to the edge detection method is that there is a cliff if the proportion of the pixels included in the multiple edge areas to the area to be detected is greater than a first threshold.
[0039] Optionally, the image analysis method includes a pixel clustering method, and the image analysis result includes an analysis result corresponding to the pixel clustering method;
[0040] The analysis module comprises:
[0041] A first processing submodule is used to cluster the pixel points in the area to be detected to obtain label information of a plurality of pixel points, wherein the label information indicates whether the corresponding pixel point is a cliff point or a non-cliff point;
[0042] A third determination submodule is used to determine the cliff side area and the non-cliff side area in the area to be detected based on the marking information of the multiple pixel points;
[0043] The fourth determination submodule is configured to determine that the analysis result corresponding to the pixel clustering method is that a cliff exists if the proportion of the cliff side area to the to-be-detected area is greater than a second threshold.
[0044] Optionally, the image analysis method includes an image region classification method, and the image analysis result includes an analysis result corresponding to the image region classification method;
[0045] The analysis module comprises:
[0046] The second processing submodule is used to input the image information of the area to be detected into a cliff detection model to obtain an analysis result corresponding to the image area classification method output by the cliff detection model, where the cliff detection model is a deep learning model.
[0047] Optionally, the image analysis method includes a method based on an optical flow field, and the image analysis result includes an analysis result corresponding to the optical flow field method;
[0048] The analysis module comprises:
[0049] An acquisition submodule, used for acquiring a second plane image, where the second plane image is a previous frame image of the first plane image;
[0050] A third processing submodule is used to calculate the optical flow field of multiple feature points in the to-be-detected area based on the first plane image and the second plane image to obtain the movement speed of the multiple feature points;
[0051] The fifth determination submodule is configured to determine that the detection result corresponding to the optical flow field-based method is that there is a cliff if the proportion of feature points whose movement speed is less than the third threshold among the multiple feature points is greater than a fourth threshold.
[0052] Optionally, the image analysis method includes one or more methods of edge detection, pixel clustering, image region classification and optical flow field, the one or more methods correspond to one or more analysis results one by one, and the image analysis result includes the one or more analysis results;
[0053] The determination module comprises:
[0054] a sixth determination submodule, configured to determine that the cliff detection result is that a cliff exists if the one or more analysis results all indicate that a cliff exists; or,
[0055] The seventh determination submodule is configured to determine that the cliff detection result is that a cliff exists if the total number of analysis results indicating the existence of a cliff in the one or more analysis results is greater than a specified number.
[0056] On the other hand, an electronic device is provided, the electronic device comprising a processor, a communication interface, a memory and a communication bus, the processor, the communication interface and the memory communicate with each other through the communication bus, the memory is used to store a computer program, and the processor is used to execute the program stored in the memory to implement the steps of the cliff detection method described above. Optionally, the electronic device is a mobile robot or a computer device.
[0057] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the cliff detection method described above are implemented.
[0058] On the other hand, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to perform the steps of the cliff detection method described above.
[0059] The technical solution provided by the embodiments of the present application can at least bring the following beneficial effects:
[0060] In the embodiments of the present application, cliff detection can be performed based only on plane images, without using depth images or motion sensors. For mobile robots that can only capture plane images, cliff detection can be achieved without adding any hardware. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0062] Figure 1 is a flow chart of a cliff detection method provided by an embodiment of the present application;
[0063] Figure 2 is a structural schematic diagram of a cliff detection device provided in an embodiment of the present application;
[0064] Figure 3It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0066] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0067] The cliff detection method provided in the embodiment of the present application can be applied to various scenarios related to mobile robots. For example, a sweeping robot can move and automatically perform cleaning work, and a food delivery robot can move and deliver food. In the mobile environment of the mobile robot, some areas with height differences are often encountered, such as the edge of stairs, desktops and other areas where there are cliffs. In order to prevent the mobile robot from falling off the cliff, it is necessary to perform cliff detection during the movement of the mobile robot. The cliff detection method provided in the embodiment of the present application can realize cliff detection based on the plane image collected by the mobile robot, thereby preventing the mobile robot from falling or falling. For example, the mobile robot collects plane images during movement, performs cliff detection based on the plane images, and obtains cliff detection results. If the cliff detection results indicate the existence of a cliff, the subsequent mobile robot can take corresponding measures to prevent falling or falling.
[0068] Next, the cliff detection method provided in the embodiment of the present application is explained in detail.
[0069] It should be noted that the cliff detection method provided in the embodiment of the present application can be applied to the mobile robot itself, that is, the mobile robot detects the cliff by itself during movement. The cliff detection method can also be applied to a computer device, and the mobile robot sends the collected plane image to the computer device, and the computer device performs cliff detection based on the plane image. Optionally, the computer device is a user terminal, a background device or a server, etc. Optionally, the user terminal can be a computer, a mobile phone, etc. In the embodiment of the present application, the process of cliff detection by the mobile robot and the computer device based on the plane image is similar. In the following embodiment, the cliff detection method is introduced by a computer device as an example.
[0070] Figure 1 This is a flowchart of a cliff detection method provided by an embodiment of the present application. Taking the method applied to a computer device as an example, please refer to Figure 1 , the method comprises the following steps.
[0071] Step 101: Acquire a first plane image to be detected, where the first plane image is an image captured by a mobile robot.
[0072] In the embodiment of the present application, the computer device acquires a first plane image to be detected, and the first plane image is an image acquired by the mobile robot. Exemplarily, the mobile robot sends the acquired first plane image to the computer device.
[0073] Optionally, the mobile robot periodically collects plane images during movement, and the plane image to be detected currently is the first plane image.
[0074] Optionally, the planar image is a two-dimensional image, and the planar image may be any image without depth information, such as an RGB image, a grayscale image, a binary image, or the like.
[0075] Step 102: performing image analysis on the area to be detected in the first plane image to obtain an image analysis result.
[0076] In an embodiment of the present application, the computer device performs image analysis on the area to be detected in the first plane image to obtain an image analysis result. Optionally, the area to be detected is an area determined according to preset parameters, and the area to be detected may include a local area in the first plane image, such as a central area, an upper area, a side area, or a lower area. Of course, the area to be detected includes the entire area of the first plane image, and the embodiment of the present application does not limit the position and size of the area to be detected.
[0077] Optionally, in the embodiment of the present application, the image analysis method includes one or more methods of edge detection, pixel clustering, image region classification, and optical flow field-based methods, the one or more methods correspond to one or more analysis results, and the image analysis result includes the one or more analysis results. That is, in the embodiment of the present application, edge detection, pixel clustering, image region classification, and optical flow field-based methods can be used alone or in combination.
[0078] Optionally, different combinations of the one or more methods correspond to different detection performances, including sensitivity, accuracy, etc. Based on this, multiple setting options can be provided to the user, and the different setting options correspond to different combinations. The user can select a setting option to set the computer device to detect cliffs. Exemplarily, the user terminal displays multiple setting options and corresponding multiple detection performances. The user selects a setting option from the multiple setting options according to the needs to set the combination corresponding to the setting option selected by the user on the computer device, and then the computer device sets the combination to perform image analysis.
[0079] Next, the edge detection, pixel clustering, image region classification and optical flow field-based four methods in the embodiments of the present application are introduced separately.
[0080] First, the edge detection method is introduced. In an embodiment of the present application, the image analysis method includes an edge detection method, and the image analysis result includes an analysis result corresponding to the edge detection method. Accordingly, the computer device performs image analysis on the area to be detected in the first plane image to obtain the image analysis result in the following manner: the computer device performs edge detection on the area to be detected, determines a plurality of edge pixels, performs connected domain analysis on the plurality of edge pixels, and obtains a plurality of edge areas. If the proportion of the pixels included in the plurality of edge areas to the area to be detected is greater than a first threshold, the computer device determines that the analysis result corresponding to the edge detection method is that there is a cliff.
[0081] Exemplarily, the computer device performs edge detection on the area to be detected to obtain multiple edge pixels, and the multiple edge pixels are used as candidate areas for cliffs. The computer device then performs connected domain analysis on the multiple edge pixels to obtain multiple edge areas, that is, the computer device determines the edge area from the candidate area, for example, filtering out independent pixel points from the multiple edge pixels. Among them, each pixel point included in the multiple edge areas corresponds to a pixel mark, and the pixel mark indicates which edge area of the multiple edge areas the corresponding pixel point belongs to. Afterwards, the computer device calculates the proportion of the pixels included in the multiple edge areas to the area to be detected. If the proportion exceeds a first threshold, it means that there are more edge areas and the possibility of cliffs is greater, then the computer device determines that the analysis result corresponding to the edge detection method is that there is a cliff. It can also be understood that the computer device performs area calculation on multiple edge areas in the area to be detected. If the area of the multiple edge areas marked in the area to be detected exceeds the area threshold, then the computer device determines that the analysis result corresponding to the edge detection method is that there is a cliff.
[0082] In an embodiment of the present application, if the proportion of pixels included in the multiple edge areas to the area to be detected is less than or equal to a first threshold, the computer device determines that the analysis result corresponding to the edge detection method is that there is no cliff.
[0083] Optionally, the first threshold is determined according to the width of the area to be detected. For example, the first threshold is set to be equal to the width of the area to be detected, that is, the number of pixels in the width direction of the area to be detected in the first plane image is set as the first threshold. Exemplarily, assuming that the width and height of the area to be detected are 40% and 20% of the width of the first plane image, respectively, then the first threshold can be set to 40% of the width of the first plane image. Optionally, the first threshold can also be set to the height of the area to be detected. In some other embodiments, the first threshold can also be set to other values, such as setting the first threshold to 90%, 110%, etc. of the width of the area to be detected, which is not limited to this embodiment of the present application.
[0084] Optionally, edge detection may be an image processing method such as Canny or Sobel, or an edge detection method based on a neural network, or other methods that can detect edges, which is not limited in the embodiments of the present application.
[0085] Next, a pixel clustering method is introduced. In an embodiment of the present application, an image analysis method includes a pixel clustering method, and an image analysis result includes an analysis result corresponding to the pixel clustering method. Accordingly, a computer device performs image analysis on the area to be detected in the first plane image to obtain an image analysis result in the following manner: the computer device clusters the pixel points in the area to be detected to obtain labeling information of a plurality of pixel points, and the labeling information indicates that the corresponding pixel point is a cliff point or a non-cliff point. Based on the labeling information of the plurality of pixel points, the computer device determines the cliff side area and the non-cliff side area in the area to be detected. If the proportion of the cliff side area in the area to be detected is greater than a second threshold value, the computer device determines that the analysis result corresponding to the pixel clustering method is that there is a cliff.
[0086] Exemplarily, the marking information of the pixel points is embodied in the form of a label, and the computer device clusters the pixel points in the area to be detected to classify each pixel point into a different label, for example, the label of the cliff point is '1', and the label of the non-cliff point is '0'. The computer device divides the area to be detected into a cliff side area and a non-cliff side area based on the cliff points and non-cliff points in the area to be detected, for example, the area composed of cliff points is the cliff side area, and the area composed of non-cliff points is the non-cliff area. Afterwards, the computer device calculates the area of the cliff side area, and calculates the proportion of the cliff side area to the area to be detected based on the area. If the proportion exceeds the second threshold, it means that there is a high possibility of the existence of a cliff, and the computer device determines that the analysis result corresponding to the pixel clustering method is that there is a cliff. Of course, the computer device can also determine that the analysis result corresponding to the pixel clustering method is that there is a cliff after determining that there is a cliff side area in the area to be detected based on clustering, and the second threshold can be understood as 0.
[0087] Optionally, if the proportion of the cliff side area to the to-be-detected area is less than or equal to a second threshold, the computer device determines that the analysis result corresponding to the pixel clustering method is that there is no cliff.
[0088] Optionally, the second threshold is determined according to the area of the area to be detected. For example, the second threshold is set to the area of the area to be detected multiplied by a specified ratio, and the specified ratio can be 8%, 10% or 15%, etc. For example, the total number of pixels included in the area to be detected is taken as the area of the area to be detected, and the second threshold can be set to 8%, 10% or 15% of the total number of pixels included in the area to be detected.
[0089] Optionally, pixel clustering may be k-means clustering, semantic segmentation, or other methods, which are not limited in the embodiments of the present application.
[0090] Then, the image area classification method is introduced. In an embodiment of the present application, the image analysis method includes the image area classification method, and the image analysis result includes the analysis result corresponding to the image area classification method. Accordingly, the computer device performs image analysis on the area to be detected in the first plane image to obtain the image analysis result in the following manner: the computer device inputs the image information of the area to be detected into the cliff detection model to obtain the analysis result corresponding to the image area classification method output by the cliff detection model. Among them, the cliff detection model is a deep learning model. That is, the computer device directly inputs the image information of the area to be detected into a trained cliff detection model, and the cliff detection model directly classifies the area to be detected to directly determine whether there is a cliff in the area to be detected.
[0091] It should be noted that the cliff detection model needs to be pre-trained. Exemplarily, an initial detection model is trained according to sample images and the annotation information corresponding to the sample images to obtain a trained cliff detection model. The sample images include a plurality of cliff sample images and a plurality of non-cliff sample images. The annotation information of the cliff sample images indicates the existence of cliffs, and the annotation information of the non-cliff sample images indicates the absence of cliffs.
[0092] Optionally, the cliff detection model is a convolutional neural network model, and the cliff detection model may also be other types of deep learning models, which is not limited in the embodiments of the present application.
[0093] Finally, the method based on the optical flow field is introduced. In an embodiment of the present application, the image analysis method includes a method based on the optical flow field, and the image analysis result includes the analysis result corresponding to the method of the optical flow field. Accordingly, the computer device performs image analysis on the area to be detected in the first plane image to obtain the image analysis result in the following manner: the computer device obtains a second plane image, the second plane image is the previous frame image of the first plane image, and the computer device performs optical flow field calculation on multiple feature points in the area to be detected based on the first plane image and the second plane image to obtain the movement speed of the multiple feature points. If the proportion of feature points in the multiple feature points whose movement speed is less than the third threshold is greater than the fourth threshold, the computer device determines that the detection result corresponding to the method based on the optical flow field is that there is a cliff.
[0094] Optionally, the multiple feature points include each pixel point in the area to be detected, or the multiple feature points include multiple corner points in the area to be detected, and the multiple corner points are part of the pixel points in the area to be detected. Optionally, the multiple corner points are determined according to preset coordinate parameters.
[0095] It should be noted that, since the optical flow field calculation is for two frames of images, the computer device needs to obtain the previous frame of the first plane image to be detected, that is, obtain the second plane image, so that the computer device obtains two consecutive frames of images, and the computer device performs optical flow field calculation based on these two consecutive frames of images. Optionally, as can be seen from the foregoing, the mobile robot can periodically collect images. If the computer device is a computer device, the mobile robot sends the collected images to the computer device in real time, and the computer device obtains the first plane image and the second plane image before performing the optical flow field calculation.
[0096] In addition, due to the different visual depths on both sides of the cliff, the movement speed of the feature points will be different. The movement speed of the feature points on the cliff side is relatively slow, while the movement speed of the feature points on the non-cliff side is relatively fast. That is, if there is a cliff in the area to be detected, there are feature points with a relatively slow movement speed in the area to be detected. Based on this, after determining the movement speeds of multiple feature points, the computer device determines the feature points whose movement speeds are less than the third threshold among the multiple feature points, that is, determines the feature points with a relatively slow movement speed. If the proportion of the determined feature points in the multiple feature points is greater than the fourth threshold, it means that there are more feature points with a relatively slow movement speed in the area to be detected, and the possibility of the existence of a cliff is relatively high. Then, the computer device determines that the analysis result corresponding to the method based on the optical flow field is that there is a cliff.
[0097] Optionally, if the proportion of feature points whose movement speed is less than the third threshold among the multiple feature points is less than or equal to a fourth threshold, the computer device determines that the detection result corresponding to the optical flow field method is that there is no cliff.
[0098] Optionally, the third threshold can be determined based on experimental data of cliff detection. Exemplarily, in the cliff detection experiment, the movement of the mobile robot in an environment with and without a cliff is simulated respectively, and the computer device performs optical flow field analysis on the plane images collected by the mobile robot during the movement, that is, analyzes the movement speed of the feature points on the cliff side and the movement speed of the feature points on the non-cliff side, and obtains the average movement speed of multiple feature points on the cliff side and the average movement speed of multiple feature points on the non-cliff side. The computer device can determine the third threshold based on the average movement speed of the feature points on the cliff side and the average movement speed of the feature points on the non-cliff side. Exemplarily, the average movement speed of the feature points on the cliff side is v1, and the average movement speed of the feature points on the non-cliff side is v2, and the computer device uses the average of v1 and v2 as the third threshold.
[0099] Optionally, the fourth threshold is set to 40%, 50% or 60%, etc. Taking the fourth threshold of 50% as an example, if the proportion of feature points with a moving speed less than the third threshold among the multiple feature points is greater than 50%, that is, there are more feature points with a moving speed less than the third threshold among the multiple feature points, then the computer device determines that the detection result corresponding to the optical flow field method is that there is a cliff. If the proportion of feature points with a moving speed less than the third threshold among the multiple feature points is less than or equal to 50%, that is, there are fewer feature points with a moving speed less than the third threshold among the multiple feature points, then the computer device determines that the detection result corresponding to the optical flow field method is that there is no cliff.
[0100] The above describes the implementation method of a computer device determining an image analysis result based on a first plane image when each of one or more methods is used alone. In an embodiment of the present application, if the one or more methods are used in combination, the computer device performs image analysis on the detection area through each method in the combination method to obtain an analysis result corresponding to the corresponding method. Optionally, the various methods included in the combination method can be parallel or serial, and the embodiment of the present application does not limit this. It should be noted that, assuming that the image analysis includes edge detection, pixel clustering, image area classification and optical flow field, the combination method can be edge detection + pixel clustering, or edge detection + pixel clustering, or edge detection + pixel clustering + optical flow field, or other combination methods, which are not listed here one by one. The specific implementation method of each method in the combination method can refer to the aforementioned related introduction, which will not be repeated here.
[0101] Optionally, if the computer device is configured to perform cliff detection based on a combination method, and the steps corresponding to each method in the combination method are executed serially, then if the computer device determines, after executing the steps corresponding to a certain method, that the analysis result corresponding to the method is that there is no cliff, the computer device no longer executes the steps corresponding to the subsequent methods of the method, and the computer device determines that the analysis results corresponding to the subsequent methods are all that there is no cliff, or the computer device only records the determined analysis results, that is, the image analysis result only includes the determined analysis results.
[0102] Optionally, if the computer device is configured to perform cliff detection based on a combination method, the steps corresponding to each method in the combination method are executed in series, and the combination method includes a specified method, and the specified method is not the last method in the series, if the computer device determines that the analysis result corresponding to the specified method indicates that there is no cliff, then the computer device no longer executes the steps corresponding to the method after the specified method, and the computer device only records the determined analysis results, that is, the image analysis result only includes the determined analysis results. For example, the combination method is edge detection + pixel clustering + based on optical flow field, these three methods are executed in series, and the specified method is the edge detection method. After the computer device performs edge detection, if the analysis result corresponding to the edge detection method is that there is no cliff, then the computer device no longer executes the steps corresponding to the pixel clustering method and the method based on optical flow field. Optionally, the computer device determines that both the pixel clustering method and the method based on optical flow field are that there is no cliff, or the computer device only records the analysis result corresponding to the edge detection.
[0103] Step 103: Based on the image analysis result, determine the cliff detection result of the area to be detected.
[0104] In an embodiment of the present application, the image analysis method includes one or more methods, and the one or more methods correspond to one or more analysis results, and the image analysis result includes the one or more analysis results. Accordingly, the computer device determines the cliff detection result in the area to be detected based on the image analysis result in the following manner: if the one or more analysis results all indicate the existence of a cliff, the computer device determines the cliff detection result as the existence of a cliff. Alternatively, if the total number of analysis results indicating the existence of a cliff in the one or more analysis results is greater than a specified number, the computer device determines the cliff detection result as the existence of a cliff.
[0105] Accordingly, if there is an analysis result indicating that there is no cliff in the one or more analysis results, the computer device determines that the cliff detection result is that there is no cliff. Alternatively, if the total number of analysis results indicating that there is a cliff in the one or more analysis results is less than or equal to a specified number, the computer device determines that the cliff detection result is that there is no cliff.
[0106] If the image analysis method includes one method, the computer device determines the image analysis result as the cliff detection result of the area to be detected. If the image analysis method includes multiple methods, the computer device determines the cliff detection result based on multiple analysis results.
[0107] Exemplarily, it is assumed that the image analysis methods include an edge detection method, a pixel clustering method, and a method based on an optical flow field, and the image analysis result includes three analysis results corresponding to the three methods. If the three analysis results all indicate that a cliff exists, the computer device determines that the cliff detection result is that a cliff exists; if there is an analysis result indicating that a cliff does not exist among the three analysis results, the computer device determines that the cliff detection result is that a cliff does not exist. Assuming that the analysis result corresponding to the edge detection method is that a cliff exists, the analysis result corresponding to the pixel clustering method is that a cliff exists, and the method based on an optical flow field is that a cliff does not exist, the cliff detection result is that a cliff does not exist.
[0108] Alternatively, assuming that the specified number is 1, if the total number of analysis results indicating the existence of a cliff among the three analysis results is greater than the specified number 1, then the computer device determines that the cliff detection result is that a cliff exists; if the total number of analysis results indicating the existence of a cliff among the three analysis results is less than or equal to 1, then the computer device determines that the cliff detection result is that there is no cliff. Assuming that the analysis result corresponding to the edge detection method is that there is a cliff, the analysis result corresponding to the pixel clustering method is that there is a cliff, and the method based on the optical flow field is that there is no cliff, then the cliff detection result is that there is a cliff. It should be noted that the numerical value of the specified number is not limited in the embodiment of the present application, and the specified number can also be set by the user.
[0109] In the embodiment of the present application, in the scheme of performing cliff detection in multiple ways, comprehensive consideration of multiple analysis results can ensure the performance of cliff detection, such as ensuring the accuracy and precision of cliff detection. In addition, after determining whether there is a cliff in the area to be detected through cliff detection, the present scheme can realize the anti-fall function of the mobile robot.
[0110] In summary, this scheme is a cliff detection method based on 2D vision. It only uses single-frame or multi-frame plane images (two-dimensional images) for cliff detection, and does not use depth information and motion sensors. That is, cliff detection can be performed based on plane images alone, without the need to use depth images or motion sensors. For mobile robots that can only collect plane images, cliff detection can be achieved without adding any hardware. This scheme has low cost and can be widely used.
[0111] All the above optional technical solutions can be combined in any way to form optional embodiments of the present application, and the embodiments of the present application will not be described in detail one by one.
[0112] Figure 2 2 is a schematic diagram of a cliff detection device 200 provided in an embodiment of the present application. The cliff detection device 200 can be implemented by software, hardware or a combination of both to form part or all of an electronic device, which can be the electronic device in the above embodiment. Figure 2 The device 200 includes: an acquisition module 201, an analysis module 202 and a determination module 203.
[0113] An acquisition module 201 is used to acquire a first plane image to be detected, where the first plane image is an image captured by a mobile robot;
[0114] The analysis module 202 is used to perform image analysis on the area to be detected in the first plane image to obtain an image analysis result;
[0115] The determination module 203 is used to determine the cliff detection result of the area to be detected based on the image analysis result.
[0116] Optionally, the image analysis method includes an edge detection method, and the image analysis result includes an analysis result corresponding to the edge detection method;
[0117] The analysis module 202 includes:
[0118] The first determination submodule is used to perform edge detection on the area to be detected and determine a plurality of edge pixels;
[0119] An analysis submodule is used to perform connected domain analysis on multiple edge pixels to obtain multiple edge regions;
[0120] The second determination submodule is used to determine that the analysis result corresponding to the edge detection method is that there is a cliff if the proportion of the pixels included in the plurality of edge regions to the area to be detected is greater than a first threshold.
[0121] Optionally, the image analysis method includes a pixel clustering method, and the image analysis result includes an analysis result corresponding to the pixel clustering method;
[0122] The analysis module 202 includes:
[0123] A first processing submodule is used to cluster the pixel points in the detection area to obtain label information of a plurality of pixel points, where the label information indicates whether the corresponding pixel point is a cliff point or a non-cliff point;
[0124] A third determination submodule is used to determine the cliff side area and the non-cliff side area in the area to be detected based on the marking information of the multiple pixels;
[0125] The fourth determination submodule is used to determine that the analysis result corresponding to the pixel clustering method is that there is a cliff if the proportion of the cliff side area to the to-be-detected area is greater than a second threshold.
[0126] Optionally, the image analysis method includes an image region classification method, and the image analysis result includes an analysis result corresponding to the image region classification method;
[0127] The analysis module 202 includes:
[0128] The second processing submodule is used to input the image information of the area to be detected into the cliff detection model to obtain the analysis result corresponding to the image area classification method output by the cliff detection model, and the cliff detection model is a deep learning model.
[0129] Optionally, the image analysis method includes a method based on an optical flow field, and the image analysis result includes an analysis result corresponding to the optical flow field method;
[0130] The analysis module 202 includes:
[0131] An acquisition submodule, used for acquiring a second plane image, where the second plane image is a previous frame image of the first plane image;
[0132] A third processing submodule is used to calculate the optical flow field of multiple feature points in the to-be-detected area based on the first plane image and the second plane image to obtain the movement speed of the multiple feature points;
[0133] The fifth determination submodule is used to determine that the detection result corresponding to the optical flow field method is that there is a cliff if the proportion of feature points whose moving speed is less than the third threshold among the multiple feature points is greater than a fourth threshold.
[0134] Optionally, the image analysis method includes one or more methods of edge detection, pixel clustering, image region classification and optical flow field-based methods, the one or more methods correspond one to one with one or more analysis results, and the image analysis result includes one or more analysis results;
[0135] The determination module 203 includes:
[0136] a sixth determination submodule, configured to determine the cliff detection result as the existence of a cliff if one or more analysis results indicate the existence of a cliff; or
[0137] The seventh determination submodule is configured to determine that the cliff detection result is that a cliff exists if the total number of analysis results indicating the existence of a cliff in the one or more analysis results is greater than a specified number.
[0138] To summarize, in the embodiments of the present application, cliff detection can be performed based only on plane images, without the need to use depth images or motion sensors. For mobile robots that can only capture plane images, cliff detection can be achieved without adding any hardware.
[0139] It should be noted that: the cliff detection device provided in the above embodiment only uses the division of the above functional modules as an example to illustrate when detecting a cliff. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the cliff detection device provided in the above embodiment and the cliff detection method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0140] Figure 3 1 is a schematic diagram of the structure of an electronic device 300 provided in an embodiment of the present application. The electronic device 300 may be: a mobile robot, a computer device, etc. The computer device may be a smart phone, a tablet computer, a laptop computer, or a desktop computer, etc. The computer device may also be called a user terminal, a terminal device, a user device, a portable electronic device, a laptop electronic device, a desktop electronic device, etc. The electronic device 300 may also be called a server, a cloud server, a service center, a computing center, a control device, etc.
[0141] Typically, the electronic device 300 includes a processor 301 and a memory 302 .
[0142] The processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 301 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 301 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0143] The memory 302 may include one or more computer-readable storage media, which may be non-transitory. The memory 302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 302 is used to store at least one instruction, which is used to be executed by the processor 301 to implement the cliff detection method provided in the method embodiment of the present application.
[0144] In some embodiments, the electronic device 300 may further optionally include: a peripheral device interface 303 and at least one peripheral device. The processor 301, the memory 302 and the peripheral device interface 303 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 303 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 304, a display screen 305, a camera assembly 306, an audio circuit 307, a positioning assembly 308 and a power supply 309.
[0145] The peripheral device interface 303 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 301 and the memory 302. In some embodiments, the processor 301, the memory 302, and the peripheral device interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302, and the peripheral device interface 303 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0146] The radio frequency circuit 304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 304 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 304 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 304 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 304 can communicate with other electronic devices through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 304 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0147] The display screen 305 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 305 is a touch display screen, the display screen 305 also has the ability to collect touch signals on the surface or above the surface of the display screen 305. The touch signal can be input to the processor 301 as a control signal for processing. At this time, the display screen 305 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 305 can be one, set on the front panel of the electronic device 300; in other embodiments, the display screen 305 can be at least two, respectively set on different surfaces of the electronic device 300 or in a folding design; in other embodiments, the display screen 305 can be a flexible display screen, set on the curved surface or folding surface of the electronic device 300. Even, the display screen 305 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 305 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).
[0148] The camera assembly 306 is used to capture images or videos. Optionally, the camera assembly 306 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the electronic device, and the rear camera is arranged on the back of the electronic device. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 306 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0149] The audio circuit 307 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 301 for processing, or input them into the radio frequency circuit 304 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the electronic device 300. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 301 or the radio frequency circuit 304 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 307 may also include a headphone jack.
[0150] The positioning component 308 is used to locate the current geographic location of the electronic device 300 to implement navigation or LBS (Location Based Service). The positioning component 308 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system, Russia's Grenas system or the European Union's Galileo system.
[0151] The power supply 309 is used to power various components in the electronic device 300. The power supply 309 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 309 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0152] In some embodiments, the electronic device 300 further includes one or more sensors 310 , including but not limited to: an acceleration sensor 311 , a gyroscope sensor 312 , a pressure sensor 313 , a fingerprint sensor 314 , an optical sensor 315 , and a proximity sensor 316 .
[0153] The acceleration sensor 311 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the electronic device 300. For example, the acceleration sensor 311 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 301 can control the display screen 305 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 311. The acceleration sensor 311 can also be used to collect game or user motion data.
[0154] The gyro sensor 312 can detect the body direction and rotation angle of the electronic device 300, and the gyro sensor 312 can cooperate with the acceleration sensor 311 to collect the user's 3D actions on the electronic device 300. The processor 301 can implement the following functions based on the data collected by the gyro sensor 312: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0155] The pressure sensor 313 can be set on the side frame of the electronic device 300 and / or the lower layer of the display screen 305. When the pressure sensor 313 is set on the side frame of the electronic device 300, it can detect the user's holding signal of the electronic device 300, and the processor 301 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 313. When the pressure sensor 313 is set on the lower layer of the display screen 305, the processor 301 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 305. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0156] The fingerprint sensor 314 is used to collect the user's fingerprint, and the processor 301 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 314, or the fingerprint sensor 314 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 301 authorizes the user to perform relevant sensitive operations, which include unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 314 can be set on the front, back, or side of the electronic device 300. When a physical button or a manufacturer logo is set on the electronic device 300, the fingerprint sensor 314 can be integrated with the physical button or the manufacturer logo.
[0157] The optical sensor 315 is used to collect the ambient light intensity. In one embodiment, the processor 301 can control the display brightness of the display screen 305 according to the ambient light intensity collected by the optical sensor 315. Specifically, when the ambient light intensity is high, the display brightness of the display screen 305 is increased; when the ambient light intensity is low, the display brightness of the display screen 305 is reduced. In another embodiment, the processor 301 can also dynamically adjust the shooting parameters of the camera assembly 306 according to the ambient light intensity collected by the optical sensor 315.
[0158] The proximity sensor 316, also called a distance sensor, is usually arranged on the front panel of the electronic device 300. The proximity sensor 316 is used to collect the distance between the user and the front of the electronic device 300. In one embodiment, when the proximity sensor 316 detects that the distance between the user and the front of the electronic device 300 is gradually decreasing, the processor 301 controls the display screen 305 to switch from the screen-on state to the screen-off state; when the proximity sensor 316 detects that the distance between the user and the front of the electronic device 300 is gradually increasing, the processor 301 controls the display screen 305 to switch from the screen-off state to the screen-on state.
[0159] Those skilled in the art will understand that Figure 3 The structure shown in the figure does not constitute a limitation on the electronic device 300, and may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0160] In some embodiments, a computer-readable storage medium is further provided, in which a computer program is stored, and when the computer program is executed by a processor, the steps of the cliff detection method in the above embodiment are implemented. For example, the computer-readable storage medium may be a ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
[0161] It is worth noting that the computer-readable storage medium mentioned in the embodiments of the present application may be a non-volatile storage medium, in other words, a non-transitory storage medium.
[0162] It should be understood that all or part of the steps to implement the above embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions can be stored in the above-mentioned computer readable storage medium.
[0163] That is, in some embodiments, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the steps of the cliff detection method described above.
[0164] It should be understood that the "at least one" mentioned herein refers to one or more, and "multiple" refers to two or more. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not limit them to be necessarily different.
[0165] The above-mentioned embodiments are provided for the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A cliff detection method, characterized in that: The method comprises: Acquire a first plane image to be detected, where the first plane image is an unprocessed image collected by the mobile robot, the first plane image is an image without depth information, and the first plane image is an RGB image, a grayscale image, or a binary image; According to a preset analysis method, image analysis is performed on the area to be detected in the first plane image to obtain an image analysis result, wherein the area to be detected is an area determined according to preset parameters, and the area to be detected is a local area in the first plane image, and the local area is a central area, an upper area, a side area or a lower area. The preset analysis method is determined when a selection operation of any one of a plurality of setting options is detected, and the plurality of setting options correspond one-to-one to a plurality of analysis methods, and the plurality of analysis methods include a plurality of image analysis methods and a combination of at least two of the plurality of image analysis methods. The plurality of image analysis methods include edge detection, pixel clustering, image area classification and a method based on optical flow field. The preset analysis method is an analysis method corresponding to a selected setting option, and different analysis methods correspond to different detection performances, and the detection performance includes sensitivity and accuracy. One or more analysis methods correspond one-to-one to one or more analysis results, and the image analysis result includes the one or more analysis results; If the one or more analysis results all indicate that a cliff exists, determining the cliff detection result is that a cliff exists; or, if the total number of analysis results indicating that a cliff exists among the one or more analysis results is greater than a specified number, determining the cliff detection result is that a cliff exists, and the specified number can be set by a user; Wherein, the preset analysis method includes an edge detection method, and the image analysis result includes an analysis result corresponding to the edge detection method; The performing image analysis on the area to be detected in the first plane image to obtain an image analysis result includes: Performing edge detection on the area to be detected to determine a plurality of edge pixel points; Performing connected domain analysis on the plurality of edge pixels to obtain a plurality of edge regions; If the proportion of the pixels included in the plurality of edge regions to the area to be detected is greater than a first threshold, determining that the analysis result corresponding to the edge detection method is that a cliff exists, and the first threshold is the width of the area to be detected, or the width of the area to be detected multiplied by the first proportion; Wherein, the preset analysis method includes a pixel clustering method, and the image analysis result includes an analysis result corresponding to the pixel clustering method; The performing image analysis on the area to be detected in the first plane image to obtain an image analysis result includes: Clustering the pixel points in the area to be detected to obtain labeling information of a plurality of pixel points, wherein the labeling information indicates whether the corresponding pixel point is a cliff point or a non-cliff point; Determine the cliff side area and the non-cliff side area in the area to be detected based on the marking information of the multiple pixels; If the proportion of the cliff side area to the area to be detected is greater than a second threshold, determining that the analysis result corresponding to the pixel clustering method is that there is a cliff, the second threshold is the area of the area to be detected multiplied by the second proportion; Wherein, the preset analysis method includes an image region classification method, and the image analysis result includes an analysis result corresponding to the image region classification method; The performing image analysis on the area to be detected in the first plane image to obtain an image analysis result includes: Inputting the image information of the area to be detected into a cliff detection model to obtain an analysis result corresponding to the image area classification method output by the cliff detection model, wherein the cliff detection model is a deep learning model; Wherein, the preset analysis method includes a method based on an optical flow field, and the image analysis result includes an analysis result corresponding to the optical flow field method; The performing image analysis on the area to be detected in the first plane image to obtain an image analysis result includes: Acquire a second plane image, where the second plane image is a previous frame image of the first plane image; Based on the first plane image and the second plane image, performing optical flow field calculation on a plurality of feature points in the to-be-detected area to obtain movement speeds of the plurality of feature points; If the proportion of feature points whose movement speed is less than the third threshold among the multiple feature points is greater than a fourth threshold, it is determined that the detection result corresponding to the optical flow field-based method is that there is a cliff, and the third threshold is the average of the first average speed and the second average speed, the first average speed is the average movement speed of multiple feature points on the cliff side, and the second average speed is the average movement speed of multiple feature points on the non-cliff side.
2. A cliff detection device, characterized in that: The device comprises: An acquisition module, used for acquiring a first plane image to be detected, wherein the first plane image is an unprocessed image collected by the mobile robot, the first plane image is an image without depth information, and the first plane image is an RGB image, a grayscale image or a binary image; an analysis module, configured to perform image analysis on a region to be detected in the first plane image according to a preset analysis method to obtain an image analysis result, wherein the region to be detected is a region determined according to preset parameters, and the region to be detected is a local region in the first plane image, and the local region is a central region, an upper region, a side region or a lower region. The preset analysis method is determined when a selection operation of any one of a plurality of setting options is detected, and the plurality of setting options correspond one-to-one to a plurality of analysis methods, and the plurality of analysis methods include a plurality of image analysis methods and a combination of at least two of the plurality of image analysis methods, and the plurality of image analysis methods include edge detection, pixel clustering, image region classification and a method based on an optical flow field. The preset analysis method is an analysis method corresponding to a selected setting option, and different analysis methods correspond to different detection performances, and the detection performance includes sensitivity and accuracy. One or more analysis methods correspond one-to-one to one or more analysis results, and the image analysis result includes the one or more analysis results; A determination module, used for determining a cliff detection result of the to-be-detected area based on the image analysis result; Wherein, the determination module includes: a sixth determination submodule, configured to determine that the cliff detection result is that a cliff exists if the one or more analysis results all indicate that a cliff exists; or, a seventh determination submodule, configured to determine that the cliff detection result is that a cliff exists if the total number of analysis results indicating the existence of a cliff in the one or more analysis results is greater than a specified number, wherein the specified number can be set by a user; Wherein, the preset analysis method includes an edge detection method, and the image analysis result includes an analysis result corresponding to the edge detection method; and the analysis module includes: A first determination submodule is used to perform edge detection on the area to be detected and determine a plurality of edge pixel points; An analysis submodule, configured to perform a connected domain analysis on the plurality of edge pixels to obtain a plurality of edge regions; a second determination submodule, configured to determine that an analysis result corresponding to the edge detection method is that a cliff exists if a ratio of the pixels included in the plurality of edge regions to the region to be detected is greater than a first threshold, wherein the first threshold is a width of the region to be detected, or is the width of the region to be detected multiplied by a first ratio; Wherein, the preset analysis method includes a pixel clustering method, and the image analysis result includes an analysis result corresponding to the pixel clustering method; and the analysis module includes: A first processing submodule is used to cluster the pixel points in the area to be detected to obtain label information of a plurality of pixel points, wherein the label information indicates whether the corresponding pixel point is a cliff point or a non-cliff point; A third determination submodule is used to determine the cliff side area and the non-cliff side area in the area to be detected based on the marking information of the multiple pixel points; a fourth determination submodule, configured to determine that the analysis result corresponding to the pixel clustering method is that there is a cliff if the proportion of the cliff side area to the area to be detected is greater than a second threshold, wherein the second threshold is the area of the area to be detected multiplied by a second proportion; Wherein, the preset analysis method includes an image region classification method, and the image analysis result includes an analysis result corresponding to the image region classification method; and the analysis module includes: A second processing submodule is used to input the image information of the area to be detected into a cliff detection model to obtain an analysis result corresponding to the image area classification method output by the cliff detection model, wherein the cliff detection model is a deep learning model; Wherein, the preset analysis method includes a method based on an optical flow field, and the image analysis result includes an analysis result corresponding to the optical flow field method; and the analysis module includes: An acquisition submodule, used for acquiring a second plane image, where the second plane image is a previous frame image of the first plane image; A third processing submodule is used to calculate the optical flow field of multiple feature points in the to-be-detected area based on the first plane image and the second plane image to obtain the movement speed of the multiple feature points; The fifth determination submodule is used to determine that the detection result corresponding to the optical flow field-based method is that there is a cliff if the proportion of feature points among the multiple feature points whose movement speed is less than a third threshold is greater than a fourth threshold, and the third threshold is the average of the first average speed and the second average speed, the first average speed is the average movement speed of multiple feature points on the cliff side, and the second average speed is the average movement speed of multiple feature points on the non-cliff side.
3. An electronic device, characterized in that: The electronic device comprises a processor and a memory; The memory is used to store computer programs; The processor is used to execute the computer program to implement the steps of the method according to claim 1.
4. The electronic device according to claim 3, characterized in that: The electronic device is a mobile robot or a computer device.
5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to claim 1 are implemented.
