Focusing methods, apparatuses, and systems
By using different resolution detection algorithms during the movement of the lens group, coarse positioning is achieved first, followed by precise positioning, ultimately improving the projector's focusing accuracy and precision.
Patent Information
- Application Number
- CN202210743194.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-27
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-06-27
AI Technical Summary
In traditional projector focusing methods, the focusing accuracy determined during the movement of the lens group is poor, resulting in a low accuracy of the final focus position.
The sharpness of the captured image is determined by using a first sharpness detection algorithm with a larger convolution kernel size to coarsely locate the refocusing area. Then, a second sharpness detection algorithm with a smaller convolution kernel size is used to precisely locate the final focus position, and the lens group is moved to the position with the greatest sharpness.
It improves the focusing accuracy and precision of the lens group, ensuring the accuracy of the final focus position.
Smart Images

Figure CN117354473B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image projection, and more particularly, to a focusing method, device and system. BACKGROUND
[0002] In the prior art, the lens group of a projector is controlled to move step by step, and the sharpness of a captured image corresponding to a projection image of the projector before and after each movement is determined, and the position of the lens group when the captured image has the highest sharpness is determined as the final focusing position. The sharpness of the captured image is determined by a sharpness detection algorithm with a fixed kernel size.
[0003] However, the focusing accuracy of the projector is poor in the prior art. SUMMARY
[0004] In view of the above problems, the present application provides a focusing method, device and system, which can improve the focusing accuracy of a projector.
[0005] In a first aspect, an embodiment of the present application provides a focusing method, which comprises:
[0006] During the step-by-step movement of the lens group of the projector, the sharpness of a captured image corresponding to a projection image of the projector before and after each movement is determined, wherein the sharpness of the captured image is determined by a first sharpness detection algorithm.
[0007] A refocusing area of the lens group is determined according to the position of the lens group when the captured image has the highest sharpness.
[0008] During the step-by-step movement of the lens group in the refocusing area, the sharpness of a new captured image corresponding to the projection image before and after each movement is obtained, wherein the sharpness of the new captured image is determined by a second sharpness detection algorithm, and the kernel size of the first sharpness detection algorithm is larger than the kernel size of the second sharpness detection algorithm.
[0009] The lens group is controlled to move to the position of the lens group when the new captured image has the highest sharpness.
[0010] In a second aspect, an embodiment of the present application provides a focusing device, which comprises:
[0011] A sharpness determination module is configured to determine the sharpness of a captured image corresponding to a projection image of the projector before and after each movement during the step-by-step movement of the lens group of the projector, wherein the sharpness of the captured image is determined by a first sharpness detection algorithm.
[0012] A region determining module is configured to determine a refocusing region of the lens group according to a position of the lens group when a photographing image with the highest clarity is captured;
[0013] A obtaining module is configured to obtain a clarity of a new photographing image corresponding to the projection image before and after each movement during the step-by-step movement of the lens group in the refocusing region, the clarity of the new photographing image being determined by a second clarity detection algorithm, a size of a convolution kernel of the first clarity detection algorithm being greater than a size of a convolution kernel of the second clarity detection algorithm;
[0014] A control module is configured to control the lens group to move to a position of the lens group when a new photographing image with the highest clarity is captured.
[0015] In a third aspect, an embodiment of the present application provides a focusing device, comprising:
[0016] one or more processors;
[0017] a memory;
[0018] one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method described above.
[0019] In a fourth aspect, an embodiment of the present application provides a focusing system, comprising at least a camera, a projector and a focusing device, wherein:
[0020] the projector is configured to project a projection image;
[0021] the camera is configured to obtain a photographing image corresponding to the projection image and a new photographing image;
[0022] the focusing device is configured to execute the method described above.
[0023] The focusing method, device and system provided by the embodiment of the present application, in the present application, the clarity of the photographing image is determined by the first clarity detection algorithm with a larger convolution kernel size, so as to coarsely position the refocusing region through the clarity of the photographing image, and then the clarity of the new photographing image is determined by the second clarity detection algorithm with a smaller convolution kernel size, and the position of the lens group when the new photographing image with the highest clarity is captured is determined as the final focusing position, so as to realize focusing. The second clarity detection algorithm with a smaller convolution kernel size has a higher accuracy of the clarity, so that the position of the new photographing image with the highest clarity determined has a higher accuracy, thereby improving the accuracy of the final focusing position. BRIEF DESCRIPTION OF DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort based on these drawings.
[0025] Figure 1 A schematic diagram of a focusing system suitable for the application environment of the embodiments of the present application is shown.
[0026] Figure 2 A flow chart of a focusing method provided by the embodiments of the present application is shown.
[0027] Figure 3 A curve diagram of the moving distance of the lens group and the sharpness of the captured image in the embodiments of the present application is shown.
[0028] Figure 4 A flow chart of another focusing method provided by the embodiments of the present application is shown.
[0029] Figure 5 Another curve diagram of the moving distance of the lens group and the sharpness of the captured image in the embodiments of the present application is shown.
[0030] Figure 6 A flow chart of a method for acquiring the sharpness of the captured image in the embodiments of the present application is shown.
[0031] Figure 7 A schematic diagram of the region of interest in the embodiments of the present application is shown.
[0032] Figure 8 A flow chart of a method for acquiring the sharpness of the new captured image in the embodiments of the present application is shown.
[0033] Figure 9 A flow chart of a method for determining the captured image with the maximum sharpness in the embodiments of the present application is shown.
[0034] Figure 10 A flow chart of a method for determining the refocusing region in the embodiments of the present application is shown.
[0035] Figure 11 Still another curve diagram of the moving distance of the lens group and the sharpness of the captured image in the embodiments of the present application is shown.
[0036] Figure 12 A block diagram of a focusing device provided by the embodiments of the present application is shown.
[0037] Figure 13 A block diagram of the focusing device of another embodiment of the present application is shown.
[0038] Figure 14 A structural block diagram of a computer readable storage medium of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0039] In order for those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application.
[0040] In the traditional focusing method, the lens group of the projector is controlled to move, and the sharpness of the captured image corresponding to the projection image of the projector is determined during the movement of the lens group, and the position of the lens group when the captured image has the highest sharpness is determined as the final focusing position, wherein the sharpness of the captured image is determined by a sharpness detection algorithm with a fixed convolution kernel size. The accuracy of the sharpness obtained according to the sharpness algorithm with a fixed convolution kernel size is low, resulting in low accuracy of the determined final focusing position.
[0041] Therefore, the inventors propose a focusing method, device and system. During the step-by-step movement of the lens group of the projector, the sharpness of the captured image corresponding to the projection image of the projector before and after each movement is determined, wherein the sharpness of the captured image is determined by a first sharpness detection algorithm; the refocusing area of the lens group is determined according to the position of the lens group when the captured image has the highest sharpness; during the step-by-step movement of the lens group in the refocusing area, the sharpness of the new captured image corresponding to the projection image before and after each movement is obtained, the sharpness of the new captured image is determined by a second sharpness detection algorithm, and the convolution kernel size of the first sharpness detection algorithm is larger than that of the second sharpness detection algorithm; the lens group is controlled to move to the position of the lens group when the new captured image has the highest sharpness.
[0042] The sharpness of the captured image is determined by the first sharpness detection algorithm with a larger convolution kernel size to roughly position the refocusing area through the sharpness of the captured image, and then the sharpness of the new captured image is determined by the second sharpness detection algorithm with a smaller convolution kernel size, and the position of the lens group when the new captured image has the highest sharpness is determined as the final focusing position, thereby realizing focusing. The accuracy of the sharpness obtained by the second sharpness detection algorithm with a smaller convolution kernel size is high, so that the accuracy of the position of the new captured image with the highest sharpness determined is high, thereby improving the accuracy of the final focusing position.
[0043] REFERENCE Figure 1 , Figure 1 A schematic diagram of a focusing system suitable for the application environment of the embodiments of the present application is shown. The focusing system includes a projector 101, a camera 102 and a focusing device 103.
[0044] The projector 101 can be any type or structure of projector, and the resolution of the projector can be 1080p, 2K, or 4K, etc. The projector can be placed in a fixed position, and the projector can project the acquired target image on the projection area 105 (the area corresponding to the dashed box). The projection area can be provided with a white projection screen, and the white projection screen displays the projected target image. The displayed projected target image is the projection image in the present application.
[0045] The camera 102 can be a high-definition camera or a digital camera, and the camera 102 can have a zoom function. The camera 102 is used to capture the projection image of the projection area. The captured image captured by the camera can at least include the projection image in the projection area, and the captured image captured by the camera can also include other contents outside the projection area. The camera capturing area 104 (the area corresponding to the solid box) includes the projection area 105, and the camera capturing area 104 is larger than the projection area 105.
[0046] The focusing device 103 is used to perform the steps of the focusing method in the present application. The focusing device can be any type of electronic device including a processor and a memory, such as a computer and a tablet, etc. The focusing device can receive the projection image sent by the projector and the captured image captured by the camera, so as to perform the identification positioning according to the projection image and the captured image.
[0047] In some embodiments, the projector realizes part or all of the focusing device through the functions of software or hardware, that is, the projector can also serve as the focusing device to perform the steps of the focusing method in the present application.
[0048] Reference Figure 2 , Figure 2 A flowchart of a focusing method provided by an embodiment of the present application is shown. The method comprises:
[0049] S110, in the process of controlling the step-by-step movement of the lens group of the projector, determining the sharpness of the captured image corresponding to the projection image of the projector before and after each movement, wherein the sharpness of the captured image is determined by a first sharpness detection algorithm.
[0050] In the present application, the projector projects the acquired target image on the projection area, the projection area displays the projection image, and the initial captured image is obtained by capturing the capturing area by the camera. The part corresponding to the projection area (for example, the part corresponding to the dashed box 105 in the middle) in the initial captured image can be determined, and this part can be used as the captured image corresponding to the projection image. In some embodiments, the initial captured image can also be directly used as the captured image corresponding to the projection image. At this time, the captured image also includes the area outside the projection area (for example, the area outside the dashed box 105 in the middle). Figure 1 Figure 1 The part between the dashed box 105 and the solid box 104.
[0051] The projector comprises a lens group, and the projector maps a target image on a projection area through the lens group to obtain a projection image. The position of the lens group can be adjusted, and after the position of the lens group is changed, the focal length of the projector changes, and the definition of the projection image projected on the projection area also changes. The definition of the projection image on the projection area can be adjusted by adjusting the position of the lens group.
[0052] In the present application, the lens group of the projector is stepwise moved in a focusing area, wherein the focusing area is the whole area covered by the movement of the lens group, and the focusing area can correspond to a focusing starting point and a focusing ending point. The lens group can be stepwise moved in a fixed direction in the focusing area, so as to cover the whole focusing area when the lens group is moved, and the movement of the lens group does not exist repeated movement, for example, stepwise moved from the focusing ending point to the focusing starting point or stepwise moved from the focusing ending point to the focusing starting point.
[0053] The stepwise moving distance of the lens group can be equal distance, and after each movement of the lens group of the projector, a camera shoots a shooting area including the projection area to obtain a shooting image corresponding to the projection image. Since the position of the lens group before each movement is the same as that after the last movement, the corresponding shooting image is also the same, the shooting image after the last movement can be determined as the shooting image before the movement of the present time, and it is not necessary to obtain the shooting image again before each movement, wherein the shooting image is obtained before the first movement.
[0054] For example, the lens group of the projector is stepwise moved from the focusing starting point to the focusing ending point, and a total of 10 times of stepwise movement is needed, and before the first stepwise movement of the projector, a first shooting image is shot, and after each stepwise movement of the projector, a shooting image is shot, and after 10 times of stepwise movement, 11 shooting images are obtained, wherein the shooting image after the second movement is also the shooting image before the third movement.
[0055] In the present application, the first definition detection algorithm can be Laplace algorithm, Sobel operator, etc., and the convolution kernel size of the first definition detection algorithm is large. After the shooting image is obtained, the definition of the shooting image is determined according to the first definition detection algorithm. The convolution kernel size can also be called the kernel window size of the algorithm.
[0056] For each of the photographed images before and after each movement, the sharpness of the photographed image obtained can be determined according to the first sharpness detection algorithm at the time when the photographed image is obtained, i.e. triggering the sharpness determination action. Alternatively, the sharpness of each of the photographed images obtained can be determined after the lens group has moved step by step through the entire focusing region (e.g. after completing the step by step movement from the starting point to the end point of focusing).
[0057] It can be understood that the lens group can move step by step at equal intervals in a fixed direction within the focusing region, the position of the lens group after each movement is different, and the photographed images obtained are also different. A corresponding relationship between the photographed images and the number of movements can be established. After the sharpness of a certain photographed image is determined, the number of movements corresponding to the photographed image and the corresponding relationship are determined, and then the position of the lens group is determined according to the number of movements.
[0058] For example, the total number of steps corresponding to the focusing region of the lens group is 10: the lens group moves 10 times from the starting point to the end point of focusing. During the step by step movement of the lens group, 11 photographed images are obtained. The photographed images are numbered 1-11 according to the order of the photographed images. The corresponding relationship between the photographed images and the number of movements is: the number of the photographed image after movement = the number of movements + 1. When the number of the photographed image is determined to be 8, the number of movements is determined to be 7, and the position of the lens group is determined according to the number of movements 7.
[0059] S120, determining the refocusing region of the lens group according to the position of the lens group when the photographed image with the maximum sharpness is photographed.
[0060] For each of the photographed images before and after each movement, the sharpness of the photographed image obtained can be determined according to the first sharpness detection algorithm at the time when the photographed image is obtained, i.e. triggering the sharpness determination action. Alternatively, the sharpness of each of the photographed images obtained can be determined after the lens group has moved step by step through the entire focusing region (e.g. after completing the step by step movement from the starting point to the end point of focusing).
[0061] Due to the large size of the convolution kernel of the first sharpness detection algorithm, the accuracy of the determined sharpness of the photographed image is low. A region with higher sharpness is determined according to the sharpness of the photographed image, and the refocusing region.
[0062] The moving distance of the lens group is continuously changed, and the definition of the corresponding captured image is also continuously changed. There is a theoretical maximum definition, but in specific applications, it is impossible to detect the definition of the captured image at all times. Therefore, in this application, the lens group is controlled to move step by step, and the definition before and after each movement is determined to determine the definition closest to the theoretical maximum definition.
[0063] Please refer to Figure 3 , Figure 3 A curve diagram of the moving distance of the lens group and the definition of the captured image in the embodiment of the application is shown. The horizontal coordinate of the moving distance refers to the distance that the lens group moves from the focusing starting point to the focusing ending point.
[0064] The solid line represents the relationship curve of the moving distance and the definition of the captured image. The starting point of each long dashed arrow represents the definition of the captured image before step-by-step movement, and the ending point of each long dashed arrow represents the definition of the captured image after step-by-step movement.
[0065] Point B in the curve represents the peak point corresponding to the theoretical maximum definition. Point A represents the maximum definition determined by the first definition detection algorithm during step-by-step movement of the lens group.
[0066] Since the movement of the lens group is step-by-step, the definition of the captured image before and after step-by-step movement is not continuous, and the peak point of the theoretical maximum definition may be missed, for example, points A and C before and after step-by-step movement are not the maximum definition. Therefore, in this application, the captured image with the maximum definition is determined, and the corresponding definition of the captured image is point A. The position of the lens group when the captured image with the maximum definition is captured is determined as a key position (the definition corresponding to the key position is the definition of point A). The position is used as a reference to determine a refocusing area, for example, the position of the lens group when the captured image corresponding to point A is captured is determined as the refocusing starting point, and the position of the lens group when the captured image corresponding to point C is captured is determined as the refocusing ending point. The area between the refocusing starting point and the refocusing ending point is determined as the refocusing area.
[0067] S130, during the step-by-step movement of the lens group in the refocusing area, the definition of the new captured image corresponding to each movement before and after is obtained, and the definition of the new captured image is determined by a second definition detection algorithm. The size of the convolution kernel of the first definition detection algorithm is greater than the size of the convolution kernel of the second definition detection algorithm.
[0068] After the refocusing area is determined, the control of the lens group moving in the focusing area is stopped, and the lens group is controlled to move step by step in the refocusing area. The lens group can move in a fixed direction during the step-by-step movement in the refocusing area. The refocusing area can be an area between a refocusing starting point and a refocusing ending point. The lens group moves step by step from the refocusing starting point to the refocusing ending point, or the lens group moves step by step from the refocusing ending point to the refocusing starting point. The lens group covers the entire refocusing area during the movement, and there is no repeated movement of the lens group.
[0069] During the step-by-step movement of the lens group in the refocusing area, the shooting image corresponding to the projection image is obtained as a new shooting image in the manner of S110, and then the clarity of the new shooting image is determined by the second clarity detection algorithm.
[0070] In this application, the step-by-step movement distance of the lens group in S110 can be different from or the same as the step-by-step movement distance of the lens group in S130.
[0071] The second clarity detection algorithm can be the same type as the first clarity detection algorithm, but the size of the convolution kernel of the first clarity detection algorithm is smaller than that of the first clarity detection algorithm. For the same image, the accuracy of the clarity obtained by the second clarity detection algorithm is higher than that obtained by the first clarity detection algorithm.
[0072] S140, control the lens group to move to the position of the lens group when the new shooting image with the maximum clarity is shot.
[0073] For each new shooting image before and after movement, the clarity of the obtained new shooting image is determined according to the second clarity detection algorithm. According to the clarity of the new shooting image before and after movement, the change of the clarity of the new shooting image is determined. According to the change of the clarity of the new shooting image, the new shooting image with the maximum clarity is determined. The position of the lens group when the new shooting image with the maximum clarity is shot is determined as the final focusing position. The lens group is moved to the final focusing position, and the focusing of the projector is completed.
[0074] For example, the stepwise moving distance of the lens group is equal, and the stepwise moving distance of the lens group in the focusing area and the refocusing area is also equal. According to the first sharpness detection algorithm, the sharpness of the image taken before the Ith moving (I is an integer not equal to 0) is the maximum, and the sharpness of the image taken after the Ith moving is slightly less than the sharpness of the image taken before the Ith moving. The position of the lens group when the image taken before the Ith moving is taken is determined as the refocusing start point of the refocusing area, and the position of the lens group when the image taken after the Ith moving is taken is determined as the refocusing end point of the refocusing area. The lens group is continuously controlled to move stepwise from the refocusing start point to the refocusing end point, and the images taken before and after the moving are obtained as new images, wherein the new images are the same as the images taken before and after the Ith moving (because the stepwise moving distance of the lens group in the focusing area and the refocusing area is also equal), and the sharpness of the two new images is determined according to the second sharpness detection algorithm, wherein the sharpness of the new image taken after the Ith moving is greater than the sharpness of the new image taken before the Ith moving, and thus the position of the new image taken after the Ith moving is determined as the final focusing position of the lens group.
[0075] Because the kernel size of the first sharpness detection algorithm is greater than the kernel size of the second sharpness detection algorithm, the accuracy of the determined sharpness of the image taken before the Ith moving is low, and the accuracy of the determined sharpness of the image taken after the Ith moving is high, and thus the position of the lens group when the image taken after the Ith moving is taken is used as the final focusing position.
[0076] In the embodiment, during step-by-step movement of the lens group of the projector, the sharpness of the photographed image corresponding to the projection image of the projector before and after each movement is determined, wherein the sharpness of the photographed image is determined by a first sharpness detection algorithm; a refocusing area of the lens group is determined according to the position of the lens group when the photographed image with the maximum sharpness is photographed; during step-by-step movement of the lens group in the refocusing area, the sharpness of a new photographed image corresponding to the projection image before and after each movement is obtained, the sharpness of the new photographed image is determined by a second sharpness detection algorithm, and the size of the convolution kernel of the first sharpness detection algorithm is greater than the size of the convolution kernel of the second sharpness detection algorithm; the lens group is controlled to move to the position of the lens group when the new photographed image with the maximum sharpness is photographed. The first sharpness detection algorithm with a larger convolution kernel size is used to determine the sharpness of the photographed image to coarsely position the refocusing area, and then the second sharpness detection algorithm with a smaller convolution kernel size is used to determine the sharpness of the new photographed image, so that the position of the lens group when the new photographed image with the maximum sharpness is photographed is determined as the final focusing position, thereby achieving focusing. The second sharpness detection algorithm with a smaller convolution kernel size has a higher accuracy of the sharpness, so that the position of the new photographed image with the maximum sharpness determined has a higher accuracy, thereby improving the accuracy of the final focusing position.
[0077] Please refer to Figure 4 , Figure 4 A flowchart of another focusing method provided by the embodiment is shown, and the method comprises the following steps:
[0078] In the embodiment, during step-by-step movement of the lens group of the projector, the sharpness of the photographed image corresponding to the projection image of the projector before and after each movement is determined, wherein the sharpness of the photographed image is determined by a first sharpness detection algorithm.
[0079] S220, according to the position of the lens group when the photographed image with the maximum sharpness is photographed, a refocusing area of the lens group is determined.
[0080] S230, during step-by-step movement of the lens group in the refocusing area, the sharpness of a new photographed image corresponding to the projection image before and after each movement is obtained, the sharpness of the new photographed image is determined by a second sharpness detection algorithm, the size of the convolution kernel of the first sharpness detection algorithm is greater than the size of the convolution kernel of the second sharpness detection algorithm, and the first preset distance is greater than the second preset distance.
[0081] S240, the lens group is controlled to move to the position of the lens group when the new photographed image with the maximum sharpness is photographed.
[0082] The lens group is controlled to move in steps with a first preset distance in the focusing area, and the position of the lens group when the shooting image with the highest definition is determined is taken as a key position, and a refocusing area with higher definition is determined according to the key position, and then the lens group is controlled to move in steps with a second preset distance in the refocusing area, and the position of the lens group when the new shooting image with the highest definition in the refocusing area is determined is taken as a final focusing position.
[0083] Please refer to Figure 5 , Figure 5 Another curve diagram of the moving distance of the lens group and the definition of the shooting image in the embodiment of the application is shown, wherein the horizontal coordinate is the moving distance of the lens group from the focusing start point to the focusing end point.
[0084] The solid line indicates the curve of the moving distance and the definition of the shooting image, the starting point of each long-dashed arrow indicates the definition of the shooting image before moving in steps according to the first preset step length, the ending point of each long-dashed arrow indicates the definition of the shooting image after moving in steps according to the first preset step length, the starting point of each short-dashed arrow indicates the definition of the shooting image before moving in steps according to the second preset step length, and the ending point of each short-dashed arrow indicates the definition of the shooting image after moving in steps according to the second preset step length.
[0085] The F point in the curve indicates the peak point corresponding to the maximum theoretical definition, and the D point indicates the point of the shooting image with the maximum definition determined by the first definition detection algorithm in the process of moving in steps according to the first preset distance. The position of the lens group when the shooting image corresponding to the D point is shot can be determined as the refocusing start point of the refocusing area, and the position of the lens group when the shooting image corresponding to the G point is shot can be determined as the refocusing end point of the refocusing area, wherein the G point is the definition of the shooting image after moving in steps corresponding to the D point. The E point indicates the point of the new shooting image with the maximum definition determined by the second definition detection algorithm in the process of moving in steps according to the second preset distance in the focusing area, and the position of the lens group corresponding to the C point is the final focusing position.
[0086] As Figure 5 shown, the definition of the shooting image with the maximum definition determined by the first definition detection algorithm in the process of moving in steps according to the first preset distance (indicated by the D point) is far from the maximum theoretical definition (indicated by the F point). The definition of the new shooting image with the maximum definition determined by the second definition detection algorithm in the process of moving in steps according to the second preset distance (indicated by the C point) is close to the maximum theoretical definition (indicated by the F point).
[0087] In the embodiment, the lens group of the projector is controlled to move step by step according to the first preset distance, and the sharpness of the photographed image is determined according to the first sharpness detection algorithm. In the process of controlling the lens group to move step by step according to the first preset distance in the refocusing area, the sharpness of the new photographed image is determined by the second sharpness detection algorithm. By adjusting the convolution kernel size of the sharpness detection algorithm and adjusting the distance of the step-by-step movement of the lens group, the sharpness of the new photographed image determined is improved, and the accuracy of the final focusing position is improved, thereby achieving the effect of improving the focusing accuracy of the lens group.
[0088] Optionally, the projector comprises a focusing motor, and the focusing motor drives the lens group to move step by step when the focusing motor moves step by step. The step length of the focusing motor corresponding to the photographed image is a first step length, and the step length of the focusing motor corresponding to the new photographed image is a second step length, and the first step length is greater than the second step length.
[0089] The focusing motor can be any type of motor, and the lens group is driven to move step by step by the step-by-step rotation of the focusing motor to achieve the focusing of the projector.
[0090] The step length of the focusing motor can be adjusted by adjusting the rotation speed of the focusing motor, so that the step length of the focusing motor per unit time changes. When the focusing motor rotates at a faster speed, the step length of the focusing motor is a first step length, and when the focusing motor rotates at a slower speed, the step length of the focusing motor is a second step length.
[0091] Please refer to Figure 6 , Figure 6 A flow chart of a method for acquiring the sharpness of the photographed image in the embodiment is shown, and the method comprises the following steps:
[0092] S310, in the process of controlling the lens group to move step by step, acquiring the photographed image corresponding to the projection image before and after each movement.
[0093] The description of S310 is referred to the description of S110 above, and will not be repeated.
[0094] S320, determining a region of interest in the photographed image.
[0095] S330, detecting the sharpness of the region of interest by a first sharpness detection algorithm to obtain the sharpness of the photographed image.
[0096] In the present application, for each photographed image, a plurality of regions of interest can be determined, and then a distinctness value is determined for each region of interest, and then the distinctness values of the regions of interest are weighted and summed or directly summed to obtain the distinctness of the photographed image. The region of interest can be randomly selected in the photographed image, or the region of interest can be determined around the center point of the photographed image.
[0097] In some embodiments, the projection image includes a projection feature point; determining a region of interest in the photographed image includes: performing feature point detection on the photographed image to determine a photographed feature point corresponding to the projection feature point; and determining a region of interest in the photographed image that includes the photographed feature point.
[0098] The projection image can correspond to a plurality of projection feature points, and in the photographed image corresponding to the projection image, a plurality of photographed feature points corresponding to the plurality of projection feature points are included. For example, the feature points of the projection image include projection feature points X1, X2, X3, and X4, and the photographed image obtained according to the projection image includes photographed feature points X5, X6, X7, and X8, wherein X5 is a photographed feature point corresponding to X1, X6 is a photographed feature point corresponding to X2, X7 is a photographed feature point corresponding to X3, and X8 is a photographed feature point corresponding to X4.
[0099] In the specific implementation of the present application, for each photographed feature point, an expansion size can be set, and the photographed feature point is expanded by the expansion size in all directions to obtain a region of interest including the photographed feature point.
[0100] Referring to Figure 7 , Figure 7 A schematic diagram of a region of interest in an embodiment of the present application is shown, the projection image is a "chessboard" image, and the corresponding photographed image is also a "chessboard" image, Figure 6 The photographed image in FIG. 9 includes three photographed feature points C1, C2, and C3 circled by black circles, and a rectangular region (dashed line frame) is expanded outwardly from each of the three photographed feature points as a region of interest 9 (a region included in one dashed line frame is one region of interest). The three photographed feature points correspond to three regions of interest, and the distinctness values of the three regions of interest are determined according to the first distinctness detection algorithm, and then the distinctness of the photographed image is determined according to the distinctness values of the three regions of interest.
[0101] Referring to Figure 8 , Figure 8 A flowchart of a method for obtaining the distinctness of a new photographed image in an embodiment of the present application is shown, and the method includes the following steps:
[0102] S410, acquiring a new photographed image corresponding to the projection image before and after each movement in the step-by-step movement of the lens set in the refocusing area.
[0103] The description of S410 refers to the description of S130 above, and will not be repeated.
[0104] S320, determining a region of interest in the new photographed image.
[0105] S330, performing sharpness detection on the region of interest of the new photographed image by a second sharpness detection algorithm to obtain the sharpness of the new photographed image.
[0106] In this application, for each new photographed image, a plurality of regions of interest are determined, and then the sharpness values of the regions of interest are determined, and the sharpness values of the regions of interest are weighted and summed or directly summed to obtain the sharpness of the new photographed image.
[0107] The region of interest can be randomly selected in the new photographed image, or the region of interest can be determined around the center point of the new photographed image.
[0108] In some embodiments, the projection image includes a projection feature point; determining a region of interest in the new photographed image includes: performing feature point detection on the new photographed image to determine a new photographed feature point corresponding to the projection feature point; and determining a region of interest in the new photographed image that includes the new photographed feature point.
[0109] The projection image can correspond to a plurality of projection feature points, and the new photographed image corresponding to the projection image includes a plurality of new photographed feature points corresponding to the plurality of projection feature points. For example, the feature points of the projection image include projection feature points Y1, Y2, Y3, and Y4, and the new photographed image obtained from the projection image includes new photographed feature points Y5, Y6, Y7, and Y8, wherein Y5 is a new photographed feature point corresponding to Y1, Y6 is a new photographed feature point corresponding to Y2, Y7 is a new photographed feature point corresponding to Y3, and Y8 is a new photographed feature point corresponding to Y4.
[0110] In the specific implementation of this application, for each new photographed feature point, an expansion size can be set, and the expansion size is a distance from the feature point to the surrounding area to obtain a region of interest including the new photographed feature point. As shown in Figure 7 , and will not be repeated.
[0111] Please refer to Figure 9 , Figure 9 a flowchart of a method for determining a photographed image with the maximum sharpness in an embodiment of this application is shown, the method comprising:
[0112] S410, determine the difference of the sharpness of the two photographed images before and after each movement.
[0113] S420, determine the photographed image before the movement corresponding to the first negative difference of the sharpness as the photographed image with the maximum sharpness.
[0114] In the present application, the lens group can be stepwise moved from the focusing starting point to the focusing ending point in the focusing area, at this time, the change of the sharpness of the photographed image is changed in the way of first increasing and then decreasing, the shape is approximately a quadratic function curve, as shown in Figure 3 or Figure 5 When the difference of the sharpness before and after a certain movement is negative, it means that the sharpness of this movement is reduced, then the sharpness of the photographed image before this movement is the photographed image with the maximum sharpness, such as Figure 3 A point in Figure 5 D point in
[0115] The position of the lens group corresponding to A point in Figure 3 (or D point in Figure 5 ) can be taken as the refocusing starting point of the refocusing area, Figure 3 The position of the lens group corresponding to C point in Figure 5 (or G point in ) can be taken as the refocusing ending point of the refocusing area. During the stepwise movement from the refocusing starting point to the refocusing ending point, the position of the lens group corresponding to the E point with the maximum sharpness is determined as the final focusing position.
[0116] It can be understood that in the present application, the method for determining the new photographed image with the maximum sharpness comprises: determining the difference of the sharpness of the two new photographed images before and after each movement, and determining the new photographed image before the movement corresponding to the first negative difference of the sharpness as the photographed image with the maximum sharpness. For specific description, please refer to the description of S410-S420 above, which will not be repeated here.
[0117] Figure 10 , Figure 10 shows the flow chart of the method for determining the refocusing area in the embodiments of the present application, the method comprises:
[0118] S510, based on the position of the lens group when the photographed image with the maximum sharpness is photographed and the preset retreat distance corresponding to the lens group, determine the refocusing starting point of the lens group.
[0119] S520, take the area between the refocusing starting point and the focusing ending point as the refocusing area.
[0120] In the present application, the preset back-off distance can be set by the user based on the actual lens group structure of the projector and requirements, and the present application does not make any limitation. The lens group is stepwise moved from the focusing start point to the focusing end point, and the position of the lens group when the clearest image is captured can be determined as a key position. Then, the key position is taken as the start point, the preset back-off distance is back-off as the refocusing start point, and the area between the refocusing start point and the focusing end point is taken as the refocusing area. At this time, the refocusing end point is the same as the focusing end point of the focusing area.
[0121] It can be understood that after the refocusing start point is determined, the lens group is controlled to move from the refocusing start point to the focusing end point by the second preset distance.
[0122] Please refer to Figure 11 , Figure 11 Another curve diagram of the moving distance of the lens group and the clarity of the captured image in the embodiment of the present application is shown. The horizontal coordinate of the moving distance refers to the distance that the lens group is moved from the focusing start point to the focusing end point.
[0123] The solid line indicates the curve of the moving distance and the clarity of the captured image. The start point of each long-dashed arrow indicates the clarity of the captured image before the lens group is moved by the first preset step length, the end point of each long-dashed arrow indicates the clarity of the captured image after the lens group is moved by the first preset step length, the start point of each short-dashed arrow indicates the clarity of the captured image before the lens group is moved by the second preset step length, and the end point of each short-dashed arrow indicates the clarity of the captured image after the lens group is moved by the second preset step length.
[0124] The K point in the curve indicates the peak point corresponding to the theoretical maximum clarity, and the I point indicates the point of the captured image with the maximum clarity determined by the first clarity detection algorithm in the process that the lens group is stepwise moved by the first preset distance. The position of the lens group when the I point corresponding captured image is captured is determined as the key position, the key position is back-off by the preset back-off distance to the focusing start point to obtain the refocusing start point, and the clarity of the new captured image corresponding to the refocusing start point is indicated by the point H. Meanwhile, the focusing end point L is taken as the refocusing end point to obtain the refocusing area.
[0125] As shown in Figure 11 , the clarity of the captured image with the maximum clarity determined by the first clarity detection algorithm in the process that the lens group is stepwise moved by the first preset distance (indicated by the I point) is far away from the theoretical maximum clarity (indicated by the K point). The clarity of the captured image with the maximum clarity determined by the second clarity detection algorithm in the process that the lens group is stepwise moved by the second preset distance from the refocusing start point to the refocusing end point (indicated by the J point) is close to the theoretical maximum clarity (indicated by the K point).
[0126] In some embodiments, the lens group is controlled to move step by step from a focusing starting point to a focusing ending point at a first preset distance, a corresponding photographed image is acquired before and after each step, then the sharpness of the photographed image is determined in real time according to a first sharpness detection algorithm, and the difference in sharpness between the two photographed images before and after each movement is determined; the photographed image before the first negative value of the difference in sharpness is determined as the photographed image with the maximum sharpness, and after the photographed image with the maximum sharpness is determined, the refocusing area is determined, and at this time, the lens group is no longer controlled to move according to the first preset distance. At the same time, the lens group is controlled to move step by step from a refocusing starting point to a refocusing ending point of the refocusing area at a second preset distance, a corresponding new photographed image is acquired before and after each step, then the sharpness of the new photographed image is determined in real time according to a second sharpness detection algorithm, and the difference in sharpness between the two new photographed images before and after each movement is determined; the new photographed image before the first negative value of the difference in sharpness is determined as the new photographed image with the maximum sharpness, and after the new photographed image with the maximum sharpness is determined, the lens group can be directly controlled to move to the position of the lens group when the new photographed image with the maximum sharpness is photographed, without controlling the lens group to move step by step. At this time, the lens group does not need to be controlled to traverse all the focusing areas at the first preset distance, and the lens group does not need to be controlled to traverse all the refocusing areas at the second preset distance, thereby saving a large amount of data processing time.
[0127] Please refer to Figure 12 , Figure 12 A block diagram of a focusing device provided by an embodiment of the present application is shown, the device 1100 comprises:
[0128] The sharpness determination module 1110 is configured to determine the sharpness of a photographed image corresponding to the projection image of the projector before and after each movement in the process of controlling the lens group of the projector to move step by step, wherein the sharpness of the photographed image is determined by a first sharpness detection algorithm.
[0129] The area determination module 1120 is configured to determine the refocusing area of the lens group according to the position of the lens group when the photographed image with the maximum sharpness is photographed.
[0130] The acquisition module 1130 is configured to acquire the sharpness of a new photographed image corresponding to the projection image before and after each movement in the process of controlling the lens group to move step by step in the refocusing area, wherein the sharpness of the new photographed image is determined by a second sharpness detection algorithm, and the size of the convolution kernel of the first sharpness detection algorithm is greater than the size of the convolution kernel of the second sharpness detection algorithm.
[0131] The control module 1140 is configured to control the lens group to move to the position of the lens group when the new photographed image with the maximum sharpness is photographed.
[0132] Optionally,
[0133] The sharpness determination module 1110 is further configured to acquire a shooting image corresponding to each of the projection images before and after movement in the process of controlling the step-by-step movement of the lens group, determine a region of interest in the shooting image, and determine the sharpness of the shooting image by using a first sharpness detection algorithm on the region of interest.
[0134] Optionally, the projection image comprises a projection feature point.
[0135] The sharpness determination module 1110 is further configured to perform feature point detection on the shooting image, determine a shooting feature point corresponding to the projection feature point, and determine a region of interest in the shooting image, which comprises the shooting feature point.
[0136] Optionally, the lens group is moved step by step from a focusing starting point to the focusing ending point.
[0137] The sharpness determination module 1110 is further configured to determine the difference in sharpness between the two shooting images before and after each movement, and determine the shooting image before the movement corresponding to the first negative sharpness difference value as the shooting image with the maximum sharpness.
[0138] Optionally, the lens group is moved step by step from a focusing starting point to the focusing ending point.
[0139] The region determination module 1120 is further configured to determine a refocusing starting point of the lens group based on the position of the lens group when the shooting image with the maximum sharpness is shot and a preset retreat distance corresponding to the lens group, and determine the refocusing region as a region between the refocusing starting point and the focusing ending point.
[0140] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and module can refer to the corresponding process in the foregoing method embodiments, which will not be described herein.
[0141] In several embodiments provided in the present application, the coupling or direct coupling or communication connection between the modules displayed or discussed can be indirect coupling or communication connection between the interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0142] In addition, each functional module in each embodiment of the present application can be integrated in one processing module, or each module can exist physically independently, or two or more modules can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software functional module.
[0143] Referring to Figure 13 , Figure 13 A block diagram of a focusing device is shown according to another embodiment of the present application. The focusing device 1200 can include one or more of the following components: a processor 1210, a memory 1220, and one or more application programs, wherein the one or more application programs can be stored in the memory 1220 and configured to be executed by the one or more processors 1210, and the one or more programs are configured to perform the methods as described in the foregoing method embodiments.
[0144] The processor 1210 can include one or more processing cores. The processor 1210 connects various parts within the focusing device 1200 by various interfaces and lines, performs various functions of the focusing device 1200 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 1220, and calling data stored in the memory 1220. Alternatively, the processor 1210 can be implemented in at least one of a hardware form of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 1210 can be integrated with a combination of one or more of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU is mainly used to process operating systems, user interfaces, and application programs; the GPU is used to render and draw display content; and the modem is used to process wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 1210, but can be realized by a separate communication chip.
[0145] The memory 1220 can include a random access memory (RAM) and can also include a read-only memory (ROM). The memory 1220 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1220 can include a program storage area and a data storage area, wherein the program storage area can store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing each of the following method embodiments, etc. The data storage area can also store data created by the terminal 1200 in use (such as a phone book, audio and video data, chat record data, etc.).
[0146] Please refer toFigure 14 Figure 14 A structural block diagram of a computer readable storage medium according to an embodiment of the present application is shown. The computer readable medium 800 stores program codes, which can be invoked by a processor to execute the methods described in the above method embodiments.
[0147] The computer readable storage medium 800 can be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer readable storage medium 800 comprises a non-transitory computer readable medium. The computer readable storage medium 800 has a storage space for program codes 810 to execute any of the above methods. These program codes can be read from or written to one or more computer program products. The program codes 810 can be compressed in a suitable form, for example.
[0148] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; even though the above embodiments of the present application have been described in detail, those skilled in the art should understand that the technical solutions recorded in the above embodiments can be modified, or some technical features can be replaced by equivalent ones; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A focusing method, characterized in that, The method includes: During the stepwise movement of the lens group of the projector, the sharpness of the projected image before and after each movement is determined, wherein the sharpness of the captured image is determined by a first sharpness detection algorithm. The refocusing area of the lens group is determined based on the position of the lens group when the image with the highest resolution is captured. During the step-by-step movement of the lens group within the refocusing area, the sharpness of the new captured image corresponding to each movement of the projected image is obtained. The sharpness of the new captured image is determined by a second sharpness detection algorithm, wherein the kernel size of the first sharpness detection algorithm is larger than the kernel size of the second sharpness detection algorithm. The lens group is controlled to move to the position where it is when capturing a new image with the highest resolution.
2. The method as described in claim 1, characterized in that, The step distance corresponding to the captured image is a first preset distance, and the step distance corresponding to the new captured image is a second preset distance, wherein the first preset distance is greater than the second preset distance.
3. The method as described in claim 1, characterized in that, The projector includes a focusing motor, which moves the lens assembly step by step when it moves in steps. The step length of the focusing motor corresponding to the captured image is the first step length. The step length of the focusing motor corresponding to the new captured image is the second step length. The first step length is greater than the second step length.
4. The method as described in claim 1, characterized in that, The method for obtaining the sharpness of the captured image includes: During the stepwise movement of the lens group, the projected image is captured before and after each movement. Determine the region of interest in the captured image; The sharpness of the captured image is obtained by performing sharpness detection on the region of interest using a first sharpness detection algorithm.
5. The method as described in claim 4, characterized in that, The projected image includes projected feature points; determining the region of interest in the captured image includes: Feature point detection is performed on the captured image to determine the captured feature points corresponding to the projected feature points; In the captured image, a region of interest including the captured feature points is determined.
6. The method as described in claim 1, characterized in that, The lens group moves step by step from the focus starting point to the focus ending point; the method for determining the image with the highest sharpness includes: Determine the difference in sharpness between two images taken before and after each movement; The image captured before movement corresponding to the first negative difference in sharpness is determined as the image with the highest sharpness.
7. The method as described in claim 1, characterized in that, The lens group moves stepwise from the focus starting point to the focus ending point; determining the refocusing area of the lens group based on its position when capturing the image with the highest sharpness includes: Based on the position of the lens group when capturing the image with the highest resolution and the preset retraction distance corresponding to the lens group, the refocusing starting point of the lens group is determined; The area between the refocusing start point and the refocusing end point is defined as the refocusing area.
8. A focusing device, characterized in that, The device includes: A sharpness determination module is used to determine the sharpness of the projected image of the projector before and after each movement during the step-by-step movement of the lens group of the projector. The sharpness of the captured image is determined by a first sharpness detection algorithm. The region determination module is used to determine the refocusing area of the lens group based on the position of the lens group when capturing the image with the highest sharpness. The acquisition module is used to acquire the sharpness of the new captured image before and after each movement of the projected image during the step-by-step movement of the lens group in the refocusing area. The sharpness of the new captured image is determined by a second sharpness detection algorithm, wherein the kernel size of the first sharpness detection algorithm is larger than the kernel size of the second sharpness detection algorithm. The control module is used to control the movement of the lens group to the position where the lens group is located when capturing a new image with the highest clarity.
9. A focusing device, characterized in that, include: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to perform the method as described in any one of claims 1-7.
10. A focusing system, characterized in that, The focusing system includes at least a camera, a projector, and a focusing device, wherein... The projector is used to project images; The camera is used to acquire the captured image corresponding to the projected image and the new captured image; The focusing device is used to perform the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Method, device and system for adjusting camera back focus
CN106375647A
Dynamic focusing window selection method and device in projection system
CN108513115A