Projection device, method and apparatus for auto-focusing of a projection device

By combining modules in the projection device and driving a DC motor, high-precision and fast focusing is achieved, solving the problems of low focusing accuracy and long focusing time in existing projection devices, and improving the user experience.

CN113934098BActive Publication Date: 2026-05-15APPOTRONICS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
APPOTRONICS CORP LTD
Filing Date
2020-07-13
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing autofocus methods for projection equipment suffer from low accuracy and excessively long autofocus times, especially when the projector thermally defocuses and cannot be effectively adjusted.

Method used

It employs a combination of projection module, drive module, camera module and computing module. By capturing the projected image frame by frame and simultaneously calculating the sharpness value, the sharpness value sequence is analyzed to determine the optimal focus position and return time. A DC motor is then used to drive the projection device to move to the optimal focus position.

Benefits of technology

It improves focusing accuracy, shortens focusing time, reduces the number of images captured, enhances focusing efficiency, and eliminates the need for an additional rangefinder.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113934098B_ABST
    Figure CN113934098B_ABST
Patent Text Reader

Abstract

The application relates to the field of projection technology, and particularly discloses a projection device, an automatic focusing method and a device with a storage function. A control module of the projection device controls a driving module to drive the projection device to move, so that a projection module projects a plurality of projection pictures according to a preset timing sequence, and controls a camera module to take the plurality of projection pictures according to the preset timing sequence, to obtain a plurality of images to be analyzed. The control module is further used for controlling a calculation module to synchronously calculate the definition values of the images to be analyzed when the camera module takes the projection pictures frame by frame, to obtain a definition value sequence, and to analyze two adjacent definition value sequences, to determine an optimal focusing position and a return time required for moving to the optimal focusing position. The control module is further used for controlling the driving module to drive the projection device to continuously move in the opposite direction of the current moving direction at a preset speed for the return time. In the above manner, the focusing precision can be improved, and the focusing time can be shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of projection technology, and in particular to a projection device, an automatic focusing method for the projection device, and an apparatus. Background Technology

[0002] Projection devices are generally used to project interface images displayed on connected devices, such as the interface images displayed on the screens of computers and mobile devices.

[0003] During the long-term research and development process, the inventors of this application discovered that some existing automatic focusing methods, such as using an additional distance measuring device to measure the distance between the screen and the projector and driving a motor to move the projection lens to a designated position based on the relationship between distance and focal length, have poor focusing accuracy and take a long time to focus, thus affecting the user experience. Summary of the Invention

[0004] This application provides a projection device, an automatic focusing method for the projection device, and a device with storage function, aiming to solve the problems of excessively long focusing time and low accuracy.

[0005] On one hand, this application provides a projection device, including: a projection module, a driving module, a camera module, a computing module, and a control module, wherein the control module is electrically coupled to the projection module, the driving module, the camera module, and the computing module;

[0006] The projection module is used to project reference images onto the screen to be displayed to form a projected image;

[0007] The control module is used to control the drive module to move the projection device so that the projection module projects multiple projection images in a preset time sequence, and controls the camera module to capture the projection images frame by frame in a preset time sequence to obtain multiple images to be analyzed.

[0008] The control module is also used to control the calculation module to simultaneously calculate the sharpness value of each image to be analyzed when the camera module captures the projected image frame by frame, obtain a sharpness value sequence, and analyze two adjacent sharpness value sequences to determine the optimal focus position and the return time required to move to the optimal focus position.

[0009] The control module is also used to control the drive module to drive the projection device to move continuously in the opposite direction of the current movement direction at a preset speed for a return time, so that the projection device moves to the optimal focus position.

[0010] On the other hand, this application provides an automatic focusing method for a projection device, the method comprising:

[0011] The projection device is driven to move at a preset speed so that the projection module inside the projection device projects the reference image onto the screen to be displayed in a preset sequence to form multiple projection images.

