A Camera-based Automatic Focusing Method and Device for Projectors

Multiple projected images of the projector are obtained through the camera, and the clarity and projection ratio calculation functions are used to realize the projector's autofocus in two steps, solving the problems of inaccurate focus and high hardware cost in the existing technology, and achieving efficient and accurate projector autofocus.

CN118741065BActive Publication Date: 2025-07-29HUNAN QUANYING ELECTRONICS CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410984115.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2025-07-29
Estimated Expiration
2044-07-22

AI Technical Summary

Technical Problem

The existing projector automatic focusing method has errors when controlling the motor to reach the clearest position on the screen, and the method that relies on the stepper motor is prone to lose steps when the lens rotates and friction torque is large, resulting in inaccurate focus and increasing hardware costs.

Method used

The camera obtains multiple projected images of the projector along the direction of focus movement, uses the clarity calculation function to determine the maximum sharpness value, and records the corresponding projected images, calculate the relative size of the projection ratio, and realizes focus in two steps: first align the vicinity of the clearest position, and then fine-tune it through the relative size function of the projection ratio.

Benefits of technology

The projector accurately focuses to the clearest position, reduces hardware costs and improves the accuracy and efficiency of focus.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118741065B_ABST
    Figure CN118741065B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for automatic focusing of a projector based on a camera, which obtains a plurality of projection images when the projector rotates along the focusing movement direction through the camera; calculates the clarity values of the plurality of projection images according to a clarity calculation function, and determines the maximum clarity value; records the projection image corresponding to the maximum clarity value, and controls the projector to stop rotating; calculates the relative size of the projection ratio of the projection image corresponding to the maximum clarity value to obtain a first projection ratio; obtains the projection image after the projector stops rotating through the camera, and calculates the relative size of the projection ratio to obtain a second projection ratio; determines whether to end the focusing according to the difference between the first projection ratio and the second projection ratio. The present application first uses the clarity calculation function to align the projector near the clearest position, and then uses the relative size function of the projection ratio to fine-tune near the clearest position, so that the projector can reach the position with the clearest focus.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of automatic focusing of projectors, and particularly to an automatic focusing method and device for projectors based on a camera. Background Art

[0002] A projector is a device used to project images or videos onto a large screen or wall. It usually consists of a light source, a lens, and an image processor. Projectors are widely used in fields such as education, business presentations, and home theaters. Using a projector, the image or video content of devices such as computers, DVD players, and game consoles can be enlarged and projected, thereby achieving a larger viewing area and enabling viewers to see image details more clearly.

[0003] During the use of a projector, if the projection distance and focal length are not appropriate, a defocus problem will occur, resulting in a relatively blurred image displayed by the projector and affecting the viewing experience. Currently, projectors generally have two methods: manual adjustment and automatic adjustment. Manual adjustment relies on the human eye to judge the image, controls the movement of the motor of the projector through a remote control, and then drives the movement of the lens to complete the focusing operation. Automatic adjustment relies on a camera or a TOF (time of flight) sensor installed on the projector to sense the projection distance or image clarity, and then automatically controls the motor to move to an appropriate position to complete the focusing operation.

[0004] A patent document with the publication number: CN106231201A discloses an automatic focusing method and device. The clarity of a feature image can be calculated by extracting the feature image from the image data uploaded by the camera, and then the feature image with the highest clarity can be found, and the driving motor is controlled to rotate to the rotation angle corresponding to the feature image with the highest clarity, thereby realizing the automatic focusing of the projector.

[0005] A patent document with the publication number: CN107277381A discloses a camera focusing method and device. By adjusting a stepping motor, multiple images under different benchmarks are obtained, and then the optimal clarity value is calculated based on these multiple images to achieve fast focusing of the camera.

[0006] A patent document with the publication number CN110740302A discloses a method and device for positioning the out-of-focus direction of a projector. By projecting a marker pattern onto the projection surface, capturing the marker pattern on the projection surface and obtaining the marker pattern image after processing, calculating the clarity value in the horizontal direction and the clarity value in the vertical direction of the marker pattern image, a method for positioning the out-of-focus direction of the projector and the corresponding positioning device based on the clarity value in the horizontal direction and the clarity value in the vertical direction of the marker pattern image are provided. The out-of-focus direction of the projector optical engine is determined, which provides an accurate left or right focusing direction for the optical engine focusing, so that the optical engine can directly adjust the focal length in the out-of-focus direction.

