Focusing method, projector and storage medium

The time-of-flight distance measuring sensor obtains the distance and angle information after the projector moves, calculates and determines the actual distance and adjusts the position of the optical machine motor, solving the problem of long-term focus and poor accuracy after the projector moves, and achieving efficient and accurate focus process.

CN119110040APending Publication Date: 2024-12-10CHENGDU XGIMI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310682532.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-09
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

The projector needs to focus frequently after moving to ensure clear picture, and the prior art takes a long time and has poor accuracy.

Method used

The time-of-flight distance measuring sensor is used to obtain the distance and angle information after the projector moves, and focus is achieved by calculating and determining the actual distance and adjusting the position of the optical machine motor.

Benefits of technology

Improves the efficiency and accuracy of focus, reduces the focus time and ensures the projected image is clear.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119110040A_ABST
    Figure CN119110040A_ABST
Patent Text Reader

Abstract

The invention discloses a focusing method, a projector and a storage medium, and the method comprises the steps: obtaining at least one distance measurement value which is collected by a flight time distance measurement sensor on the projector and is away from a projection area, and at least one distance measurement angle which is in one-to-one correspondence with the at least one distance measurement value, and a pitch angle of the time-of-flight ranging sensor relative to the projector; determining an actual distance from the projector to the projection area based on the at least one distance measurement value, the at least one distance measurement angle and the pitch angle; and determining a target position of a ray machine motor on the projector based on the actual distance, and adjusting the ray machine motor to the target position to realize focusing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of projectors, and in particular to a focusing method, a projector and a storage medium. Background Art

[0002] In daily use, projectors often need to be moved due to uncertain usage scenarios. Every time the placement of the projector is changed, the focal length of the current optical machine on the projector will not match the actual usage scenario, which will cause the projected image to become blurred.

[0003] In the prior art, for the above scenario, the user needs to perform a second focus after each movement of the projector to ensure that the projection image is clear, or adjust the focus based on the projection image, which makes the focusing time-consuming and the accuracy poor. Summary of the invention

[0004] The embodiments of the present application are intended to provide a focusing method, a projector, and a storage medium.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] An embodiment of the present application provides a focusing method, which is applied to a projector. The method includes: after detecting the movement of the projector, obtaining at least one ranging value from a projection area collected by a time-of-flight ranging sensor on the projector, at least one ranging angle corresponding to the at least one ranging value, and a pitch angle of the time-of-flight ranging sensor relative to the projector; determining an actual distance between the projector and the projection area based on the at least one ranging value, the at least one ranging angle, and the pitch angle; determining a target position of an optical motor on the projector based on the actual distance, and adjusting the optical motor to the target position to achieve focusing.

[0007] The present application provides a projector, including:

[0008] an acquisition module, configured to acquire, after detecting movement of the projector, at least one ranging value from a projection area acquired by a time-of-flight ranging sensor on the projector, at least one ranging angle corresponding to the at least one ranging value, and a pitch angle of the time-of-flight ranging sensor relative to the projector;

[0009] A determination module, configured to determine an actual distance between the projector and the projection area based on the at least one ranging value, the at least one ranging angle, and the pitch angle;

[0010] The adjustment module is used to determine the target position of the optical motor on the projector based on the actual distance, and adjust the optical motor to the target position to achieve focusing.

[0011] An embodiment of the present application provides a projector, comprising: a processor, a memory and a communication bus; the communication bus is used to realize a communication connection between the processor and the memory; the processor is used to execute a computer program stored in the memory to realize the above-mentioned focusing method.

[0012] An embodiment of the present application provides a computer-readable storage medium, which stores one or more computer programs. The one or more computer programs can be executed by one or more processors to implement the above-mentioned focusing method.

[0013] The embodiment of the present application provides a focusing method, a projector and a storage medium, the method comprising: after detecting the movement of the projector, obtaining at least one ranging value from the projection area collected by the time-of-flight ranging sensor on the projector, at least one ranging angle corresponding to the at least one ranging value, and the pitch angle of the time-of-flight ranging sensor relative to the projector; determining the actual distance between the projector and the projection area based on the at least one ranging value, the at least one ranging angle, and the pitch angle; determining the target position of the optical motor on the projector based on the actual distance, and adjusting the optical motor to the target position to achieve focusing. The technical solution provided by the present application can accurately determine the actual distance between the projector and the projection area based on the at least one ranging value collected by the time-of-flight ranging sensor, the angle corresponding to each ranging value, and the pitch angle of the time-of-flight ranging sensor itself after the projector moves, and then determine the target position where the current optical motor should be located based on the accurately determined actual distance to achieve focusing, thereby improving the efficiency and accuracy of focusing. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 A schematic diagram of a flow chart of a calibration distance and focus relationship provided in an embodiment of the present application;

[0015] Figure 2 A flowchart of a focusing method provided in an embodiment of the present application;

[0016] Figure 3 A schematic diagram of an exemplary process for determining an actual distance provided in an embodiment of the present application;

[0017] Figure 4 An exemplary process for determining a target location provided in an embodiment of the present application is shown in FIG. Figure 1 ;

[0018] Figure 5 An exemplary process for determining a target location provided in an embodiment of the present application is shown in FIG. Figure 2 ;

[0019] Figure 6An exemplary process for determining a target location provided in an embodiment of the present application is shown in FIG. Figure 3 ;

[0020] Figure 7 An exemplary real-time focusing process provided in the embodiment of the present application is shown in FIG. Figure 1 ;

[0021] Figure 8 A schematic diagram of an exemplary process of determining a final position provided in an embodiment of the present application;

[0022] Fig. 9 An exemplary real-time focusing process provided in the embodiment of the present application is shown in FIG. Figure 2 ;

[0023] Fig.10 A schematic diagram of a projector provided in an embodiment of the present application Figure 1 ;

[0024] Fig.11 A schematic diagram of a projector provided in an embodiment of the present application Figure 2 . DETAILED DESCRIPTION

[0025] The technical solution in the present application will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present application. It is to be understood that the specific embodiments described herein are only used to explain the related application, rather than to limit the application. It should also be noted that, for ease of description, only the parts related to the related application are shown in the accompanying drawings.

[0026] An embodiment of the present application provides a focusing method, which is implemented by a projector. Before the projector implements the focusing method, the pre-calibrated distance between the projector and the projection area and the focusing relationship of the optical motor are obtained from the calibration end. Then, when the projector implements the focusing method, the position of the optical motor on the projector is adjusted in real time according to the pre-calibrated focusing relationship in response to the distance changes that occur during the movement of the projector to achieve focusing.

[0027] The following is a detailed description of the specific process of calibrating the relationship between the distance of the projector from the projection area and the focusing of the optical motor at the calibration end:

[0028] Step S101, point the projector directly at the wall and project an image.

[0029] Here, the projector can be located 0.5m away from the wall (projection area). The distance from the wall can be adjusted according to the actual product positioning, and a black and white text image can be projected (the image is projected to the projection area). Of course, it can also be other images with obvious textures, or other images whose clarity can be measured. This application does not impose any restrictions on this.