[0012] The projected images are captured frame by frame according to a preset time sequence to obtain multiple images to be analyzed;

[0013] While capturing the projected image frame by frame, the sharpness value of each image to be analyzed is calculated simultaneously to obtain a sharpness value sequence.

[0014] Analyze two adjacent sharpness value sequences to determine the optimal focus position and the return time required to move to the optimal focus position;

[0015] Drive the projection device to move continuously in the opposite direction of the current movement direction at a preset speed for a return time, so that the projection device moves to the optimal focus position.

[0016] On another front, this application provides a device with a storage function, on which a computer program is stored, which, when executed by a processor, implements the steps of the aforementioned autofocus method.

[0017] The technical solution provided in this application can achieve the following beneficial effects: The projection module of this application projects multiple projected images according to a preset time sequence. While the camera module captures these multiple projected images frame by frame, the calculation module simultaneously calculates the sharpness value of each image to be analyzed to obtain a sharpness value sequence. By analyzing two adjacent sharpness value sequences, the optimal focus position and the return time required to move to the optimal focus position can be determined. Since this application can determine the optimal focus position by directly analyzing the gradient change of image sharpness, it does not require an additional ranging device, which can improve focusing accuracy. At the same time, it does not require analyzing all sharpness values ​​and then searching for the optimal sharpness value. Compared with the prior art, it captures fewer images, has a shorter focusing time, and higher focusing efficiency. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:

[0019] Figure 1 This is a schematic diagram of the functional modules of the first embodiment of the projection device of this application;

[0020] Figure 2 This is a functional module diagram of the second embodiment of the projection device of this application;

[0021] Figure 3This is a functional module diagram of the third embodiment of the projection device of this application.

[0022] Figure 4 This is a functional module diagram of the fourth embodiment of the projection device of this application;

[0023] Figure 5 This is a flowchart illustrating the first embodiment of the automatic focusing method for the projection device of this application;

[0024] Figure 6 This is a flowchart illustrating the second embodiment of the automatic focusing method for the projection device of this application.

[0025] Figure 7 This is a flowchart illustrating the third embodiment of the automatic focusing method for the projection device of this application;

[0026] Figure 8 This is a graph showing the image sharpness value after filtering in the autofocus method of the projection device of this application. Detailed Implementation

[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0028] Current projection equipment typically uses distance measurement for focusing. This method obtains the distance between the projector and the projection plane using sensors (primarily distance-measuring sensors such as TOF, infrared, and ultrasonic sensors). Then, based on a pre-stored distance-optimal focus position lookup table, it directly calculates the distance the projection module needs to move to the optimal focus position. A drive motor then moves the projection module to this position to achieve focus. However, this method has significant drawbacks: firstly, it lacks accuracy; secondly, it cannot address the issue of thermal defocusing. When a projector experiences thermal defocusing, the projection module's position remains unchanged, but the corresponding optimal focus position shifts due to the expansion of the optical instruments. This results in the loss of reliable distance information, rendering the distance measurement method ineffective.

[0029] To address the technical problems existing in the prior art, this application provides a projection device, with reference to... Figure 1 , Figure 1This is a functional block diagram of the first embodiment of the projection device of this application. In this embodiment, the projection device 10 can be a projection device body (including a micro projection device body) or a laser TV, etc., capable of projecting images. The projection device 10 includes: a projection module 11, a driving module 12, a camera module 13, a computing module 14, and a control module 15. The control module 15 is electrically coupled to the projection module 11, the driving module 12, the camera module 13, and the computing module 14.

[0030] The projection module 11 is used to project a reference image onto the screen to be displayed to form a projected image. The control module 15 is used to control the drive module 12 to drive the projection device to move, so that the projection module 11 projects multiple projected images according to a preset sequence.

