Method, device and equipment for controlling camera based on ultrasonic waves and storage medium

Through ultrasonic control methods, the spatial coordinates of obstacles are calculated and the camera rotation angle is adjusted, which solves the problem of shooting blind spots caused by the limited viewing angle of the camera, and effectively captures and tracks obstacles in the blind spots.

CN119136058APending Publication Date: 2024-12-13AXERA SEMICON (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411304129.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

Due to the limited viewing angle, the camera cannot capture obstacles entering the blind spot.

Method used

Using an ultrasonic control method, by generating and receiving ultrasonic waves, the spatial coordinates of the obstacles are calculated, and the rotation angle of the camera is determined based on the coordinates, and the camera is guided to rotate to capture the obstacles.

Benefits of technology

It effectively solves the problem of camera shooting blind spots, can clearly and comprehensively capture and track obstacles, and improves the monitoring range.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119136058A_ABST
    Figure CN119136058A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for controlling a camera based on ultrasonic waves, equipment and a storage medium. The method comprises the following steps: generating the ultrasonic waves and playing the ultrasonic waves; receiving effective echoes; the effective echoes are ultrasonic waves reflected back by an obstacle; acquiring playing time and receiving time, and calculating a first space coordinate of the obstacle based on the playing time, the receiving time and the wave velocity; determining a rotation angle based on the first space coordinate and a to-be-adjusted shooting area of the camera; the rotation angle is the angle between the first connecting line and the center line of the to-be-adjusted shooting area; two ends of the first connecting line are respectively a first space coordinate and a second space coordinate; the second space coordinates are coordinates of the camera; the second space coordinates are coordinates of a preset coordinate system; guiding the camera to rotate based on the rotation angle to obtain a target shooting area of the camera; the center line of the target shooting area passes through the first space coordinates. According to the technical scheme, the problem that the camera has a shooting blind area can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent control technology, and in particular to a method, device, equipment and storage medium for controlling a camera based on ultrasonic waves. Background Art

[0002] Currently, cameras have been widely used in various places. However, in general, the viewing angle of a camera is about 60°, so the monitoring range of the camera is limited, which leads to blind spots in the camera. Rotatable cameras usually rotate regularly or are controlled by the user.

[0003] However, when obstacles such as people or animals silently break into the camera's blind spot, the camera cannot capture these obstacles, resulting in the camera having a blind spot problem. Summary of the invention

[0004] The embodiments of the present application provide a method, device, equipment and storage medium for controlling a camera based on ultrasonic waves, which can solve the problem of a camera having a blind spot. The technical solution is as follows:

[0005] According to a first aspect of an embodiment of the present application, a method for controlling a camera based on ultrasound is provided, the method comprising:

[0006] Generate ultrasonic waves and play the ultrasonic waves;

[0007] Receive a valid echo; the valid echo is the ultrasonic wave reflected by the obstacle;

[0008] Obtaining the play time and the receiving time, and calculating the first spatial coordinates of the obstacle based on the play time, the receiving time and the wave speed; the play time is the play time of the ultrasonic wave; the receiving time is the time of receiving the effective echo; the wave speed is the propagation speed of the ultrasonic wave in the air; the first spatial coordinate is the coordinate of the preset coordinate system;

[0009] Based on the first spatial coordinate and the shooting area to be adjusted of the camera, a rotation angle is determined; the rotation angle is an angle between a first connecting line and a midline of the shooting area to be adjusted; the two ends of the first connecting line are the first spatial coordinate and the second spatial coordinate respectively; the second spatial coordinate is the coordinate of the camera; the second spatial coordinate is the coordinate of the preset coordinate system;

[0010] Based on the rotation angle, the camera is guided to rotate to obtain a target shooting area of ​​the camera; the center line of the target shooting area passes through the first space coordinate.

[0011] In a possible implementation, the receiving a valid echo includes:

[0012] An initial digital signal corresponding to the effective echo is acquired based on a microphone array; and the initial digital signal is filtered to obtain the target digital signal.

[0013] In a possible implementation, the microphone array includes a plurality of microphones; the coordinates of the first microphone are third space coordinates; and the remaining microphones are arranged around the camera;

[0014] The third spatial coordinate is the same as the second spatial coordinate.

[0015] In a possible implementation, the calculating the first spatial coordinate of the obstacle based on the playing time, the receiving time and the wave speed includes:

[0016] Based on the play time, the first receiving time and the wave speed, the length of the first connection line is calculated; the first receiving time is the time when the first microphone receives the valid echo;

[0017] Based on the play time, the i-th receiving time, the wave speed and the length of the first connecting line, the length of the i-th connecting line between the obstacle and the i-th microphone is calculated; the i-th receiving time is the time when the i-th microphone receives the valid echo; i is an integer greater than or equal to 2;

[0018] The first space coordinate is calculated based on the length of the first link and the length of each i-th link.

[0019] In a possible implementation, the microphone array includes three microphones;

[0020] The first spatial coordinate is calculated based on the length of the first link and the length of each i-th link, including:

[0021] Based on the length of the first connecting line, the length of the second connecting line and the first line segment, a first angle is obtained; the first angle is the angle between the first connecting line and the first line segment; the first line segment indicates the distance between the first microphone and the second microphone;

[0022] Based on the length of the first connecting line, the length of the third connecting line and the second line segment, a second angle is obtained; the second angle is the angle between the first connecting line and the second line segment; the second line segment indicates the distance between the first microphone and the third microphone;

[0023] The first space coordinate is obtained based on the first angle, the second angle and the length of the first connecting line.

[0024] In a possible implementation, obtaining the first space coordinate based on the first angle, the second angle, and the length of the first connecting line includes:

[0025] Based on the first angle and the length of the first connecting line, a value corresponding to the first spatial coordinate on the x-axis is obtained;

[0026] Based on the second angle and the length of the second connecting line, obtain the value of the first spatial coordinate on the y-axis;

[0027] Based on the second angle, the length of the first connecting line and the value of the first spatial coordinate on the x-axis, the value of the first spatial coordinate on the z-axis is obtained.

[0028] In a possible implementation, determining the rotation angle based on the first space coordinate and the shooting area to be adjusted of the camera includes:

[0029] Determine a first pitch angle of the camera, where the first pitch angle is an angle between the center line of the shooting area to be adjusted and a first preset plane;

[0030] Determine a first direction angle of the camera, where the first direction angle of the camera is the angle between the center line of the shooting area to be adjusted and the second preset plane;

[0031] Determine a second pitch angle of the obstacle, where the second pitch angle is the angle between the first connecting line and the projection; the projection is the projection of the first connecting line on the first preset plane;

[0032] Determine a second direction angle of the obstacle, where the second direction angle is the angle between the projection and the first line segment;

[0033] The rotation angle is determined based on the first pitch angle, the first direction angle, the second pitch angle, and the second direction angle.

[0034] In a possible implementation manner, determining the rotation angle based on the first pitch angle, the first direction angle, the second pitch angle, and the second direction angle includes:

[0035] When the first pitch angle matches the second pitch angle, and the first direction angle matches the second direction angle, the rotation angle is 0°; or

[0036] When the first pitch angle does not match the second pitch angle, and the first direction angle matches the second direction angle, determining the rotation angle based on the first pitch angle and the second pitch angle; or

[0037] When the first pitch angle matches the second pitch angle, and the first direction angle does not match the second direction angle, determining the rotation angle based on the first direction angle and the second direction angle; or

[0038] When the first pitch angle does not match the second pitch angle, and the first direction angle does not match the second direction angle, the rotation angle is determined based on the first pitch angle, the second pitch angle, the first direction angle, and the second direction angle.

[0039] In a possible implementation, the generating of ultrasonic waves and the playing of the ultrasonic waves include:

[0040] The ultrasonic wave is generated based on a sound wave generator;

[0041] The ultrasonic wave is played based on a loudspeaker; the coordinates of the loudspeaker and the sound wave generator are fifth spatial coordinates; and the fifth spatial coordinates are the same as the second spatial coordinates.

[0042] According to a second aspect of an embodiment of the present application, there is provided a device for controlling a camera based on ultrasound, the device comprising:

[0043] Camera, ultrasonic module, receiving module, calculation module, determination module and guidance module;

[0044] The ultrasonic module is used to generate ultrasonic waves and play the ultrasonic waves;

[0045] The receiving module is used to receive a valid echo; the valid echo is the ultrasonic wave reflected by an obstacle;

[0046] The calculation module is used to obtain the play time and the receiving time, and calculate the first spatial coordinates of the obstacle based on the play time, the receiving time and the wave speed; the play time is the play time of the ultrasonic wave; the receiving time is the time of receiving the effective echo; the wave speed is the propagation speed of the ultrasonic wave in the air; the first spatial coordinates are the coordinates of the preset coordinate system;

[0047] The determination module is used to determine a rotation angle based on the first spatial coordinate and the to-be-adjusted shooting area of ​​the camera; the rotation angle is an angle between a first connecting line and a midline of the to-be-adjusted shooting area; the two ends of the first connecting line are the first spatial coordinate and the second spatial coordinate respectively; the second spatial coordinate is the coordinate of the camera; the second spatial coordinate is the coordinate of the preset coordinate system;

[0048] The guiding module is used to guide the camera to rotate based on the rotation angle to obtain a target shooting area of ​​the camera; the center line of the target shooting area passes through the first space coordinate.

[0049] According to a third aspect of an embodiment of the present application, a computer device is provided, which includes a processor and a memory, wherein the memory is used to store at least one program, and the at least one program is loaded by the processor and executes the method for controlling a camera based on ultrasound as described above.

[0050] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which at least one program is stored. The at least one program is loaded and executed by a processor to implement the method of controlling a camera based on ultrasound as described above.

[0051] In an embodiment of the present application, an ultrasonic-based camera control method is provided, wherein the first spatial coordinates of an obstacle are determined based on the ultrasonic wave; the rotation angle is determined based on the first spatial coordinates and the camera's shooting area to be adjusted; the camera is guided to rotate based on the rotation angle to obtain the camera's target shooting area; the midline of the target shooting area passes through the first spatial coordinate. Through ultrasonic waves, obstacles in the camera's shooting blind spot can be found, and the camera can be guided to rotate to capture the obstacles in the shooting blind spot. In addition, since the midline of the target shooting area passes through the first spatial coordinate, that is, the center of the camera is facing the obstacle, the obstacle can be photographed and tracked more clearly and more comprehensively. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] 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.

[0053] Figure 1 is a schematic diagram of an implementation environment provided according to an embodiment of the present application;

[0054] Figure 2 is a flow chart of a method for controlling a camera based on ultrasound provided in an embodiment of the present application;

[0055] Figure 3 is a flow chart of step 201 provided according to an embodiment of the present application;

[0056] Figure 4 is a flow chart of step 203 provided according to an embodiment of the present application;

[0057] Figure 5 is a flowchart of step 2033 provided according to an embodiment of the present application;

[0058] Figure 6is a flowchart of step 20333 provided according to an embodiment of the present application;

[0059] Figure 7 is a flow chart of step 204 provided according to an embodiment of the present application;

[0060] Figure 8 is a schematic diagram of the origin of a camera in a preset coordinate system according to an embodiment of the present application;

[0061] Fig. 9 is a schematic diagram of the structure of a device for controlling a camera based on ultrasonic waves according to an embodiment of the present application;

[0062] Fig.10 is a schematic diagram of the structure of a terminal provided according to an embodiment of the present application;

[0063] Fig.11 It is a structural diagram of a server provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0064] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0065] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.