[0030] In the embodiments of the present application, taking into account the differences in the optical motors, projection distances, etc. of different projectors, the projector, in the process of implementing the focusing method, obtains the focusing relationship calibrated by the calibration end based on the projector data of the same product as the current projector. In this way, the problem of poor focusing effect caused by differences in focusing relationships due to different products can be effectively avoided.

[0031] Step S102 , adjusting the optical-mechanical motor until the projection image is clearest, and recording the optical-mechanical motor position p1 at this time.

[0032] Here, after moving the projector, the clarity of the projected image is calculated through the camera. At this time, the calibration end can use a clarity calculation algorithm to obtain the clarity of the projected image, and adjust the position of the optomechanical motor on the projector in real time according to the calculated clarity, so as to adjust the optomechanical motor to the position where the projection image is clearest, and record the optomechanical motor position p1 at this time.

[0033] Step S103: Obtain all ranging values ​​of the multi-point tof sensor directly in front of the projector, all angles between the ranging values ​​and the normal, and the pitch angle.

[0034] Here, the calibration end obtains all the ranging values ​​(d1, d2, ..., dn) collected by the time of flight (tof) ranging sensor on the projector, where each ranging value corresponds to a ranging angle, which is the angle between each ranging value and the normal of the projection area, so that the angles (ranging angles) between all ranging values ​​and the normal can be obtained (θ1, θ2, ..., θn). The pitch angle here is the pitch angle α of the multi-point tof sensor relative to the projector.

[0035] Step S104: Calculate the distance τ and the error ε from the actual distance by combining all the distance measurement values ​​of the multi-point tof sensor, the angles between all the distance measurement values ​​and the normal, and the pitch angle.

[0036] Here, each tof distance measurement point (corresponding to a distance measurement value) is the exact distance (projected vertical distance) from the wall, and the calculated distance τ is determined based on the calculated accurate distance. Each distance measurement value corresponds to the distance between a distance measurement point and the wall. For the specific distance determination method, see formula (1):

[0037] τ 1i=1…n =d i=1…n *cos(α+θ i=1…n ) (1);

[0038] Among them, τ 1i is the vertical distance of the projection corresponding to the i-th distance measurement value when the projector is at position 1 (0.5m from the wall), d iis the i-th distance measurement value, θ i is the ranging angle corresponding to the i-th ranging value, and α is the pitch angle.

[0039] After the projection vertical distance is determined at the calibration end, the average of the obtained projection vertical distance can be calculated. The specific formula is shown in formula (2):

[0040] τ1=(τ 11 +…+τ 1n ) / n (2);

[0041] Wherein, τ1 is the calculated distance between the projector and the projection area when the projector is at position 1.

[0042] Of course, the distance can also be calculated in other ways. For example, the projection area is divided into multiple sub-areas, each sub-area has a different ranging weight, and the ranging confidence weight set for the sub-area at the edge of the projection area is lower, and the ranging confidence weight set for the sub-area in the middle of the projection area is higher. In this way, the ranging error caused by the instability of the edge ranging can also be avoided.

[0043] In the embodiment of the present application, considering that there is an error between the calculated distance τ1 and the actual distance, in order to make the projector more accurate when used, the distance error needs to be calibrated.

[0044] For example, the error calibration method is shown in formula (3):

[0045] ε j =τ j -τ r (3);

[0046] Among them, ε j is the distance error, τ j To calculate the distance, τ r is the true distance. When j is 1, it represents the distance error corresponding to τ1.

[0047] If the projector is an automatically movable projector, the calibration end will also record the position of the moving motor on the projector at this time: r1.

[0048] Step S105, adjust the posture of the projector to project at a preset left angle and a preset right angle. Repeat the above steps S101 to S104, and record the distance τ′1, τ″1 between the projector and the wall, and the corresponding optical motor positions p1′, p1″.

[0049] The preset angle here can be 30 degrees. Of course, it can be other angles depending on the product type of the projector, and this application does not limit it.

[0050] Among them, if the projector is an automatically movable projector, the projector can be driven to project to the left at a preset angle and to the right at a preset angle, and the deflection angle of the projector at this time can be recorded: β'1, β'1′. If the preset angle is 30 degrees, the deflection angle at this time may also be 30 degrees, or it may have a slight deviation.

[0051] Step S106: adjust the position of the projector to increase the distance between the projector and the wall.

[0052] Here, the calibration end is discussed using 0.5m, 0.6m, 0.7m, ..., 1m as an example, that is, the projector is moved to 0.6m, 0.7m, 0.8m, 0.9m, and 1m away from the wall. The position of the projector and the distance interval between the projector and the wall can be set according to the product type and application scenario, which is not limited in this application.

[0053] Step S107: determine whether the distance from the wall exceeds the set maximum distance.

[0054] Here, since 0.5m, 0.6m, 0.7m, ..., 1m are used as examples for discussion, the maximum distance is set to 1m. At this time, if the distance from the wall does not exceed the set maximum distance of 1m, repeat the above steps S101 to S105 respectively, and record the optical motor positions: p2, p2', p2", ..., p6, p6', p6" and the distance from the projector to the wall: τ1, τ1', τ1", ..., τ6, τ6', τ6".

[0055] It should be noted that after obtaining the calculated distances τ1, τ2, ..., τ6 and obtaining the distance error at each position point in ε1 = τ1-0.5, ..., ε6 = τ6-1 according to the above formula (3), the average error can also be calculated. For the specific calculation formula, see formula (4):

[0056] ε=(ε1+…+ε6) / 6 (4);

[0057] In this way, the calibration end can obtain the distance error of each calculated distance calibration for the projector to obtain and use in the focusing process.

[0058] Alternatively, if the projector is an automatically movable projector, the projector is driven to move to 0.6m, 0.7m, ..., 1m from the wall, respectively. And the positions r2, r3, ..., r6 of the movable motor at this time, and the deflection angles β2', β2", ..., β6', β6" of the projector are recorded.

[0059] For a projector that cannot be moved automatically, the calibration end can obtain the optical motor position p of the projector at 0.6m, 0.7m,..., 1m away from the wall, and the distance from the wall (projection distance) τ, τ', τ". For a projector that can be moved automatically, the calibration end will obtain the mobile motor position r at 0.6m, 0.7m,..., 1m, and the deflection angles β', β" while obtaining the above information.

[0060] If the distance from the wall exceeds the set maximum distance (1 m), step S108 is executed.

[0061] Step S108: Calibration ends.

[0062] After completing the above calibration, the calibration end can obtain the corresponding relationship between the projection distance τ and the optical motor position p, the corresponding relationship between the deflection angle β and the optical motor position p, and the corresponding relationship between the projection distance τ and the optical motor position, and the corresponding relationship between the mobile motor position r and the optical motor position p for the projector to obtain and use in the focusing process. These corresponding relationships are based on the projector being 0.6m, 0.7m, ·······, 1m away from the wall.