[0031] Specifically, the projection module 11 includes a light source module, an optical engine module, and a projection lens. The light source module provides an illumination beam. The optical engine module converts the illumination beam into an image beam. The projection lens converts the image beam into a projection beam and projects the projection beam to form a projected image. The drive module 12 can be a focusing motor connected to the projection module 11, which drives the projection lens of the projection module 11 to move along the optical axis. Driven by the drive module 12, the projection lens of the projection module 11 projects an image onto a wall or screen while moving according to a preset sequence. Understandably, the clarity of the projected image varies as the projection lens moves. The camera module 13 captures and records the projected images of different clarity frame by frame according to a preset sequence, obtaining multiple images to be analyzed.

[0032] In other embodiments, the drive module 12 can be a drive rod. The projection device includes a fixed bracket and a support structure for fixing to an external fixed surface. The drive rod is mounted on the fixed bracket, and the support structure is fixed to the drive rod. The fixed bracket includes a main body and fixed ends that bend and extend to both sides from the main body. The fixed ends are used to adhere to and fix to the external fixed surface. The main body includes a top wall and a bottom wall that are disposed opposite to each other. The drive rod passes through the top wall and the bottom wall and is spaced apart from the fixed ends. The support structure extends from the drive rod in a direction away from the external fixed surface. The support structure is used to support the object to be fixed. The height position of the support structure can be continuously adjusted by rotating the drive rod, thereby making the height position of the projection module 11 of the projection device continuously adjustable. The continuous adjustment of the height position of the support structure by rotating the drive rod not only facilitates fixing but also facilitates position adjustment along the height direction, effectively adjusting the projection effect.

[0033] While the camera module 13 captures the projected image frame by frame, the calculation module 14 simultaneously calculates the sharpness value of each image to be analyzed, obtaining a sharpness value sequence. It then analyzes two adjacent sharpness value sequences to determine the optimal focus position and the return time required to move to the optimal focus position. The optimal focus position and return time are then fed back to the control module 15. The control module 15 controls the drive module 12 to drive the projection device 10 to move continuously in the opposite direction of the current movement direction at a preset speed for the return time, until the projection device 10 moves to the optimal focus position to achieve focus.

[0034] To further improve the stability of the installation of the projection device 10 and the camera module 13, the camera module 13 can be embedded in the projection device 10, making the camera module 13 and the projection device 10 an integrated structure. This effectively improves the accuracy of the camera module 13 in calibrating the projected image and ensures the reliability of the projection device 10.

[0035] Specifically, the calculation module 14 is used to simultaneously calculate the sharpness value SN of the image PN to be analyzed corresponding to the projection image when the camera module 13 captures the projection image frame by frame. That is, the calculation module 14 calculates the image sharpness and the camera module 13 captures the projection image at the same time, which can save the time consumed by the calculation module 14 in processing the image.

