A projection focusing method and a projection focusing device

By applying a reinforcement learning model in projection focus dynamically adjusting the motor moving step size, the problems of insufficient focus accuracy and focus failure caused by thermal loss of the projector in the prior art are solved, and a fast and accurate focus effect is achieved.

CN113497925BActive Publication Date: 2025-06-24APPOTRONICS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010256434.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-02
Publication Date
2025-06-24
Estimated Expiration
2040-04-02

AI Technical Summary

Technical Problem

When the existing projection focus method deals with projector thermal out-of-focus, the accuracy is insufficient and cannot effectively solve the problem of focus failure caused by thermal out-of-focus.

Method used

The reinforcement learning model is used to control the motor. By obtaining training data, the action space, state space and reward function are defined, and the reinforcement learning model is trained to dynamically adjust the motor's moving step size to achieve fast focus.

Benefits of technology

Effectively reduce the time when the projector reaches the optimal focus position, improves the focus speed and accuracy, and solves the problem of focus failure caused by thermal loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113497925B_ABST
    Figure CN113497925B_ABST
Patent Text Reader

Abstract

The present application discloses a projection focusing method and a projection focusing device. The method includes obtaining training data, where the training data includes the sharpness of multiple projection images; defining an action space, a state space, and a reward function using the training data, and the state space includes the gradient of sharpness, the moving step length of the motor, and the identification value of the rotation direction of the motor; training a reinforcement learning model using the training data, the action space, the state space, and the reward function; obtaining a current projection image using a camera device and identifying the sharpness of the current projection image, and inputting the sharpness of the current projection image into the reinforcement learning model to obtain the current moving step length of the motor; controlling the motor to move the current moving step length so that the motor drives the projection device to move; and continuing to control the motor to move when the focusing is not successful. Through the above manner, the present application can control the motor using the reinforcement learning model, reducing the time for the projection device to reach the optimal focusing position.
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 particularly to a projection focusing method and a projection focusing device. Background Art

[0002] Currently, most focusing methods adopt the ranging method and the clarity comparison method. The ranging method obtains the distance information between the projector and the projection plane through a sensor, and then directly calculates the distance that the lens needs to move to the best focusing position according to the pre-stored look-up table of distance and the best focusing position. Then, the motor is driven to drive the lens to move. Its advantage is that the speed is relatively fast, and the required time is only the time for the motor to move to the best position. However, the accuracy is insufficient, and the problem of projector thermal defocus cannot be solved. When the projector has thermal defocus, the position of the lens does not change, but the corresponding best focusing position has shifted due to the expansion of the optical instrument. At this time, the distance information that can be referenced is lost, resulting in the failure of the ranging method.

[0003] The basis of the clarity comparison method is that the distribution of the clarity of the image within the moving range of the lens has unimodality. By using the hill-climbing search method, the motor can be controlled to make the lens position approach the best focusing position. To reach a relatively ideal focusing position, the lens will oscillate back and forth near the best focusing position several times. Due to the existence of local saddle points in the clarity curve, if the motor step size is too small, the lens is likely to fall into the saddle point, resulting in focusing failure. If the step size is too large, the number of times the lens oscillates back and forth near the best focusing position will increase, slowing down the focusing speed. Therefore, a relatively efficient approach is to dynamically change the step size of the motor movement. When the lens is far from the best focusing position, the motor moves with a large step size. When the lens is close to the best focusing position, the motor step size is reduced. However, the change parameters of the step size still need to be set by people according to experience, and the generalization ability is far from sufficient. Summary of the Invention

[0004] This application provides a projection focusing method and a projection focusing device, which can control the motor by using a reinforcement learning model to reduce the time for the projection device to reach the best focusing position.