[0007] In summary, in the current automatic focusing method based on a camera, when controlling the motor to reach the position with the clearest image, the clearance between the motor and the lens gear, the rotational inertia of the motor, and the image blurring caused by the motor movement are not considered. These problems will lead to errors in the image clarity evaluation method, and the motor cannot accurately stop at the clearest position.

[0008] In addition, relying on the count value of the stepper motor to control the stepper motor to move to the clearest position, this method is prone to losing steps when the rotational frictional torque of the lens is large, thus affecting the focusing accuracy; installing an angle sensor on the motor, when the camera obtains the clarity evaluation value of the projection image, the angle of the motor can be recorded, so as to obtain the point with the clearest focus position. This method will increase the hardware cost. Summary of the Invention

[0009] Therefore, the present application provides a method and device for automatic focusing of a projector based on a camera to solve the problem of inaccurate focusing of the projector focusing method in the prior art.

[0010] To achieve the above object, the present application provides the following technical solutions:

[0011] In a first aspect, a method for automatic focusing of a projector based on a camera includes:

[0012] Step 1: Obtain a plurality of projection images when the projector rotates along the focusing movement direction through a camera;

[0013] Step 2: Calculate the clarity values of the plurality of projection images according to the clarity calculation function and determine the maximum clarity value;

[0014] Step 3: Record the projection image corresponding to the maximum clarity value and control the projector to stop rotating;

[0015] Step 4: Calculate the relative size of the projection ratio of the projection image corresponding to the maximum clarity value to obtain a first projection ratio;

[0016] Step 5: Obtain the projection image after the projector stops rotating through the camera, calculate the relative size of the projection ratio, and obtain the second projection ratio;

[0017] Step 6: Determine whether to end the focusing based on the difference between the first projection ratio and the second projection ratio.

[0018] Optionally, in the above Step 1, the process of determining the focusing movement direction is as follows:

[0019] Step 101: Obtain multiple projection images when the projector rotates in any direction through the camera;

[0020] Step 102: Calculate the sharpness values of the multiple projection images according to the sharpness calculation function to obtain multiple sharpness values;

[0021] Step 103: Determine the focusing movement direction according to the multiple sharpness value sequences.

[0022] Optionally, the above Step 103 is specifically:

[0023] If the multiple sharpness value sequences first rise and then fall, the focusing movement direction is appropriate; if the multiple sharpness value sequences fall, it is opposite to the focusing movement direction.

[0024] Optionally, in the above Step 2, when determining the maximum sharpness value:

[0025] If the sharpness value sequences of the multiple projection images first rise and then fall, control the projector to reverse, and at the same time control the camera to continuously capture the projection images projected by the projector, and calculate the sharpness value of the current projection image. If the difference between the sharpness value of the current projection image and the maximum sharpness value in the sharpness value sequence is within the threshold range, the sharpness value of the current projection image is the maximum sharpness value.

[0026] Optionally, in the above Step 2, the sharpness calculation function is the variance of Laplacian, Sobel gradient, Fourier transform or Brenner gradient.

[0027] Optionally, in the above Step 4 or Step 5, the relative size of the projection ratio is the average distance between multiple feature points in the projection image.

[0028] Optionally, the above Step 6 is specifically:

[0029] Step 601: Judge whether the difference between the first projection ratio and the second projection ratio is less than the threshold,

[0030] Step 602: If the difference is less than the threshold, end the focusing;

[0031] Step 603: If the difference is greater than the threshold, control the projector to move along the direction of the maximum sharpness value and reshoot the projection screen;

[0032] Step 604: Calculate the relative size of the projection ratio of the reshot projection screen, and obtain the second projection ratio again until the difference between the first projection ratio and the second projection ratio is less than the threshold.

[0033] In a second aspect, a camera-based automatic focusing device for a projector includes:

[0034] A projection screen acquisition module, configured to acquire multiple projection screens when the projector rotates along the focusing movement direction through a camera;

[0035] A sharpness value calculation module, configured to calculate the sharpness values of the multiple projection screens according to a sharpness calculation function and determine the maximum sharpness value;

[0036] A projection screen determination module: record the projection screen corresponding to the maximum sharpness value and control the projector to stop rotating;

[0037] A projection ratio relative size calculation module, configured to calculate the relative size of the projection ratio of the projection screen corresponding to the maximum sharpness value to obtain a first projection ratio;

[0038] And acquire the projection screen after the projector stops rotating through the camera, and calculate the relative size of the projection ratio to obtain a second projection ratio;

[0039] A difference calculation module, configured to determine whether to end focusing according to the difference between the first projection ratio and the second projection ratio.

[0040] In a third aspect, a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a camera-based automatic focusing method for a projector are implemented.

[0041] In a fourth aspect, a computer program product includes a computer program or instruction, and when the computer program or instruction is executed by a processor, the steps of a camera-based automatic focusing method for a projector are implemented.

[0042] Compared with the prior art, the present application has at least the following beneficial effects:

[0043] The present application provides a method and device for automatic focusing of a projector based on a camera. Multiple projection images are obtained by the camera when the projector rotates along the focusing movement direction; the clarity values of the multiple projection images are calculated according to a clarity calculation function, and the maximum clarity value is determined; the projection image corresponding to the maximum clarity value is recorded, and the projector is controlled to stop rotating; the relative size of the projection ratio of the projection image corresponding to the maximum clarity value is calculated to obtain a first projection ratio; a projection image after the projector stops rotating is obtained by the camera, and the relative size of the projection ratio is calculated to obtain a second projection ratio; whether to end the focusing is determined according to the difference between the first projection ratio and the second projection ratio. The present application first uses the clarity calculation function to align the projector near the clearest position, and then uses the relative size function of the projection ratio to fine-tune near the clearest position, so that the projector can reach the position with the clearest focus. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] To more intuitively illustrate the prior art and the present application, exemplary drawings are given below. It should be understood that the specific shapes and structures shown in the drawings generally should not be regarded as limiting conditions when implementing the present application; for example, those skilled in the art are capable of making routine adjustments or further optimizations to the addition / deletion / attribution division of certain units (components), specific shapes, positional relationships, connection methods, dimensional ratio relationships, etc. based on the technical concept disclosed in the present application and the exemplary drawings.

[0045] Figure 1 It is a basic flowchart of a method for automatic focusing of a projector based on a camera provided in Embodiment 1 of the present application;

[0046] Figure 2 It is a judgment flowchart of a method for automatic focusing of a projector based on a camera provided in Embodiment 1 of the present application;

[0047] Figure 3 It is a schematic diagram showing the relationship between the clarity calculation function value and the focal length provided in Embodiment 1 of the present application;

[0048] Figure 4 It is a schematic diagram showing the relationship between the projection ratio and the focal length provided in Embodiment 1 of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0049] The following further details the present application through specific embodiments in conjunction with the drawings.

[0050] In the description of the present application: Unless otherwise specified, "a plurality of" means two or more. The terms "first", "second", "third", etc. in the present application are intended to distinguish the objects being referred to, and do not have special meanings in terms of technical connotations (for example, they should not be understood as emphasizing importance or order, etc.). Expressions such as "including", "comprising", "having", etc. also mean "not limited to" (certain units, components, materials, steps, etc.).

[0051] In the present application, terms such as "upper", "lower", "left", "right", "middle", etc. cited are usually indications of the general relative position relationship for the convenience of intuitively understanding with reference to the accompanying drawings, and are not absolute limitations on the position relationship in the actual product.

[0052] Embodiment 1

[0053] Please refer to Figure 1 and Figure 2 , this embodiment provides a method for automatically focusing a projector based on a camera, including:

[0054] S1: Obtain a plurality of projection images when the projector rotates along the focusing movement direction through the camera;

[0055] Specifically, at the beginning of focusing, since the focusing movement direction is not clear, it is necessary to first determine the focusing movement direction:

[0056] S101: Obtain a plurality of projection images P when the projector rotates in any direction through the camera;

[0057] S102: Calculate the clarity values of the plurality of projection images P according to the clarity calculation function f1 to obtain a plurality of clarity values;

[0058] More specifically, this embodiment provides a clarity calculation function f1, which can be used to quantify the clarity value of the image. The clearer the image, the larger the function value. Since both too close and too far focal lengths will cause the image to be blurred, the clarity calculation function f1 is a unimodal function with respect to the focal length value.

[0059] S103: Determine the focusing movement direction according to the plurality of clarity value sequences.

[0060] More specifically, if the plurality of clarity value sequences first rise and then fall, the focusing movement direction is appropriate; if the plurality of clarity value sequences fall, it is opposite to the focusing movement direction.

[0061] S2: Calculate the clarity values of the plurality of projection images according to the clarity calculation function f1, and determine the maximum clarity value f1(P m );

[0062] Specifically, determine the maximum clarity value f1(Pm ) When:

[0063] Since the clarity calculation function f1 has unimodality, if the clarity value sequences of multiple projection screens first rise and then fall, it indicates that the clearest position P has been passed. m , so it is necessary to control the motor of the projector to reverse, and at the same time control the camera to continuously capture the projection screen P projected by the projector, and calculate the clarity value of the current projection screen P. If the clarity value of the current projection screen and the maximum clarity value f1(P m ) in the clarity value sequence are within the threshold range, it indicates that it is close to the clearest position P. m , so the clarity value of the current projection screen can be determined as the maximum clarity value f1(p m ).

[0064] Specifically, the clarity calculation function f1 is the Laplacian variance, Sobel gradient, Fourier transform or Brenner gradient.

[0065] S3: Record the projection screen P(p m ) corresponding to the maximum clarity value, and control the projector to stop rotating;

[0066] S4: Calculate the relative size of the projection ratio of the projection screen corresponding to the maximum clarity value to obtain the first projection ratio;

[0067] Please refer to Figure 3 , the calculated value of the clarity calculation function f1 and the focal length do not have a one-to-one relationship. Near the peak of f1, the slope of f1 with respect to the focal length is small, and the change in the clarity value caused by the movement of the focal length is also small. Therefore, it is easy to have inaccurate focusing near the peak. Therefore, this embodiment provides another function f2, which is used to calculate the relative size of the projection ratio of the projection. Because during the focusing process, the projection ratio of the projector will change. From the minimum focal length to the maximum, the projection ratio also changes monotonically, as Figure 4 shown. The projection ratio is reflected on the image captured by the camera, showing as two points on the projection screen. As the projection ratio increases, the distance between the two points on the camera image becomes smaller. Therefore, the change in the projection ratio can be reflected by measuring the distance between these two points.

[0068] Specifically, the relative size of the projection ratio is the average value of the distances between multiple feature points on the projection screen. Therefore, if the f2(p m ) value of the clarity peak is recorded, then the relationship between P and P m can be determined according to the relationship between the current f2(p) value and the peak f2(p m ), so as to determine the rotation direction of the projector motor.

[0069] S5: Obtain the projected image after the projector stops rotating through a camera, calculate the relative size of the projection ratio, and obtain the second projection ratio.

[0070] S6: Determine whether to end the focusing based on the difference between the first projection ratio and the second projection ratio.

[0071] Since the f2 function is a monotonic function, it is possible to judge the size of P m and P, and thus control the motor to move a certain distance along the P m direction. At this time, capture the current image P again, and calculate the f2(p) value of the current projected image P. If P m and P are less than the threshold, the entire focusing process can end; if P m and P are greater than the threshold, continue to control the motor to fine-tune in the P m direction until P m and P are less than the threshold.

[0072] Specifically:

[0073] S601: Judge whether the difference between the first projection ratio and the second projection ratio is less than the threshold.

[0074] S602: If the difference is less than the threshold, end the focusing.

[0075] S603: If the difference is greater than the threshold, control the projector to move along the direction of the maximum clarity value, and capture the projected image again.