[0036] The sharpness value can be calculated using methods such as wavelet transform, Fourier transform, image grayscale gradient value, image grayscale gradient value algorithm, and Tenengrad function. Different algorithms are suited to different application environments; preferably, this embodiment uses the Tenengrad function. Furthermore, since the sharpness value curve has a unimodal characteristic, the calculation module 14 can analyze two adjacent sharpness value sequences {s1, s2, ..., s...} N-1} and {s2, s3, ..., s N The optimal focus position and the return point of the projection module 11 are determined. At this time, the control module 15 can control the projection module 11 to move from the return point at a preset speed and return to the optimal focus position after a preset return time, thereby achieving focus.

[0037] In the above manner, the projection module 11 of this application embodiment projects multiple projected images according to a preset time sequence. While the camera module 13 captures these multiple projected images frame by frame, the calculation module 14 simultaneously calculates the sharpness value of each image to be analyzed to obtain a sharpness value sequence. By analyzing two adjacent sharpness value sequences, the optimal focus position and the return time required to move to the optimal focus position can be determined. Since this application can determine the optimal focus position by directly analyzing the gradient change of image sharpness, it does not require an additional ranging device, which can improve focusing accuracy. At the same time, it does not require analyzing all sharpness values ​​before searching for the optimal sharpness value. Compared with the prior art, it captures fewer images, has a shorter focusing time, and has higher focusing efficiency.

[0038] In one embodiment, the camera module 13 is used to capture the projected image frame by frame to obtain the projected image, and extract the pixels of the desired focus area in the projected image to generate an image to be analyzed.

[0039] Specifically, the camera module 13 captures and records frame by frame the projected image I corresponding to the position of the projection module 11 after each movement. o And extract the projected image I o The pixels in the desired focus area form a new image I to be analyzed. t .

[0040] Reference Figure 2 , Figure 2 This is a functional module diagram of a second embodiment of the projection device of this application. In one embodiment, the drive module 12 can be a DC motor 122, which is connected to the projection module 11.

[0041] The DC motor 122 is used to drive the projection module 11 to move at a preset speed so that the projection module 11 projects multiple projection images in a preset sequence.

[0042] It should be noted that in existing technologies, the projection module 11 is typically moved step by step to the optimal focus position using the output of a stepper motor. However, the inventors of this application have discovered that to achieve a relatively ideal focus position, the projection module 11 will oscillate back and forth several times around the optimal focus position. Since the sharpness curve is prone to local saddle points, if the step size of the stepper motor is too small, the projection module 11 is prone to getting stuck in the saddle point, resulting in focus failure. If the step size of the stepper motor is too large, it will increase the number of times the lens oscillates back and forth at the optimal focus position, slowing down the focusing speed. Unlike existing technologies, this embodiment uses a DC motor 122 to drive the projection module 11 to move. Unlike the control of a stepper motor, the DC motor 122 directly controls the movement time of the motor by controlling the timing of the high-level signal and controls the motor speed by controlling the duty cycle of the PWM signal. Therefore, the timing of the high-level signal and the duty cycle of the PWM determine the displacement of the motor, and there is no need to set the movement step size, thus avoiding the problems of focus failure or slow focusing speed of stepper motors in existing technologies.

[0043] Reference Figure 3 , Figure 3 This is a functional module diagram of the third embodiment of the projection device of this application. The calculation module 14 includes: a filtering unit 141, a movement direction determination unit 142, and a return time calculation unit 143.

[0044] The calculation module 14 synchronously calculates the sharpness value of each image to be analyzed captured by the camera module 13 to obtain a sharpness value sequence.

[0045] The filtering unit 141 is used to filter two adjacent sharpness value sequences using the average filtering method to obtain two adjacent filtered values.

[0046] Specifically, in order to eliminate local saddle points in the sharpness curve and thus prevent the projection module 11 from getting stuck in a saddle point, this embodiment uses a filtering unit 141 to filter the obtained sharpness value sequence, making the focusing method more robust. Preferably, the filtering unit 141 can be a low-pass filter.

[0047] After capturing the projected image N times, the sequence of two adjacent sharpness values ​​{s1, s2, ..., s} is calculated. N-1} and {s2, s3, ..., s N After applying the average filtering method to the two adjacent sharpness value sequences, two filtered values ​​s' are obtained. N-1 and s' N ,in,

[0048] The movement direction determination unit 142 is used to determine whether two adjacent filter values ​​are attenuated with the current movement direction of the projection module 11. If not, it is determined that the projection module 11 should move in the opposite direction of the current movement direction.

[0049] Specifically, calculate s' N-1 -s' N The value of s' N-1 -s' N If the value is greater than 0, it means that the two adjacent filter values ​​attenuate as the projection module 11 moves in the current direction. In this case, the direction the projection module 11 is moving is the direction of the optimal focus position, and the projection module 11 is controlled to continue moving in the current direction. When s' N-1 -s' N If the value is less than 0, it means that the two adjacent filter values ​​increase with the current moving direction of the projection module 11, indicating that the projection module 11 has passed the optimal focus position and should move to the optimal focus position in the opposite direction of the current moving direction.

[0050] The return time calculation unit 143 is used to obtain the return time based on each resolution value and the calculation time of each resolution value.

[0051] Specifically, when s' N-1 -s' N When the value is less than 0, the projection module 11 stops moving. For example, the DC motor 122 can be stopped, thereby stopping the projection module 11 from moving further. The stored sharpness sequence {s1, s2, ..., s} is searched. N Find the maximum value in the expression, and locate the position corresponding to the maximum value, d = argmax(S). This position is the optimal focus position. Calculate the return time required to move from the current position to the optimal focus position. t i For the resolution value s i The calculation time.

[0052] Furthermore, the control module 15 is also used to control the DC motor 122 to drive the projection module 11 to move continuously at a preset speed for a return time T in the opposite direction of the current moving direction, so that the projection module 11 moves to the optimal focus position.

[0053] Reference Figure 4 , Figure 4 This is a functional module diagram of the fourth embodiment of the projection device of this application. The calculation module 14 further includes a sharpness calculation unit 144, which is used to calculate the sharpness value of each image to be analyzed according to the sharpness evaluation function.

[0054] Specifically, the sharpness value s of each image to be analyzed is calculated using the evaluation function of the Tenengrad gradient algorithm, where,

[0055]

[0056] Among them, S x (x, y) and S y (x, y) represents the value at pixel (x, y) of the image to be analyzed convolved with the Sobel edge operator. The Sobel edge operator has one in the x-axis direction and one in the y-axis direction.

[0057] The calculation method in this embodiment balances calculation speed and effect, ensuring the single peak of the sharpness curve while quickly evaluating the sharpness of the image to be analyzed. It has lower computational complexity and less time consumption, allowing the calculation module 14 to acquire and process more sequence images within the range that the projection module 11 can move, thus ensuring the density of the sharpness curve.

[0058] Reference Figure 5 , Figure 5 This is a flowchart illustrating the first embodiment of the autofocus method for the projection device of this application. The autofocus method for the projection device of this application is based on the projection device 10 in the above embodiments. For a detailed description of the projection device, please refer to the above embodiments, which will not be repeated here.

[0059] The automatic focusing method of this projection device includes the following steps:

[0060] S11: Drive the projection device to move at a preset speed so that the projection module inside the projection device projects the reference image onto the screen to be displayed in a preset sequence to form multiple projection images.

[0061] S12: Capture the projected images frame by frame according to the preset time sequence to obtain multiple images to be analyzed.

[0062] S13: While capturing the projected image frame by frame, the sharpness value of each image to be analyzed is calculated simultaneously to obtain a sharpness value sequence.

[0063] S14: Analyze two adjacent sharpness value sequences to determine the optimal focus position and the return time required to move to the optimal focus position.

[0064] S15: Drive the projection device to move continuously in the opposite direction of the current movement direction at a preset speed for a return time, so that the projection device moves to the optimal focus position.

[0065] Specifically, driven by the drive module, the projection module moves while projecting an image onto a wall or screen according to a preset timing sequence. Understandably, the clarity of the projected image varies as the projection lens moves. Frame by frame, projected images of different clarity are captured and recorded according to the preset timing sequence, resulting in multiple images to be analyzed.

[0066] When capturing the projected image frame by frame, the sharpness value SN of the corresponding image PN to be analyzed is calculated simultaneously. That is, the calculation of image sharpness and the capture of the projected image are performed at the same time, which can save the time spent processing images.

[0067] The sharpness value can be calculated using methods such as wavelet transform, Fourier transform, image grayscale gradient value, image grayscale gradient value algorithm, and the Tenengrad function. Different algorithms are suited to different application environments; preferably, this embodiment uses the Tenengrad function. Furthermore, since the sharpness value curve has a unimodal characteristic, it is possible to analyze two adjacent sharpness value sequences {s1, s2, ..., s...} N-1} and {s2, s3, ..., s N This process is used to determine the optimal focus position and the camera module's return point. At this point, the camera module can be controlled to move from the return point back to the optimal focus position after a return time, thus achieving focus.

[0068] In the above manner, the projection module of this application embodiment projects multiple projected images according to a preset time sequence. While capturing these multiple projected images frame by frame, the sharpness value of each image to be analyzed is calculated simultaneously to obtain a sharpness value sequence. By analyzing two adjacent sharpness value sequences, the optimal focus position and the return time required to move to the optimal focus position can be determined. Since this application can determine the optimal focus position by directly analyzing the gradient change of image sharpness, it does not require an additional ranging device, which can improve focusing accuracy. At the same time, it does not require analyzing all sharpness values ​​and then searching for the optimal sharpness value. Compared with the prior art, it captures fewer images, has a shorter focusing time, and has higher focusing efficiency.

[0069] Reference Figure 6 , Figure 6 This is a schematic flowchart of the second embodiment of the automatic focusing method for the projection device of this application. Step S12 specifically includes the following steps:

[0070] S121: Capture the projected image frame by frame to obtain the projected image, and extract the pixels of the desired focus area in the projected image to generate the image to be analyzed.

[0071] Reference Figure 7 , Figure 7 A flowchart illustrating the third embodiment of the automatic focusing method for the projection device of this application. Step S11 specifically includes the following steps:

[0072] S111: The projection module is driven by a DC motor to move at a preset speed so that the projection module projects the reference image onto the screen to be displayed in a preset sequence to form multiple projection images.

[0073] Specifically, the DC motor starts driving the camera module to move, and simultaneously, the camera module captures and records the projected image I corresponding to the position of the camera module after each movement. o And extract the projected image I o The pixels in the desired focus area form a new image I to be analyzed. t .

[0074] In this method, the DC motor directly controls the movement time by controlling the timing of the high-level signal and controls the motor speed by controlling the duty cycle of the PWM signal. Therefore, the timing of the high-level signal and the duty cycle of the PWM determine the displacement of the motor, and there is no need to set the movement step size, thus avoiding the problems of focusing failure or slow focusing speed of stepper motors in the prior art.

[0075] Step S14 specifically includes the following steps:

[0076] S141: The average filtering method is used to process two adjacent sharpness value sequences {s1, s2, ..., s...} respectively. N} and {s2, s3, ..., s N+1} Perform filtering to obtain two adjacent filtered values ​​s' N-1 and s' N .