[0005] To solve the above technical problems, the technical solution adopted in this application is as follows: Provide a projection focusing method, which includes: obtaining training data, where the training data includes the sharpness of multiple projection images; defining an action space, a state space, and a reward function using the training data, where the action space includes the moving step size of the motor in the current time period, the state space includes the gradient of sharpness and the action in the previous time period of the current time period, and the reward function is used to evaluate the executed action; training a reinforcement learning model using the training data, the action space, the state space, and the reward function, where the input of the reinforcement learning model includes the sharpness of the projection image, and the output of the reinforcement learning model includes the moving step size of the motor; obtaining the current projection image using a camera device and identifying the sharpness of the current projection image, inputting the sharpness of the current projection image into the reinforcement learning model to obtain the current moving step size of the motor; controlling the motor to move the current moving step size so that the motor drives the projection device to move; determining whether the focusing is successful, if the focusing is not successful, then return to the step of obtaining the current projection image using the camera device, identifying the sharpness of the current projection image, and inputting the sharpness of the current projection image into the reinforcement learning model to obtain the current moving step size of the motor, until the focusing is successful.

[0006] To solve the above technical problems, the technical solution adopted in this application is as follows: Provide a projection focusing device, which includes a memory and a processor connected to each other, where the memory is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the above projection focusing method.

[0007] Through the above solution, the beneficial effect of this application is: First, obtain training data, then define the action space and state space based on the collected training data, and design a reward function; then, based on the collected training data, the defined action space, state space, and reward function, construct a reinforcement learning model, and then train it to obtain a reinforcement learning model; in actual use, the sharpness of the current projection image can be input into the reinforcement learning model, so as to obtain the step size that the current motor needs to move, and the motor drives the projection device to move, which can effectively reduce the moving time of the projection device, so as to quickly achieve the focusing effect. Description of the Drawings

[0008] To more clearly illustrate the technical solutions in the embodiments of this application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings. Among them:

[0009] Figure 1 It is a flowchart of an embodiment of the projection focusing method provided by this application;

[0010] Figure 2 It is a schematic flowchart of another embodiment of the projection focusing method provided by this application;

[0011] Figure 3 It is a schematic structural diagram of an embodiment of the projection focusing device provided by this application. Detailed implementation manners

[0012] Next, the technical solutions in the embodiments of this application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.

[0013] Reinforcement learning can be used to solve decision-making problems. A typical reinforcement learning model consists of two parts, namely an agent and an environment. The agent consists of a policy function and a value function. The environment includes a reward function, a state space, an action space, and a state transition function; the value function evaluates the magnitudes of all actions in the action space under the current state; the policy function selects and executes actions according to the values evaluated by the value function; the reward function evaluates the quality of the executed actions and then feeds back to the agent; the state transition function enables the agent to enter the next state according to the current state and action; the goal of reinforcement learning is to enable the agent to complete a certain task during the interaction with the environment, so that the sum of the reward values obtained by the agent in the environment is maximized.

[0014] Please refer to Figure 1 , Figure 1 It is a schematic flowchart of an embodiment of the projection focusing method provided by this application. The method includes:

[0015] Step 11: Obtain training data.

[0016] The training data includes the sharpness of multiple projection images. Multiple projection images projected by a projection device can be captured by a camera device or multiple projection images can be obtained from an image database, and then the sharpness of these projection images can be calculated using a method for calculating image sharpness to obtain the training data.

[0017] Step 12: Define an action space, a state space, and a reward function using the training data.

[0018] After obtaining the training data, the training data can be processed to define the action space, state space, and reward function. The action space includes the moving step length of the motor in the current time period. The state space includes the gradient of sharpness and the action in the previous time period of the current time period. The reward function is used to evaluate the executed action and can feedback the evaluation result to the agent.

[0019] Step 13: Use the training data, action space, state space, and reward function to train the reinforcement learning model.

[0020] After defining the action space, state space, and reward function, the reinforcement learning model can be trained using the training data. The training of the reinforcement learning model can use an iterative method. In each round of training, the agent starts from an initial position and then outputs different actions according to the policy function, thereby changing the position of the agent in the environment to obtain a trained reinforcement learning model. The input of this reinforcement learning model includes the sharpness of the projection image, and the output of the reinforcement learning model includes the moving step length of the motor.

[0021] It can be understood that Steps 11 - 13 can be carried out before the actual application starts, that is, the training model stage. During the actual application, the reinforcement learning model obtained in Steps 11 - 13 can be directly used to execute Steps 14 - 16.