[0063] Of course, at this time, the calibration end can also calibrate the position change △rij of the moving motor from position i to position j, and the position change △pij of the optical motor to make the projection picture clear. At this time, i and j are any position corresponding to multiple projection distances calibrated at 0.5m, 0.7m,..., 1m.

[0064] For example, the projector is moved from position 1 (0.5m) to position 6 (1m), and the movement variable △r16 of the moving motor at this time is recorded, as well as the optical motor position offset (variation) △p16 when the projection image is clear. In this way, △r21-△r26,.......,△r61-△r66, and the corresponding optical motor position offsets Δp21-Δp26,......,Δp61-Δp66 can be obtained. Among them, when i and j are the same, △rij is 0, △pij is 0, for example, △r66 is 0, Δp66 is 0.

[0065] In this way, the calibration can obtain the relationship between the projection distance and the position change of different moving motors, for example, the projection distance τ1 corresponds to △r11-△r16. The corresponding relationship between the moving motor position change and the optical motor change can also be obtained, that is, △r11-△r16 corresponds to Δp11-Δp16, for the projector to obtain and use in the focusing process. Among them, △r11 corresponds to Δp11.

[0066] After the calibration is completed at the calibration end, the projector can directly obtain the calibration information from the calibration end, and then use it in the projector to implement the focusing process. Figure 2 As shown, the steps S201 to S203 are included:

[0067] Step S201: after detecting the movement of the projector, obtaining at least one ranging value from the projection area collected by a time-of-flight ranging sensor on the projector, at least one ranging angle corresponding to the at least one ranging value, and a pitch angle of the time-of-flight ranging sensor relative to the projector.

[0068] In an embodiment of the present application, the projector is an electronic device with a focus function. The projector can be an automatically movable projector or a non-automatically movable projector. If the projector is a non-automatically movable projector, the movement of the projector at this time is by means of an external force. If the projector is an automatically movable projector, the movement at this time can be based on the mobile motor included in the projector itself. The time of flight (TOF) ranging sensor on the projector can be a multi-point TOF ranging sensor, a single-point TOF ranging sensor, or a surface TOF ranging sensor.

[0069] Exemplarily, take the projector as a short-focus projector and the TOF ranging sensor as a multi-point TOF ranging sensor as an example for discussion: when the user places the short-focus projector in the home environment and adjusts the projection angle (or after the projector is moved), obtain the current ranging value (d1, d2, ..., dn) of the multi-point TOF directly in front of the projector at this time, obtain the angles (ranging angles) (θ1, θ2, ..., θn) between all ranging and the normal when the multi-point TOF sensor (multi-point TOF ranging sensor) is facing the wall, and obtain the pitch angle α of the multi-point TOF sensor equipped on the front of the short-focus projector.

[0070] Step S202: Determine the actual distance between the projector and the projection area based on at least one ranging value, at least one ranging angle, and a pitch angle.

[0071] In an embodiment of the present application, after obtaining at least one ranging value, at least one ranging angle, and a pitch angle, the projector can determine the actual distance between the projector and the projection area based on the at least one ranging value, at least one ranging angle, and the pitch angle.

[0072] Exemplarily, for each of the at least one ranging value, the projector can determine a projection vertical distance based on its corresponding ranging angle and pitch angle to obtain at least one projection vertical distance d i , and then based on at least one projected vertical distance d iDetermine the actual distance of the projector from the projection area.

[0073] Step S203: determine the target position of the optical motor on the projector based on the actual distance, and adjust the optical motor to the target position to achieve focusing.

[0074] In an embodiment of the present application, the projector determines a target position of an optical-mechanical motor on the projector based on an actual distance, and adjusts the optical-mechanical motor to the target position to achieve focusing.

[0075] In an embodiment of the present application, the optomechanical motor is a motor for adjusting the projection focal length. After determining the actual distance, the projector can determine the target position of the optomechanical motor on the projector based on the actual distance, and then adjust the optomechanical motor to the target position to achieve focus, so that the projection image in the projection area is clear.

[0076] Compared with the prior art, when the projector moves, the user is required to perform secondary focusing to ensure a clear projection image, which easily leads to problems of low focusing efficiency and poor accuracy.

[0077] The present application directly determines the actual distance between the projector and the projection area based on at least one ranging value collected by the time-of-flight ranging sensor, the angle corresponding to each ranging value, and the pitch angle of the time-of-flight ranging sensor itself, and then determines the target position of the current optical motor based on the accurately determined actual distance to achieve focusing, thereby improving the efficiency and accuracy of focusing.

[0078] In some embodiments, the above step S202 may include the following steps S301 to S303:

[0079] Step S301: for each ranging value in at least one ranging value, determine the corresponding projection vertical distance using the corresponding ranging angle and pitch angle, and obtain at least one projection vertical distance corresponding to the at least one ranging value; each projection vertical distance is a vertical distance between the projector and the projection area determined based on one ranging value.

[0080] For example, the projector is a short-throw projector and the TOF distance measurement sensor is a multi-point TOF distance measurement sensor. At this time, the projector obtains the current distance measurement value (d1, d2, ..., dn) of the multi-point TOF, the angles between all distance measurements and the normal (distance measurement angle) (θ1, θ2, ..., θn), and the pitch angle α. The projection vertical distance corresponding to each distance measurement value can be determined according to the formula (1) in the above step S104.

[0081] Step S302: determine an average value of at least one projection vertical distance, and determine the average value as the calculated distance between the projector and the projection area.

[0082] In an embodiment of the present application, after the projector determines the projection vertical distance corresponding to each ranging value and obtains at least one projection vertical distance, it averages the at least one projection vertical distance to obtain the calculated distance. For the specific calculation process, see formula (2) in the above step S104.

[0083] Step S303: Obtain a pre-calibrated distance error corresponding to the calculated distance, and determine the actual distance based on the calculated distance and the distance error.

[0084] In an embodiment of the present application, after obtaining the calculated distance, the projector can obtain a pre-calibrated distance error corresponding to the calculated distance. For example, if the calculated distance calculated at this time is 0.59m, that is, the 0.59m is closest to the multiple real distances of 0.6m in the above steps, then the distance error ε2 corresponding to 0.6m can be used as the distance error corresponding to it, or the average error ε can be used as the distance error corresponding to it. The specific distance error can be set according to the actual situation and application scenario, and this application does not limit this.

[0085] Exemplarily, after obtaining the distance error, the projector determines the sum of the calculated distance and the distance error as the actual distance. For a specific actual distance calculation formula, see formula (5):

[0086] d = τ + ε (5);

[0087] Where d is the actual distance, τ is the calculated distance, and ε is the distance error.

[0088] Here, after calculating the distance, the projector also takes into account the error of the calculated distance, so that the actual distance calculated is more accurate.

[0089] In some embodiments, the above step S203 may include the following steps S401 to S404:

[0090] Step S401, obtaining a pre-calibrated corresponding relationship between the projection distance and the position of the optical motor; the corresponding relationship between the projection distance and the position of the optical motor includes the position of the optical motor corresponding to each projection distance among a plurality of projection distances.

