Obstacle detection method, device and self-propelled equipment
By using the light emitting device and the shooting device in conjunction, two images are acquired and compared successively, which solves the problem of ambient light affecting the accuracy of obstacle detection and achieves higher detection accuracy.
Patent Information
- Application Number
- CN202210462476.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-04-28
AI Technical Summary
Existing obstacle detection methods are easily affected by ambient light, resulting in inaccurate detection results.
The light emitting device and the shooting device work together to first obtain a first image in the light emitting state, and then obtain a second image in the light off state. The presence of obstacles is determined by comparing the two images to eliminate the interference of ambient light.
The accuracy of obstacle detection is improved and the impact of ambient light on detection results is reduced.
Smart Images

Figure CN117011822B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of detection technology, and in particular to an obstacle detection method, device, self-mobile device and computer-readable storage medium. Background Art
[0002] Nowadays, with the continuous development of science and technology, the application of autonomous mobile devices is becoming increasingly widespread. Autonomous mobile devices are devices that can move on their own. For example, autonomous mobile devices can be cleaning robots that can clean objects (such as the floor). Autonomous mobile devices are typically equipped with a detection device that detects the environment outside the autonomous device. The detection device determines whether there are obstacles.
[0003] However, this obstacle detection method still has some drawbacks and urgently needs to be improved. For example, this obstacle detection method is easily affected by ambient light, resulting in inaccurate obstacle detection results. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide an obstacle detection method, apparatus, self-mobile device, and computer-readable storage medium to address the problem that current obstacle detection methods are easily affected by ambient light, resulting in inaccurate obstacle detection results.
[0005] The present invention proposes an obstacle detection method, which is applied to a self-moving device, wherein a light emitting device and a shooting device are provided on the self-moving device. The obstacle detection method includes: when the light emitting device emits light toward a specified direction, controlling the shooting device to shoot toward the specified direction to obtain a first image; controlling the light emitting device to enter an off state; when the light emitting device is in the off state, controlling the shooting device to shoot toward the specified direction to obtain a second image; comparing the first image and the second image to obtain a comparison result, and determining an obstacle detection result based on the comparison result, wherein the obstacle detection result can indicate whether there is an obstacle in the specified direction.
[0006] In some embodiments of the present invention, controlling the shooting device to shoot in the specified direction to obtain the first image includes: controlling the light emitting device to emit light in the specified direction; if the shooting device shoots a light spot in the specified direction and the self-moving device is in a moving state, controlling the self-moving device to stop moving, and controlling the shooting device to shoot in the specified direction to obtain the first image.
[0007] In some embodiments of the present invention, after controlling the self-moving device to stop moving, it includes: obtaining the current position of the self-moving device; correspondingly, determining the obstacle detection result based on the comparison result includes: determining that the obstacle detection result is a first detection result based on the comparison result, and the first detection result can indicate that there is no obstacle within the detection range in the specified direction; after determining that the obstacle detection result is the first detection result based on the comparison result, it includes: controlling the self-moving device to move toward the specified direction based on the current position of the self-moving device and the specified distance.
[0008] In some embodiments of the present invention, controlling the self-moving device to move toward the specified direction based on the current position of the self-moving device and the specified distance includes: taking the current position of the self-moving device as the starting point of movement, controlling the self-moving device to move toward the specified direction by a specified distance.
[0009] In some embodiments of the present invention, the comparing the first image and the second image to obtain a comparison result, and determining the obstacle detection result based on the comparison result, includes: comparing the first image and the second image based on an XOR operation to obtain a comparison result, if the comparison result indicates that there is a light spot corresponding to the light emitting device on the first image, then determining that the obstacle detection result is the second detection result, and the second detection result can indicate that there is an obstacle in the specified direction.
[0010] In some embodiments of the present invention, after determining that the obstacle detection result is the second detection result, the method includes determining a distance between the obstacle and the self-moving device according to the comparison result.
[0011] In some embodiments of the present invention, determining the obstacle detection result based on the comparison result includes: determining the obstacle detection result as a first detection result based on the comparison result; correspondingly, after determining the obstacle detection result as the first detection result based on the comparison result, it includes: turning off the shooting device, and controlling the mobile device to move toward the specified direction.
[0012] A second aspect of an embodiment of the present invention provides a self-moving device, wherein the obstacle detection device is applied to the self-moving device, the self-moving device is provided with a light emitting device and a shooting device, and the obstacle detection device includes:
[0013] a first control module, configured to control the photographing device to photograph in a designated direction to acquire a first image when the light emitting device emits light in the designated direction;
[0014] A second control module, configured to control the light emitting device to enter a closed state;
[0015] a third control module, configured to control the photographing device to shoot in the designated direction to acquire a second image when the light emitting device is in an off state;
[0016] A result determination module is configured to compare the first image and the second image to obtain a comparison result, and determine an obstacle detection result according to the comparison result, wherein the obstacle detection result can indicate whether there is an obstacle in the specified direction.
[0017] A third aspect of an embodiment of the present invention provides a self-moving device, including a light emitting device, a shooting device, a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein the processor implements the steps of the obstacle detection method described above when executing the computer program.
[0018] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the obstacle detection method described above are implemented.
[0019] In an embodiment of the present invention, when the light emitting device emits light in a specified direction, the self-mobile device can control the shooting device to shoot in the shooting direction to obtain a first image, and then control the light emitting device to enter a closed state. When the light emitting device is in the closed state, the shooting device is controlled to shoot in the specified direction to obtain a second image. Since the second image is an image obtained when the light emitting device does not emit light to the outside, the first image and the second image are compared to obtain a comparison result, and the obstacle detection result is determined based on the comparison result. If there is ambient light, the interference of the ambient light on the obstacle detection result can be eliminated, thereby greatly improving the accuracy of the obstacle detection result. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0021] Figure 1 is a schematic diagram of an obstacle detection method according to an embodiment of the present invention;
[0022] Figure 2 is a schematic diagram of a detection range according to an embodiment of the present invention;
[0023] Figure 3 is a schematic diagram of a first image according to an embodiment of the present invention;
[0024] Figure 4 is a schematic diagram of an obstacle detection device according to an embodiment of the present invention;
[0025] Figure 5 FIG. 1 is a schematic diagram of a self-moving device according to an embodiment of the present invention.
[0026] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0027] In the following description, specific details such as particular system structures and techniques are provided for purposes of illustration, not limitation, to facilitate a thorough understanding of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
[0028] To illustrate the technical solutions of the present invention, the following is a description using specific embodiments. It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements, or / and components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, or / and combinations thereof.
[0029] It should also be understood that the terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0030] It should be further understood that the term "or / and" used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0031] Example 1
[0032] Figure 2A flow chart of an obstacle detection method provided by an embodiment of the present application is shown. The obstacle detection method can be applied to a self-moving device, which is a device capable of moving, for example, a cleaning robot, which is a robot capable of cleaning objects. The self-moving device is provided with a detection device, which includes a light emitting device and a camera. The light emitting device is a device capable of emitting light. By way of example and not limitation, the light emitting device is a line laser emitting device, which is a device capable of emitting a line laser. The obstacle detection method includes:
[0033] Step S101 : When the light emitting device emits light toward a specified direction, the photographing device is controlled to photograph toward the specified direction to acquire a first image.
[0034] That is, the first image reflects the situation captured by the photographing device in the designated direction when the light emitting device emits light in the designated direction.
[0035] As an example and not a limitation, the designated direction is a direction of movement (forward direction) of the self-moving device, or the designated direction is set at an angle with the direction of movement, and the angle is greater than 0 degrees. The angle between the designated direction and the direction of movement may include: the designated direction and the direction of movement are set at an angle on a horizontal plane, or / and the designated direction and the direction of movement are set at an angle on a vertical plane, wherein the vertical plane is a plane perpendicular to the horizontal plane.
[0036] In addition, the photographing device facing the specified direction may mean that the optical axis of the camera of the photographing device is parallel to the specified direction. Since the photographing device can face the specified direction to photograph, the photographing range of the photographing device includes the area in the specified direction.
[0037] Optionally, controlling the shooting device to shoot in the specified direction to obtain the first image includes: controlling the light emitting device to emit light in the specified direction; if the shooting device shoots a light spot in the specified direction and the self-moving device is in a moving state, controlling the self-moving device to stop moving, and controlling the shooting device to shoot in the specified direction to obtain the first image.
[0038] Specifically, the self-moving device is controlled to move in a specified direction. During the movement of the self-moving device, the light emitting device is controlled to emit light in the specified direction. During the emission of light by the light emitting device, the shooting device is controlled to shoot in the specified direction. If a light spot is captured (that is, the captured image includes an image area that can represent the light spot), the light spot may be caused by ambient light or by the light emitted by the light emitting device being projected onto an obstacle. This means that there may be an obstacle in the specified direction. Therefore, in order to avoid a collision between the self-moving device and the obstacle, the self-moving device needs to control itself to stop moving. When the self-moving device stops moving / after the self-moving device stops moving, the shooting device is controlled to shoot in the specified direction to obtain a first image (the first image is used for comparison with the second image), so as to accurately determine whether there is an obstacle in the area in the specified direction through the first image and subsequent steps.
[0039] In addition, as an example but not a limitation, the light spot in this article may include a point-shaped light spot and / or a strip-shaped light spot.
[0040] Step S102: Control the light emitting device to enter a closed state.
[0041] As an example but not a limitation, the line laser emitting device is controlled to enter an off state, that is, the line laser emitting device is controlled to be in a state of pausing / stopping the emission of the line laser.
[0042] Step S103 : When the light emitting device is in the off state, controlling the photographing device to photograph in the designated direction to obtain a second image.
[0043] As an example but not limitation, when the light emitting device is in the off state, that is, when the light emitting device does not emit light in a specified direction, the shooting device is controlled to shoot in the specified direction to obtain a second image, wherein the position of the mobile device when shooting the first image is the same as the position of the mobile device when shooting the second image.
[0044] Step S104: Compare the first image and the second image to obtain a comparison result, and determine an obstacle detection result according to the comparison result, wherein the obstacle detection result can indicate whether there is an obstacle in the specified direction.
[0045] By way of example and not limitation, the comparing the first image and the second image includes comparing each pixel in the first image with each pixel in the second image. For ease of description, a single pixel in the first image and a single pixel in the second image are referred to as a first pixel and a second pixel, respectively. The comparing each pixel in the first image and each pixel in the second image may include performing the following steps on each first pixel: comparing the pixel value of the first pixel with the pixel value of the second pixel corresponding to the first pixel, wherein the second pixel corresponding to the first pixel refers to a pixel in the second image that has the same position as the first pixel. For example, the second pixel corresponding to the first pixel in the first row and first column of the first image is located in the first row and first column of the second image.
[0046] Optionally, the process of acquiring the first image includes: when the light emitting device emits light in a specified direction, the shooting device shoots in the specified direction and obtains image A, and the self-mobile device grayscales and binarizes image A, that is, the self-mobile device can acquire the first image; the process of acquiring the second image includes: when the light emitting device is in a closed state, the shooting device shoots in the specified direction and obtains image B, and the self-mobile device grayscales and binarizes image B, so as to acquire the second image. The pixel value of a single pixel of the image after binarization is the first pixel value or the second pixel value, the first pixel value can be represented by 0, and the second pixel value can be represented by 1. Acquiring the first image and the second image in this way can facilitate comparison of the first image and the second image.
[0047] Optionally, after controlling the self-moving device to stop moving, it includes: obtaining the current position of the self-moving device; correspondingly, determining the obstacle detection result based on the comparison result includes: determining that the obstacle detection result is a first detection result based on the comparison result, and the first detection result can indicate that there is no obstacle within the detection range in the specified direction; after determining that the obstacle detection result is the first detection result based on the comparison result, it includes: controlling the self-moving device to move toward the specified direction based on the current position of the self-moving device and the specified distance.
[0048] By way of example and not limitation, Figure 2 As shown, Figure 2 The circle in the figure represents the self-moving device, and the triangle surrounded by solid lines represents the detection range of the detection device. The height of the longest side of the triangle ( Figure 2 The dotted line in the figure represents the specified distance, and the direction perpendicular to the height of the longest side of the triangle is the specified direction.
[0049] Since the self-moving device can control itself to move in a specified direction according to the current position of the self-moving device and the specified distance, it can be ensured that the self-moving device will not collide with obstacles during the movement.
[0050] In some embodiments, controlling the self-moving device to move toward the specified direction based on the current position of the self-moving device and the specified distance includes: taking the current position of the self-moving device as the starting point of movement, and controlling the self-moving device to move toward the specified direction by a specified distance.
[0051] As an example and not a limitation, based on the current position of the self-moving device and the specified distance, the self-moving device is controlled to accelerate and move toward the specified direction for a specified distance.
[0052] Optionally, step S104 includes: comparing the first image and the second image based on an XOR operation to obtain a comparison result; if the comparison result indicates that there is a light spot corresponding to the light emitting device on the first image, then determining that the obstacle detection result is the second detection result, and the second detection result can indicate that there is an obstacle in the specified direction.
[0053] As an example but not limitation, the comparing the first image and the second image based on the XOR operation to obtain a comparison result includes: comparing each pixel in the first image with each pixel in the second image based on the XOR operation to obtain a comparison result, which may specifically include: executing step a for each first pixel: performing an XOR operation on the pixel value of the first pixel and the pixel value of the second pixel corresponding to the first pixel, which includes: if the pixel value of the first pixel and the pixel value of the second pixel corresponding to the first pixel are the same, the XOR operation result is 0 (first pixel value); if the pixel value of the first pixel and the pixel value of the second pixel corresponding to the first pixel are different, the XOR operation result is 1 (second pixel value); in addition, executing step b for each first pixel: updating the pixel value of the first pixel to the value corresponding to the XOR operation result. After executing step b, the comparison result obtained from the mobile device includes the first image after the pixel value is updated. If there is at least one pixel with a pixel value of 1 in the first image after the pixel value is updated, the comparison result indicates that there is a light spot corresponding to the light emitting device in the first image before the pixel value is updated, that is, there is a light spot formed by the light emitted by the light emitting device projected onto the obstacle, then the obstacle detection result is determined to be the second detection result, and the second detection result can indicate that there is an obstacle in the specified direction.
[0054] In some embodiments, after determining that the obstacle detection result is the second detection result, the method further includes: determining a distance between the obstacle and the self-moving device according to the comparison result.
[0055] As an example and not a limitation, the comparison result includes the first image after the pixel value is updated, and determining the distance between the obstacle and the self-moving device based on the comparison result includes: determining the distance between the obstacle and the self-moving device based on the pixel position of the pixel with a pixel value of 1 in the first image after the pixel value is updated.
[0056] For example, Figure 3 As shown, the first image includes 4 rows and 4 columns of pixels, wherein the distances corresponding to the first row of pixels, the second row of pixels, the third row of pixels, and the fourth row of pixels can be preset to be 16 cm, 12 cm, 8 cm, and 4 cm respectively. Assume Figure 3 The black pixel in represents a pixel with a pixel value of 1. The position of the black pixel is in the third row of the first pixel. It can be determined that the distance between the obstacle and the self-moving device is 8 centimeters.
[0057] In some embodiments, determining the obstacle detection result based on the comparison result includes: determining the obstacle detection result as a first detection result based on the comparison result; correspondingly, after determining the obstacle detection result as the first detection result based on the comparison result, it includes: turning off the shooting device, and controlling the mobile device to move toward the specified direction.
[0058] Specifically, the mobile device is controlled to move in a specified direction, and the camera is turned off during the movement. Since there are no obstacles within the detection range in the specified direction, the mobile device is controlled to move in the specified direction without colliding with any obstacles. During this process, the mobile device controls the camera to stop / pause filming, effectively reducing energy consumption and computational complexity.
[0059] In some embodiments, while the self-mobile device is moving toward a specified direction, the shooting device still shoots to obtain image data, but the self-mobile device does not process the image data, thereby reducing the amount of calculation.
[0060] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0061] Example 2
[0062] Corresponding to the above embodiment, Figure 4A schematic diagram of an obstacle detection device provided in an embodiment of the present application is shown. The obstacle detection device can be applied to a self-moving device, which is provided with a light emitting device and a shooting device. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0063] The obstacle detection device includes a first control unit 21 , a second control unit 22 , a third control unit 23 and a result determination unit 24 .
[0064] The first control unit 21 is configured to control the photographing device to photograph in a designated direction to acquire a first image when the light emitting device emits light in the designated direction.
[0065] Optionally, when the first control unit 21 executes the control of the shooting device to shoot in the specified direction to obtain the first image, it is specifically used to: control the light emitting device to emit light in the specified direction; if the shooting device shoots a light spot in the specified direction and the self-moving device is in a moving state, then control the self-moving device to stop moving, and control the shooting device to shoot in the specified direction to obtain the first image.
[0066] The second control unit 22 is used to control the light emitting device to enter a closed state.
[0067] The third control unit 23 is configured to control the photographing device to photograph in the designated direction to acquire a second image when the light emitting device is in the off state.
[0068] The result determination unit 24 is configured to compare the first image and the second image to obtain a comparison result, and determine an obstacle detection result according to the comparison result, wherein the obstacle detection result can indicate whether there is an obstacle in the specified direction.
[0069] Optionally, the obstacle detection device further includes a position acquisition unit and a movement unit.
[0070] The position acquisition unit is used to: obtain the current position of the self-moving device after the first control unit 21 executes the control of stopping the movement of the self-moving device; correspondingly, the result determination unit 24, when executing the determination of the obstacle detection result based on the comparison result, is specifically used to: determine the obstacle detection result as a first detection result based on the comparison result, and the first detection result can indicate that there is no obstacle within the detection range in the specified direction; the moving unit is used to: after the result determination unit 24 executes the determination of the obstacle detection result as the first detection result based on the comparison result, control the self-moving device to move toward the specified direction according to the current position of the self-moving device and the specified distance.
[0071] Optionally, when the result determination unit 24 performs the comparison of the first image and the second image to obtain a comparison result and determines the obstacle detection result based on the comparison result, it is specifically used to: compare the first image and the second image based on an XOR operation to obtain a comparison result; if the comparison result indicates that there is a light spot corresponding to the light emitting device on the first image, then the obstacle detection result is determined to be the second detection result, and the second detection result can indicate that there is an obstacle in the specified direction.
[0072] Optionally, the obstacle detection device further includes a distance determination unit.
[0073] The distance determination unit is configured to determine the distance between the obstacle and the self-moving device according to the comparison result after the result determination unit 24 determines that the obstacle detection result is the second detection result.
[0074] Optionally, the obstacle detection device further includes a shutoff unit. When determining the obstacle detection result based on the comparison result, the result determination unit 24 is specifically configured to: determine, based on the comparison result, that the obstacle detection result is a first detection result; correspondingly, the shutoff unit is configured to shut off the camera device and control the self-moving device to move toward the specified direction after determining, based on the comparison result, that the obstacle detection result is the first detection result.
[0075] It should be noted that for technical details not fully described in this embodiment, reference may be made to the obstacle detection methods provided in each embodiment of the first embodiment.
[0076] Example 3
[0077] Figure 5 FIG. 1 is a schematic diagram of a self-moving device provided by an embodiment of the present invention. Figure 5 As shown, the self-moving device 3 of this embodiment includes: a light emitting device 34, a shooting device 35, a processor 31, a memory 32, and a computer program 33 stored in the memory 32 and executable on the processor 31. When the processor 31 executes the computer program 33, the steps in the above-mentioned obstacle detection method embodiments are implemented, such as Figure 1 Alternatively, when the processor 31 executes the computer program 33, the functions of each unit in the above-mentioned device embodiments are realized, for example Figure 4 The functions of units 21 to 24 are shown.
[0078] Exemplarily, the computer program 33 may be divided into one or more modules / units, one or more of which are stored in the memory 32 and executed by the processor 31 to implement the present invention. One or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 33 in the mobile device 3. For example, the computer program 33 may be divided into a first control unit 21, a second control unit 22, a third control unit 23, and a result determination unit 24. The specific functions of each unit are as follows:
[0079] A first control unit 21 is configured to control the photographing device to photograph in a designated direction to acquire a first image when the light emitting device emits light in the designated direction;
[0080] A second control unit 22, configured to control the light emitting device to enter a closed state;
[0081] a third control unit 23, configured to control the photographing device to shoot in the designated direction to acquire a second image when the light emitting device is in the off state;
[0082] The result determination unit 24 is configured to compare the first image and the second image to obtain a comparison result, and determine an obstacle detection result according to the comparison result, wherein the obstacle detection result can indicate whether there is an obstacle in the specified direction.
[0083] Those skilled in the art will understand that Figure 5 It is only an example of the self-mobile device 3 and does not constitute a limitation of the self-mobile device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the self-mobile device may also include input and output devices, network access devices, buses, etc.
[0084] The processor 31 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0085] The memory 32 can be an internal storage unit of the mobile device 3, such as the hard drive or memory of the mobile device 3. The memory 32 can also be an external storage device of the mobile device 3, such as a plug-in hard drive, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the mobile device 3. Furthermore, the memory 32 can include both the internal storage unit of the mobile device 3 and an external storage device. The memory 32 is used to store computer programs and other programs and data required by the mobile device. The memory 32 can also be used to temporarily store data that has been output or is about to be output.
[0086] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0087] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0088] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0089] In the embodiments provided by the present invention, it should be understood that the disclosed devices / self-moving devices and methods can be implemented in other ways. For example, the device / self-moving device embodiments described above are merely illustrative. For example, the division of modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0090] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0091] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0092] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the above-mentioned embodiment method, and can also be completed by a computer program to instruct the relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above-mentioned method embodiments. Among them, the computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media does not include electric carrier signals and telecommunication signals.
[0093] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. 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 embodiments of the present invention, and should all be included in the scope of protection of the present invention.
[0094] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. All equivalent structural transformations made using the contents of the present invention's description and drawings, or direct / indirect applications in other related technical fields, within the scope of the present invention are included in the patent protection scope of the present invention.
Claims
1. An obstacle detection method, characterized in that: The obstacle detection method is applied to a self-moving device, which is provided with a light emitting device and a shooting device. The obstacle detection method includes: When the light emitting device emits light in a specified direction, controlling the photographing device to photograph in the specified direction to acquire a first image; Controlling the light emitting device to enter an off state, wherein the off state is a state of pausing / stopping the emission of the linear laser; When the light emitting device is in an off state, controlling the shooting device to shoot in the specified direction to acquire a second image; comparing the first image and the second image to obtain a comparison result, and determining an obstacle detection result according to the comparison result, wherein the obstacle detection result can indicate whether there is an obstacle in the specified direction; The controlling the shooting device to shoot in the specified direction to acquire the first image includes: Controlling the light emitting device to emit light in a specified direction; If the shooting device shoots a light spot toward the specified direction and the self-moving device is in a moving state, the self-moving device is controlled to stop moving, and the shooting device is controlled to shoot toward the specified direction to acquire a first image.
2. The obstacle detection method according to claim 1, wherein: After controlling the self-moving device to stop moving, the method further includes: Obtaining the current location of the mobile device; Correspondingly, determining the obstacle detection result according to the comparison result includes: Determining, based on the comparison result, that the obstacle detection result is a first detection result, where the first detection result can indicate that no obstacle exists within the detection range in the specified direction; After determining, according to the comparison result, that the obstacle detection result is the first detection result, the method further includes: The self-moving device is controlled to move toward the specified direction according to the current position of the self-moving device and the specified distance.
3. The obstacle detection method according to claim 2, wherein: Controlling the self-moving device to move toward the specified direction according to the current position of the self-moving device and the specified distance includes: The current position of the self-moving device is used as a moving starting point, and the self-moving device is controlled to move a specified distance in the specified direction.
4. The obstacle detection method according to claim 1, wherein: The comparing the first image and the second image to obtain a comparison result, and determining an obstacle detection result according to the comparison result, includes: The first image and the second image are compared based on an XOR operation to obtain a comparison result. If the comparison result indicates that there is a light spot corresponding to the light emitting device on the first image, the obstacle detection result is determined to be the second detection result, and the second detection result can indicate that there is an obstacle in the specified direction.
5. The obstacle detection method according to claim 4, characterized in that: After determining that the obstacle detection result is the second detection result, the method further includes: The distance between the obstacle and the self-moving device is determined according to the comparison result.
6. The obstacle detection method according to claim 1, wherein: Determining the obstacle detection result according to the comparison result includes: Determining the obstacle detection result as a first detection result according to the comparison result; Correspondingly, after determining, according to the comparison result, that the obstacle detection result is the first detection result, the method further includes: The photographing device is turned off, and the self-moving device is controlled to move toward the specified direction.
7. An obstacle detection device, characterized in that: The obstacle detection device is applied to a self-moving device, which is provided with a light emitting device and a shooting device. The obstacle detection device includes: a first control unit, configured to control the photographing device to photograph in a designated direction to acquire a first image when the light emitting device emits light in the designated direction; a second control unit, configured to control the light emitting device to enter a shutdown state, wherein the shutdown state is a state of pausing / stopping the emission of the linear laser; a third control unit, configured to control the photographing device to shoot in the designated direction to acquire a second image when the light emitting device is in an off state; a result determination unit, configured to compare the first image and the second image to obtain a comparison result, and determine an obstacle detection result according to the comparison result, wherein the obstacle detection result can indicate whether there is an obstacle in the specified direction; When the first control unit executes the control of the shooting device to shoot in the specified direction to obtain the first image, it is specifically used to: control the light emitting device to emit light in the specified direction; if the shooting device shoots a light spot in the specified direction and the self-moving device is in a moving state, then control the self-moving device to stop moving, and control the shooting device to shoot in the specified direction to obtain the first image.
8. A self-propelled device comprising a light emitting device, a photographing device, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the obstacle detection method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the obstacle detection method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Obstacle detection method, obstacle detection module and self-moving device
CN113343907A
Novel obstacle recognition device
CN204301735U