[0022] Step 14: Use the imaging device to obtain the current projection image, identify the sharpness of the current projection image, and input the sharpness of the current projection image into the reinforcement learning model to obtain the current moving step length of the motor.

[0023] After training the reinforcement learning model, the actual adjustment stage can be entered, that is, the stage of adjusting the operation of the motor, so that the motor can drive the projection device to move, thereby achieving focusing. The motor can be a stepper motor, a servo motor, etc. The imaging device can be a camera. In order not to introduce errors caused by the camera, the camera can be fixedly arranged on the projector body and does not move. The motor drives the projection device to move. Specifically, it drives the projection lens in the projection device to move. For example, the motor controls the projection lens to extend and retract to make the projection device move, thereby achieving focusing. As another embodiment, the motor driving the projection device to move can also be driving the feet in the projection device to move. For example, the motor controls the feet to extend and retract to make the projection device move to achieve focusing.

[0024] Furthermore, the imaging device can be controlled to take a picture to obtain the current projection image, then the sharpness of the current projection image can be calculated using the method of calculating image sharpness, and then the sharpness of the current projection image is input into the trained reinforcement learning model to obtain the step length that the current motor needs to move.

[0025] Step 15: Control the motor to move the current moving step length so that the motor drives the projection device to move.

[0026] After obtaining the current moving step length, a control instruction can be output to the motor to control the motor to move the current moving step length, or the current moving step length can be input into the motor to make the motor move. Since the motor is connected to the projection lens or the support feet in the projection device, the motor drives the projection lens or the support feet in the projection device to move. In one embodiment, the motor drives the projection lens to move forward or backward by an appropriate step length so that the projection lens is located at the optimal focusing position. In another embodiment, the motor drives the support feet of the projection device to extend or shorten by an appropriate step length so that the height of the support feet is located at the optimal focusing position.

[0027] Step 16: Determine whether the focusing is successful.

[0028] After the projection device has moved, it can be determined whether the current position of the projection device is the optimal focusing position; if the projection device currently reaches the optimal focusing position, it indicates that the focusing is successful and clear shooting can be performed; if the projection device does not currently reach the optimal focusing position and there is a distance from the optimal focusing position, it indicates that the focusing is not successful. At this time, the steps of using the imaging device to obtain the current projection image, identifying the clarity of the current projection image, and inputting the clarity of the current projection image into the reinforcement learning model to obtain the current moving step length of the motor can be returned until the focusing is successful.

[0029] This embodiment provides a projection autofocus method based on reinforcement learning. An imaging device can be used to capture the projection image of the projector, define the action space and the state space based on the collected training data, and design a reward function; then, based on the collected training data, the defined action space, state space, and reward function, a reinforcement learning model is constructed; then the reinforcement learning model is trained to generate an optimal focusing strategy, and the trained reinforcement learning model is used for focusing. The current clarity is input into the reinforcement learning model to obtain the step length that the current motor needs to move, so that the motor drives the projection device to move. It is possible to train the optimal strategy for controlling the motor based on the reinforcement learning model established by the clarity comparison focusing method, dynamically adjust the moving step length of the motor, reduce the time for the projection device to reach the optimal focusing position, and achieve fast focusing.

[0030] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of another embodiment of the projection focusing method provided by this application. The method includes:

[0031] Step 21: Control the motor to move at a preset step length within a preset moving interval so that the motor drives the projection device to move.

[0032] The projector can be placed first, and the projector is controlled to project an image, and then the motor is controlled to move from one end point of the preset movement range to the other end point.

[0033] Step 22: Control the imaging device to take a picture after the motor moves a preset step length to obtain a projection image, and calculate the sharpness of the projection image by using the gradient method.

[0034] After the motor moves a preset step length each time, the projection screen can be photographed to obtain a projection image, and then the gradient method can be used to process the obtained projection image to obtain the sharpness of the projection image, and it is stored, so as to obtain a sharpness array, which is used as the data set for training the reinforcement learning model.

[0035] Optionally, in order to increase the generalization ability of the reinforcement learning model, the projector can be placed at different positions from the projection plane, and multiple groups of sharpness arrays are collected as training data.

[0036] Step 23: Define the action space, state space and reward function by using the training data.