[0091] In an embodiment of the present application, the projector obtains a pre-calibrated correspondence between the projection distance and the optical motor position from the calibration end. For an exemplary correspondence between the projection distance and the optical motor position, refer to the correspondence between the projection distance τ and the optical motor position p obtained after the calibration of the above step S108 is completed, that is, the correspondence between τ1 and p1,..., the correspondence between τ6 and p6.

[0092] Step S402: Select a first distance that is smaller than the actual distance and has the smallest numerical difference, and a second distance that is larger than the actual distance and has the smallest numerical difference from the multiple projection distances.

[0093] Exemplarily, referring to the multiple projection distances calibrated in step S107 as τ1, ..., τ6, compare between which two projection distances the actual distance d is located, for example, d is between τ3 and τ4, then τ3 is the first distance and τ4 is the second distance.

[0094] Step S403 : searching, from the corresponding relationship between the projection distance and the optical-mechanical-motor position, the first optical-mechanical-motor position corresponding to the first distance and the second optical-mechanical-motor position corresponding to the second distance.

[0095] Exemplarily, after knowing the first distance τ3 and the second distance τ4, the projector can directly find the first optomechanical motor position p3 corresponding to the first distance τ3 and the second optomechanical motor position p4 corresponding to the second distance τ4 from the corresponding relationship between the projection distance and the optomechanical motor position.

[0096] Step S404 , determining a target position based on the first distance, the second distance, the first optical-mechanical motor position, the second optical-mechanical motor position, and the actual distance.

[0097] Exemplarily, after the projector knows the first distance τ3, the second distance τ4, the first optical motor position p3, the second optical motor position p4, and the actual distance d, the target position pt can be determined. The determination process can be: multiplying the difference between the second distance and the first distance and the difference between the second optical motor position and the first optical motor position to obtain a first product; comparing the difference between the actual distance and the first distance and the first product to obtain a first ratio; and determining the sum of the first ratio and the first distance as the first position. The specific determination formula is shown in formula (6):

[0098] pf=(d-τ3) / τ4-τ3)*(p4-p3)+p3 (6);

[0099] Among them, pf is the first position, τ3 is the first distance, τ4 is the second distance, p3 is the first optical motor position, and p4 is the second optical motor position.

[0100] If the projector is a non-automatic moving projector, the projector can directly determine the calculated first position as the target position. After obtaining the target position, the projector can adjust the optical motor to the target position to achieve focus. When the user is adjusting the projector, directly repeating the above steps S102 to S104, steps S301 to S303, and steps S401 to S404, the optical motor can be adjusted in real time according to the distance between the projector and the wall, and the real-time picture can be clear.

[0101] If the projector is an automatically movable projector, the projector needs to further determine the target position based on the first position. Specifically, the projector may determine the target position based on the first position including the following steps S501 to S505:

[0102] Step S501: Obtain the side projection angle of the projector.

[0103] Here, for the automatically movable projector, the projector can obtain the side projection angle of the projector: β through a rotation motor on the projector.

[0104] Step S502, obtaining a pre-calibrated correspondence between a deflection angle and an optomechanical motor position; the correspondence between a deflection angle and an optomechanical motor position includes an optomechanical motor position corresponding to each of a plurality of deflection angles.

[0105] Exemplarily, the correspondence between the pre-calibrated deflection angle and the optomechanical motor position obtained by the projector refers to the correspondence between the deflection angle β and the optomechanical motor position p in the above step S105: β1′ corresponds to p1′, β1″ corresponds to p1″, ..., β6′ corresponds to p6′, β6″ corresponds to p6″.

[0106] Step S503: Select a first angle that is smaller than the deflection angle and has the smallest numerical difference, and a second angle that is larger than the deflection angle and has the smallest numerical difference from the multiple deflection angles.

[0107] For example, in the above step S403, the projector knows that d is between τ3 and τ4, so now it only needs to determine the position of the deflection angle β between β'-β". If β is between β3' and β3, the first angle is β3 and the second angle is β3'.

[0108] Step S504 , searching for the third optomechanical motor position corresponding to the first angle and the fourth optomechanical motor position corresponding to the second angle from the corresponding relationship between the deflection angle and the optomechanical motor position.

[0109] Exemplarily, after knowing that the first angle is β3 and the second angle is β3′, the projector can directly find the third optomechanical motor position p3 corresponding to the first angle β3 and the fourth optomechanical motor position p3′ corresponding to the second angle β3′ from the correspondence between the deflection angle and the optomechanical motor position.

[0110] Step S505 , determining a target position based on the first angle, the second angle, the third optomechanical motor position, the fourth optomechanical motor position, and the first position.

[0111] Exemplarily, after the projector knows that the first angle is β3, the second angle is β3′, the third optical motor position p3, the fourth optical motor position p3′, and the first position, the target position pf can be determined. The implementation process of determining the target position based on the first position is: multiplying the difference between the second angle and the first angle and the difference between the third optical motor position and the fourth optical motor position to obtain a second product; comparing the difference between the side projection angle and the first angle with the second product to obtain a second ratio; and determining the sum of the second ratio and the third optical motor position as the target position. For the specific determination formula, see formula (7):