[0066] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items with substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there a limitation on the quantity and execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms.

[0067] These terms are only used to distinguish one element from another element. For example, without departing from the scope of various examples, a first action can be referred to as a second action, and similarly, a second action can also be referred to as a first action. Both the first action and the second action can be actions, and in some cases, can be separate and different actions.

[0068] Here, at least one means one or more than one, for example, at least one action can be one action, two actions, three actions, or any other action that is an integer greater than or equal to one. And multiple means two or more than two, for example, multiple actions can be two actions, three actions, or any other action that is an integer greater than or equal to two.

[0069] Figure 1 It is a schematic diagram of an implementation environment provided according to an embodiment of the present application, and the implementation environment may include a terminal 101 and a server 102.

[0070] The terminal 101 is provided with a camera, such as a camera provided on a computer or a camera component provided on a mobile phone.

[0071] The terminal 101 may be a mobile phone with a camera, a personal computer, a laptop computer, a wearable device, a tablet computer, a smart TV, a car terminal, etc.

[0072] The server 102 may be a single server, a server cluster consisting of multiple servers, or a cloud processing center.

[0073] The terminal 101 is connected to the server 102 via a wired or wireless network.

[0074] In some embodiments, the wireless network or wired network uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to any combination of local area network (LAN), metropolitan area network (MAN), wide area network (WAN), mobile, wired or wireless network, private network or virtual private network. In some embodiments, the data exchanged through the network is represented by technology and / or format including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec) can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technology can also be used to replace or supplement the above data communication technology.