[0077] in,

[0078] S142: Determine whether two adjacent filter values ​​decrease as the projection module moves in the current direction.

[0079] If s′ N-1 -s′ N If the value is less than 0, the projection module should be moved in the opposite direction of the current movement direction.

[0080] Specifically, after N captures of the projected image, the sequence of sharpness values ​​{s1, s2, ..., s} between two adjacent images is calculated. N} and {s2, s3, ..., s N+1 After applying the N-point averaging filter to the two adjacent sharpness value sequences, two filtered values ​​s' are obtained. N-1 and s' N ,in,

[0081] Calculate s' N-1 -s' N If the value of is greater than 0, it means that the two adjacent filter values ​​attenuate as the projection module moves in the current direction. In this case, the direction the projection module is moving is the direction of the optimal focus position, and the projection module is controlled to continue moving in the current direction. When s' N-1 -s'N A value less than 0 indicates that the two adjacent filter values ​​increase with the current movement direction of the projection module, meaning that the projection module has passed the optimal focus position and should move to the optimal focus position in the opposite direction of the current movement direction.

[0082] S143: When s' N-1 -s' N When <0, stop driving the projection module to move and search for the sharpness sequence {s1, s2, ..., s}. N The maximum value in}.

[0083] Wherein, the position corresponding to the maximum value is d = argmax(S).