[0037] The length of the obtained sharpness array is the length of the preset movement range, and the maximum step length of the single movement of the motor can be determined according to the length of the preset movement range; for example, if the length of the sharpness array is N, the maximum step length is defined as N / 4.

[0038] Since the motor can rotate forward and backward, the action space can be represented by a vector containing two elements, that is, the action space is denoted as a, a ∈ [d, n], d is the identification value of the rotation direction of the motor, d = -1, 1, n is the movement step length of the motor, n = 1, 2,..., L max , L max is the maximum step length, where d = -1 means the motor rotates backward, d = 1 means the motor rotates forward; when the maximum step length is N / 4, there are N / 2 output actions in total, that is, the action space is a discrete vector with a length of N / 2.

[0039] The state of the reinforcement learning model needs to satisfy the Markov property, that is, the response of the environment only depends on the current state and action. The definition of the state should fully describe the position of the agent in the reinforcement learning model as much as possible, with richness and uniqueness. The gradient of the sharpness and the action in the previous time period can be defined as the state in the current time period, that is, the state space includes the gradient of the sharpness, the movement step length of the motor in the previous time period, and the identification value of the rotation direction of the motor in the previous time period. The state space is denoted as s, s ∈ [g, d, n], g is the gradient of the sharpness, and S t is the sharpness of the projection image at time t, S t-1is the sharpness of the projected image at time t-1, and n is the moving step of the motor at time t-1. Since the gradient of sharpness is continuous, the state space is theoretically infinite.

[0040] It can be seen from the focusing method based on sharpness evaluation that when the projection device approaches the best focusing position, the gradient of sharpness gradually decreases, and the step size also gradually decreases. Based on this characteristic, the designed reward function is:

[0041]

[0042] where α and β are weighting coefficients, and the values of α and β are related to the training data. k is the number of times of the currently executed action, and its purpose is to make the reinforcement learning strategy be executed as few times as possible to improve the focusing speed. Specifically, continuous testing and learning are carried out through the collected data, and the weighting coefficients α and β are evaluated according to the test results.

[0043] Step 24: Construct a reinforcement learning model network using the action space, state space, and reward function.

[0044] The environment model in the reinforcement learning model can be represented by the stored sharpness array. Since the sharpness of the position where the projection device is located and the sharpness of the new position after the execution of the action can be read from the stored sharpness array, it can avoid the time spent on calculating sharpness when actually controlling the motor and speed up the model training.

[0045] The agent adopts the classic DQN (Deep Q-Learning) algorithm, uses the neural network algorithm to establish a policy function that maps the state space to the action space, and then uses the Q-learning algorithm and the backpropagation algorithm to update the parameters of the neural network.

[0046] Step 25: Use the training data to train the reinforcement learning model network to obtain a reinforcement learning model.

[0047] Train the established reinforcement learning model network. The termination condition for each round of training is that the agent in the reinforcement learning model reaches the best focusing position and / or the decision-making times of the agent are greater than the preset times.

[0048] After each preset round of training, use the test data to test the currently obtained reinforcement learning model to obtain the reward value corresponding to the test data; then sum up the reward values corresponding to the test data to obtain the total reward value, and store the total reward value; continue the training until the total reward value converges, that is, the termination condition of the training is that the total reward value no longer increases. At this time, the training can be ended to obtain the reinforcement learning model.

[0049] Step 26: Use the imaging device to obtain the current projection image, identify the clarity of the current projection image, and input the clarity of the current projection image into the reinforcement learning model to obtain the current moving step of the motor.

[0050] Step 27: Control the motor to move the current moving step so that the motor drives the projection device to move.

[0051] Step 28: Determine whether the focusing is successful.

[0052] Steps 26-28 are the same as steps 14-16 in the above embodiment, and will not be repeated here.

[0053] In this embodiment, the training data is first obtained by using the imaging device. The defined action space includes the identification value of the rotation direction of the motor and the moving step of the motor. The defined state space includes the gradient of clarity and the action in the previous time period. The reward function is designed by using the identification value of the rotation direction of the motor, the gradient of clarity, the moving step of the motor, and the number of times of executing the action. Then, the reinforcement learning model network is constructed and trained to obtain the reinforcement learning model. The moving step of the motor can be adjusted in real time through this reinforcement learning model, which can effectively reduce the moving time of the projection device and achieve fast focusing.