[0075] In the related art, the user controls the camera to realize the shooting function by touching the display screen or voice interaction. The terminal controls the camera to realize the shooting function in response to the user touching the display screen. For example: in response to the user starting the camera operation, the terminal displays a shooting preview interface, and the shooting preview interface displays the captured preview image and the function controls for adjusting the shooting. In response to the user's touch operation on the above function control, the terminal controls the camera to execute the function responded by the function control. However, if the camera is rotated by the user, when the user cannot find the emergency in time, the camera will not be able to capture the emergency in time, that is, the camera has a shooting blind spot.

[0076] In order to solve the problem of blind spots in the above-mentioned cameras, an embodiment of the present application provides a method for controlling the camera based on ultrasound, so that no matter whether the obstacle is captured by the camera, as long as the effective echo reflected by the obstacle is received by the terminal, the terminal can adjust the camera and take a picture of the obstacle, thus solving the problem of blind spots in the camera.

[0077] Figure 2 is a flow chart of a method for controlling a camera based on ultrasound provided in an embodiment of the present application, such as Figure 2 As shown, in the embodiment of the present application, the application is described by taking the application in a terminal with a camera as an example. The method comprises the following steps:

[0078] In step 201, the terminal generates ultrasonic waves and plays ultrasonic waves.

[0079] The ultrasonic wave may be an ultrasonic wave of a fixed frequency.

[0080] For example, the frequency of ultrasound is 24KHZ.

[0081] Figure 3 It is a flowchart of step 201 provided according to an embodiment of the present application.

[0082] Combine the following Figure 3 Step 201 is exemplarily described.

[0083] In some embodiments, the above step 201 includes the following steps 2011 and 2012:

[0084] In step 2011, the terminal generates ultrasonic waves based on the sound wave generator.

[0085] In step 2012, the terminal plays ultrasonic waves based on the speaker; the coordinates of the speaker and the sound wave generator are the fifth space coordinates; the fifth space coordinates are the same as the second space coordinates.

[0086] In one example, for the convenience of calculation, the second spatial coordinate may be the origin of a preset coordinate system, that is, the second spatial coordinate and the fifth spatial coordinate are both (0, 0, 0).

[0087] In some embodiments, the terminal plays periodic ultrasonic waves based on a speaker.

[0088] In step 202, the terminal receives a valid echo; a valid echo is an ultrasonic wave reflected by an obstacle.

[0089] In some embodiments, before step 202, the method further includes: the terminal estimates environmental noise and reference echoes, wherein the environment can be understood as the shooting range of the camera.

[0090] In one example, the terminal estimates the environmental noise based on the noise estimation technology when there are no obstacles in the environment. For example, the noise estimation technology relies on measuring equipment such as acoustic sensors and sound level meters, and analysis methods such as spectrum analysis to estimate the environmental noise.

[0091] In one example, after receiving the ambient noise, the microphone array converts the ambient noise into an electrical signal, and converts the electrical signal into an ambient digital signal based on an analog-to-digital conversion module. The terminal stores the ambient digital signal.

[0092] It should be noted that the analog-to-digital conversion module can be obtained from the relevant technology and will not be described in detail in the embodiments of the present application.

[0093] In some embodiments, even if there are no obvious obstacles in the environment, the ultrasonic wave may be reflected and scattered by tiny particles in the air, temperature gradient changes, or medium inhomogeneities, that is, to form reference echoes, which may be captured by the microphone array. Therefore, in order to determine whether the echo received by the microphone is reflected by an obstacle, the reference echo needs to be determined.

[0094] In one example, after receiving the reference echo, the microphone converts the reference echo into an electrical signal, and then converts the electrical signal into a reference digital signal based on an analog-to-digital conversion module.

[0095] In one example, after the microphone receives the echo, a digital signal corresponding to the echo is obtained based on the above method. The digital signal is filtered based on the reference digital signal and the ambient digital signal. That is, the ambient digital signal and the reference digital signal are removed from the digital signal to obtain the remaining part of the digital signal. If there is no remaining part of the digital signal after removing the ambient digital signal and the reference digital signal, or the remaining part is 0. That is, the sum of the ambient digital signal and the reference digital signal is the digital signal. Then the echo is not an echo reflected by an obstacle. That is, the echo is not a valid echo, but an invalid echo.

[0096] In some embodiments, the above step 202 can be implemented as follows:

[0097] An initial digital signal corresponding to a valid echo is obtained based on a microphone array; the initial digital signal is filtered to obtain a target digital signal.

[0098] In one example, after receiving the ultrasonic wave, the microphone array converts the ultrasonic wave into an electrical signal, and converts the electrical signal into an initial digital signal based on an analog-to-digital conversion module.

[0099] In one example, after acquiring the initial digital signal, the terminal filters the initial digital signal based on the reference digital signal and the ambient digital signal. That is, the reference digital signal and the ambient digital signal are removed from the initial digital signal to obtain the target digital signal. At this time, the target digital signal is not 0. For example, the reference digital signal and the ambient digital signal are removed from the initial digital signal based on a DSP (Digital Signal Processor).

[0100] In some embodiments, the microphone array includes multiple microphones; the coordinates of the first microphone are third spatial coordinates; and the remaining microphones are arranged around the camera.

[0101] In one example, for ease of calculation, the third spatial coordinate is the same as the second spatial coordinate. For example, the third spatial coordinate is represented as (0, 0, 0).

[0102] In step 203, the terminal obtains the playback time and the receiving time, and calculates the first spatial coordinates of the obstacle based on the playback time, the receiving time and the wave speed; the playback time is the playback time of the ultrasonic wave; the receiving time is the time for receiving a valid echo; the wave speed is the propagation speed of the ultrasonic wave in the air; the first spatial coordinate is the coordinate of the preset coordinate system.