[0112] pt=(β-β3) / (β'3-β3)*(p3′-p3)+pf (7);

[0113] Among them, the target position is pt, β3 is the first angle, β3′ is the second angle, p3 is the third optical motor position, p3′ is the fourth optical motor position, and the first position is pf.

[0114] In some embodiments, if the projector is an automatically movable projector, before determining the target position, the projector will drive the moving motor to move forward and backward to complete the keystone correction, and when the projector is driven to move by the moving motor installed on the projector, the above step S203 may also include the following steps S601 to S605:

[0115] Step S601: Obtain a target moving motor position corresponding to an actual distance from a preset corresponding relationship between a projection distance and a moving motor position.

[0116] Here, the preset projection distance and the mobile motor position correspondence relationship is a relationship obtained by the projector in advance during the process of completing the trapezoidal correction by driving the mobile motor to move forward and backward. Therefore, after determining the actual distance, the target mobile motor position r' corresponding to the actual distance can be directly obtained from the preset projection distance and the mobile motor position correspondence relationship. The target mobile motor position is the position of the mobile motor recommended based on the trapezoidal correction when the projection distance is the actual distance.

[0117] Step S602, obtaining a pre-calibrated correspondence between a moving motor position and an optomechanical motor position; the correspondence between a moving motor position and an optomechanical motor position includes an optomechanical motor position corresponding to each moving motor position in a plurality of moving motor positions.

[0118] Here, since the calibration end has pre-calibrated the correspondence between the mobile motor position and the optomechanical motor position, here, the projector can be directly obtained from the calibration end. The correspondence between the mobile motor position and the optomechanical motor position includes the optomechanical motor position corresponding to each of the multiple mobile motor positions. Exemplarily, since in the above step S104, the position of the mobile motor is also recorded for the automatically movable projector, and the mobile motor positions r at 0.6m, 0.7m,..., 1m are obtained in step S107, the multiple mobile motor positions are: r1, r2,..., r6 corresponding to 0.6m, 0.7m,..., 1m; the optomechanical motor position corresponding to each mobile motor position is: r1 corresponds to p1, r2 corresponds to p2,..., r6 corresponds to p6.

[0119] Step S603 , selecting a first moving motor position that is closer to the target moving motor position and has the shortest distance therefrom, and a second moving motor position that is farther from the target moving motor position and has the shortest distance therefrom, from the plurality of moving motor positions.

[0120] Here, the projector selects the first moving motor position and the second moving motor position from the plurality of moving motor positions according to the target moving motor position. An exemplary selection method is as follows: assuming that the target moving motor position is r', since r1 to r6 are arranged from near to far in terms of position, r' is bound to be located between the two moving motor positions. If it is located between r3 and r4, then the first moving motor position selected here that is closer to the target moving motor position and has the smallest distance is r3, and the second moving motor position selected that is farther from the target moving motor position and has the smallest distance is r4.

[0121] Step S604 , searching the fifth optomechanical motor position corresponding to the first moving motor position and the sixth optomechanical motor position corresponding to the second moving motor position from the correspondence between the moving motor position and the optomechanical motor position.

[0122] Here, the calibration end pre-calibrates the correspondence between the moving motor position r and the optical motor position p. The projector directly obtains the correspondence and searches for the fifth optical motor position p3 corresponding to the first moving motor position r3 and the sixth optical motor position p4 corresponding to the second moving motor position r4 from the correspondence.

[0123] Step S605 , determining a target position based on the first moving motor position, the second moving motor position, the fifth optomechanical motor position, the sixth optomechanical motor position, and the target moving motor position.

[0124] Exemplarily, after the projector knows the first moving motor position r3, the second moving motor position r4, the fifth optical motor position p3, the sixth optical motor position p4, and the target moving motor position r', the target position pt can be determined. The determination process can be: multiplying the difference between the second moving motor position and the first moving motor position and the difference between the sixth optical motor position and the fifth optical motor position to obtain a third product; comparing the difference between the target moving motor position and the second moving motor position and the third product to obtain a third ratio; and determining the sum of the third ratio and the fifth optical motor position as the target position. The specific determination formula is shown in formula (8):

[0125] pt=(r'-r4) / (r4-r3)*(p4-p3)+p3 (8);

[0126] Among them, pt is the target position, r3 is the first moving motor position, r4 is the second moving motor position, p3 is the fifth optical motor position, p4 is the sixth optical motor position, and r' is the target moving motor position. After obtaining the target position, the projector can adjust the optical motor to the target position to achieve focus.

[0127] In some embodiments, the projector is an automatically movable projector, that is, a movable motor is installed on the projector, so that it can still move forward and backward after determining the actual distance. Then, after the projector determines the actual distance, if the projector moves forward and backward, the actual distance between the projector and the projection area has changed. The target position of the projector's polishing motor determined based on the actual distance can no longer meet the current projector after the distance change. At this time, the projector needs to consider the change in the movable motor on the basis of the actual distance to determine the target position of the projector's polishing motor. In this way, after executing the above step S203, the projector can also execute the following steps S701 to S705:

[0128] Step S701: Obtain the movement position change of the movement motor on the projector.

[0129] Here, since the moving motor installed on the automatically movable projector can drive the projector to move, when the projector detects that the projector moves again, the moving position change of the moving motor on the projector is obtained. For example, if the position of the moving motor before the movement is r0 and after the movement is r', then the moving position change is △r = r'-r0.

[0130] Step S702: acquiring the projection distance with the smallest difference from the actual distance from a plurality of pre-calibrated projection distances to obtain the target projection distance.

[0131] Here, the actual distance is calculated by the projector in step S505. Here, the projector selects the projection distance with the smallest difference from the actual distance from the pre-calibrated multiple projection distances to obtain the target projection distance. For example, if the actual distance is d, and the pre-calibrated multiple projection distances are τ1, ······, τ6, the actual distance d is compared with which projection distance is closest, for example, d is closest to τ i closest, then τ i is the target projection distance.

[0132] Step S703, obtaining a pre-calibrated correspondence between projection distances and different mobile motor position changes; the correspondence between projection distances and mobile motor position changes includes multiple mobile motor position changes corresponding to each of the multiple projection distances.

[0133] Here, it can be seen from the above step S106 that the corresponding relationship between the projection distance obtained by the projector and the change in the position of the mobile motor includes that each of the multiple projection distances corresponds to multiple changes in the position of the mobile motor. Exemplarily, τ1 corresponds to △r11-△r16, τ2 corresponds to △r21-△r26, ..., τ6 corresponds to △r61-△r66. It can be seen that each change in the position of the mobile motor actually has a direction, that is, △r16 and △r61 have different directions.

[0134] Step S704: acquiring a plurality of target moving motor position changes corresponding to the target projection distance from the corresponding relationship between the projection distance and different moving motor position changes.

[0135] Here, after the projector determines the target projection distance and obtains the corresponding relationship between the projection distance and the position changes of different mobile motors, it can obtain multiple target mobile motor position changes corresponding to the target projection distance from the corresponding relationship between the projection distance and the position changes of different mobile motors. For example, if the target projection distance is τ i , then the obtained position changes of multiple target moving motors are △ri1-△ri6.

[0136] Step S705 , determining the final position of the optical motor based on the target position, the movement position change, and the position changes of multiple target movement motors, and adjusting the optical motor to the final position to achieve real-time focusing.

[0137] Here, after obtaining the target position, the change in the moving position, and the change in the positions of multiple target moving motors, the projector can determine the final position of the optical motor, and then adjust the optical motor to the final position to achieve real-time focusing. It can be understood that the present application can achieve a real-time clear effect by adjusting the optical motor in real time according to the movement of the projector.

[0138] In some embodiments, the above step S704 may include the following steps S801 to S805:

[0139] Step S801 , selecting a first moving motor position change amount that is smaller than the moving position change amount and has the smallest difference, and a second moving motor position change amount that is larger than the moving position change amount and has the smallest difference from the moving position change amount from a plurality of target moving motor position change amounts.

[0140] Here, the projector selects the first moving motor position change amount and the second moving motor position change amount from a plurality of target moving motor position change amounts according to the moving position change amount. An exemplary selection method is: if the moving position change amount is △r, it is determined between which two moving motor position change amounts of △ri1-△ri6 the △r is located, and if it is between △ri3 and △ri4, then the projector selects the first moving motor position change amount that is smaller than the moving position change amount and has the smallest difference as △ri3, and selects the second moving motor position change amount that is larger than the moving position change amount and has the smallest difference as △ri4.

[0141] Step S802 , obtaining a first optical motor position change corresponding to the first moving motor position change and a second optical motor position change corresponding to the second moving motor position change from the pre-calibrated correspondence between the moving motor position change and the optical motor position change.

[0142] Here, the calibration end calibrates the correspondence between the mobile motor position change and the optomechanical motor position change. For example, after determining that the first mobile motor position change is △ri3 and the second mobile motor position change is △ri4, the first optomechanical motor position change Δpi3 corresponding to the first mobile motor position change and the second optomechanical motor position change Δpi4 corresponding to the second mobile motor position change can be obtained based on the correspondence between the mobile motor position change and the optomechanical motor position change obtained from the calibration end.

[0143] Step S803 , multiplying the difference between the second moving motor position change and the first moving motor position change and the difference between the second optical motor position change and the first optical motor position change to obtain a fourth product.

[0144] Exemplarily, the difference (△ri4-△ri3) between the second moving motor position change △ri4 and the first moving motor position change △ri3 is multiplied by the difference (Δpi4-Δpi3) between the second optical motor position change Δpi4 and the first optical motor position change Δpi3 to obtain a fourth product (△ri4-△ri3)*(Δpi4-Δpi3).

[0145] Step S804: Compare the difference between the moving position change amount and the first moving motor position change amount with the fourth product to obtain a fourth ratio.

[0146] Exemplarily, the difference (△r-△ri3) between the moving position change △r and the first moving motor position change △ri3 is multiplied by the fourth product (△ri4-△ri3)*(Δpi4-Δpi3) to obtain a fourth ratio (△r-△ri3) / (△ri4-△ri3)*(Δpi4-Δpi3).

[0147] Step S805: determine the sum of the fourth ratio and the target position as the final position.

[0148] Exemplarily, the sum of the fourth ratio (Δr-Δri3) / (Δri4-Δri3)*(Δpi4-Δpi3) and the target position pt is determined as the final position. The specific final position calculation formula is shown in formula (9):

[0149] pu=pt+(Δr-Δri3) / (Δri4-Δri3)*(Δpi4-Δpi3) (9);

[0150] Among them, pu is the final position, pt is the target position, △r is the moving position change, △ri3 is the position change of the first moving motor, △ri4 is the position change of the second moving motor, Δpi3 is the position change of the first optical motor, and Δpi4 is the position change of the second optical motor.

[0151] Fig. 9 The following is a schematic diagram of an exemplary real-time focusing process provided in an embodiment of the present application. Fig. 9 As shown, the following steps S901 to S905 are included:

[0152] Step S901: The user projects the projector onto the wall.

[0153] Here, the user projects the projector onto the wall. If the projector is an automatically movable projector, the projector can be directly controlled by itself to project onto the wall. If the projector is a non-automatically movable projector, the user needs to manually project onto the wall.

[0154] Step S902: Obtain multi-point tof ranging, pitch angle, calibration error and calculate the distance d to the projection surface.

[0155] Here, the projector obtains multi-point tof ranging (ranging value) and pitch angle (pitch angle), and calculates the distance to the projection surface (projection area) based on the multi-point tof ranging and the pitch angle, and then calculates the distance d (actual distance) to the projection surface based on the calibration error (distance error).

[0156] Step S903, calculating the position p to which the optical motor should be adjusted based on d and the pre-calibrated relationship between the distance and the motor, as well as the side projection angle of the projector itself.

[0157] Here, after the projector obtains the actual distance, it can calculate the position p (target position) to which the optical motor on the projector should be adjusted based on the above-mentioned pre-calibrated distance and motor relationship (including various relationships calibrated at the calibration end) and the side projection angle.

[0158] Step S904, adjusting the optical motor to position p.

[0159] Here, after the projector determines the position p, the optical motor on the projector can be adjusted to the position p so that the projection image in the current projection area is clearest.

[0160] Step S905: determine whether the user moves the projector.

[0161] Here, when the projector detects that the projector is moving, the above steps S901 to S904 are repeated to achieve real-time focusing. It can be understood that the present application combines the movable short-throw projector to make the best moving path of the projected image, and dynamically plans the adjustment position of the optical motor to achieve a real-time clear effect.

[0162] The embodiment of the present application provides a focusing method, which is applied to a projector. The method includes: after detecting the movement of the projector, obtaining at least one ranging value from the projection area collected by the time-of-flight ranging sensor on the projector, at least one ranging angle corresponding to the at least one ranging value, and the pitch angle of the time-of-flight ranging sensor relative to the projector; determining the actual distance between the projector and the projection area based on the at least one ranging value, the at least one ranging angle, and the pitch angle; determining the target position of the optical motor on the projector based on the actual distance, and adjusting the optical motor to the target position to achieve focusing. The focusing method provided by the present application can directly determine the actual distance between the projector and the projection area based on the at least one ranging value collected by the time-of-flight ranging sensor, the angle corresponding to each ranging value, and the pitch angle of the time-of-flight ranging sensor itself after the projector moves, and then determine the target position where the current optical motor should be located based on the accurately determined actual distance to achieve focusing, thereby improving the efficiency and accuracy of focusing.

[0163] The present application embodiment provides a projector, such as Fig.10 As shown, including:

[0164] The acquisition module 1001 is used to acquire, after detecting the movement of the projector, at least one ranging value from the projection area collected by the time-of-flight ranging sensor on the projector, at least one ranging angle corresponding to the at least one ranging value, and a pitch angle of the time-of-flight ranging sensor relative to the projector;

[0165] A determination module 1002, configured to determine an actual distance between the projector and the projection area based on at least one ranging value, at least one ranging angle, and a pitch angle;

[0166] The adjustment module 1003 is used to determine the target position of the optical motor on the projector based on the actual distance, and adjust the optical motor to the target position to achieve focusing.

[0167] In one embodiment of the present application, the determination module 1002 is further used to determine, for each ranging value in the at least one ranging value, a corresponding projection vertical distance using a corresponding ranging angle and a pitch angle, to obtain at least one projection vertical distance corresponding to the at least one ranging value; each projection vertical distance is a vertical distance between the projector and the projection area determined based on one ranging value; determine an average value of the at least one projection vertical distance, and determine the average value as the calculated distance between the projector and the projection area; obtain a pre-calibrated distance error corresponding to the calculated distance, and determine the actual distance based on the calculated distance and the distance error.

[0168] In one embodiment of the present application, the adjustment module 1002 is also used to obtain a pre-calibrated correspondence between the projection distance and the optical motor position; the correspondence between the projection distance and the optical motor position includes an optical motor position corresponding to each of a plurality of projection distances; a first distance that is smaller than the actual distance and has the smallest numerical difference, and a second distance that is larger than the actual distance and has the smallest numerical difference are selected from the plurality of projection distances; a first optical motor position corresponding to the first distance and a second optical motor position corresponding to the second distance are searched from the correspondence between the projection distance and the optical motor position; and the target position is determined based on the first distance, the second distance, the first optical motor position, the second optical motor position, and the actual distance.

[0169] In one embodiment of the present application, the adjustment module 1002 is further used to multiply the difference between the second distance and the first distance and the difference between the second optical motor position and the first optical motor position to obtain a first product; compare the difference between the actual distance and the first distance with the first product to obtain a first ratio; determine the sum of the first ratio and the first distance as the first position; when the projector is a non-automatic projector, determine the target position based on the first position; when the projector is an automatically movable projector, determine the target position based on the first position.

[0170] In one embodiment of the present application, the adjustment module 1002 is also used to obtain the side projection angle of the projector; obtain a pre-calibrated correspondence between the deflection angle and the optical motor position; the correspondence between the deflection angle and the optical motor position includes an optical motor position corresponding to each deflection angle among multiple deflection angles; select a first angle that is smaller than the deflection angle and has the smallest numerical difference, and a second angle that is larger than the deflection angle and has the smallest numerical difference from the multiple deflection angles; search for a third optical motor position corresponding to the first angle and a fourth optical motor position corresponding to the second angle from the correspondence between the deflection angle and the optical motor position; determine the target position based on the first angle, the second angle, the third optical motor position, the fourth optical motor position, and the first position.

[0171] In one embodiment of the present application, the adjustment module 1002 is also used to multiply the difference between the second angle and the first angle and the difference between the third optical motor position and the fourth optical motor position to obtain a second product; compare the difference between the side projection angle and the first angle with the second product to obtain a second ratio; and determine the sum of the second ratio and the third optical motor position as the target position.

[0172] In one embodiment of the present application, the adjustment module 1002 is also used to obtain a target mobile motor position corresponding to the actual distance from a preset projection distance and a mobile motor position correspondence; obtain a pre-calibrated mobile motor position and an optical motor position correspondence; the mobile motor position and the optical motor position correspondence include an optical motor position corresponding to each of a plurality of mobile motor positions; a first mobile motor position that is closer to the target mobile motor position and has the smallest distance therebetween, and a second mobile motor position that is farther from the target mobile motor position and has the smallest distance therebetween are selected from the plurality of mobile motor positions; a fifth optical motor position corresponding to the first mobile motor position and a sixth optical motor position corresponding to the second mobile motor position are searched from the mobile motor position and the optical motor position correspondence; and the target position is determined based on the first mobile motor position, the second mobile motor position, the fifth optical motor position, the sixth optical motor position, and the target mobile motor position.

[0173] In one embodiment of the present application, the adjustment module 1002 is also used to multiply the difference between the second moving motor position and the first moving motor position and the difference between the sixth optical motor position and the fifth optical motor position to obtain a third product; compare the difference between the target moving motor position and the second moving motor position with the third product to obtain a third ratio; and determine the sum of the third ratio and the fifth optical motor position as the target position.

[0174] In one embodiment of the present application, the adjustment module 1002 is also used to obtain the moving position change of the moving motor on the projector; obtain the projection distance that is the smallest difference from the actual distance from multiple pre-calibrated projection distances to obtain the target projection distance; obtain the correspondence between the pre-calibrated projection distance and the different moving motor position change amounts; the correspondence between the projection distance and the moving motor position change amount includes multiple moving motor position change amounts corresponding to each projection distance in the multiple projection distances; obtain multiple target moving motor position change amounts corresponding to the target projection distance from the correspondence between the projection distance and the different moving motor position change amounts; determine the final position of the optical motor based on the target position, the moving position change amount, and the multiple target moving motor position change amounts, and adjust the optical motor to the final position to achieve real-time focusing.

[0175] In one embodiment of the present application, the adjustment module 1002 is also used to select a first mobile motor position change amount that is smaller than the mobile position change amount and has the smallest difference, and a second mobile motor position change amount that is larger than the mobile position change amount and has the smallest difference from a plurality of target mobile motor position change amounts; obtain a first optical motor position change amount corresponding to the first mobile motor position change amount, and a second optical motor position change amount corresponding to the second mobile motor position change amount from a pre-calibrated correspondence between the mobile motor position change amount and the optical motor position change amount; multiply the difference between the second mobile motor position change amount and the first mobile motor position change amount and the difference between the second optical motor position change amount and the first optical motor position change amount to obtain a fourth product; compare the difference between the mobile position change amount and the first mobile motor position change amount and the fourth product to obtain a fourth ratio; and determine the sum of the fourth ratio and the target position as the final position.

[0176] The present application embodiment provides a projector, such as Fig.11 As shown, the projector includes: a processor 1101, a memory 1102 and a communication bus 1103;

[0177] A communication bus 1103 is used to implement communication connection between the processor 1101 and the memory 1102;

[0178] The processor 1101 is used to execute the computer program stored in the memory 1102 to implement the above-mentioned focusing method.

[0179] The embodiment of the present application provides a projector, which, after detecting the movement of the projector, obtains at least one ranging value from the projection area collected by the time-of-flight ranging sensor on the projector, at least one ranging angle corresponding to the at least one ranging value, and the pitch angle of the time-of-flight ranging sensor relative to the projector; determines the actual distance between the projector and the projection area based on the at least one ranging value, the at least one ranging angle, and the pitch angle; determines the target position of the optical motor on the projector based on the actual distance, and adjusts the optical motor to the target position to achieve focusing. The projector provided by the present application can accurately determine the actual distance between the projector and the projection area based on the at least one ranging value collected by the time-of-flight ranging sensor, the angle corresponding to each ranging value, and the pitch angle of the time-of-flight ranging sensor itself after the projector moves, and then determines the target position where the current optical motor should be located based on the accurately determined actual distance to achieve focusing, thereby improving the efficiency and accuracy of focusing.

[0180] An embodiment of the present application provides a computer-readable storage medium, which stores one or more computer programs, and the one or more computer programs can be executed by one or more processors to implement the above-mentioned focusing method. The computer-readable storage medium can be a volatile memory (volatile memory), such as a random access memory (Random-Access Memory, RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (Read-Only Memory, ROM), a flash memory (flash memory), a hard disk (Hard Disk Drive, HDD) or a solid-state drive (Solid-State Drive, SSD); it can also be a respective device including one or any combination of the above-mentioned memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc.

[0181] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.

[0182] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0183] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0184] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0185] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A focusing method, characterized in that: Applied to a projector, the method comprises: After detecting the movement of the projector, obtaining at least one ranging value from a projection area collected by a time-of-flight ranging sensor on the projector, at least one ranging angle corresponding to the at least one ranging value, and a pitch angle of the time-of-flight ranging sensor relative to the projector; Determine an actual distance between the projector and the projection area based on the at least one ranging value, the at least one ranging angle, and the pitch angle; The target position of the optical motor on the projector is determined based on the actual distance, and the optical motor is adjusted to the target position to achieve focusing.