[0084] S144: Calculate the return time T.

[0085] in, t i For the resolution value s i The calculation time.

[0086] Specifically, when s' N-1 -s' N When the value is less than 0, the projection module stops moving. For example, the DC motor can be stopped, thus stopping the projection module from moving further. The stored sharpness sequence {s1, s2, ..., s} is searched. N Find the maximum value in the expression, and locate the position d = argmax(S) corresponding to this maximum value. This position is the optimal focus position. Calculate the return time required to move from the current position to the optimal focus position d. t i For the resolution value s i The calculation time.

[0087] like Figure 8 As shown, the original image sharpness value curve is unimodal but contains many local saddle points. The curve becomes smoother after averaging filtering, allowing the gradient calculation of this filtered curve to smoothly traverse the optimal focus position of the projection module. Based on steps S143 and S144, the corresponding return point and optimal focus position can be found. Figure 8 The sharpness curve depicts the sharpness range within the movement range of the projection module. The return time T can be calculated according to step S145. Figure 8 As can be seen, assuming the initial position of the projection module is at the leftmost end of the image curve, the total time spent on focusing in this example is approximately equal to the time spent calculating 50 frames of images. If the average time to calculate one frame of image is 20ms, then the total time spent on autofocus in this case is about 1 second.

[0088] Step S15 specifically includes the following steps:

[0089] Step S151: Drive the projection module to move continuously in the opposite direction of the current movement direction at a preset speed for a return time T, so that the projection module moves to the optimal focus position.

[0090] In one embodiment, step S13 further includes: calculating the sharpness value s of each image to be analyzed based on a sharpness evaluation function while moving the projected image.

[0091]

[0092] Among them, S x (x, y) and S y (x, y) is obtained by the Sobel edge detection operator and image convolution.

[0093] Specifically, the sharpness value s of each image to be analyzed is calculated using the evaluation function of the Tenengrad gradient algorithm, where S is the sharpness value of each image to be analyzed. x (x, y) and S y (x, y) represents the value at pixel (x, y) of the image to be analyzed convolved with the Sobel edge operator. The Sobel edge operator has one in the x-axis direction and one in the y-axis direction.

[0094] The calculation method in this embodiment balances calculation speed and effect, ensuring the single-peak nature of the sharpness curve while quickly evaluating the sharpness of the image to be analyzed. It has lower computational complexity and less time consumption, allowing the calculation module to acquire and process more sequence images within the range that the camera module can move, thus ensuring the density of the sharpness curve.

[0095] This application also provides a device with a storage function. The device stores a computer program, which, when executed by a processor, implements the steps of the autofocus method for the aforementioned projection device. For details, please refer to the above embodiments, which will not be repeated here.

[0096] As described above, this application uses a device with storage function to store programs, which are executed by the processor and intermediate data generated during program execution, facilitating users to pre-store data. It should be understood that the methods and devices disclosed in the several embodiments provided in this application can be implemented in other ways. For example, the device implementations described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0097] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0098] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0099] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), servers, magnetic disks, or optical disks.

[0100] The above are merely embodiments of this application and do not limit the scope of this patent application. Any equivalent structural or procedural changes made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of this application.

Claims

1. A projection device, characterized in that, include: The system includes a projection module, a driving module, a camera module, a computing module, and a control module, wherein the control module is electrically coupled to the projection module, the driving module, the camera module, and the computing module. The projection module is used to project the reference image onto the screen to be displayed to form a projected image. The control module is used to control the drive module to drive the projection device to move, so that the projection module projects multiple projection images in a preset time sequence, and controls the camera module to capture the projection images frame by frame in the preset time sequence to obtain multiple images to be analyzed. The control module is also used to control the calculation module to synchronously calculate the sharpness value of each image to be analyzed when the camera module captures the projected image frame by frame, to obtain a sharpness value sequence, and to analyze two adjacent sharpness value sequences to determine the optimal focus position and the return time required to move to the optimal focus position. The control module is also used to control the drive module to drive the projection device to move continuously at a preset speed in the opposite direction of the current moving direction for the return time, so that the projection device moves to the optimal focus position; The calculation module includes a filtering unit, which is used to filter two adjacent sharpness value sequences using an average filtering method to obtain two adjacent filtered values. The movement direction determination unit is used to determine whether two adjacent filter values ​​are attenuated with the current movement direction of the projection module. If not, it is determined that the projection module should move in the opposite direction of the current movement direction. The return time calculation unit is used to obtain the return time based on each of the resolution values ​​and the calculation time of each of the resolution values.