[0103] In some embodiments, before step 203, the terminal obtains a target digital signal, and in response to the target digital signal, the terminal obtains a play time and a receive time.

[0104] Each time the terminal plays and receives an ultrasonic wave, the terminal stores the playing time and receiving time corresponding to the ultrasonic wave.

[0105] The propagation speed of ultrasound in air is 340m / s.

[0106] Figure 4 It is a flowchart of step 203 provided according to an embodiment of the present application.

[0107] Combine the following Figure 4 Step 203 is exemplarily described.

[0108] In some embodiments, the above step 203 includes the following steps 2031 to 2033:

[0109] In step 2031, the terminal calculates the length of the first connection line based on the playback time, the first receiving time and the wave speed; the first receiving time is the time when the first microphone receives the effective echo.

[0110] In some embodiments, the distance between the first microphone and the obstacle is obtained based on the wave speed and the propagation time.

[0111] In one example, the first propagation time is obtained based on the difference between the first receiving time and the playing time, the distance of ultrasonic wave propagation within the first propagation time is obtained based on the first propagation time and the wave speed, and the length of the first connection line is obtained based on the ultrasonic wave propagation distance.

[0112] For example, the length of the first line is obtained by the following formula.

[0113] The length of the first connection = (first receiving time - playing time) × wave speed / 2.

[0114] In step 2032, the terminal calculates the length of the i-th line between the obstacle and the i-th microphone based on the playback time, the i-th receiving time, the wave speed, and the length of the first line; the i-th receiving time is the time when the i-th microphone receives a valid echo; i is an integer greater than or equal to 2.

[0115] In some embodiments, since the position of the second microphone is different from the position of the camera, the length of the second line is obtained by calculating the length of the first line. However, since the length of the first line has been calculated in the above steps, the length of the second line can be calculated by the length of the first line.

[0116] In one example, the second propagation time is obtained based on the difference between the second receiving time and the playing time; the distance of ultrasonic wave propagation in the second propagation time is obtained based on the second propagation time and the wave speed. The length of the second connecting line is obtained based on the distance of ultrasonic wave propagation and the length of the first connecting line. The second receiving time is also the time when the second microphone receives the effective echo.

[0117] For example, the length of the first line is obtained by the following formula.

[0118] The length of the second connection = (second receiving time - broadcasting time) × wave speed - the length of the first connection.

[0119] Similarly, the length of the i-th line can be obtained.

[0120] In step 2033, the terminal calculates the first space coordinate based on the length of the first link and the length of each i-th link.

[0121] In some embodiments, the coordinates of each microphone are known, that is, the position of each microphone can be set according to actual needs. The specific number of microphones can also be set according to actual needs.

[0122] Figure 5 It is a flowchart of step 2033 provided according to an embodiment of the present application.

[0123] Combine the following Figure 5 Step 2033 is exemplarily described.

[0124] In some embodiments, the above step 2033 may include the following steps 20331 to 20333:

[0125] The microphone array includes three microphones.

[0126] In step 20331, the terminal obtains a first angle based on the length of the first line, the length of the second line and the first line segment; the first angle is the angle between the first line and the first line segment; the first line segment indicates the distance between the first microphone and the second microphone.

[0127] In one example, the terminal calculates the length of the first line, the length of the second line, and the first line segment based on the cosine theorem to obtain the cosine value of the first angle; and obtains the first angle based on the cosine value of the first angle.

[0128] In step 20332, the terminal obtains a second angle based on the length of the first line, the length of the third line and the second line segment; the second angle is the angle between the first line and the second line segment; the second line segment indicates the distance between the first microphone and the third microphone.

[0129] In one example, the terminal calculates the length of the first line, the length of the third line, and the second line segment based on the cosine theorem to obtain the cosine value of the second angle; and obtains the second angle based on the cosine value of the second angle.

[0130] In step 20333, the terminal obtains the first spatial coordinate based on the first angle, the second angle, and the length of the first connecting line.

[0131] Figure 6 It is a flowchart of step 20333 provided according to an embodiment of the present application.

[0132] Combine the following Figure 6 Step 20333 is exemplified.

[0133] In some embodiments, the above step 20333 may include the following steps 203331 to 203333:

[0134] In step 203331, the terminal obtains the value of the first spatial coordinate corresponding to the x-axis based on the first angle and the length of the first connecting line.

[0135] In one example, the terminal obtains the cosine value of the first angle, and uses the product of the length of the first line and the cosine value of the first angle as the value corresponding to the first spatial coordinate on the x-axis.

[0136] In step 203332, the terminal obtains the value of the first spatial coordinate corresponding to the y-axis based on the second angle and the length of the second connecting line.

[0137] In one example, the terminal obtains the cosine value of the second angle, and uses the product of the length of the second line and the cosine value of the second angle as the value corresponding to the first spatial coordinate on the y-axis.

[0138] In step 203333, the terminal obtains the value of the first spatial coordinate corresponding to the z-axis based on the second angle, the length of the first connecting line, and the value of the first spatial coordinate corresponding to the x-axis.

[0139] In one example, the terminal obtains the sine value of the second angle; obtains the product of the sine value of the second angle and the length of the first line; and obtains the value corresponding to the first spatial coordinate on the z-axis based on the product of the sine value of the second angle and the length of the first line and the value corresponding to the first spatial coordinate on the x-axis.

[0140] In step 204, the terminal determines the rotation angle based on the first spatial coordinates and the shooting area to be adjusted of the camera; the rotation angle is the angle between the first connecting line and the midline of the shooting area to be adjusted; the two ends of the first connecting line are the first spatial coordinates and the second spatial coordinates respectively; the second spatial coordinates are the coordinates of the camera; the second spatial coordinates are the coordinates of the preset coordinate system.

[0141] Figure 7 It is a flowchart of step 204 provided according to an embodiment of the present application.

[0142] Combine the following Figure 7 Step 204 is exemplarily described.

[0143] In some embodiments, the above step 204 may include the following steps 2041 to 2045:

[0144] In step 2041, the terminal determines a first pitch angle of the camera, where the first pitch angle is an angle between a center line of the shooting area to be adjusted and a first preset plane.

[0145] In one example, in a scenario where a camera tracks an object or obstacle on the ground, the first preset plane is the xoy plane, the positive direction of the z-axis points vertically to the ground, and the center line of the camera's shooting area to be adjusted falls on the z-axis, that is, the camera is shooting directly at the ground.