2. The method according to claim 1, characterized in that The determining, based on the at least one ranging value, the at least one ranging angle, and the pitch angle, an actual distance between the projector and the projection area comprises: For each of the at least one ranging value, a corresponding projection vertical distance is determined using a corresponding ranging angle and the pitch angle to obtain at least one projection vertical distance corresponding to the at least one ranging value; each projection vertical distance is a vertical distance between the projector and the projection area determined based on one ranging value; Determine an average value of the at least one projection vertical distance, and determine the average value as a calculated distance of the projector from the projection area; A pre-calibrated distance error corresponding to the calculated distance is obtained, and the actual distance is determined based on the calculated distance and the distance error.

3. The method according to claim 1, characterized in that: The step of determining a target position of a projector polishing motor based on the actual distance comprises: Acquire a pre-calibrated corresponding relationship between the projection distance and the position of the optical motor; the corresponding relationship between the projection distance and the position of the optical motor includes the position of the optical motor corresponding to each projection distance among a plurality of projection distances; Selecting a first distance smaller than the actual distance and having the smallest numerical difference, and a second distance larger than the actual distance and having the smallest numerical difference from the multiple projection distances; Finding a first optical motor position corresponding to the first distance and a second optical motor position corresponding to the second distance from the corresponding relationship between the projection distance and the optical motor position; The target position is determined based on the first distance, the second distance, the first optomechanical motor position, the second optomechanical motor position, and the actual distance.