[0054] Refer to Figure 3 , Figure 3 which is a schematic structural diagram of an embodiment of the projection focusing device provided by the present application. The projection focusing device 30 includes a memory 31 and a processor 32 connected to each other. The memory 31 is used to store a computer program, and when the computer program is executed by the processor 32, it is used to implement the projection focusing method in the above embodiment.

[0055] The above are only the embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.

Claims

1. A projection focusing method, characterized in that, Including: Obtain training data, where the training data includes the sharpness of multiple projection images; Define an action space, a state space, and a reward function using the training data. Among them, the action space includes the moving step size of the motor in the current time period, the state space includes the gradient of the sharpness and the motor action in the previous time period of the current time period, and the reward function is used to evaluate the executed action; Train a reinforcement learning model using the training data, the action space, the state space, and the reward function. Among them, the input of the reinforcement learning model includes the sharpness of the projection image, and the output of the reinforcement learning model includes the moving step size of the motor; Obtain the current projection image using a camera device, identify the sharpness of the current projection image, and input the sharpness of the current projection image into the reinforcement learning model to obtain the current moving step size of the motor; Control the motor to move the current moving step size so that the motor drives the projection device to move; Judge whether the focusing is successful; If not, return to the step of obtaining the current projection image using the camera device, identifying the sharpness of the current projection image, and inputting the sharpness of the current projection image into the reinforcement learning model to obtain the current moving step size of the motor until the focusing is successful.

2. The projection focusing method according to claim 1, wherein The step of obtaining training data includes: Control the motor to move within a preset moving interval at a preset step size so that the motor drives the projection device to move; Control the camera device to take a picture after the motor moves the preset step size to obtain the projection image, and calculate the sharpness of the projection image using the gradient method.

3. The projection focusing method according to claim 2, wherein The step of defining the action space using the training data includes: Determine the maximum step size of the motor's single movement according to the length of the preset moving interval; Among them, the action space is denoted as a, a ∈ [d, n], where d is the identification value of the rotation direction of the motor, d = -1, 1; n is the moving step of the motor, n = 1, 2, …, L max , L max is the maximum step length.

4. The projection focusing method according to claim 3, wherein: The state space is denoted as s, s ∈ [g, d, n], where g is the gradient of the sharpness, and S t is the sharpness of the projected image at time t, S t-1 is the sharpness of the projected image at time t - 1, and n is the moving step of the motor.

5. The projection focusing method according to claim 4, wherein: The reward function is: Where α and β are weighting coefficients, the values of α and β are related to the training data, k is the number of times of the currently executed action, and n is the moving step size of the motor.

6. The projection focusing method according to claim 1, wherein The step of training the reinforcement learning model using the training data, the action space, the state space, and the reward function includes: Construct a reinforcement learning model network using the action space, the state space, and the reward function; Use the training data to train the reinforcement learning model network to obtain the reinforcement learning model.

7. The projection focusing method according to claim 6, wherein The step of constructing a reinforcement learning model network using the action space, the state space, and the reward function includes: Establish a policy function that maps the state space to the action space using a neural network algorithm; Update the parameters of the neural network using the Q-learning algorithm and the backpropagation algorithm.

8. The projection focusing method according to claim 1, wherein: The termination condition for each round of training is that the agent in the reinforcement learning model reaches the best focusing position and / or the decision-making times of the agent are greater than the preset times.

9. The projection focusing method according to claim 1, wherein The method further includes: After each preset round of training, using test data to test the currently trained reinforcement learning model to obtain a reward value corresponding to the test data; Summing up the reward values corresponding to the test data to obtain a total reward value, and storing the total reward value; Continuing the training until the total reward value converges.

10. A projection focusing device, characterized in that, It includes a memory and a processor connected to each other. Among them, the memory is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the projection focusing method described in any one of claims 1-9.

Citation Information

Patent Citations

  • Automatic focusing device and automatic focusing method for projector

    CN101571665A

  • Automatic focusing method and device, storage medium and computer equipment

    CN109698901A