[0146] In step 2042, the terminal determines a first direction angle of the camera, where the first direction angle of the camera is an angle between a center line of the shooting area to be adjusted and a second preset plane.

[0147] For example, the second preset plane is the xoz plane.

[0148] In step 2043, the terminal determines a second pitch angle of the obstacle, where the second pitch angle is the angle between the first connecting line and the projection; the projection is the projection of the first connecting line on the first preset plane.

[0149] In step 2044, the terminal determines a second direction angle of the obstacle, where the second direction angle is the angle between the projection and the first line segment.

[0150] In step 2045, the terminal determines a rotation angle based on the first elevation angle, the first direction angle, the second elevation angle, and the second direction angle.

[0151] In some embodiments, the above step 2045 can be implemented in the following ways:

[0152] The first implementation mode: when the first pitch angle matches the second pitch angle, and the first direction angle matches the second direction angle, the rotation angle is 0°. In the first implementation mode, the center line of the camera's shooting area to be adjusted passes through the first space coordinate, that is, the camera does not need to be adjusted, that is, the center of the camera's shooting area to be adjusted faces the obstacle, so as to capture the obstacle as clearly and comprehensively as possible.

[0153] The second implementation method: when the first pitch angle does not match the second pitch angle, and the first direction angle matches the second direction angle, the rotation angle is determined based on the first pitch angle and the second pitch angle.

[0154] A third implementation method: when the first pitch angle matches the second pitch angle, and the first direction angle does not match the second direction angle, a rotation angle is determined based on the first direction angle and the second direction angle.

[0155] A fourth implementation method: when the first pitch angle does not match the second pitch angle, and the first direction angle does not match the second direction angle, a rotation angle is determined based on the first pitch angle, the second pitch angle, the first direction angle, and the second direction angle.

[0156] In the second, third and fourth implementations described above, the center line of the to-be-adjusted shooting area of ​​the camera does not pass through the first space coordinate, that is, the camera needs to be adjusted.

[0157] In step 205, the terminal guides the camera to rotate based on the rotation angle to obtain a target shooting area of ​​the camera; the midline of the target shooting area passes through the first space coordinate.

[0158] In some embodiments, when the first pitch angle does not match the second pitch angle, the first direction angle matches the second direction angle, and the rotation angle is the difference between the first pitch angle and the second pitch angle. The terminal adjusts the first pitch angle based on the rotation angle so that the adjusted first pitch angle is consistent with the second pitch angle, and the first direction angle is consistent with the second direction angle, so that the midline of the target adjustment shooting area of ​​the camera passes through the first space coordinate.

[0159] In some embodiments, when the first pitch angle matches the second pitch angle, the first direction angle does not match the second direction angle, and the rotation angle is the difference between the first direction angle and the second direction angle. The terminal adjusts the first direction angle based on the rotation angle so that the adjusted first direction angle is consistent with the second direction angle, and the first pitch angle matches the second pitch angle, so that the midline of the target adjustment shooting area of ​​the camera passes through the first space coordinate.

[0160] In some embodiments, when the first pitch angle does not match the second pitch angle, and the first direction angle does not match the second direction angle, the rotation angle is determined based on the difference between the first pitch angle and the second pitch angle and the difference between the first direction angle and the second direction angle.

[0161] Optionally, the terminal first adjusts the first pitch angle based on the second pitch angle so that the adjusted first pitch angle is consistent with the second pitch angle; and then adjusts the first direction angle based on the second direction angle so that the adjusted first direction angle is consistent with the second direction angle, so that the midline of the target adjustment shooting area of ​​the camera passes through the first spatial coordinate.

[0162] Optionally, the first direction angle is first adjusted based on the second direction angle so that the adjusted first direction angle is consistent with the second direction angle; then the first pitch angle is adjusted based on the second pitch angle so that the adjusted first pitch angle is consistent with the second pitch angle, so that the midline of the target adjustment shooting area of ​​the camera passes through the first spatial coordinate.

[0163] In some embodiments, after the rotation angle is determined, the terminal generates a rotation signal based on the rotation angle, and controls the rotation of the camera based on the rotation signal.

[0164] For example, the terminal sends the rotation angle to the rotation controller, the rotation controller generates a rotation signal based on the rotation angle, and controls the rotation of the camera based on the rotation signal.

[0165] In some embodiments, the terminal cyclically executes the above steps 201 to 205. It should be noted that the environmental noise and the reference echo need only be calculated once, and there is no need to calculate repeatedly.

[0166] In some embodiments, when the midline of the camera's target adjustment shooting area passes through the first spatial coordinate, that is, after the adjustment of the camera's shooting area is completed; when the obstacle moves, the camera automatically tracks the obstacle, that is, always keeps the camera facing the moving obstacle.

[0167] Figure 8 It is a schematic diagram of the origin of a camera in a preset coordinate system provided according to an embodiment of the present application.

[0168] Combine the following Figure 8 An exemplary description is given of the rotation of the guiding camera.

[0169] exist Figure 8 In the embodiment, the preset coordinate system is a three-dimensional coordinate system consisting of an x-axis, a y-axis, and a z-axis, and O represents the origin of the preset coordinate system. The microphone array includes three microphones.

[0170] For the convenience of description, M represents an obstacle; A represents the first microphone; B represents the second microphone; C represents the third microphone; N represents the foot of M on the xoy plane; the length value of AD represents the numerical value corresponding to the first spatial coordinate on the y-axis; the length value of AE represents the numerical value corresponding to the first spatial coordinate on the x-axis; the length value of MN represents the numerical value corresponding to the first spatial coordinate on the z-axis; AB is known and represents the first line segment; AC is known and represents the second line segment; AM represents the first connecting line; MB represents the second connecting line; MC represents the third connecting line; AN represents the projection of AM on the xoy plane; S represents the wave speed; T1 represents the first propagation time; T2 represents the second propagation time; T3 represents the third propagation time.

[0171] The coordinates of the first microphone, camera, speaker and sound wave generator are the same, which are all the origin. The first angle is ∠BAM; the second angle is ∠CAM.

[0172] Combination Figure 8 ,The first step is to calculate the length of AB, MB and AC:

[0173] AM=S×T1 / 2.