[0076] S604: Calculate the relative size of the projection ratio of the re-captured projected image, re-obtain the second projection ratio, until the difference between the first projection ratio and the second projection ratio is less than the threshold.

[0077] The automatic focusing method for a projector based on a camera provided in this embodiment takes into account the gap between the projector lens and the motor, the inertia of the lens, and the frictional resistance, making it difficult to align accurately in one go during the automatic focusing process. Therefore, the automatic focusing process is divided into two steps: the first time is to align near the clearest position, and the second time is to gradually approach the clearest position through several fine-tunings; this embodiment also takes into account that when the projection focal length changes, the projection ratio of the projector will also change accordingly, and the change in the projection ratio is reflected in the photo obtained by the camera as the change in the pixel distance between the marking points. Therefore, by measuring the distance between the marking points in the photo, the corresponding relationship of the focal length can be indirectly obtained.

[0078] When searching for the clearest position in this embodiment, a photo of the clearest position will be recorded, and the distance between the marking points of the photo of the clearest position will be obtained. When making fine adjustments near the clearest position, by comparing the distance between the current marking points with the distance between the clearest marking points, and based on the difference between this distance value and the distance value of the marking points in the current screen, it is determined whether the focal length is too far or too close. Thus, by controlling the moving direction of the motor, it continuously moves towards the focal length of the clearest position.

[0079] In summary, in this embodiment, the projector is first aligned near the clearest position by using the clarity calculation function, and then fine-tuned near the clearest position by using the relative size function of the projection ratio, so that the projector can reach the position with the clearest focus.

[0080] Embodiment 2

[0081] This embodiment provides a camera-based automatic focusing device for a projector, including:

[0082] A projection screen acquisition module, configured to acquire multiple projection screens when the projector rotates along the focusing movement direction through a camera;

[0083] A clarity value calculation module, configured to calculate the clarity values of the multiple projection screens according to the clarity calculation function and determine the maximum clarity value;

[0084] A projection screen determination module: record the projection screen corresponding to the maximum clarity value and control the projector to stop rotating;

[0085] A projection ratio relative size calculation module, configured to calculate the relative size of the projection ratio of the projection screen corresponding to the maximum clarity value to obtain a first projection ratio;

[0086] And acquire the projection screen after the projector stops rotating through the camera, and calculate the relative size of the projection ratio to obtain a second projection ratio;

[0087] A difference calculation module, configured to determine whether to end the focusing according to the difference between the first projection ratio and the second projection ratio.

[0088] For the specific implementation content of each module in a camera-based automatic focusing device for a projector, reference can be made to the limitations on a camera-based automatic focusing method for a projector in the above text, which will not be elaborated here.

[0089] Embodiment 3

[0090] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a camera-based automatic focusing method for a projector are implemented.

[0091] Embodiment 4

[0092] This embodiment provides a computer program product, including a computer program or instructions, and when the computer program or instructions are executed by a processor, the steps of a method for automatically focusing a camera-based projector are implemented.

[0093] The technical features of the above embodiments can be combined arbitrarily (as long as there is no contradiction in the combination of these technical features). For the sake of concise description, not all possible combinations of the various technical features in the above embodiments are described; these embodiments that are not explicitly written should also be considered to be within the scope described in this specification.

Claims