4. The method according to claim 3, characterized in that The determining the target position based on the first distance, the second distance, the first optical motor position, the second optical motor position, and the actual distance comprises: multiplying a difference between the second distance and the first distance and a difference between the second optical mechanical motor position and the first optical mechanical motor position to obtain a first product; Compare the difference between the actual distance and the first distance with the first product to obtain a first ratio; determining a sum of the first ratio and the first distance as a first position; In a case where the projector is a non-automatically movable projector, determining the target position by using the first position; In the case where the projector is an automatically movable projector, the target position is determined based on the first position.

5. The method according to claim 4, characterized in that Determining the target position based on the first position includes: Obtaining a side projection angle of the projector; Acquire a pre-calibrated correspondence between a deflection angle and an optical motor position; the correspondence between the deflection angle and the optical motor position includes an optical motor position corresponding to each of a plurality of deflection angles; Selecting a first angle smaller than the deflection angle and having the smallest numerical difference, and a second angle larger than the deflection angle and having the smallest numerical difference from the multiple deflection angles; Finding a third optomechanical motor position corresponding to the first angle and a fourth optomechanical motor position corresponding to the second angle from the corresponding relationship between the deflection angle and the optomechanical motor position; The target position is determined based on the first angle, the second angle, the third optomechanical motor position, the fourth optomechanical motor position, and the first position.