[0174] MB=S×T2-AM.

[0175] MC=S×T3-AM.

[0176] The second step is to calculate the cosine values ​​of ∠BAM and ∠CAM:

[0177] cos∠BAM=(AM 2 +AB 2 -MB 2 ) / (2×AM×AB).

[0178] cos∠CAM=(AM 2 +AC 2 -MC 2 ) / (2×AM×AC).

[0179] The third step is to calculate ∠BAM and ∠CAM:

[0180] ∠BAM=arccos((AM 2 +AB 2 -MB 2 ) / (2×AM×AB)).

[0181] ∠CAM=arccos((AM 2 +AC 2 -MC 2 ) / (2×AM×AC)).

[0182] The fourth step is to calculate the first space coordinates:

[0183] The value corresponding to the first spatial coordinate on the x-axis=AM×cos∠BAM.

[0184] The value corresponding to the first spatial coordinate on the y-axis=AM×cos∠CAM.

[0185]

[0186] That is, the first space coordinate is:

[0187]

[0188] It should be noted that the value corresponding to the first spatial coordinate on the z-axis may be a positive number or a negative number. In the embodiment of the present application, in a scenario where the camera tracks an object or obstacle on the ground, the value corresponding to the first spatial coordinate on the z-axis may be preset to be a positive number.

[0189] Step 4: Calculate the second pitch angle and the second direction angle:

[0190] The first preset plane is the xoy plane, and the second preset plane is the xoz plane.

[0191] The first pitch angle is the angle between the center line of the camera's shooting area to be adjusted and the xoy plane; the first direction angle is the angle between the center line of the camera's shooting area to be adjusted and the xoz plane. The first pitch angle is 90°, and the first direction angle is 0°.

[0192] The second pitch angle is ∠MAN; the second azimuth angle is ∠BAN;

[0193] ∠MAN=arcsin(MN / AM).

[0194] ∠BAN=arctan(EN / AE).

[0195] The fifth step is to compare the first pitch angle with the second pitch angle, and compare the first direction angle with the second direction angle to obtain the rotation angle.

[0196] In the sixth step, a rotation signal is generated based on the rotation angle, and the rotation of the camera is controlled based on the rotation signal.

[0197] In an embodiment of the present application, a method for controlling a camera based on ultrasound determines the first spatial coordinates of an obstacle based on ultrasound; determines the rotation angle based on the first spatial coordinates and the camera's shooting area to be adjusted; guides the camera to rotate based on the rotation angle to obtain the camera's target shooting area; the midline of the target shooting area passes through the first spatial coordinate. Through ultrasound, obstacles in the camera's shooting blind spot can be found, and the camera can be guided to rotate to capture the obstacles in the shooting blind spot. In addition, since the midline of the target shooting area passes through the first spatial coordinate, that is, the center of the camera is facing the obstacle, the obstacle can be photographed and tracked more clearly and comprehensively.

[0198] Fig. 9 is a structural diagram of a device 900 for controlling a camera based on ultrasonic waves according to an embodiment of the present application, the device comprising:

[0199] Camera 906, ultrasonic module 901, receiving module 902, calculation module 903, determination module 904 and guiding module 905;

[0200] The ultrasonic module 901 is used to generate ultrasonic waves and play the ultrasonic waves;

[0201] The receiving module 902 is used to receive a valid echo; the valid echo is the ultrasonic wave reflected by an obstacle;

[0202] The calculation module 903 is used to obtain the play time and the receiving time, and calculate the first spatial coordinates of the obstacle based on the play time, the receiving time and the wave speed; the play time is the play time of the ultrasonic wave; the receiving time is the time of receiving the effective echo; the wave speed is the propagation speed of the ultrasonic wave in the air; the first spatial coordinates are the coordinates of the preset coordinate system;

[0203] The determination module 904 is used to determine a rotation angle based on the first spatial coordinate and the to-be-adjusted shooting area of ​​the camera 906; the rotation angle is an angle between a first connecting line and a midline of the to-be-adjusted shooting area; the two ends of the first connecting line are the first spatial coordinate and the second spatial coordinate respectively; the second spatial coordinate is the coordinate of the camera 906; the second spatial coordinate is the coordinate of the preset coordinate system;

[0204] The guiding module 905 is used to guide the camera 906 to rotate based on the rotation angle to obtain a target shooting area of ​​the camera 906; the center line of the target shooting area passes through the first space coordinate.

[0205] In some embodiments, the device is further used to:

[0206] An initial digital signal corresponding to the effective echo is acquired based on a microphone array; and the initial digital signal is filtered to obtain the target digital signal.

[0207] In some embodiments, the microphone array includes a plurality of microphones; the coordinates of the first microphone are the third spatial coordinates; and the remaining microphones are arranged around the camera;

[0208] The third spatial coordinate is the same as the second spatial coordinate.

[0209] In some embodiments, the device is further used to:

[0210] Based on the play time, the first receiving time and the wave speed, the length of the first connection line is calculated; the first receiving time is the time when the first microphone receives the valid echo;

[0211] Based on the play time, the i-th receiving time, the wave speed and the length of the first connecting line, the length of the i-th connecting line between the obstacle and the i-th microphone is calculated; the i-th receiving time is the time when the i-th microphone receives the valid echo; i is an integer greater than or equal to 2;

[0212] The first space coordinate is calculated based on the length of the first link and the length of each i-th link.

[0213] In some embodiments, the microphone array includes three microphones;

[0214] The device is also used for:

[0215] Based on the length of the first connecting line, the length of the second connecting line and the first line segment, a first angle is obtained; the first angle is the angle between the first connecting line and the first line segment; the first line segment indicates the distance between the first microphone and the second microphone;

[0216] Based on the length of the first connecting line, the length of the third connecting line and the second line segment, a second angle is obtained; the second angle is the angle between the first connecting line and the second line segment; the second line segment indicates the distance between the first microphone and the third microphone;

[0217] The first space coordinate is obtained based on the first angle, the second angle and the length of the first connecting line.

[0218] In some embodiments, the device is further used to:

[0219] Based on the first angle and the length of the first connecting line, a value corresponding to the first spatial coordinate on the x-axis is obtained;

[0220] Based on the second angle and the length of the second connecting line, obtain the value of the first spatial coordinate on the y-axis;

