Projection device and automatic focusing method
By utilizing multiple movements and varying timings of the focusing motor to adjust the position of the optical components in the autofocus method, the effects of noise and backlash are eliminated, thus improving the accuracy of the focusing process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HISENSE VISUAL TECH CO LTD
- Filing Date
- 2023-07-21
- Publication Date
- 2026-05-29
AI Technical Summary
Automatic focusing methods are easily affected by noise and backlash, resulting in low accuracy during the focusing process.
By controlling the focusing motor to move the optical component to the endpoint position with the first focusing parameter, the sharpness of the sampled image is acquired and calculated. The position of the optical component is adjusted according to the sharpness change trend, the target position corresponding to the maximum sharpness is recorded, and the second focusing parameter is used to adjust in reverse to improve accuracy.
It mitigates the interference of noise and backlash, and improves the accuracy of the focusing process.
Smart Images

Figure CN117608155B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of projection equipment technology, and in particular to a projection device and an automatic focusing method. Background Technology
[0002] A projection device is a display device that projects images or videos onto a screen. During projection, the device uses a lens to project the image onto a projection surface. This projection surface can be a screen used with the device, such as a screen wall, projection cloth, or Fresnel hard screen. Alternatively, it can be a flat surface positioned in the direction of the lens's projection, such as a wall or ceiling.
[0003] Due to the varying application scenarios of projection equipment, the distance between the lens and the projection surface is not fixed. Therefore, in order to form a clear image on the projection surface, the projection equipment needs to be focused during use. Focusing includes manual focus and automatic focus. Automatic focus uses a drive motor to move the lens and zoom, while simultaneously taking pictures to acquire images, calculating image sharpness, and finding the focal length position with the highest sharpness by continuously comparing sharpness, thus making the projected image clear. In other words, automatic focus selects an appropriate sharpness evaluation function, searches for the maximum value of the sharpness evaluation function, and uses the drive motor to move the lens assembly to the target maximum value.
[0004] However, the sharpness evaluation function is susceptible to noise interference and exhibits multiple peaks, causing the autofocus method to easily get trapped in local optima and fail to adjust to the sharpest focal length. Furthermore, the autofocus method is affected by the backlash of the drive motor, making it impossible to find the optimal focus position again by reversing the rotation by a fixed step size after finding it, thus reducing the accuracy of the focusing process. Summary of the Invention
[0005] This application provides a projection device and an automatic focusing method to solve the problem that the accuracy of the automatic focusing method is easily affected by noise and backlash.
[0006] On one hand, this application provides a projection device, including: a lens, a camera, and a controller. The lens includes an optical component and a focusing motor; the focusing motor is connected to the optical component to move the optical component; the camera is configured to capture a sampled image; the controller is configured to execute the following program steps:
[0007] In response to a focusing command, the focusing motor is controlled to move the optical component to the endpoint position with a first focusing parameter, the first focusing parameter including a first direction and a first step length;
[0008] Acquire the first sampled image captured by the camera during the movement, and calculate the sharpness of the first sampled image;
[0009] Based on the sharpness variation trend of multiple first sampled images, the focusing motor is controlled to adjust the position of the optical component with a second focusing parameter. The second focusing parameter includes a second direction and a second step size. The second direction is opposite to the first direction, and the second step size is smaller than the first step size.
[0010] Acquire the second sampled image captured by the camera during the adjustment process, and calculate the sharpness of the second sampled image;
[0011] If the sharpness of a preset number of consecutive second sampled images shows a decreasing trend, record the target location corresponding to the maximum sharpness.
[0012] The focusing motor is controlled to adjust the optical component to the target position.
[0013] On the other hand, this application also provides an automatic focusing method, the first aspect of which is applied to a projection device, the projection device including: a lens, a camera, and a controller; wherein, the lens includes optical components and a focusing motor; the automatic focusing method includes the following steps:
[0014] In response to a focusing command, the focusing motor is controlled to move the optical component to the endpoint position with a first focusing parameter, the first focusing parameter including a first direction and a first step length;
[0015] Acquire the first sampled image captured by the camera during the movement, and calculate the sharpness of the first sampled image;
[0016] Based on the sharpness variation trend of multiple first sampled images, the focusing motor is controlled to adjust the position of the optical component with a second focusing parameter. The second focusing parameter includes a second direction and a second step size. The second direction is opposite to the first direction, and the second step size is smaller than the first step size.
[0017] Acquire the second sampled image captured by the camera during the adjustment process, and calculate the sharpness of the second sampled image;
[0018] If the sharpness of a preset number of consecutive second sampled images shows a decreasing trend, record the target location corresponding to the maximum sharpness.
[0019] The focusing motor is controlled to adjust the optical component to the target position.
[0020] As can be seen from the above technical solutions, this application provides a projection device and an automatic focusing method. The method responds to a focusing command by controlling a focusing motor to move an optical component to an endpoint position in a first direction and with a first step length, and acquiring a first sampled image and its sharpness captured by a camera during the movement. Then, based on the sharpness change trend of multiple first sampled images, the focusing motor is controlled to adjust the position of the optical component in a second direction and with a second step length, and a second sampled image and its sharpness captured by the camera during the adjustment process are acquired. If the sharpness change trend of a consecutive preset number of second sampled images is a decreasing trend, the target position corresponding to the maximum sharpness is recorded, thereby controlling the focusing motor to adjust the optical component to the target position. This method can search for the optimal focusing position through multiple movements and different focusing step lengths, which can alleviate noise and backlash interference and improve the accuracy of the focusing process. Attached Figure Description
[0021] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram of the projection state of the projection device in an embodiment of this application;
[0023] Figure 2 This is a schematic diagram of the projection device structure in an embodiment of this application;
[0024] Figure 3 This is a schematic diagram of the optical engine architecture of the projection device in the embodiments of this application;
[0025] Figure 4 This is a schematic diagram of the optical path of the projection device in the embodiments of this application;
[0026] Figure 5 This is a schematic diagram of the system framework of the projection device in the embodiments of this application;
[0027] Figure 6 This is a schematic diagram of the lens structure of the projection device in the embodiments of this application;
[0028] Figure 7 This is a schematic diagram of the lens projection optical path in an embodiment of this application;
[0029] Figure 8 This is a schematic diagram of the sharpness position curve in the embodiments of this application;
[0030] Figure 9 This is a schematic diagram of the automatic focusing method in the embodiments of this application;
[0031] Figure 10This is a schematic diagram of the focusing direction where the current position is to the left of the peak in this embodiment of the application;
[0032] Figure 11 This is a schematic diagram of the process for determining a downward trend based on adjacent sampled images in an embodiment of this application;
[0033] Figure 12 This is a schematic diagram of the process for determining a downward trend based on the first and last sampled images in an embodiment of this application;
[0034] Figure 13 This is a schematic diagram of the sharpness position curve fitted in the embodiments of this application;
[0035] Figure 14 This is a schematic diagram of the process for adjusting the backlash difference in an embodiment of this application. Detailed Implementation
[0036] To make the objectives and implementation methods of this application clearer, the exemplary implementation methods of this application will be clearly and completely described below with reference to the accompanying drawings of the exemplary embodiments of this application. Obviously, the exemplary embodiments described are only some embodiments of this application, and not all embodiments.
[0037] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0038] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily imply a specific order or sequence, unless otherwise specified. It should be understood that such terms are interchangeable where appropriate.
[0039] The terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.
[0040] The term "module" refers to any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0041] The embodiments of this application can be applied to various types of projection devices. The following description will use a projector as an example to illustrate the projection device and the automatic focusing method.
[0042] A projector is a device that projects images or videos onto a screen. Projectors can connect to computers, cable TV networks, the internet, VCD (Video Compact Disc), DVD (Digital Versatile Disc Recordable), game consoles, DV camcorders, and other devices via various interfaces to play corresponding video signals. Projectors are widely used in homes, offices, schools, and entertainment venues.
[0043] Figure 1 This paper shows a schematic diagram of the projection state of the projection device in an embodiment of this application. Figure 2 A schematic diagram of the projection device structure in an embodiment of this application is shown.
[0044] In some embodiments, reference Figure 1-2 This application provides a projection device including a projection screen 1 and a projection device 2. The projection screen 1 is fixed in a first position, and the projection device 2 is placed in a second position so that the image projected by the device matches the projection screen 1. The projection device includes a laser light source 100, an optical engine 200, a lens 300, and a projection medium 400. The laser light source 100 provides illumination for the optical engine 200, which modulates the light beam and outputs it to the lens 300 for imaging, projecting it onto the projection medium 400 to form a projected image. Since the laser light source 100, the optical engine 200, and the lens 300 are used together to emit projection light to project the image, in some embodiments of this application, the laser light source 100, the optical engine 200, and the lens 300 are collectively referred to as the light-emitting assembly.
[0045] In some embodiments, the laser source 100 of the projection device includes a laser assembly 110 and an optical lens assembly 120. The light beam emitted by the laser assembly 110 can pass through the optical lens assembly 120 to provide illumination for the optical engine. For example, the optical lens assembly 120 requires a high level of environmental cleanliness and airtightness; while the chamber in which the laser assembly is installed can be sealed with a lower level of dustproof sealing to reduce sealing costs.
[0046] In some embodiments, the optical engine 200 of the projection device may include a blue optical engine, a green optical engine, and a red optical engine, and may also include a heat dissipation system, a circuit control system, etc. It should be noted that in some embodiments, the light-emitting component of the projector may also be implemented using an LED light source.
[0047] Figure 3A schematic diagram of the optical-mechanical architecture of a projection device according to an embodiment of this application is shown. In some embodiments, the projection device may include a display control circuit 10, a laser light source 20, at least one laser driving component 30, and at least one brightness sensor 40. The laser light source 20 may include at least one laser corresponding to at least one laser driving component 30. Here, "at least one" refers to one or more, and "more than one" refers to two or more.
[0048] Based on this circuit architecture, the projection device can achieve adaptive adjustment. For example, by setting a brightness sensor 40 in the light output path of the laser light source 20, the brightness sensor 40 can detect the first brightness value of the laser light source and send the first brightness value to the display control circuit 10.
[0049] The display control circuit 10 can acquire the second brightness value corresponding to the driving current of each laser, and determine that the laser has a COD fault when the difference between the second brightness value and the first brightness value of the laser is greater than the difference threshold. Then the display control circuit can adjust the current control signal of the corresponding laser driving component until the difference is less than or equal to the difference threshold, thereby eliminating the COD fault of the blue laser. The projection device can eliminate the COD fault of the laser in a timely manner, reduce the damage rate of the laser, and improve the image display effect of the projection device.
[0050] Figure 4 A schematic diagram of the optical path of the projection device in an embodiment of this application is shown.
[0051] In some embodiments, the laser light source 20 in the projection device may include independently configured blue laser 201, red laser 202 and green laser 203. The projection device may also be called a three-color projection device. The blue laser 201, red laser 202 and green laser 203 are all modular lightweight (Mirai Console Loader, MCL) packaged lasers, which are small in size and facilitate compact arrangement of the optical path.
[0052] In some embodiments, the controller includes at least one of a central processing unit (CPU), a video processor, an audio processor, a graphics processing unit (GPU), RAM (random access memory), ROM (read-only memory), a first to an nth interface for input / output, a communication bus, etc.
[0053] In some embodiments, the projection device may be configured with a camera for working in conjunction with the projection device to adjust and control the projection process. For example, the camera configured with the projection device may be specifically implemented as a 3D camera or a binocular camera; when the camera is implemented as a binocular camera, it specifically includes a left camera and a right camera; the binocular camera can acquire the image and playback content presented on the screen corresponding to the projection device, i.e., the projection surface, which is projected by the optical engine built into the projection device.
[0054] When the projection device moves, its projection angle and distance to the projection surface change, which will cause the projected image to be distorted, and the projected image will be displayed as a trapezoidal image or other distorted image; the projection device controller can achieve automatic trapezoidal correction based on the image captured by the camera, by coupling the angle between the optical engine and the projection surface and the correct display of the projected image.
[0055] Figure 5 A schematic diagram of the system framework of the projection device in an embodiment of this application is shown.
[0056] In some embodiments, the projection device has the characteristics of a long-throw micro-projector, and its controller can control the display of the projected light image through a preset algorithm to achieve functions such as automatic keystone correction, automatic screen entry, automatic obstacle avoidance, automatic focus adjustment, and eye protection.
[0057] In some embodiments, the projection device is equipped with a gyroscope sensor; during the movement of the device, the gyroscope sensor can sense the position movement and actively collect movement data; then the collected data is sent to the application service layer through the system framework layer to support the application data required during user interface interaction and application interaction. The collected data can also be used by the controller for data calls in the algorithm service implementation.
[0058] In some embodiments, the projection device is equipped with a time-of-flight sensor. After the time-of-flight sensor collects the corresponding data, the data will be sent to the time-of-flight service corresponding to the service layer. After the time-of-flight service obtains the data, it will send the collected data to the application service layer through a process communication framework. The data will be used for data calls, user interfaces, program applications, and other interactive applications of the controller.
[0059] In some embodiments, the projection device is configured with a camera for acquiring images, which may be a binocular camera, a depth camera, or a 3D camera, etc. The camera acquisition data is sent to a camera service, and then the camera service sends the acquired image data to a process communication framework and / or a projection device calibration service. The projection device calibration service can receive the camera acquisition data sent by the camera service, and the controller can call the corresponding control algorithm in the algorithm library for different functions to be implemented.
[0060] In some embodiments, data interaction is performed with the application service through a process communication framework, and then the calculation results are fed back to the correction service through the process communication framework. The correction service sends the obtained calculation results to the projection device operating system to generate control signaling, and sends the control signaling to the optical engine control driver to control the optical engine operating conditions and realize automatic correction of the displayed image.
[0061] In some embodiments, the projector uses an autofocus algorithm and its configured laser rangefinder to obtain the current object distance, calculate the initial focal length and search range, and then drives the camera to take a picture and uses the corresponding algorithm to evaluate the sharpness.
[0062] Within the aforementioned search range, the projector uses a search algorithm to find the optimal focal length, then repeats the steps of taking photos and evaluating sharpness. Finally, it finds the optimal focal length through sharpness comparison and completes automatic focusing.
[0063] For example, after the projector is turned on, the user moves the mobile device; after the projector automatically completes the calibration and refocuses, the controller will detect whether the autofocus function is enabled; when the autofocus function is not enabled, the controller will end the autofocus operation; when the autofocus function is enabled, the projector will obtain the detection distance of the time-of-flight (TOF) sensor through the middleware for calculation.
[0064] The controller queries a preset mapping table based on the acquired distance to obtain the projector's focal length; then the middleware sets the acquired focal length to the projector's optical engine; after the optical engine emits a laser at the aforementioned focal length, the camera executes a photo-taking command; the controller determines whether the projector's focus adjustment is complete based on the acquired image and evaluation function.
[0065] If the judgment result meets the preset completion conditions, the automatic focus adjustment process ends; if the judgment result does not meet the preset completion conditions, the middleware will fine-tune the focal length parameters of the projector's optical engine. For example, the focal length can be finely adjusted gradually by preset step size, and the adjusted focal length parameters will be set back to the optical engine. This achieves repeated photo taking and sharpness evaluation steps, and finally finds the optimal focal length through sharpness comparison to complete the automatic focus adjustment.
[0066] To support the automatic focusing process of the projection device, in some embodiments, such as Figure 6 As shown, the lens 300 of the projection device may also include an optical component 310 and a focusing motor 320. The optical component 310 is a lens group consisting of one or more lenses, which can refract the light emitted by the optical engine 200, so that the light emitted by the optical engine 200 can be projected onto the projection surface to form an image of the projected content.
[0067] The optical assembly 310 may include a lens barrel and multiple lenses disposed within the lens barrel. Depending on whether the lenses are movable, the lenses in the optical assembly 310 can be divided into movable lenses 311 and fixed lenses 312. By changing the position of the movable lens 311, the distance between the movable lens 311 and the fixed lens 312 is adjusted, thereby changing the overall focal length of the optical assembly 310. Therefore, the focusing motor 320 can be connected to the movable lens 311 in the optical assembly 310 to drive the movable lens 311 to move its position, thus achieving automatic focusing.
[0068] The focusing motor 320 can be connected to the movable lens 311 via a specific transmission mechanism. The transmission mechanism can be any structure capable of converting rotational motion into movement. Examples include worm gear drives, ball screw drives, and threaded screw drives. In the case of a threaded screw drive, the outer edge of the movable lens 311 has a lens frame, which may have threads. The power output shaft of the focusing motor 320 is connected to the screw, and through the threaded engagement between the screw and the lens frame, the rotational motion output by the focusing motor 320 can be converted into the movement of the lens frame, thereby driving the movable lens 311 to move within the lens barrel.
[0069] Since the moving lens 311 has different effects on the overall focal length of the optical component 310 depending on its position, the projection device can rotate the focusing motor 320 by a specific angle or number of revolutions to position the moving lens 311 in the corresponding position. To achieve this function, the focusing motor 320 can be a stepper motor, servo motor, or other type with controllable rotation angle. During focusing, the controller 500 of the projection device can send a movement command to the focusing motor 320, which can include the angle data required for the focusing motor 320 to rotate. For example, for a stepper motor-type focusing motor 320, the movement command sent by the controller 500 can include a pulse signal corresponding to the required rotation angle. After sending the movement command to the focusing motor 320, the focusing motor 320 can parse the pulse signal from the movement command and rotate according to the pulse signal.
[0070] It should be noted that, in order to adjust the moving lens 311 to a specific position, the correspondence between the moving distance of the moving lens 311 and the rotation angle of the focusing motor 320 can be calculated in advance based on the internal structure of the projection device. The correspondence between the moving distance and the rotation angle can be linear, influenced by the transmission ratio of the transmission mechanism. Therefore, during focusing, the projection device can first calculate the target position of the moving lens 311, and then calculate the distance the moving lens 311 needs to move by subtracting it from the current position of the moving lens 311. Then, based on the correspondence between the moving distance and the rotation angle, the angle that the focusing motor 320 needs to rotate is calculated, thereby generating a movement command and sending it to the focusing motor 320.
[0071] Since the movable lens 311 can only move within the lens barrel, its travel is limited during focusing. For example... Figure 7 As shown, for ease of description, the end of the moving lens 311 closest to the optical engine can be called the near end, and the end of the moving lens 311 furthest from the optical engine can be called the far end. The overall movement distance of the moving lens 311 is the distance between the near end and the far end. In some embodiments, to facilitate accurate adjustment of the projection effect, the actual focusing range of the projection device can be within the movement range of the moving lens 311. For example, after moving the moving lens 311 to the near end, the focusing motor 320 can adjust forward 300 steps to meet the focusing requirements of the projection device at the closest projection distance; while adjusting forward 900 steps from the near end can meet the focusing requirements of the projection device at the farthest projection distance. Therefore, the actual focusing range can be the position range corresponding to the adjustment of the focusing motor 320 from 300 steps to 900 steps.
[0072] Since the focusing process can be affected by a combination of factors such as the characteristics of the focusing motor, environmental characteristics, and the projection device's orientation, a certain adjustment margin is required at both the near and far ends to ensure the desired projection effect. Therefore, in some embodiments, the adjustment range of the projection device can be increased by adding a margin to the actual focusing range. For example, for the position range corresponding to 300 to 900 steps of adjustment, after setting a 100-step adjustment margin, the positions 200 steps and 1000 steps from the near end can be set as the starting and ending points of the adjustment, respectively, to form the final focusing range.
[0073] When the distance between the projection device and the projection surface varies, the lens of the projection device needs to be adjusted to different focal lengths to project a clear image onto the projection surface. During projection, the distance between the projection device and the projection surface will vary depending on the user's placement, requiring different focal lengths. Therefore, to adapt to different usage scenarios, the projection device needs to adjust the focal length of the optical component 310.
[0074] In some embodiments, the projection device may support manual focus adjustment, meaning that the projection device may have interactive buttons or be equipped with a remote control. Users can interact with the projection device using the focus adjustment buttons on the projection device or the remote control. During the interaction, the controller 500 of the projection device can generate movement commands based on the user's button operations and send the movement commands to the focus motor to control the focus motor to move the moving lens 311, thereby changing the focal length of the optical components.
[0075] For example, if a user finds the projected image unclear while using the projector, they can press the "forward" button on the projector. In response to this button press, the projector generates a movement command to move the moving lens 311 away from the optical engine. This command is then sent to the focusing motor. Upon receiving the command, the focusing motor rotates clockwise to output torque, driving the moving lens 311 away from the optical engine. As the moving lens 311 moves, the sharpness of the projected image changes. The user can then choose to continue focusing or stop focusing based on the image sharpness until a satisfactory image is achieved.
[0076] During manual focusing, the projector's controller 500 can control the focusing motor 320 according to preset interaction rules. Specifically, in some embodiments, the controller 500 can determine the rotation angle of the focusing motor based on the duration of the user's button press. Thus, when the focusing amount is large, the user can press the focusing button for a longer period; while when the focusing amount is small, the user can press the focusing button for a shorter period.
[0077] In some embodiments, the controller 500 of the projection device can also determine the rotation angle of the focusing motor based on the number of times the user presses the button. For example, if the projection device is in coarse adjustment mode and the adjustment amount for each button press is set to 100 steps, corresponding to one revolution of the focusing motor, then when the user adjusts to the far end by 300 steps, the user needs to press the "forward" button three times consecutively.
[0078] The projection device can also automatically adjust the focal length according to the projection effect. That is, in some embodiments, the projection device can sample the projected image through a camera to obtain a sampled image. The sharpness of the sampled image is calculated, and when the sharpness is less than a preset sharpness threshold, the automatic focusing function is activated, causing the focusing motor to drive the moving lens 311 to move, changing the focal length of the lens 300, thereby adjusting the sharpness of the projected image.
[0079] Projection devices can incorporate image processing applications to calculate the sharpness of sampled images. These applications can calculate sharpness based on one or more combinations of methods such as grayscale conversion, gradient magnitude, sharpness metrics, and ambiguity measurement. For example, a projection device can convert a color image to grayscale using a grayscale conversion algorithm, and then calculate sharpness by averaging or weighted averaging the pixels in the red, green, and blue channels. Alternatively, it can use gradient magnitude algorithms to calculate the image's gradient in the horizontal and vertical directions using gradient operators (such as Sobel and Prewitt), and then determine the image sharpness by calculating the gradient magnitude. Furthermore, a projection device can calculate sharpness metrics such as the mean squared error (MSE) or variance, combining the MSE measurement of the average pixel difference between the image and its blurred version, and the variance measurement of the dispersion of pixel values to determine image sharpness. For ambiguity measurement methods, the projection device can use various ambiguity measurement algorithms, such as Fourier transform and autocorrelation functions, to determine ambiguity, and then use the ambiguity to inversely determine the image sharpness.
[0080] Image processing applications can use image processing software or programming languages to combine one or more of the above sharpness calculation methods and implement them using suitable image processing software (such as OpenCV) or programming languages (such as Python). It should be noted that there are different methods for calculating image sharpness, and the appropriate method should be selected based on the specific application scenario and device requirements. Additionally, for some specific application scenarios, deep learning models can also be used to evaluate image sharpness.
[0081] Once the projection device's position is determined, the distance between the projection device lens 300 and the projection surface can be temporarily fixed. Theoretically, there exists an optimal focus position. Taking this theoretically optimal focus position as the peak value, the sharpness relative to other positions can exhibit a peak-shaped relationship similar to a normal distribution. Figure 8 As shown. Based on Figure 8 The "sharpness-position" relationship curve shown is used in the autofocus process to find the target position corresponding to the peak (maximum) of the curve, and then adjust the moving lens 311 to the target position through the focusing motor.
[0082] In some embodiments, the maximum search method can be based on algorithms such as function approximation, Fibbonacci search, and hill-climbing search. Among these, the hill-climbing search algorithm, proposed based on the curve trend of the focus evaluation function, is also a search algorithm for the maximum value of contrast-based focus searching. It can be used to find the sharpest projected image. However, directly using the sharpness evaluation function in the hill-climbing method results in multiple peaks due to noise interference, making it prone to getting trapped in local optima. Furthermore, the hill-climbing search is affected by the backlash of the focusing motor; after finding the optimal focus position, it cannot be found again by reversing the rotation with a fixed step size.
[0083] To mitigate the effects of noise and backlash, some embodiments of this application also provide an automatic focusing method. This automatic focusing method can be applied to a projection device. To implement the automatic focusing method, the projection device should at least include: a lens 300, a camera, and a controller 500. The lens 300 includes an optical component 310 and a focusing motor 320. The focusing motor 320 is connected to the optical component 310 to adjust the position of the moving lens 311 within the optical component 310. The camera can be positioned at the optical engine location of the projection device, and its shooting range covers the projection surface of the projection device. The camera can capture images of the projected image formed on the projection surface to obtain a sampled image. Figure 9 As shown, the controller 500 is configured to execute the program steps corresponding to the autofocus method, including the following:
[0084] S100: In response to a focusing command, controls the focusing motor to move the optical component to the endpoint position with a first focusing parameter.
[0085] Projection devices can receive various control commands during operation. Some of these commands can be used to adjust the projection focal length and are called focus commands. Since this embodiment describes an automatic focus method, the focus commands specifically refer to automatic focus commands in this embodiment. An automatic focus command is a control command used to trigger the projection device to automatically focus. Automatic focus commands can be manually input by the user. For example, after turning on the power to the projection device, the user can press the automatic focus button on the projection device or its remote control to automatically focus, thus obtaining a focus command.
[0086] In some embodiments, the focus command can also be automatically generated based on the control program built into the projection device. For example, when the projection device detects the first video signal input after power-on, it can trigger autofocus and generate an autofocus command. Another example is when the projection device detects a change in its placement or setting position; to eliminate the impact of this change, the projection device can automatically adjust the focus upon detecting the change, thus generating a focus command.
[0087] After receiving the focusing command, the projection device can control the focusing motor to perform an initial search. The purpose of this initial search is to determine the range where the peak (maximum value) is located. Therefore, to improve search efficiency, the initial search can be a coarse search. During the initial search, the controller 500 can control the focusing motor 320 to move the optical component 310 (including the moving lens 311) to an endpoint position using a first focusing parameter. This first focusing parameter includes a first direction and a first step length. The endpoint position is either the near end or the far end of the total travel of the moving lens 311 within the optical component 310. For example, for a projection device with the near end as the initial focusing position, the first direction is the direction towards the near end.
[0088] The projection device can divide the total travel of the moving lens 311 in the optical component 310 into multiple sub-sections at equal intervals, with the distance corresponding to each self-loading component being the first step length. For example, the total travel of the moving lens 311 (L = 1000 steps) can be divided into 10 equal parts, and the distance corresponding to each part is taken as the first step length (L / 10 = 100 steps). That is, as follows... Figure 8 As shown, taking the current position M of the moving lens 311 as the initial search position, the first step length bigstep = |MN|, and the direction is the direction closer to the near end for the first search.
[0089] S200: Acquire a first sampled image captured by the camera during the movement, and calculate the sharpness of the first sampled image.
[0090] During the initial search, the projector's camera can also sequentially capture multiple first-sample images, following the first step sequence. The controller 500 can then acquire these first-sample images captured by the camera and invoke a resolution-related image processing application to calculate the resolution of the first-sample images.
[0091] It should be noted that in this embodiment, the projection device can directly use the sharpness value for subsequent judgment after calculating the sharpness, or it can convert the sharpness value into a sharpness evaluation value that is easier to calculate and judge. There is a correlation between the sharpness evaluation value and the sharpness; for example, the sharpness evaluation value AD = aD + b, where D is the sharpness, and a and b are relationship constants. Therefore, both sharpness and the sharpness evaluation value can reflect the display quality of the projected image.
[0092] S300: Based on the sharpness variation trend of multiple first sampled images, control the focusing motor to adjust the position of the optical component with the second focusing parameter.
[0093] After calculating the sharpness of the first sampled image, the projection device can begin a second search (fine search) based on the sharpness change trend of the first sampled image. The second search aims to determine the optimal focusing position from the position range determined in the first search. However, the search range of the second search is not the entire travel of the moving lens 311, but rather a range within that travel. Therefore, to more accurately determine the optimal focusing position, the search step size of the second search is smaller than that of the first search, and the direction is opposite. That is, the second focusing parameters include a second direction and a second step size, where the second direction is opposite to the first direction, and the second step size is smaller than the first step size.
[0094] For example, the second step length is 1 / 2 or 1 / 5 of the first step length. That is, when the first step length bigstep = |MN| = 100 steps, the second step length ministep = 50 steps or 20 steps. And the second direction is "-direction", that is, the direction away from the near end, to perform the second search.
[0095] In order to control the focusing motor to adjust the position of the optical component with the second focusing parameter according to the sharpness change trend of multiple first sampled images, the projection device can determine the sharpness change trend of multiple first sampled images based on the sharpness corresponding to multiple first sampled images after calculating the sharpness of the first sampled images, thereby determining whether a position range containing the peak (maximum value) is found in the first search (coarse search) process.
[0096] like Figure 8 As shown, since the relationship between sharpness and focus position is peak-shaped, when the sharpness change trend of the first sampled image is first increasing and then decreasing, it indicates that a position interval containing the peak was found during the first search. That is, in some embodiments, the projection device can generate the sharpness change trend of multiple consecutive first sampled images based on the sharpness of multiple first sampled images, and analyze the sharpness change trend. If the sharpness change trend of the first sampled image is first increasing and then decreasing, the focus motor is controlled to adjust the position of the optical component with the second focus parameter, that is, the second search is started.
[0097] For example, by comparing the sharpness of multiple first-sampled images, it can be determined that the first search process includes both an upward (upward) trend and a downward (downward) trend in sharpness. Therefore, when sharpness begins to decrease, the corresponding sampling position can be recorded, thus obtaining the position range containing the peak, such as the interval between the near end point and the position point corresponding to the start of sharpness decrease. Then, a second search is started, that is, the focusing motor is controlled to move away from the near end and perform the second search in steps of 50 or 20 steps.
[0098] If the sharpness change trend of the first sampled image is not an initial increase followed by a decrease, it indicates that the position range containing the peak was not found during the first search. Therefore, the projection device needs to continue the first search (coarse search), that is, control the focusing motor to move the position of the optical component in the second direction and the first step length. For example, Figure 10 As shown, during the process of the focusing motor 320 moving the moving lens 311 from the current position M to the near position N, the sharpness change trend of the multiple first sampled images captured by the camera does not include a trend of first rising and then falling. This indicates that the current position M and the near position N are on the same side of the peak. Therefore, the focusing motor needs to change direction = -direction and continue the first search in the direction away from the near end according to the step size bigstep = |MN|.
[0099] Similarly, the projection device can continue to calculate the sharpness based on the third sampled image captured by the camera after the direction change, and generate a sharpness change trend of multiple consecutive third sampled images. That is, in some embodiments, the projection device can control the camera to capture a third sampled image according to a first step length while the optical component moves in the second direction, acquire the third sampled image, and calculate the sharpness of the third sampled image. Then, a peak interval is determined based on the sharpness of the third sampled image. The peak interval is the interval containing the position corresponding to the maximum sharpness of the third sampled image, starting from the endpoint position. The focusing motor 320 is then controlled to adjust the position of the optical component within the peak interval in the first direction and with a second step length, that is, to start the second search (fine search).
[0100] S400: Acquire the second sampled image captured by the camera during the adjustment process, and calculate the sharpness of the second sampled image.
[0101] During the second search, the controller 500 can send a shooting command to the camera, which includes the search step size for the second search process, i.e., the second step size. After receiving the shooting command, the camera can capture an image according to the second step size.
[0102] The controller 500 then calls the image processing application to perform sharpness calculations on the captured second sampled images to obtain the sharpness of each second sampled image and the sharpness variation trend among multiple second sampled images. For example, during the process of the focusing motor 320 adjusting the position of the moving lens 311 in a step size of 20 steps away from the near end position, the camera can take an image every 20 steps to obtain multiple second sampled images. For each second sampled image, the projection device can calculate its sharpness and generate a sharpness variation trend based on the sharpness of multiple second sampled images, thereby determining the optimal focusing position based on the sharpness variation trend of multiple second sampled images.
[0103] S500: If the sharpness of a preset number of consecutive second sampled images shows a decreasing trend, record the target position corresponding to the maximum sharpness.
[0104] After determining the sharpness change trend corresponding to the second sampled image, the projection device can detect the sharpness trend of multiple consecutive second sampled images to determine whether a predetermined number of consecutive second sampled images exhibit a decreasing sharpness change trend. If a predetermined number of consecutive second sampled images show a decreasing sharpness change trend, it indicates that the optimal focus position has been found in the second search process. Therefore, the second sampled image corresponding to the maximum sharpness during the second search process can be extracted, and the target position corresponding to the maximum sharpness can be recorded.
[0105] Due to the influence of noise from the environment, lighting, and camera exposure, sharpness may have multiple peak points throughout the focusing range. In practical applications, sharpness has multiple local optima, rather than the ideal single-peak state. In the hill-climbing search method, if sharpness decreases and the search direction is changed, it is easy to find a local optimum and stop the search, resulting in unclear focus. Furthermore, the step size of the second search process is small, and the granularity of sharpness changes in the projected image is small, making it easily affected by external factors. If only one decrease is judged, the truly sharp focus position will not be found. Therefore, to reduce the influence of local optima on the search algorithm, this embodiment can adopt a method of multiple downward trend judgments to find the true downward trend of sharpness before changing the search direction.
[0106] For example, if the preset quantity is 3, then based on the sharpness of the second sampled image, it can be determined that when the sharpness decreases three times consecutively, it indicates that the second search process has passed the peak position, and the target position P corresponding to the maximum sharpness can be recorded. Since the search step size of the second search process is shorter than that of the first search process, the target position corresponding to the maximum sharpness recorded is also closer to the optimal focusing position.
[0107] Whether a downward trend exists can be determined (Down=1 or Down=0) through gradient calculation. That is, as follows... Figure 11 As shown, in some embodiments, the projection device may preset a judgment window, which may include a preset number of second sampled images. The sharpness of the preset number of second sampled images is obtained according to the preset judgment window. Obviously, the preset number is greater than or equal to 2.
[0108] Calculate the first sharpness change gradient between two adjacent second sampled images in a predetermined number of second sampled images. The first sharpness change gradient is the ratio of the sharpness difference between two adjacent second sampled images to a direction marker value, where the direction marker value is a value set according to an initial direction (or a first direction). For example, the direction marker value can be set to 1 when moving away from the near end, and -1 when moving closer to the near end. Therefore, the first sharpness change gradient can be calculated using the following formula:
[0109] Gradient=(Score–Score') / direction;
[0110] Where Gradient represents the first sharpness gradient, Score represents the sharpness of the second sampled image acquired later among two adjacent second sampled images, Score' represents the sharpness of the second sampled image acquired earlier among two adjacent second sampled images, and direction represents the direction marker value.
[0111] After calculating the first sharpness change gradient, a trend can be determined based on this gradient. If all of the first sharpness change gradients are less than 0, the sharpness change trend of the second sampled image is marked as a downward trend. If any of the first sharpness change gradients is greater than or equal to 0, the sharpness change trend of the second sampled image is marked as not a downward trend. That is:
[0112]
[0113] As can be seen, whether a true downward trend appears during the second search process is determined by the sharpness decreasing continuously n times (e.g., 2-3 times). For example, if the preset judgment window size is 3, then by continuously acquiring 3 second sample images, the corresponding sharpnesses are Score1 = 0.75, Score2 = 0.7, and Score3 = 0.63 respectively. According to the above formula, it can be determined that:
[0114] Gradient1=(Score2–Score1) / direction=(0.7-0.75) / 1<0;
[0115] Gradient2=(Score3–Score2) / direction=(0.63-0.7) / 1<0;
[0116] Therefore, if the sharpness decreases twice consecutively (n=2), and the corresponding sharpness change gradient is less than 0, then the downward trend is recorded as Down=1.
[0117] In some embodiments, the determination of continuous decline can be achieved through the following two methods. One method is a more stringent method of continuous determination, which can be performed according to the following formula:
[0118] Gradient n =(Score) n –Score n-1 ) / direction;
[0119] Gradient n+1 =(Score) n+1 –Score n ) / direction;
[0120] ...
[0121]
[0122] In the formula, Score n Score represents the sharpness of the nth second-sampled image; n-1 Score represents the sharpness of the image preceding the nth second-sampled image; n+1 Gradient indicates the sharpness of the image following the nth second-sampled image; n This represents the sharpness gradient value between the nth second-sampled image and the (n-1th)th second-sampled image; Gradient n+1 This represents the sharpness gradient value between the nth second sampled image and the (n+1)th second sampled image.
[0123] Another approach is a relatively lenient judgment of continuous decline, such as... Figure 12As shown, in some embodiments, the projection device can acquire a preset number of second sampled images, wherein the preset number is greater than or equal to 2. A head image and a tail image are extracted from the preset number of second sampled images. Then, the sharpness of the head image and a second sharpness change gradient of the tail image are acquired. The second sharpness change gradient is the ratio of the sharpness difference between the head image and the tail image to the direction marker value. If the second sharpness change gradient is less than 0, the sharpness change trend of the second sampled image is marked as a decreasing trend; if the second sharpness change gradient is greater than or equal to 0, the sharpness change trend of the second sampled image is marked as not a decreasing trend. Therefore, a relatively lenient continuous decreasing judgment can be made according to the following formula:
[0124] Gradient = (Score) n –Score1) / direction;
[0125]
[0126] In the formula, Score n Score1 indicates the sharpness of the last second sampled image in the preset judgment window; Score1 indicates the sharpness of the first second sampled image in the preset judgment window.
[0127] If the sharpness trend of a consecutive preset number of second sampled images is determined to be decreasing, the target position corresponding to the maximum sharpness is recorded. Specifically, the target position is the location of the moving lens 311 during the capture of the second sampled image with the maximum sharpness among the multiple second sampled images. However, since the second sampled images are captured according to a second step length, and although the second step length is shorter than the first step length, it is not continuous, the image with the maximum sharpness among the second sampled images may deviate from the actual optimal focusing position. Therefore, to determine a target position closer to the optimal focusing position, the second step length can be further reduced to make the second search process more precise.
[0128] The optimal focusing position can also be predicted by fitting a curve. That is, Figure 13 As shown, in some embodiments, after acquiring the first sampled image and the second sampled image, the projection device extracts the sharpness and corresponding focus position of the first sampled image and the second sampled image, respectively. Then, it uses the sharpness and the focus position to fit a sharpness-position curve, calculates the maximum sharpness based on the sharpness-position curve, and records the target position corresponding to the maximum sharpness.
[0129] Curve fitting is the process of approximating data by finding the best-fitting curve or function to a given dataset. This can be achieved through methods such as linear fitting, polynomial fitting, nonlinear fitting, spline interpolation, and nonparametric fitting. Linear fitting uses a linear function (first-order polynomial) to fit the data. The best-fitting line can be found using methods such as least squares or gradient descent. Polynomial fitting uses a higher-order polynomial function to fit the data. The best-fitting curve can be found using methods such as least squares or polynomial regression. Nonlinear fitting uses a nonlinear function to fit the data. This method is more flexible and can adapt to more complex data patterns. Curves can be fitted using methods such as least squares, gradient descent, or nonlinear regression. Spline interpolation uses a series of small curve segments (splines) to approximate the data. This can be achieved using methods such as linear interpolation, cubic spline interpolation, or B-spline interpolation. Nonparametric fitting does not depend on a specific function form but rather fits the data using an appropriate function. Nonparametric methods include least squares, least absolute value method, and kernel regression.
[0130] Since the sharpness and focus position can satisfy a curve relationship, the variation law between the sharpness and focus position of the projection device in the current state can be determined by the curve fitting algorithm, that is, the sharpness-position curve is generated. Then, the theoretical value of the maximum sharpness can be solved by using the sharpness-position curve, thereby determining the target position that is closer to the optimal focus position.
[0131] S600: Control the focusing motor to adjust the optical component to the target position.
[0132] After recording the target position, the projection device can control the focusing motor 320 to adjust the moving lens 311 to the target position, completing automatic focusing. After recording the target position P, the projection device can, based on the end position of the second search process, i.e., when the sharpness change trend of a consecutive preset number of second sampled images is decreasing, adjust the position of the moving lens 311 in the opposite direction to the second direction (the first direction) to the position P2 of the last second sampled image among the consecutive preset number of second sampled images. The adjustment distance is the distance between the target position P and the end position P2, i.e., |P2-P|.
[0133] In some embodiments, the focusing motor 320 may use a step-by-step search method to adjust the optical component 310 to the target position. That is, it may perform a reverse search according to the small step size of the second search and obtain the position P' of the moving lens in real time. If the current position of the moving lens 311 satisfies: |P'–P|<PT (the set distance threshold, such as 10 steps), the search ends and the moving lens 311 is stopped at the current position.
[0134] Because the search direction for the second search is the second direction, while the focusing motor 320 adjusts the optical component 310 to the target position in the first direction, the two movements of the optical component are in opposite directions. These two opposite movements will be affected by the backflip difference (RD) of the focusing motor 320, its transmission components, and the optical component 310. This causes the actual position reached when moving |P-P2| distances in the reverse direction to be P+RD, rather than the target position P. Furthermore, the backflip difference RD is variable and its true value is difficult to calculate, thus affecting focusing accuracy.
[0135] To mitigate the impact of backlash on focusing accuracy, in some embodiments, when the controller 500 controls the focusing motor 320 to move the optical component 310 to the target position, it can also control the focusing motor 320 to move the optical component 310 in a first direction and with a third step length. The third step length is less than or equal to the second step length. For example, the focusing motor 320 moves the optical component 310 towards the near end, and the step length during this movement can be the second step length ministep used in the second search process, i.e., 50 steps or 20 steps, to keep the backlash as stable as possible at a specific value.
[0136] The camera is then controlled to capture a fourth sampled image during the movement of the optical component according to the third step length, and the sharpness of the fourth sampled image is calculated. For example, the camera performs image capture every 50 or 20 steps to obtain multiple fourth sampled images. Furthermore, the controller 500 can again calculate the sharpness score of the fourth sampled image through an image processing application.
[0137] The absolute value of the difference between the sharpness of the fourth sampled image and the maximum sharpness is calculated as |Score - Score|. p |, thus in the absolute value of the difference |Score-Score p | less than or equal to the preset judgment threshold λ, i.e. |Score-Score p |≤λ or the sharpness score of the fourth sampled image is greater than the maximum sharpness score. p That is, Score greater than Score p When the time is right, the focusing motor is stopped so that the moving lens 311 stops at the target position P.
[0138] As can be seen, by adjusting the above methods, it can better adapt to projection equipment with good clear range and large backlash of the 320 focusing motor, thereby improving the success rate of clear focusing.
[0139] Since the backlash of the focusing motor 320 is generated during the direction change, the two turns in different directions during the entire search process can cancel out the effect of the backlash. Therefore, the target position P with maximum sharpness obtained in the second search cannot be reached directly by turning once, but can be reached by turning twice to eliminate the effect of the backlash. That is, Figure 14 As shown, in some embodiments, in the step of controlling the focusing motor 320 to adjust the optical component 310 to the target position, the maximum backlash difference max(RD) of the focusing motor 320 can also be obtained, and then the distance difference P2-P between the current position P2 of the optical component 310 and the target position P can be calculated.
[0140] Then, the number of callback movement steps, step1, is calculated based on the maximum return distance difference max(RD) and the distance difference P2-P. Step1 can be the sum of the maximum return distance difference max(RD) and the distance difference P2-P, i.e., step1 = P2-P + max(RD). This controls the focusing motor 320 to move the optical component 310 to the callback position P3 according to the first direction and the number of callback movement steps. Then, the adjustment direction is switched, and the focusing motor 320 drives the moving lens 311 to move a callback distance Step2 in the second direction. The callback distance Step2 is the difference between the callback position P3 and the target position P, i.e., Step = P - P3.
[0141] As can be seen, the effect of the backlash difference can be offset by two reverse callback processes, so that the optical component 310 can be moved to the target position and the focusing accuracy can be improved.
[0142] Through the focusing methods provided in the above embodiments, the projection device can improve the hill-climbing search algorithm, mitigate the impact of noise and backlash on the focusing process, make the autofocus method adaptable to different types of projection devices, and improve the image clarity of long-distance projection devices. After completing autofocus, the projection device can maintain the automatically adjusted focus to project the image. Since the projection device may move during use, or different projection images may have different sharpness evaluation values and different sharpness requirements, in some embodiments, the projection device can also monitor the projected image in real time during normal operation and re-autofocus when a sharpness abnormality occurs.
[0143] Based on this, the controller 500 of the projection device is further configured to: control the camera to capture a fifth sampled image according to a preset sampling period, acquire multiple fifth sampled images, and calculate the sharpness of the fifth sampled image. If the sharpness of the fifth sampled image is less than a sharpness threshold, the focus adjustment command is generated. The preset sampling period can be set according to the application scenario, device sensitivity, and hardware configuration of the projection device. For example, the preset sampling period is 5 minutes, meaning that a sharpness detection is performed every 5 minutes. The sharpness threshold can be greater than or equal to the judgment threshold λ in the above embodiment. By acquiring the fifth sampled image in real time, the projection quality of the projection device can be monitored, and automatic focus can be triggered when an abnormality occurs to improve the user experience.
[0144] Based on the above-described automatic focusing method, some embodiments of this application also provide a projection device. The projection device includes a lens, a camera, and a controller. The lens includes an optical component and a focusing motor; the focusing motor is connected to the optical component to move the optical component; the camera is configured to capture a sampled image; and the controller is configured to execute the following program steps:
[0145] In response to a focusing command, the focusing motor is controlled to move the optical component to the endpoint position with a first focusing parameter, the first focusing parameter including a first direction and a first step length;
[0146] Acquire the first sampled image captured by the camera during the movement, and calculate the sharpness of the first sampled image;
[0147] Based on the sharpness variation trend of multiple first sampled images, the focusing motor is controlled to adjust the position of the optical component with a second focusing parameter. The second focusing parameter includes a second direction and a second step size. The second direction is opposite to the first direction, and the second step size is smaller than the first step size.
[0148] Acquire the second sampled image captured by the camera during the adjustment process, and calculate the sharpness of the second sampled image;
[0149] If the sharpness of a preset number of consecutive second sampled images shows a decreasing trend, record the target location corresponding to the maximum sharpness.
[0150] The focusing motor is controlled to adjust the optical component to the target position.
[0151] As can be seen from the above technical solutions, this application provides a projection device and an automatic focusing method. The method responds to a focusing command by controlling a focusing motor to move an optical component to an endpoint position in a first direction and with a first step length, and acquiring a first sampled image and its sharpness captured by a camera during the movement. Then, based on the sharpness change trend of multiple first sampled images, the focusing motor is controlled to adjust the position of the optical component in a second direction and with a second step length, and a second sampled image and its sharpness captured by the camera during the adjustment process are acquired. If the sharpness change trend of a consecutive preset number of second sampled images is a decreasing trend, the target position corresponding to the maximum sharpness is recorded, thereby controlling the focusing motor to adjust the optical component to the target position. This method can search for the optimal focusing position through multiple movements and different focusing step lengths, which can alleviate noise and backlash interference and improve the accuracy of the focusing process.
[0152] Similar parts between the embodiments provided in this application can be referred to mutually. The specific implementation methods provided above are only a few examples under the overall concept of this application and do not constitute a limitation on the scope of protection of this application. For those skilled in the art, any other implementation methods extended from the solution of this application without creative effort shall fall within the scope of protection of this application.
Claims
1. A projection device, characterized in that, include: The lens, including optical components and a focusing motor; The camera is configured to capture sampled images; The controller is configured as follows: In response to a focusing command, the focusing motor is controlled to move the optical component to the endpoint position with a first focusing parameter, the first focusing parameter including a first direction and a first step length; Acquire the first sampled image captured by the camera during the movement, and calculate the sharpness of the first sampled image; Based on the sharpness variation trend of multiple first sampled images, the focusing motor is controlled to adjust the position of the optical component with a second focusing parameter. The second focusing parameter includes a second direction and a second step size. The second direction is opposite to the first direction, and the second step size is smaller than the first step size. Acquire the second sampled image captured by the camera during the adjustment process, and calculate the sharpness of the second sampled image; If the sharpness of a preset number of consecutive second sampled images shows a decreasing trend, record the target location corresponding to the maximum sharpness. The focusing motor is controlled to adjust the optical component to the target position.
2. The projection device according to claim 1, characterized in that, The controller, based on the sharpness variation trend of multiple first sampled images, controls the focusing motor to adjust the position of the optical component using a second focusing parameter, and is further configured to: Generate the sharpness variation trend of multiple consecutive first sampled images; If the sharpness of the first sampled image changes in a trend of first increasing and then decreasing, the focusing motor is controlled to adjust the position of the optical component using the second focusing parameter; If the sharpness of the first sampled image does not change in a trend of first increasing and then decreasing, the focusing motor is controlled to move the position of the optical component in the second direction and the first step length.
3. The projection device according to claim 2, characterized in that, The controller is also configured to: During the movement of the optical component in the second direction, the camera is controlled to capture a third sampled image according to the first step length; Acquire the third sampled image and calculate the sharpness of the third sampled image; The peak range is determined based on the sharpness of the third sampled image. The peak range is the range that includes the position corresponding to the maximum sharpness of the third sampled image, starting from the endpoint position. The focusing motor is controlled to adjust the position of the optical component within the peak range in a first direction and with a second step.
4. The projection device according to claim 1, characterized in that, After performing the step of calculating the sharpness of the second sampled image, the controller is further configured to: Obtain the sharpness of a preset number of the second sampled images, wherein the preset number is greater than or equal to 2; Calculate the first sharpness change gradient between two adjacent second sampled images in a preset number of second sampled images. The first sharpness change gradient is the ratio of the sharpness difference between two adjacent second sampled images to the orientation marker value. If all the first sharpness change gradients are less than 0, the sharpness change trend of the second sampled image is marked as a downward trend; If any of the first sharpness change gradients is greater than or equal to 0, the sharpness change trend of the second sampled image is marked as not being a downward trend.
5. The projection device according to claim 1, characterized in that, After performing the step of calculating the sharpness of the second sampled image, the controller is further configured to: Obtain a preset number of the second sampled images, wherein the preset number is greater than or equal to 2; Extract the head image and tail image from a preset number of second sampled images; The sharpness of the first image and the second sharpness change gradient of the tail image are obtained. The second sharpness change gradient is the ratio of the sharpness difference between the first image and the tail image to the orientation marker value. If the second sharpness change gradient is less than 0, the sharpness change trend of the second sampled image is marked as a downward trend; If the second sharpness change gradient is greater than or equal to 0, the sharpness change trend of the second sampled image is marked as not being a downward trend.
6. The projection device according to claim 1, characterized in that, The controller is configured to control the focusing motor to adjust the optical component to the target position, and is also configured to: The focusing motor is controlled to move the optical component in a first direction and a third step, wherein the third step is less than or equal to the second step. The camera is controlled to capture a fourth sampled image during the movement of the optical component according to the third step length; Calculate the sharpness of the fourth sampled image; The absolute value of the difference between the sharpness of the fourth sampled image and the maximum sharpness; When the absolute value of the difference is less than or equal to a preset judgment threshold, or when the clarity of the fourth sampled image is greater than the maximum clarity, the focusing motor is controlled to stop running.
7. The projection device according to claim 1, characterized in that, The controller is configured to control the focusing motor to adjust the optical component to the target position, and is also configured to: Obtain the maximum backlash difference of the focusing motor; Calculate the distance difference between the current position of the optical component and the target position; The number of callback steps is calculated based on the maximum return difference and the distance difference. The focusing motor is controlled to move the optical component to the callback position according to the first direction and the number of callback steps; The focusing motor is controlled to move a callback distance in the second direction, the callback distance being the difference between the callback position and the target position.
8. The projection device according to claim 1, characterized in that, The target location corresponding to the maximum resolution recorded by the controller is also configured as follows: Obtain the sharpness and focus position of the first sampled image and the second sampled image; Use the sharpness and the focus position to fit a sharpness-position curve; The maximum sharpness is calculated based on the sharpness position curve, and the target position corresponding to the maximum sharpness is recorded.
9. The projection device according to claim 1, characterized in that, The controller is also configured to: The camera is controlled to capture a fifth sampled image according to a preset sampling period; Acquire multiple first sampled images and calculate the sharpness of the fifth sampled image; If the sharpness of the fifth sampled image is less than the sharpness threshold, then the focus adjustment command is generated.
10. An automatic focusing method, characterized in that, An application is made in a projection device, the projection device comprising: a lens, a camera, and a controller; wherein the lens includes optical components and a focusing motor; the automatic focusing method includes: In response to a focusing command, the focusing motor is controlled to move the optical component to the endpoint position with a first focusing parameter, the first focusing parameter including a first direction and a first step length; Acquire the first sampled image captured by the camera during the movement, and calculate the sharpness of the first sampled image; Based on the sharpness variation trend of multiple first sampled images, the focusing motor is controlled to adjust the position of the optical component with a second focusing parameter. The second focusing parameter includes a second direction and a second step size. The second direction is opposite to the first direction, and the second step size is smaller than the first step size. Acquire the second sampled image captured by the camera during the adjustment process, and calculate the sharpness of the second sampled image; If the sharpness of a preset number of consecutive second sampled images shows a decreasing trend, record the target location corresponding to the maximum sharpness. The focusing motor is controlled to adjust the optical component to the target position.