Projection automatic focusing method and system based on image ranging
Through the projection autofocus method based on image ranging, using the camera to take photos and fit functional relationships, the problems of high cost of the existing projector autofocus system and inability to accurately focus in complex environments are solved, automatic accurate focus is achieved and projection cost is reduced.
Patent Information
- Application Number
- CN202411921529.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-25
AI Technical Summary
The existing projector autofocus system is expensive and may not be able to accurately focus in complex environments, and the maintenance costs are also high.
Using the projection autofocus method based on image ranging, by projecting the preset focus image to the center of the projection surface, taking photos with the projector's camera and fitting functional relationships, solving the distance between the projection surface and the projector, and adjusting the clarity of the picture according to the distance.
Without using laser ranging sensors, automatic precise focus is achieved, projection costs are reduced, and focus capabilities are improved in complex environments.
Smart Images

Figure CN119893061A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of projectors, and in particular to an automatic focusing method and system for projection based on image ranging. Background Art
[0002] Compared with traditional TVs, projectors are popular because of their portability and superb visual effects. Therefore, projectors have gradually expanded from business scenes, conference scenes and teaching scenes to general home scenes.
[0003] Projection focus is a key method for a projector to adjust image clarity. Different projectors use different focus methods. Existing projectors mainly use auto focus to adjust image clarity. Auto focus technology usually uses internal sensors or camera-type focus systems to automatically adjust the focal length according to image clarity to achieve the best picture effect. However, most of these methods are based on laser ranging sensors for distance measurement, so as to accurately adjust the picture according to the distance measured by the sensor. Although they can cope with frequent movements, adjustments to projection distances or changes in ambient light to maintain picture clarity, the auto focus system requires built-in sensors and complex electronic control systems, resulting in high costs. The price of projectors will also increase accordingly, and in some complex environments (such as low light, backgrounds with complex textures, etc.), accurate focus may not be achieved. In the event of a system failure, the auto focus may not work properly, and the repair cost is relatively high.
[0004] Therefore, the prior art needs to be improved. Summary of the invention
[0005] The technical problem to be solved by the present invention is that, in view of the defects of the prior art, the present invention provides a method and system for projection automatic focusing based on image ranging to solve the problem of high cost in the existing projection focusing method.
[0006] The technical solution adopted by the present invention to solve the technical problem is as follows: In a first aspect, the present invention provides a method for projection autofocus based on image ranging, comprising: Projecting a preset focused image to the center of the projection surface; Taking a photo including the projection surface through a camera of the projector, and fitting a functional relationship according to the coordinates of the focused image in the photo; The distance between the projection surface and the projector is solved according to the fitted functional relationship, and the clarity of the picture on the projection surface is adjusted according to the distance.
[0007] In one implementation, the preset focus image includes: a square image.
[0008] In one implementation, projecting a preset focused image to the center of a projection surface includes: The square image is acquired, and the square image is projected to the center of the projection surface.
[0009] In one implementation, taking a photo including the projection surface by a camera of the projector, and fitting a functional relationship according to the coordinates of the focused image in the photo, includes: Adjusting the distance between the optical machine of the projector and the projection surface to a preset distance; Taking a photo containing the block image through the camera of the projector, setting the upper left corner of the photo as the coordinate origin, and setting the X direction and Y direction of the photo; Identify the center coordinates corresponding to the block image in the photo according to the coordinate origin, the X direction, and the Y direction; A functional relationship between the projection center of the projector and the center of the square image is obtained by fitting according to the center coordinates corresponding to the square image.
[0010] In one implementation, the step of fitting the functional relationship between the projection center of the projector and the center of the square image according to the center coordinates corresponding to the square image includes: Calculating a first polynomial function relationship of horizontal alignment between the camera and the optical machine of the projector; Or calculate a second polynomial function relationship of the vertical alignment between the camera of the projector and the optical machine.
[0011] In one implementation, the functional relationship is: S = aX n + bX (n-1) .
[0012] In one implementation, solving the distance between the projection surface and the projector according to the fitted functional relationship, and adjusting the clarity of the image on the projection surface according to the distance, includes: Detecting whether the distance between the optical machine of the projector and the projection surface changes; If yes, recalculate the center coordinates of the square image; Input the new center coordinates into the functional relationship to solve the current distance between the projection surface and the optical machine; The clarity of the image in the projection surface is adjusted according to the solved current distance.
[0013] In a second aspect, the present invention provides a projection auto-focus system based on image ranging, comprising: A focused image projection module, used to project a preset focused image to the center of the projection surface; A function relationship fitting module, used to take a photo including the projection surface through a camera of the projector, and fit the function relationship according to the coordinates of the focused image in the photo; The auto-focus module is used to solve the distance between the projection surface and the projector according to the fitted function relationship, and adjust the clarity of the image on the projection surface according to the distance.
[0014] In a third aspect, the present invention provides a terminal, comprising: a processor and a memory, wherein the memory stores a program for projection auto-focus based on image ranging, and when the program for projection auto-focus based on image ranging is executed by the processor, it is used to implement the operation of the method for projection auto-focus based on image ranging as described in the first aspect.
[0015] In a fourth aspect, the present invention further provides a medium, which is a computer-readable storage medium, and which stores a program for projection autofocus based on image ranging. When the program for projection autofocus based on image ranging is executed by a processor, it is used to implement the operation of the method for projection autofocus based on image ranging as described in the first aspect.
[0016] The present invention adopts the above technical solution to achieve the following effects: The present invention projects a preset focused image to the center of the projection surface, takes a photo of the projection surface through the camera of the projector, and fits a functional relationship according to the coordinates of the focused image in the photo; solves the distance between the projection surface and the projector according to the fitted functional relationship, and adjusts the clarity of the image on the projection surface according to the distance. The present invention can measure the distance by fitting the functional relationship through the acquisition data group, and realize automatic and accurate focusing without using a laser rangefinder sensor, thereby reducing the projection cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0018] Figure 1 It is a flow chart of the method for projection auto-focusing based on image ranging in the present invention.
[0019] Figure 2 It is a schematic diagram of a block image in the present invention.
[0020] Figure 3 It is a schematic diagram of a picture taken by a projector camera in the present invention.
[0021] Figure 4 It is a schematic diagram of the angle deviation between the picture taken by the projector camera and the picture projected by the projector optical machine in the present invention.
[0022] Figure 5 It is a functional principle diagram of a terminal in one implementation of the present invention.
[0023] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0025] Exemplary Methods Projection focus is a key method for a projector to adjust image clarity. Different projectors use different focus methods. Existing projectors mainly use auto focus to adjust image clarity. Auto focus technology usually uses internal sensors or camera-type focus systems to automatically adjust the focal length according to image clarity to achieve the best picture effect. However, most of these methods are based on laser ranging sensors for distance measurement, so as to accurately adjust the picture according to the distance measured by the sensor. Although they can cope with frequent movements, adjustments to projection distances or changes in ambient light to maintain picture clarity, the auto focus system requires built-in sensors and complex electronic control systems, resulting in high costs. The price of projectors will also increase accordingly, and in some complex environments (such as low light, backgrounds with complex textures, etc.), accurate focus may not be achieved. In the event of a system failure, the auto focus may not work properly, and the repair cost is relatively high.
[0026] In response to the above technical problems, an embodiment of the present invention provides a method for projection autofocus based on image ranging, which mainly projects a preset focus image to the center of the projection surface; takes a photo of the projection surface through the camera of the projector, and fits a functional relationship according to the coordinates of the focus image in the photo; solves the distance between the projection surface and the projector according to the fitted functional relationship, and adjusts the clarity of the image on the projection surface according to the distance. The embodiment of the present invention can measure the distance by fitting the functional relationship through the acquisition data group, and realizes automatic and precise focusing without using a laser ranging sensor, thereby reducing the projection cost.
[0027] like Figure 1As shown, an embodiment of the present invention provides a method for projection auto-focusing based on image ranging, comprising the following steps: Step S100: projecting a preset focused image to the center of a projection surface.
[0028] In this embodiment, the method for projection automatic focusing based on image ranging can be applied to a projector that is not equipped with a laser ranging sensor, so as to achieve automatic precise focusing without using a laser ranging sensor, thereby reducing the projection cost.
[0029] In this embodiment, the projector is equipped with a camera, which takes a photo containing a focused image, so that the center of the focused image is located based on the photo, and the actual distance between the projector and the projection surface is calculated in real time according to the located center position and the functional relationship, thereby achieving automatic and precise focusing.
[0030] In this embodiment, a preset focus image is loaded and projected to the center of the projection surface.
[0031] Specifically, in an implementation of this embodiment, step S100 includes the following steps: Step S101, acquiring the square image, and projecting the square image to the center of the projection surface.
[0032] In this embodiment, the preset focus image includes: a square image and other images that are easy to identify, such as a circular image or a QR code image, etc.; in this embodiment, the square image is taken as an example to illustrate the method for projection autofocus based on image ranging.
[0033] like Figure 2 As shown, in this embodiment, an image with a white background and a black block in the middle is used as the square image; the square image is pre-stored in the local database of the projector; after the projector is turned on, the square image is loaded and projected to the center of the projection surface.
[0034] like Figure 1 As shown, an embodiment of the present invention provides a method for projection auto-focusing based on image ranging, comprising the following steps: Step S200: taking a photo including the projection surface through the camera of the projector, and fitting a functional relationship according to the coordinates of the focused image in the photo.
[0035] In this embodiment, after the block image is projected to the center of the projection surface, a photo including the projection surface can be taken by the camera of the projector. Since the field of view of the camera is slightly larger than the field of view of the optical machine, the projection screen can be completely captured in all photos. Figure 3 As shown; after taking a photo through the camera of the projector, a functional relationship can be fitted according to the coordinates of the focused image in the photo.
[0036] It is worth mentioning that Figure 4 As shown, the projector in this embodiment is a projector with a camera, because the optical machine installation positions of the camera and the projector are not overlapped. For example, when the camera and the optical machine are aligned horizontally, the working range of the camera and the optical machine is two isosceles triangles from a top view, where the distance d between the perpendicular bisector of the triangle of the projector optical machine and the edge of the camera triangle and the distance S between the optical machine and the projection cloth show a certain correlation. In this embodiment, the distance can be measured by fitting a functional relationship through the acquisition of data sets; therefore, in this embodiment, it is necessary to change the distance between the projector and the projection surface multiple times, and shoot the corresponding screen containing the projection surface at different distances Sn, and find the center position (Xn, Yn) of the square in this screen. By fitting functions through multiple sets of data, the function of this machine can be found.
[0037] Specifically, in an implementation of this embodiment, step S200 includes the following steps: Step S201, adjusting the distance between the optical machine of the projector and the projection surface to a preset distance; Step S202, taking a photo containing the square image through the camera of the projector, setting the upper left corner of the photo as the coordinate origin, and setting the X direction and Y direction of the photo; Step S203, identifying the center coordinates corresponding to the block image in the photo according to the coordinate origin, the X direction and the Y direction; Step S204 , obtaining a functional relationship between the projection center of the projector and the center of the square image by fitting according to the center coordinates corresponding to the square image.
[0038] Specifically, in an implementation of this embodiment, step S204 includes the following steps: Step S204a, calculating a first polynomial function relationship between the camera of the projector and the optical machine horizontal alignment; Step S204b, calculating a second polynomial function relationship between the camera of the projector and the optical machine for vertical alignment.
[0039] In this embodiment, after the square image is projected to the center of the projection surface, the distance Sn between the projector optical machine and the projection surface (screen) is manually measured, and then the coordinates of the center of the square are identified; specifically, the upper left corner of the square photo is set as the coordinate origin, the horizontal right direction is X, and the vertical downward direction is Y, and the coordinates (X, Y) of the center point of the small black block in the projection image are identified. Since the optical machine installation positions of the camera and the projector are not overlapped, the functional angle range of the camera and the projector is as follows: Figure 4 As shown, it can be seen that the distance between the center point of the projection image and the origin of the photo increases as the projector and the projection screen increase.
[0040] So at different distances Sn, shoot the projected images and find the center position of the square (Xn, Yn). Therefore, two sets of data can be obtained, (Sn-Xn) and (Sn-Yn). If the camera and the optical machine are horizontally aligned, then Sn-Xn has a polynomial function relationship (that is, the first polynomial function relationship of the horizontal alignment of the camera and the optical machine of the projector). When the camera and the optical machine are vertically aligned, then Sn-Yn has a polynomial function relationship (that is, the second polynomial function relationship of the vertical alignment of the camera and the optical machine of the projector). Based on these polynomial function relationships, function fitting can be performed to find the function Fun(x) of this machine, S = aX n + bX (n-1) .
[0041] It is worth mentioning that in the present embodiment, the center position (Xn, Yn) is collected once for each distance adjustment. Therefore, the amount of collected data can be set to perform functional relationship fitting. For example, the amount of collected data is 10. After collecting the center position (Xn, Yn) of the square image each time, determine whether the current amount of collected data reaches the preset amount of data (10). If not, continue to change the distance S between the projector optical machine and the projection surface (screen) within the working distance range of the projector until the set amount of data is met.
[0042] In this embodiment, the square image is acquired and projected to the center of the projection surface. After each adjustment of the distance Sn between the projector optical machine and the projection surface (screen), the center position (Xn, Yn) of the square image is acquired, and then (Sn-Xn) and (Sn-Yn) are obtained until the amount of data of the acquired center coordinates meets the setting. After the amount of data of the acquired center coordinates meets the requirement, the function Fun(x) of the projector is obtained by function fitting, S = aX n + bX (n-1), and save this function Fun(x) in the local database of the projector, and embed it in the autofocus program of the projector; in this way, every time the projector is turned on for autofocus, or when the projector needs to be focused during use (for example, the projector is moved during use and needs to be refocused), by calling this function Fun(x), the center position of the real-time collected block image is substituted into this function Fun(x), and the real-time distance between the current projector and the projection surface (screen) can be calculated.
[0043] like Figure 1 As shown, an embodiment of the present invention provides a method for projection auto-focusing based on image ranging, comprising the following steps: Step S300, calculating the distance between the projection surface and the projector according to the fitted function relationship, and adjusting the clarity of the image on the projection surface according to the distance.
[0044] In this embodiment, after the test and adjustment process of the above steps S100 to S200, in the actual use of the projector, for example, in the scene where autofocus needs to be performed each time the projector is turned on, or in the use of the projector, after the projector is moved, the scene where autofocus needs to be re-performed, it is only necessary to load and project the block image, and identify the real-time center coordinates of the block image in the photo, and substitute the identified center coordinates into this function Fun(x), so as to calculate the real-time distance between the projector optical machine and the projection surface (screen), so as to re-autofocus according to this distance.
[0045] Specifically, in an implementation of this embodiment, step S300 includes the following steps: Step S301, detecting whether the distance between the optical machine of the projector and the projection surface changes; Step S302, if yes, recalculate the center coordinates of the square image; Step S303, inputting the new center coordinates into the functional relationship to solve the current distance between the projection surface and the optical machine; Step S304: adjusting the clarity of the image on the projection surface according to the solved current distance.
[0046] In this embodiment, each time the projector is turned on, it is determined whether it is necessary to re-measure the distance and adjust the focus during the startup process according to the user's system settings; if it is necessary to re-measure the distance and automatically focus during the startup process, the block image is directly loaded and projected, and the real-time center coordinates of the block image in the photo are identified, and the identified center coordinates are substituted into the function Fun(x), and automatic focus is performed according to the calculated distance until the clarity of the focused image meets the requirements.
[0047] In this embodiment, during the use of the projector, after the projector is moved, it is necessary to re-autofocus the scene; at this time, it is necessary to first determine whether the distance between the optical machine of the projector and the projection surface has changed by means of image detection, for example, by detecting whether it has been moved through a micro switch; if it is detected that the projector has been moved, the shape or size of the projection image before and after the movement is compared to determine whether the distance between the optical machine of the projector and the projection surface has changed; if it is detected that the distance between the optical machine of the projector and the projection surface has changed, the block image is reloaded and projected, a photo containing the block image is taken, the new center position of the block image is calculated, and the calculated new center position is substituted into the function Fun(x), and then autofocus can be performed according to the calculated distance until the clarity of the focused image meets the requirements; if it is detected that the projector has not been moved, no focusing process is required.
[0048] In this embodiment, after each autofocus is completed, the camera of the projector can be used to capture a projection image, and then the clarity of the standard projection image (or template) is compared to determine whether the clarity of the display image after autofocus meets the requirements.
[0049] This embodiment achieves the following technical effects through the above technical solution: This embodiment projects a preset focused image to the center of the projection surface, takes a photo of the projection surface through the camera of the projector, and fits a functional relationship according to the coordinates of the focused image in the photo; solves the distance between the projection surface and the projector according to the fitted functional relationship, and adjusts the clarity of the image on the projection surface according to the distance. This embodiment can measure the distance by fitting the functional relationship through the acquisition data group, and realize automatic and precise focusing without using a laser ranging sensor, thereby reducing the projection cost.
[0050] Exemplary Devices Based on the above embodiments, the present invention further provides a projection auto-focus system based on image ranging, comprising: A focused image projection module, used to project a preset focused image to the center of the projection surface; A function relationship fitting module, used to take a photo including the projection surface through a camera of the projector, and fit the function relationship according to the coordinates of the focused image in the photo; The auto-focus module is used to solve the distance between the projection surface and the projector according to the fitted function relationship, and adjust the clarity of the image on the projection surface according to the distance.
[0051] This embodiment achieves the following technical effects through the above technical solution: This embodiment projects a preset focused image to the center of the projection surface, takes a photo of the projection surface through the camera of the projector, and fits a functional relationship according to the coordinates of the focused image in the photo; solves the distance between the projection surface and the projector according to the fitted functional relationship, and adjusts the clarity of the image on the projection surface according to the distance. This embodiment can measure the distance by fitting the functional relationship through the acquisition data group, and realize automatic and precise focusing without using a laser ranging sensor, thereby reducing the projection cost.
[0052] Based on the above embodiment, the present invention further provides a terminal, whose principle block diagram can be as follows: Figure 5 shown.
[0053] The terminal includes: a processor, a memory, an interface, a display screen and a communication module connected through a system bus; wherein the processor of the terminal is used to provide computing and control capabilities; the memory of the terminal includes a storage medium and an internal memory; the storage medium stores an operating system and a computer program; the internal memory provides an environment for the operation of the operating system and the computer program in the storage medium; the interface is used to connect to external devices; the display screen is used to display corresponding information; and the communication module is used to communicate with a cloud server or other devices.
[0054] When the computer program is executed by a processor, the computer program is used to implement the operation of a projection auto-focus method based on image ranging.
[0055] It can be understood by those skilled in the art that Figure 5 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the terminal to which the scheme of the present invention is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0056] In one embodiment, a terminal is provided, comprising: a processor and a memory, wherein the memory stores a program for projection auto-focus based on image ranging, and the program for projection auto-focus based on image ranging is used to implement the operations of the above method for projection auto-focus based on image ranging when executed by the processor.
[0057] In one embodiment, a storage medium is provided, wherein the storage medium stores a program for projection auto-focus based on image ranging, and when the program for projection auto-focus based on image ranging is executed by a processor, it is used to implement the operations of the above method for projection auto-focus based on image ranging.
[0058] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and volatile memory.
[0059] In summary, the present invention provides a method and system for projection autofocus based on image ranging, including: projecting a preset focus image to the center of the projection surface; taking a photo of the projection surface through the camera of the projector, and fitting a functional relationship according to the coordinates of the focus image in the photo; solving the distance between the projection surface and the projector according to the fitted functional relationship, and adjusting the clarity of the image on the projection surface according to the distance. The present invention can measure the distance by fitting a functional relationship through the acquisition of data groups, and realize automatic and precise focusing without using a laser ranging sensor, thereby reducing the projection cost.
[0060] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A method for projection autofocus based on image ranging, characterized in that: include: Projecting a preset focused image to the center of the projection surface; Taking a photo including the projection surface through a camera of the projector, and fitting a functional relationship according to the coordinates of the focused image in the photo; The distance between the projection surface and the projector is solved according to the fitted functional relationship, and the clarity of the picture on the projection surface is adjusted according to the distance.
2. The method for projection autofocus based on image ranging according to claim 1, characterized in that: The preset focus image includes: a square image.
3. The method for projection autofocus based on image ranging according to claim 2, characterized in that: The step of projecting the preset focused image to the center of the projection surface comprises: The square image is acquired, and the square image is projected to the center of the projection surface.
4. The method for projection autofocus based on image ranging according to claim 3, characterized in that: The method of taking a photo including the projection surface by using a camera of the projector and fitting a functional relationship according to the coordinates of the focused image in the photo comprises: Adjusting the distance between the optical machine of the projector and the projection surface to a preset distance; Using the camera of the projector to take a photo containing the square image, setting the upper left corner of the photo as the coordinate origin, and setting the X direction and Y direction of the photo; Identify the center coordinates corresponding to the block image in the photo according to the coordinate origin, the X direction, and the Y direction; A functional relationship between the projection center of the projector and the center of the square image is obtained by fitting according to the center coordinates corresponding to the square image.
5. The method for projection autofocus based on image ranging according to claim 4, characterized in that: The step of fitting the center coordinates corresponding to the square image to obtain a functional relationship between the projection center of the projector and the center of the square image includes: Calculating a first polynomial function relationship of horizontal alignment between the camera and the optical machine of the projector; Or calculate a second polynomial function relationship of the vertical alignment between the camera of the projector and the optical machine.
6. The method for projection autofocus based on image ranging according to claim 5, characterized in that: The functional relationship is: S = aX n + bX (n-1) .
7. The method for projection autofocus based on image ranging according to claim 5, characterized in that: The step of solving the distance between the projection surface and the projector according to the fitted functional relationship and adjusting the clarity of the image on the projection surface according to the distance comprises: Detecting whether the distance between the optical machine of the projector and the projection surface changes; If yes, recalculate the center coordinates of the square image; Input the new center coordinates into the functional relationship to solve the current distance between the projection surface and the optical machine; The clarity of the image in the projection surface is adjusted according to the solved current distance.
8. An image-based ranging system for projection autofocus, characterized in that: include: A focused image projection module, used to project a preset focused image to the center of the projection surface; A function relationship fitting module, used to take a photo including the projection surface through a camera of the projector, and fit the function relationship according to the coordinates of the focused image in the photo; The auto-focus module is used to solve the distance between the projection surface and the projector according to the fitted function relationship, and adjust the clarity of the image on the projection surface according to the distance.
9. A terminal, characterized in that: include: A processor and a memory, wherein the memory stores a program for projection auto-focus based on image ranging, and when the program for projection auto-focus based on image ranging is executed by the processor, it is used to implement the operation of the method for projection auto-focus based on image ranging as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program for projection auto-focus based on image ranging, and when the program for projection auto-focus based on image ranging is executed by a processor, it is used to implement the operation of the method for projection auto-focus based on image ranging as described in any one of claims 1-7.