2. The projection device according to claim 1, characterized in that, The camera module is used to capture the projected image frame by frame to obtain the projected image, and extract the pixels of the desired focus area in the projected image to generate the image to be analyzed.

3. The projection device according to claim 1, characterized in that, The drive module is a DC motor; the control module is used to control the DC motor to drive the projection module to move at a preset speed, so that the projection module projects multiple projection images in a preset sequence.

4. The projection device according to claim 3, characterized in that, The control module is also used to control the DC motor to drive the projection module to move continuously at the preset speed in the opposite direction of the current moving direction for the return time, so that the projection module moves to the optimal focus position.

5. The projection device according to claim 4, characterized in that, The calculation module further includes a sharpness calculation unit, used to calculate the sharpness value of each of the images to be analyzed according to the sharpness evaluation function.

6. The projection device according to claim 4, characterized in that, The filtering unit is a low-pass filter.

7. An automatic focusing method for a projection device, characterized in that, The method includes: driving the projection device to move at a preset speed, so that the projection module installed in the projection device projects the reference image onto the screen to be displayed in a preset sequence to form multiple projected images; The projected images are captured frame by frame according to the preset time sequence to obtain multiple images to be analyzed; While capturing the projected image frame by frame, the sharpness value of each image to be analyzed is calculated simultaneously to obtain a sharpness value sequence. Analyze two adjacent sequences of said sharpness values ​​to determine the optimal focus position and the return time required to move to said optimal focus position; Drive the projection device to move continuously in the opposite direction of the current movement direction at the preset speed for the return time, so that the projection device moves to the optimal focus position; Among them, the average filtering method is used to process two adjacent sharpness value sequences { }and{ } Perform filtering to obtain two adjacent filtered values. and , in, , , ; Determine whether two adjacent filter values ​​attenuate with the current movement direction of the projection module, wherein if If the value is less than 0, it is determined that the projection module should move in the opposite direction of the current moving direction; when When the value is less than 0, stop driving the projection module to move and search for the sharpness sequence. The maximum value in the}, where the position corresponding to the maximum value is d=argmax(S); Calculate the return time T, where, , The resolution value The calculation time.

8. The method according to claim 7, characterized in that, The step of capturing the projected image frame by frame according to the preset time sequence to obtain multiple images to be analyzed includes: capturing the projected image frame by frame to obtain a projected image, and extracting pixels of the desired focus area in the projected image to generate the image to be analyzed.

9. The method according to claim 7, characterized in that, The step of driving the projection device to move at a preset speed so that the projection module installed in the projection device projects the reference image onto the screen to be displayed in a preset sequence to form multiple projection images includes: driving the projection module to move at a preset speed by a DC motor so that the projection module projects the reference image onto the screen to be displayed in a preset sequence to form multiple projection images. The step of driving the projection device to the optimal focus position includes: The projection module is driven to move continuously in the opposite direction of the current movement direction at the preset speed for the return time T, so that the projection module moves to the optimal focus position.

10. The method according to claim 7, characterized in that, The step of simultaneously calculating the sharpness value of each of the images to be analyzed while capturing the projected image, to obtain a sharpness value sequence, includes: When capturing the projected image, the sharpness value s of each image to be analyzed is calculated according to the sharpness evaluation function. in, and It is obtained by Sobel edge detection operator and image convolution.

11. A device with storage function, wherein a computer program is stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the autofocus method for the projection device as described in any one of claims 7-10.