[0221] Based on the second angle, the length of the first connecting line and the value of the first spatial coordinate on the x-axis, the value of the first spatial coordinate on the z-axis is obtained.

[0222] In some embodiments, the device is further used to:

[0223] Determine a first pitch angle of the camera, where the first pitch angle is an angle between the center line of the shooting area to be adjusted and a first preset plane;

[0224] Determine a first direction angle of the camera, where the first direction angle of the camera is the angle between the center line of the shooting area to be adjusted and the second preset plane;

[0225] Determine a second pitch angle of the obstacle, where the second pitch angle is the angle between the first connecting line and the projection; the projection is the projection of the first connecting line on the first preset plane;

[0226] Determine a second direction angle of the obstacle, where the second direction angle is the angle between the projection and the first line segment;

[0227] The rotation angle is determined based on the first pitch angle, the first direction angle, the second pitch angle, and the second direction angle.

[0228] In some embodiments, the apparatus further comprises:

[0229] When the first pitch angle matches the second pitch angle, and the first direction angle matches the second direction angle, the rotation angle is 0°; or

[0230] When the first pitch angle does not match the second pitch angle, and the first direction angle matches the second direction angle, determining the rotation angle based on the first pitch angle and the second pitch angle; or

[0231] When the first pitch angle matches the second pitch angle, and the first direction angle does not match the second direction angle, determining the rotation angle based on the first direction angle and the second direction angle; or

[0232] When the first pitch angle does not match the second pitch angle, and the first direction angle does not match the second direction angle, the rotation angle is determined based on the first pitch angle, the second pitch angle, the first direction angle, and the second direction angle.

[0233] In some embodiments, the device is further used to:

[0234] The ultrasonic wave is generated based on a sound wave generator;

[0235] The ultrasonic wave is played based on a loudspeaker; the coordinates of the loudspeaker and the sound wave generator are fifth spatial coordinates; and the fifth spatial coordinates are the same as the second spatial coordinates.

[0236] It should be noted that: when the device based on ultrasonic control of the camera provided in the above embodiment performs the corresponding steps, only the division of the above functional modules is used as an example. 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 device based on ultrasonic control of the camera provided in the above embodiment and the method embodiment based on ultrasonic control of the camera belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0237] In the embodiment of the present application, the first spatial coordinates of the obstacle are determined based on ultrasound; the rotation angle is determined based on the first spatial coordinates and the camera's shooting area to be adjusted; based on the rotation angle, the camera is guided to rotate to obtain the camera's target shooting area; the midline of the target shooting area passes through the first spatial coordinates. Through ultrasound, obstacles in the camera's shooting blind spot can be found, and the camera can be guided to rotate to capture the obstacles in the shooting blind spot. In addition, since the midline of the target shooting area passes through the first spatial coordinates, that is, the center of the camera is facing the obstacle, the obstacle can be photographed and tracked more clearly and comprehensively.

[0238] An embodiment of the present application further provides a computer device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and the processor implements the above method when executing the computer program.

[0239] Taking computer equipment as the terminal as an example, Fig.10 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present application, see Fig.10 The terminal 1000 may be a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer or a desktop computer. The terminal 1000 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.

[0240] Typically, the terminal 1000 includes a processor 1001 and a memory 1002 .

[0241] The processor 1001 may include one or more processing cores, such as a 4-core processor, a 5-core processor, etc. The processor 1001 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 1001 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 1001 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 1001 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0242] The memory 1002 may include one or more computer-readable storage media, which may be non-transitory. The memory 1002 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 1002 is used to store at least one program code, which is used to be executed by the processor 1001 to implement the process of terminal execution in the above method provided in the method embodiment of the present application.

[0243] In some embodiments, the terminal 1000 may further optionally include: a peripheral device interface 1003 and at least one peripheral device. The processor 1001, the memory 1002 and the peripheral device interface 1003 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 1003 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a display screen 1004, a camera assembly 1005, an audio circuit 1006 and a power supply 1007.

[0244] The peripheral device interface 1003 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1001 and the memory 1002. In some embodiments, the processor 1001, the memory 1002, and the peripheral device interface 1003 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1001, the memory 1002, and the peripheral device interface 1003 may be implemented on a separate chip or circuit board, which is not limited in the embodiments of the present application.

[0245] The display screen 1004 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1004 is a touch display screen, the display screen 1004 also has the ability to collect touch signals on the surface or above the surface of the display screen 1004. The touch signal can be input to the processor 1001 as a control signal for processing. At this time, the display screen 1004 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 1004 can be one, set on the front panel of the terminal 1000; in other embodiments, the display screen 1004 can be at least two, respectively set on different surfaces of the terminal 1000 or in a folding design; in other embodiments, the display screen 1004 can be a flexible display screen, set on the curved surface or folding surface of the terminal 1000. Even, the display screen 1004 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1004 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0246] The camera assembly 1005 is used to capture images or videos. In some embodiments, the camera assembly 1005 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. 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 panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1005 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.

[0247] The audio circuit 1006 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 1001 for processing. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 1000. 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 1001 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 1006 may also include a headphone jack.

[0248] The power supply 1007 is used to power various components in the terminal 1000. The power supply 1007 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1007 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.

[0249] Those skilled in the art will understand that Fig.10 The structure shown in the figure does not constitute a limitation on the terminal 1000, and the terminal 1000 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.

[0250] Take the computer device as a server as an example. Fig.11 It is a structural diagram of a server provided in an embodiment of the present application. The server 1100 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1101 and one or more memories 1102, wherein the one or more memories 1102 store at least one computer program, and the at least one computer program is loaded and executed by the one or more processors 1101 to implement the above-mentioned method of controlling a camera based on ultrasonic waves. Of course, the server 1100 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server 1100 may also include other components for implementing device functions, which will not be described in detail here.