6. The method according to claim 5, characterized in that The determining the target position based on the first angle, the second angle, the third optical motor position, the fourth optical motor position, and the first position comprises: multiplying the difference between the second angle and the first angle and the difference between the third optical-mechanical motor position and the fourth optical-mechanical motor position to obtain a second product; Compare the difference between the side projection angle and the first angle with the second product to obtain a second ratio; The sum of the second ratio and the third optical-mechanical motor position is determined as the target position.

7. The method according to claim 1, characterized in that The projector is an automatically movable projector, and the step of determining a target position of a projector polishing motor based on the actual distance includes: Obtaining a target mobile motor position corresponding to the actual distance from a preset corresponding relationship between the projection distance and the mobile motor position; Acquire a pre-calibrated correspondence between a mobile motor position and an optical motor position; the correspondence between the mobile motor position and the optical motor position includes an optical motor position corresponding to each mobile motor position in a plurality of mobile motor positions; Selecting from the plurality of mobile motor positions a first mobile motor position that is closer to the target mobile motor position and has the shortest distance therefrom, and a second mobile motor position that is farther from the target mobile motor position and has the shortest distance therefrom; Finding a fifth optomechanical motor position corresponding to the first moving motor position and a sixth optomechanical motor position corresponding to the second moving motor position from the correspondence between the moving motor position and the optomechanical motor position; The target position is determined based on the first motion motor position, the second motion motor position, the fifth optomechanical motor position, the sixth optomechanical motor position, and the target motion motor position.

8. The method according to claim 7, characterized in that The determining the target position based on the first moving motor position, the second moving motor position, the fifth optical motor position, the sixth optical motor position, and the target moving motor position comprises: multiplying a difference between the position of the second moving motor and the position of the first moving motor and a difference between the position of the sixth optical mechanical motor and the position of the fifth optical mechanical motor to obtain a third product; Comparing the difference between the target mobile motor position and the second mobile motor position with the third product to obtain a third ratio; The sum of the third ratio and the fifth optomechanical motor position is determined as the target position.

9. The method according to any one of claims 1 to 8, characterized in that: The projector is an automatically movable projector. After determining the target position of the projector polishing motor based on the actual distance, the method further includes: Obtaining a moving position change of a moving motor on the projector; Obtaining a projection distance that is least different from the actual distance from a plurality of pre-calibrated projection distances to obtain a target projection distance; Obtaining a pre-calibrated correspondence between projection distances and different mobile motor position changes; the correspondence between projection distances and mobile motor position changes includes multiple mobile motor position changes corresponding to each projection distance in a plurality of projection distances; Acquire a plurality of target moving motor position changes corresponding to the target projection distance from the corresponding relationship between the projection distance and different moving motor position changes; The final position of the optical motor is determined based on the target position, the movement position variation, and the multiple target movement motor position variation, and the optical motor is adjusted to the final position to achieve real-time focusing.

10. The method according to claim 9, characterized in that The determining the final position of the optical motor based on the target position, the moving position change, and the multiple target moving motor position change amounts includes: Selecting a first moving motor position change amount that is smaller than the moving position change amount and has the smallest difference from the first moving motor position change amount, and a second moving motor position change amount that is larger than the moving position change amount and has the smallest difference from the first moving motor position change amount from the plurality of target moving motor position change amounts; Obtaining a first optical motor position change amount corresponding to the first moving motor position change amount and a second optical motor position change amount corresponding to the second moving motor position change amount from a pre-calibrated correspondence relationship between the moving motor position change amount and the optical motor position change amount; multiplying the difference between the second moving motor position change and the first moving motor position change and the difference between the second optical motor position change and the first optical motor position change to obtain a fourth product; Compare the difference between the movement position change amount and the first movement motor position change amount with the fourth product to obtain a fourth ratio; The sum of the fourth ratio and the target position is determined as the final position.

11. A projector, characterized in that: include: an acquisition module, configured to acquire, after detecting movement of the projector, at least one ranging value from a projection area acquired by a time-of-flight ranging sensor on the projector, at least one ranging angle corresponding to the at least one ranging value, and a pitch angle of the time-of-flight ranging sensor relative to the projector; A determination module, configured to determine an actual distance between the projector and the projection area based on the at least one ranging value, the at least one ranging angle, and the pitch angle; The adjustment module is used to determine the target position of the optical motor on the projector based on the actual distance, and adjust the optical motor to the target position to achieve focusing.

12. A projector, characterized in that: include: processor, memory, and communication bus; The communication bus is used to realize the communication connection between the processor and the memory; The processor is used to execute the computer program stored in the memory to implement the focusing method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more computer programs, and the one or more computer programs can be executed by one or more processors to implement the focusing method according to any one of claims 1 to 10.