1. An automatic focusing method for a camera-based projector, characterized in that, including: Step 1: Obtain multiple projection images through a camera when the projector rotates along the focus movement direction; Step 2: Calculate the clarity values of the multiple projection images according to the clarity calculation function, and determine the maximum clarity value; When determining the maximum clarity value, specifically: If the clarity value sequence of the multiple projection images first rises and then falls, control the projector to reverse, and at the same time control the camera to continuously capture the projection image projected by the projector, and calculate the clarity value of the current projection image. If the difference between the clarity value of the current projection image and the maximum clarity value in the clarity value sequence is within the threshold range, the clarity value of the current projection image is the maximum clarity value; Step 4: Record the projection image corresponding to the maximum clarity value, and control the projector to stop rotating; Step 5: Calculate the relative size of the projection ratio of the projection image corresponding to the maximum clarity value to obtain the first projection ratio; the relative size of the projection ratio is the average value of the distances between multiple feature points in the projection image; Step 6: Obtain the projection image after the projector stops rotating through the camera, and calculate the relative size of the projection ratio to obtain the second projection ratio; Step 7: Determine whether to end the focus according to the difference between the first projection ratio and the second projection ratio; In the said Step 1, the determination process of the focus movement direction is: Step 101: Obtain multiple projection images through a camera when the projector rotates along any direction; Step 102: Calculate the clarity values of the multiple projection images according to the clarity calculation function to obtain multiple clarity values; Step 103: Determine the focus movement direction according to the multiple clarity value sequences; specifically: If the multiple clarity value sequences first rise and then fall, the focus movement direction is appropriate; if the multiple clarity value sequences fall, it is opposite to the focus movement direction; The said Step 6 is specifically: Step 601: Judge whether the difference between the first projection ratio and the second projection ratio is less than the threshold; Step 602: If the difference is less than the threshold, end the focus; Step 603: If the difference is greater than the threshold, control the projector to move along the direction of the maximum clarity value, and re-capture the projection image; Step 604: Calculate the relative size of the projection ratio of the re-captured projection image to re-obtain the second projection ratio until the difference between the first projection ratio and the second projection ratio is less than the threshold.

2. The automatic focusing method of a camera-based projector according to claim 1, wherein In the said Step 2, the clarity calculation function is the variance of Laplacian, Sobel gradient, Fourier transform or Brenner gradient.

3. An automatic focusing device for a camera-based projector, characterized in that, including: A projection image acquisition module, configured to obtain multiple projection images through a camera when the projector rotates along the focus movement direction; The determination process of the focus movement direction is: Obtain multiple projection images through a camera when the projector rotates along any direction; Calculate the clarity values of the multiple projection images according to the clarity calculation function to obtain multiple clarity values; Determine the focus movement direction according to the multiple clarity value sequences; specifically: If the multiple clarity value sequences first rise and then fall, the focus movement direction is appropriate; if the multiple clarity value sequences fall, it is opposite to the focus movement direction; Sharpness value calculation module, which is used to calculate the sharpness values of multiple said projection images according to the sharpness calculation function and determine the maximum sharpness value; specifically when determining the maximum sharpness value: if the sharpness value sequence of multiple said projection images first rises and then falls, control the projector to reverse, and at the same time control the camera to continuously capture the projection image projected by the projector, and calculate the sharpness value of the current projection image. If the difference between the sharpness value of the current projection image and the maximum sharpness value in the sharpness value sequence is within the threshold range, the sharpness value of the current projection image is the maximum sharpness value; Projection image determination module: record the projection image corresponding to the maximum sharpness value and control the projector to stop rotating; Projection ratio relative size calculation module, which is used to calculate the relative size of the projection ratio of the projection image corresponding to the maximum sharpness value to obtain the first projection ratio; the relative size of the projection ratio is the average value of the distances between multiple feature points in the projection image; And obtain the projection image after the projector stops rotating through the camera, and calculate the relative size of the projection ratio to obtain the second projection ratio; Difference calculation module, which is used to determine whether to end the focus according to the difference between the first projection ratio and the second projection ratio; specifically: judge whether the difference between the first projection ratio and the second projection ratio is less than the threshold; If the difference is less than the threshold, end the focus; if the difference is greater than the threshold, control the projector to move in the direction of the maximum sharpness value and re-capture the projection image; calculate the relative size of the projection ratio of the re-captured projection image to re-obtain the second projection ratio until the difference between the first projection ratio and the second projection ratio is less than the threshold.

4. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 2.

5. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instruction is executed by a processor, it implements the steps of the method according to any one of claims 1 to 2.

Citation Information

Patent Citations

  • Automatic focusing method and device

    CN106231201A

  • Camera focusing method and device

    CN107277381A

  • Positioning method and positioning device for out-of-focus direction of projector

    CN110740302A

  • Gap compensation method, gap compensation device and projection device

    CN107277477A

  • Focal point adjustment method for projector, and projector

    JP2006023401A