[0251] The embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned method for generating an image processing model. Optionally, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0252] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0253] The above description is only an optional embodiment of the present application and is 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 method for controlling a camera based on ultrasonic wave, characterized in that: include: generating ultrasonic waves and playing the ultrasonic waves; Receiving effective echoes; the effective echoes are the ultrasonic waves reflected by obstacles; Obtaining the play time and the receiving time, and calculating the first spatial coordinates of the obstacle based on the play time, the receiving time and the wave speed; the play time is the play time of the ultrasonic wave; the receiving time is the time of receiving the effective echo; the wave speed is the propagation speed of the ultrasonic wave in the air; the first spatial coordinate is the coordinate of the preset coordinate system; Based on the first spatial coordinates and the shooting area to be adjusted of the camera, a rotation angle is determined; the rotation angle is an angle between a first connecting line and a midline of the shooting area to be adjusted; the two ends of the first connecting line are the first spatial coordinates and the second spatial coordinates respectively; the second spatial coordinates are the coordinates of the camera; the second spatial coordinates are the coordinates of the preset coordinate system; Based on the rotation angle, the camera is guided to rotate to obtain a target shooting area of ​​the camera; the midline of the target shooting area passes through the first space coordinate.

2. The method according to claim 1, characterized in that: The receiving of the effective echo comprises: An initial digital signal corresponding to the effective echo is acquired based on a microphone array; and the initial digital signal is filtered to obtain a target digital signal.

3. The method according to claim 2, characterized in that The microphone array includes a plurality of microphones; the coordinates of the first microphone are the third space coordinates; the remaining microphones are arranged around the camera; The third spatial coordinate is the same as the second spatial coordinate.

4. The method according to claim 3, characterized in that The calculating the first spatial coordinate of the obstacle based on the playing time, the receiving time and the wave speed includes: Calculate the length of the first connection line based on the play time, the first receiving time and the wave speed; the first receiving time is the time when the first microphone receives the effective echo; Based on the play time, the i-th receiving time, the wave speed and the length of the first connecting line, the length of the i-th connecting line between the obstacle and the i-th microphone is calculated; the i-th receiving time is the time when the i-th microphone receives the valid echo; i is an integer greater than or equal to 2; The first space coordinate is calculated based on the length of the first connecting line and the length of each i-th connecting line.

5. The method according to claim 4, characterized in that The microphone array includes three microphones; The calculating the first space coordinate based on the length of the first connecting line and the length of each i-th connecting line comprises: Based on the length of the first connecting line, the length of the second connecting line and the first line segment, a first angle is obtained; the first angle is the angle between the first connecting line and the first line segment; the first line segment indicates the distance between the first microphone and the second microphone; Based on the length of the first connecting line, the length of the third connecting line and the second line segment, a second angle is obtained; the second angle is the angle between the first connecting line and the second line segment; the second line segment indicates the distance between the first microphone and the third microphone; The first space coordinate is obtained based on the first angle, the second angle and the length of the first connecting line.

6. The method according to claim 5, characterized in that The obtaining the first spatial coordinate based on the first angle, the second angle, and the length of the first connecting line includes: Based on the first angle and the length of the first connecting line, obtaining a value of the first spatial coordinate on the x-axis; Based on the second angle and the length of the second connecting line, obtaining the value of the first spatial coordinate on the y-axis; Based on the second angle, the length of the first connecting line and the value of the first spatial coordinate on the x-axis, the value of the first spatial coordinate on the z-axis is obtained.

7. The method according to claim 5, characterized in that The determining of the rotation angle based on the first spatial coordinates and the to-be-adjusted shooting area of ​​the camera includes: Determine a first pitch angle of the camera, where the first pitch angle is an angle between the center line of the shooting area to be adjusted and a first preset plane; Determine a first direction angle of the camera, where the first direction angle of the camera is the angle between the center line of the shooting area to be adjusted and a second preset plane; Determine a second pitch angle of the obstacle, where the second pitch angle is the angle between the first connecting line and the projection; the projection is the projection of the first connecting line on the first preset plane; Determine a second direction angle of the obstacle, where the second direction angle is the angle between the projection and the first line segment; The rotation angle is determined based on the first pitch angle, the first direction angle, the second pitch angle, and the second direction angle.

8. The method according to claim 7, characterized in that The determining the rotation angle based on the first pitch angle, the first direction angle, the second pitch angle and the second direction angle comprises: When the first pitch angle matches the second pitch angle, and the first direction angle matches the second direction angle, the rotation angle is 0°; or When the first pitch angle does not match the second pitch angle, and the first direction angle matches the second direction angle, determining the rotation angle based on the first pitch angle and the second pitch angle; or When the first pitch angle matches the second pitch angle, and the first direction angle does not match the second direction angle, determining the rotation angle based on the first direction angle and the second direction angle; or When the first pitch angle does not match the second pitch angle, and the first direction angle does not match the second direction angle, the rotation angle is determined based on the first pitch angle, the second pitch angle, the first direction angle, and the second direction angle.

9. The method according to claim 1, characterized in that: The generating of ultrasonic waves and playing of the ultrasonic waves include: Generate the ultrasonic wave based on the sound wave generator; The ultrasonic wave is played based on a loudspeaker; the coordinates of the loudspeaker and the sound wave generator are fifth spatial coordinates; and the fifth spatial coordinates are the same as the second spatial coordinates.

10. A device for controlling a camera based on ultrasonic wave, characterized in that: include: Camera, ultrasonic module, receiving module, calculation module, determination module and guidance module; The ultrasonic module is used to generate ultrasonic waves and play the ultrasonic waves; The receiving module is used to receive a valid echo; the valid echo is the ultrasonic wave reflected by an obstacle; The calculation module is used to obtain the play time and the receiving time, and calculate the first spatial coordinates of the obstacle based on the play time, the receiving time and the wave speed; the play time is the play time of the ultrasonic wave; the receiving time is the time of receiving the effective echo; the wave speed is the propagation speed of the ultrasonic wave in the air; the first spatial coordinate is the coordinate of the preset coordinate system; The determination module is used to determine a rotation angle based on the first spatial coordinates and the shooting area to be adjusted of the camera; the rotation angle is an angle between a first connecting line and a midline of the shooting area to be adjusted; the two ends of the first connecting line are the first spatial coordinates and the second spatial coordinates respectively; the second spatial coordinates are the coordinates of the camera; the second spatial coordinates are the coordinates of the preset coordinate system; The guiding module is used to guide the camera to rotate based on the rotation angle to obtain a target shooting area of ​​the camera; the center line of the target shooting area passes through the first space coordinate.

11. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory is used to store at least one program, and the at least one program is loaded by the processor and executes the method for controlling a camera based on ultrasonic waves as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one program, and the at least one program is loaded and executed by a processor to implement the method for controlling a camera based on ultrasonic waves as described in any one of claims 1 to 9.