Projector focusing method, electronic device, and storage medium
Patent Information
- Application Number
- CN202611012350.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-08
- Publication Date
- 2026-09-01
AI Technical Summary
[0003]然而,现有被动式对焦方案缺乏对投影距离变化和画面内容特性的动态响应机制
[0015]本申请的有益效果:通过引入动态配置权重系数的综合清晰度得分计算方法,能够根据投影图像的画面内容特征动态调整对边缘细节敏感的清晰度评价特征和对全局纹理分布敏感的清晰度评价特征的权重,能够更准确地反映不同画面内容下的最佳清晰度,为后续的对焦搜索提供更可靠的依据。采用两阶段的对焦搜索策略,即先搜索目标对焦区间,再在该区间内逐步逼近搜索清晰度峰值。在保证对焦精度的同时,也提高对焦效率,能够更好地适应不同场景下的对焦需求,避免因景深变化导致的对焦困难,提升投影仪的整体用户体验。
Smart Images

Figure CN122679261A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of projector technology, and in particular to a projector focusing method, electronic device, and storage medium. Background Technology
[0002] Currently, the mainstream focusing technology for smart projectors is passive focusing.
[0003] However, existing passive autofocus solutions lack a dynamic response mechanism to changes in projection distance and image content characteristics. Specifically, when the projection distance is close, the optical depth of field is narrow, and even slight movements of the lens group can cause drastic fluctuations in image sharpness, leading to oscillations or deviations from the optimal focusing position. Conversely, when the projection distance is far, the depth of field expands, and fixed-step movements struggle to accurately capture sharpness peaks, resulting in insufficient focusing accuracy. Furthermore, existing passive autofocus solutions use uniform parameters to process all image content, failing to differentiate between the focusing requirements of high-texture and low-texture images. This rigid parameter setting makes the focusing process unstable under diverse environmental conditions, especially with rapidly changing projection distances or complex image content, making efficient and reliable autofocus difficult to achieve. Summary of the Invention
[0004] The purpose of this application is to provide a projector focusing method, electronic device, and storage medium that can adapt to changes in depth of field and image content at different projection distances, thereby improving focusing accuracy and environmental adaptability.
[0005] This application provides a projector focusing method, including: As the focusing lens group moves along the peak direction, the target focusing range containing the sharpness peak is searched based on the changing trend of the overall sharpness score of multiple acquired projection images. Within the focus range, a progressive approximation method is used to search for the sharpness peak to determine the target focus position corresponding to the sharpness peak; The method for calculating the overall sharpness score includes: Extract the image content features, the first sharpness evaluation features that are sensitive to image edge details, and the second sharpness evaluation features that are sensitive to the global texture distribution of the image from the projected image; Based on the characteristics of the image content, dynamically configure the weight coefficients of the first clarity evaluation feature and the second clarity evaluation feature; The overall sharpness score of the projected image is calculated based on the first sharpness evaluation feature, the second sharpness evaluation feature, and the weighting coefficient.
[0006] In some embodiments, searching for a target focus range containing a sharpness peak based on the changing trend of the overall sharpness score of the acquired multiple projected images includes: When the projected image is not captured for the first time, the difference in the overall sharpness score between the two most recently captured projected images is calculated to obtain the sharpness score difference value. When the difference in sharpness score is negative for the first time, the target focus range is determined based on the focus positions of the two most recently acquired projected images.
[0007] In some embodiments, the step of searching for the sharpness peak using a progressive approximation method within the target focus range includes: Select at least two detection positions within the current search range; during the first search, the current search range is the target focusing range, and during subsequent searches, the current search range is the search range updated in the last search. Based on the pairwise comparison results of the comprehensive sharpness scores at the detection locations, the current search interval is narrowed to obtain the updated search interval for the current search. Determine whether the length of the currently updated search interval is less than the preset interval length; If not, return to the step of selecting at least two probe locations within the current search interval; If so, determine the target focus position corresponding to the sharpness peak based on the search interval updated in the current search.
[0008] In some embodiments, the weight coefficient of the first sharpness evaluation feature is positively correlated with the texture level indicated by the image content feature, and the weight coefficient of the second sharpness evaluation feature is negatively correlated with the texture level indicated by the image content feature.
[0009] In some embodiments, prior to calculating the overall sharpness score, the method further includes: Identify overexposed areas in the projected image where pixel values exceed a preset overexposure threshold; Generate a weighted mask to reduce the contribution of the overexposed areas to the sharpness evaluation; Based on the weighted mask, the first sharpness evaluation feature and the second sharpness evaluation feature are spatially weighted to obtain the weighted first sharpness evaluation feature and the second sharpness evaluation feature.
[0010] In some embodiments, the projector focusing method further includes: During the search process, the gradient information of the overall sharpness score as a function of focus position is determined; The movement step size of the focusing lens group is adjusted based on the gradient information, the texture level and high-frequency detail level indicated by the image content features; the movement step size is positively correlated with the gradient information and negatively correlated with the texture level and high-frequency detail level indicated by the image content features. Based on the mapping relationship between the focus position of the focusing lens group and the lens parameters, the estimated projection distance is determined, and depth compensation is performed on the movement step size based on the estimated projection distance; the degree of depth compensation is negatively correlated with the estimated projection distance.
[0011] In some embodiments, the projector focusing method further includes: During the search process, when the overall sharpness score is lower than a preset score threshold, and the number of consecutive times the rate of change of the overall sharpness score is lower than the rate of change threshold reaches a preset number, the search range is expanded, and the step of searching for the target focus range containing the sharpness peak based on the changing trend of the overall sharpness scores of the multiple projected images is re-executed.
[0012] In some embodiments, the projector focusing method further includes: During the search process, the structural similarity between two adjacent projected images is determined; When the structural similarity is lower than a preset similarity threshold, the current search process is paused, and after a preset time, the step of searching for the target focus range containing the sharpness peak based on the changing trend of the comprehensive sharpness score of multiple acquired projection images is re-executed.
[0013] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described projector focusing method.
[0014] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described projector focusing method.
[0015] The beneficial effects of this application are as follows: By introducing a comprehensive sharpness score calculation method with dynamically configured weight coefficients, the weights of sharpness evaluation features sensitive to edge details and sharpness evaluation features sensitive to global texture distribution can be dynamically adjusted according to the content characteristics of the projected image. This allows for a more accurate reflection of the optimal sharpness under different image content, providing a more reliable basis for subsequent focus search. A two-stage focus search strategy is adopted: first, the target focus range is searched, and then the search for the peak sharpness is gradually approached within that range. While ensuring focus accuracy, focus efficiency is also improved, enabling better adaptation to focus requirements in different scenarios, avoiding focusing difficulties caused by changes in depth of field, and enhancing the overall user experience of the projector. Attached Figure Description
[0016] Figure 1 This is a flowchart of the projector focusing method provided in the embodiments of this application.
[0017] Figure 2 This is a flowchart of a method for searching a target focus range containing a sharpness peak, provided in an embodiment of this application.
[0018] Figure 3 This is a flowchart of a method for searching for sharpness peaks within the target focus range using a stepwise approximation method, as provided in an embodiment of this application.
[0019] Figure 4 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0021] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and drawings are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application. Furthermore, the information, data, and signals involved in the embodiments of this application are all authorized by relevant parties or have been fully authorized by all parties, and the collection, use, and processing of related data comply with the relevant laws, regulations, and standards of the relevant countries and regions.
[0023] Current projector focusing technologies suffer from deficiencies due to the lack of adaptive mechanisms for projection distance and image content. Specifically, variations in projection distance cause differences in depth-of-field characteristics, making fixed-parameter focusing strategies unsuitable for different scenarios. At close range, the narrow depth-of-field means that even small displacements of the focusing lens group cause significant changes in image sharpness, making peak detection difficult. At long range, the wide depth-of-field makes it difficult to accurately pinpoint sharpness peaks with larger step movements. Furthermore, the spatial grayscale and spectral energy distribution characteristics of the image content affect the reliability of sharpness evaluation, and fixed-weight evaluation methods produce unstable results when content changes. For example, in a home environment, when a projector projects text onto a white wall at close range, the spatial grayscale distribution is uniform, and the spectral energy is concentrated in the low-frequency region. With the focusing lens group moving in fixed steps, the sharpness score changes drastically within a very small displacement range, causing the search process to miss the sharpness peak point and requiring repeated adjustments. When a projector projects a richly textured screen from a distance onto a movie scene, the spatial grayscale distribution is uneven, the spectral energy distribution is wide, the sharpness score changes gradually, and the fixed step size movement cannot distinguish the peak position, causing the focus position to shift.
[0024] If these issues are not resolved, the focusing system will experience focusing failures or suboptimal focusing. This results in a persistently blurry projected image, requiring manual intervention from the user and reducing automation. In dynamically changing environments, the system will be unable to adapt promptly, leading to performance degradation and compromising user experience and product reliability.
[0025] Based on this, embodiments of this application provide a projector focusing method, an electronic device, and a storage medium. By dynamically configuring the weight coefficients of the sharpness evaluation features and combining them with a progressively approximating search strategy, it can adapt to changes in depth of field and image content at different projection distances, thereby improving focusing accuracy and environmental adaptability.
[0026] like Figure 1 As shown, in one embodiment, a projector focusing method is provided, which includes, but is not limited to, the following steps S101 to S107.
[0027] Step S101: During the movement of the focusing lens group along the peak direction, the target focusing range containing the sharpness peak is searched based on the changing trend of the comprehensive sharpness score of the multiple projected images.
[0028] The focusing lens group refers to the group of optical elements inside the projector used to adjust the focal length of the light path. By controlling the movement of this lens group, the convergence point of the projected light rays can be changed, so that the projected image is clearly formed on the receiving surface.
[0029] A projected image is visual content projected onto a screen or other receiving surface by a projector. During the focusing process, this projected image is typically captured and analyzed to assess its sharpness.
[0030] The overall sharpness score is a numerical indicator used to quantify the sharpness of a projected image.
[0031] Peak sharpness refers to the highest level of sharpness that the projected image can achieve across the entire range of movement of the focusing lens group. This peak corresponds to the optimal focus position.
[0032] The target focus area refers to a small region within the movement range of the focusing lens group, determined through an initial search. This region is considered to contain the sharpness peak.
[0033] Searching for the target focus range containing the sharpness peak can be achieved by first having the focusing lens group move in one direction from an initial position with a preset fixed step size, acquiring a projected image at each position. Then, the overall sharpness score for each image is calculated. By observing the continuous changes in these scores, for example, when the score begins to decrease, it can be determined that the sharpness peak has been passed. At this point, the two positions before and after the score begins to decrease are defined as the boundary of the target focus range. Alternatively, a coarse full scan can be performed first, recording the sharpness scores at all positions. Then, by analyzing the score curve, the area with the highest score can be identified as the target focus range.
[0034] Step S102: Within the focus range, a progressive approximation method is used to search for the sharpness peak to determine the target focus position corresponding to the sharpness peak.
[0035] Determining the target focus position corresponding to the sharpness peak can be achieved by selecting multiple detection positions within a defined target focus range. For example, the range can be divided into several sub-ranges, and image acquisition and sharpness score calculation can be performed at the center of each sub-range. By comparing the scores of these detection positions, the search range can be gradually narrowed. For instance, if the scores of the three detection positions within a range show a "low-high-low" trend, the range formed by the detection position with the highest score in the middle and its two adjacent detection positions is taken as the new search range. This process is repeated until the search range is small enough; at this point, the center position of the range or the position with the highest score is determined as the target focus position.
[0036] In step S101, the method for calculating the overall sharpness score includes: Step S1011: Extract the image content features, the first sharpness evaluation features that are sensitive to image edge details, and the second sharpness evaluation features that are sensitive to the global texture distribution of the image from the projected image.
[0037] Image content features refer to information describing the visual characteristics of a projected image. These features can reflect the image's texture, edges, brightness distribution, etc., and are the basis for evaluating image sharpness and making dynamic weight allocations.
[0038] The first sharpness evaluation feature is a sharpness evaluation metric that is sensitive to changes in image edge detail. This feature is typically used to measure the sharpness of lines and contours in an image.
[0039] The second sharpness evaluation feature is a sharpness evaluation metric that is sensitive to the global texture distribution of an image. This feature is typically used to assess the overall detail richness and uniformity of an image.
[0040] Image content features can include spatial grayscale distribution features and spectral energy distribution features of the projected image. Spatial grayscale distribution features refer to the spatial distribution of pixel grayscale values in the projected image, reflecting the brightness, contrast, and local brightness variations of the projected image. Spectral energy distribution features refer to the energy distribution of the projected image at different frequency components after Fourier transform, reflecting information such as texture coarseness and detail richness. The first sharpness evaluation feature can be obtained by processing the projected image using edge detection algorithms such as the Laplacian operator and the Sobel operator, and then calculating the variance or energy of its response value. The second sharpness evaluation feature can be characterized by the entropy value, texture energy, or energy of a specific frequency band of the projected image.
[0041] Step S1012: Based on the characteristics of the image content, dynamically configure the weight coefficients of the first sharpness evaluation feature and the second sharpness evaluation feature.
[0042] The weighting coefficients of the first and second sharpness evaluation features are dynamically configured. Based on the overall image brightness, contrast, or texture density indicated by the image content features, an appropriate weighting combination is selected from a preset weighting coefficient lookup table. When the image content leans towards high contrast and sharp edges, a higher weighting coefficient can be assigned to the first sharpness evaluation feature. When the image content leans towards complex textures and rich details, a higher weighting coefficient can be assigned to the second sharpness evaluation feature.
[0043] Step S1013: Calculate the overall sharpness score of the projected image based on the first sharpness evaluation feature, the second sharpness evaluation feature, and the weighting coefficient.
[0044] The overall sharpness score of the projected image can be calculated by weighting and summing the first and second sharpness evaluation features using weighted coefficients.
[0045] The following example will provide a more detailed explanation of the above technical solution: Suppose user A is using a smart projector for a presentation. The projector needs to autofocus to ensure a clear image.
[0046] First, the projector's focusing system is activated. The focusing lens group moves from its initial position in preset steps. During this movement, the projector's built-in camera continuously captures images projected onto the screen. For example, as the focusing lens group moves from position P1 to P2, then to P3...Pn, the system sequentially captures images I1, I2, I3...In.
[0047] For each acquired projected image, the system calculates its overall sharpness score. Specifically, for image In, its content features are first extracted, such as calculating the image's average gray value, gray-level variance (spatial gray-level distribution features), and Fourier spectral energy in a specific high-frequency region (spectral energy distribution features). Based on these content features, the system dynamically assigns weights to the first sharpness evaluation feature (e.g., edge sharpness based on the Laplacian operator response) and the second sharpness evaluation feature (e.g., global texture sharpness based on image entropy). For example, if the content features indicate that the current image has rich edge details but relatively smooth global texture, the system may assign a higher weight to the first sharpness evaluation feature. Subsequently, based on these weights and the calculated values of the first and second sharpness evaluation features, the overall sharpness score for image In is obtained.
[0048] The system continuously monitors the trends in these overall sharpness scores. For example, the score reaches its highest point when the focusing lens group moves to position P5, and then begins to decline when it moves to P6. At this point, the system determines that the sharpness peak is likely located between P4 and P6. Therefore, P4 to P6 is defined as the target focus range.
[0049] Next, the system performs a fine-grained search within the target focusing range (P4 to P6) using a progressive approximation method. For example, the system can select three detection positions between P4 and P6: P4.5, P5, and P5.5. Projected images of these three positions are acquired, and their combined sharpness scores are calculated. Assuming that position P5 has the highest score, the system narrows the search range to P4.5 to P5.5. This process is repeated, for example, selecting detection positions again between P4.5 and P5.5, until the length of the search range is less than a preset minimum value. When this condition is met, the system determines the center position of the current smallest search range or the position with the highest score as the final target focusing position.
[0050] Finally, the focusing lens group is precisely moved to the target focusing position, thereby achieving optimal image clarity from the projector. Through this process, the projector can adaptively find the best focusing position based on the actual projected image content and the movement feedback of the focusing lens group, solving the problem of poor adaptability of traditional fixed-parameter focusing methods in different scenarios.
[0051] Based on the above examples, the projector focusing method provided in this embodiment demonstrates a significant technical contribution.
[0052] This embodiment introduces a comprehensive sharpness score calculation method with dynamically configured weight coefficients. This method dynamically adjusts the weights of the first sharpness evaluation feature (sensitive to edge details) and the second sharpness evaluation feature (sensitive to global texture distribution) based on the content characteristics of the projected image (such as spatial grayscale distribution and spectral energy distribution). For example, when the projected image is text or a line drawing, the system can increase the weight of features sensitive to edge details to ensure text sharpness; when the projected image is a landscape or a complex image, the system can increase the weight of features sensitive to global texture to ensure overall image richness. This adaptive sharpness evaluation mechanism, compared to existing single or fixed-weight evaluation methods, can more accurately reflect the optimal sharpness under different image content, thus providing a more reliable basis for subsequent focus search.
[0053] Furthermore, this embodiment employs a two-stage focus search strategy: first, it searches the target focus range, and then gradually approaches the peak sharpness within that range. In the example above, the system first monitors the changing trend of the overall sharpness score to quickly lock in a coarse range containing the peak sharpness, avoiding time-consuming fine searches throughout the entire focusing process. Subsequently, within this target focus range, a gradual approach method is used for fine focusing, ensuring focus accuracy. This combined coarse and fine search strategy improves focusing efficiency while maintaining focus accuracy. Compared to the single scan or fixed step size search that may exist in existing technologies, the method in this embodiment can better adapt to the focusing needs of different scenarios, avoiding focusing difficulties caused by changes in depth of field, thereby improving the overall user experience of the projector.
[0054] like Figure 2 As shown, in one embodiment, the method for searching a target focus range containing a sharpness peak includes, but is not limited to, the following steps S201 to S202.
[0055] Step S201: When a projected image is not acquired for the first time, calculate the difference in the overall sharpness score between the two most recently acquired projected images to obtain the sharpness score difference value.
[0056] Step S202: When the sharpness score difference is negative for the first time, the target focus range is determined based on the focus positions of the two most recently acquired projection images.
[0057] During the movement of the focusing lens group, the system continuously acquires projected images and calculates their overall sharpness score. By calculating the score difference between two adjacent acquired images, the trend of increase or decrease in the sharpness score can be quantified. For example, a processor or controller can subtract the overall sharpness score of the previously acquired projected image from the acquired image's overall sharpness score after each acquisition and calculation, obtaining the difference. This difference can be a relative value with a positive or negative sign to indicate an increase or decrease in the sharpness score.
[0058] As the focusing lens group moves from a blurred area to a sharp area, the sharpness score typically increases gradually, resulting in a positive difference. After passing the peak point, the sharpness score begins to decrease, and the difference becomes negative for the first time, indicating that the sharpness peak point has been passed. At this point, an interval containing the peak can be defined based on the two focusing positions before and after passing the peak point. For example, the system can maintain a list of historical sharpness score differences. When a negative difference is detected, while the previous difference was positive (or zero), it is considered the first occurrence of a negative value. In this case, the focusing positions corresponding to the current image and the previous image (e.g., the physical position of the focusing lens group or the number of steps of the stepper motor) are used as the two endpoints of the target focusing interval.
[0059] This application's solution precisely defines the target focus range containing the sharpness peak by continuously monitoring the dynamic changes in the overall sharpness score of the projected image and using the first negative change in the sharpness score difference as a key trigger condition. During the movement of the focusing lens group, the system continuously acquires images and calculates their overall sharpness score. When the sharpness score continuously increases, the difference is usually positive. Once the focusing lens group passes the optimal focus position, the sharpness score begins to decrease, at which point the difference in the overall sharpness score between adjacent images will become negative for the first time. This "first negative" event provides a clear signal that the system has passed the sharpness peak point. Based on this, the system can immediately and accurately determine a target focus range containing the sharpness peak using the two most recent focus positions that caused this first negative difference. This method avoids broad scanning or complex trend analysis of the entire focusing journey, instead quickly locking down the peak area through a simple and effective judgment condition, providing a smaller and more accurate search range for subsequent fine focusing.
[0060] The following is a concrete example. Suppose the projector's focusing lens group is moving from a blurry position to a sharp position. The projector's control unit periodically acquires projected images and calculates the overall sharpness score for each image. For example, when the focusing lens group moves to position P1, image I1 is acquired, and the overall sharpness score S1 is calculated; when it moves to position P2, image I2 is acquired, and the overall sharpness score S2 is calculated; and so on. The system continuously calculates the difference in overall sharpness scores between adjacent images. For example, it calculates S2-S1, S3-S2, S4-S3, etc. Suppose that at some point, the system calculates a positive value for S5-S4, indicating that sharpness is still improving; but when it immediately calculates S6-S5, it finds a negative value, and this is the first time a negative value has appeared. At this point, the control unit immediately determines the focus positions corresponding to positions P5 and P6 as the boundaries of the target focus range. For example, if the focus position is represented by the number of steps of a stepper motor, then P5 and P6 could be the number of steps the motor takes at a specific moment. This defined target focus area will then be used in subsequent step-by-step searches to precisely find the optimal focus position.
[0061] like Figure 3 As shown, in one embodiment, the method of searching for the sharpness peak using a stepwise approximation method within the target focus range includes, but is not limited to, the following steps S301 to S304.
[0062] Step S301: Select at least two detection locations within the current search range.
[0063] During the first search, the current search range is the target focus range; during subsequent searches, the current search range is the search range updated in the last search.
[0064] During the initial search, the current search interval is the target focus interval determined by the aforementioned method, which includes the sharpness peak. In subsequent searches, the current search interval is a smaller interval updated based on the previous search result. For example, an equal-interval selection method can be used to divide the current search interval into three equal parts and select two probe points; or the probe points can be selected according to the golden ratio to optimize search efficiency.
[0065] Step S302: Based on the pairwise comparison results of the comprehensive clarity scores at the detection locations, the current search interval is narrowed to obtain the updated search interval for the current search.
[0066] By comparing the overall sharpness scores at different detection locations, the direction in which the sharpness peak might be located can be determined. For example, if the scores at the three detection locations show a "low-high-low" trend, the peak is located near the middle detection location; if it shows a "low-high-higher" trend, the peak is located to the right of the rightmost detection location. Based on this comparison, areas with lower sharpness can be eliminated, narrowing the search interval and making the new search interval closer to the sharpness peak. Specifically, a three-part method can be used, comparing the sharpness scores of the three detection points and retaining the interval formed by the point with the highest score and its adjacent points; or a two-part method can be used, comparing between two detection points and narrowing the interval towards the side with the higher score based on the comparison result.
[0067] Step S303: Determine whether the length of the currently updated search interval is less than the preset interval length. If not, return to step S301; if yes, proceed to step S304.
[0068] Step S304: Determine the target focus position corresponding to the sharpness peak based on the currently updated search range.
[0069] If the length of the currently updated search interval is less than the preset interval length, then the current search interval is small enough to meet the preset accuracy requirements, and the sharpness peak can be considered to be located within this extremely small interval. In this case, the final target focus position can be determined based on this interval. For example, the center point of the interval can be directly taken as the target focus position; alternatively, linear interpolation or quadratic curve fitting can be performed within the interval to more accurately estimate the peak position.
[0070] This application's solution refines the sharpness peak location within a pre-determined target focus range using a progressively approximating strategy. The method first selects multiple detection positions within the current search range and compares the overall sharpness scores of these positions to determine the trend of the sharpness peak. Based on this trend, the system can effectively eliminate areas with low sharpness, thus gradually narrowing the search range. This process is iterative, with each iteration bringing the search range closer to the true sharpness peak. When the search range shrinks to a sufficiently small preset length, it indicates that the required focusing accuracy has been achieved, at which point the final target focus position can be determined from this extremely small range. This iterative approach to narrowing the range avoids blind or inefficient searching throughout the entire focusing journey, significantly improving focusing efficiency and accuracy. By combining this with the aforementioned method for determining the target focus range, this solution achieves a focusing process from coarse positioning to precise locking, ensuring the final sharpness of the projected image.
[0071] The following is a concrete example to illustrate this. Suppose that a target focus range has been determined to be [10mm, 50mm] using the aforementioned method. During the initial search, the current search range is [10mm, 50mm]. The golden ratio method can be used to select two detection positions, for example, at 10mm + (50-10). 0.382 = 25.28mm and 10mm + (50-10) A projected image is acquired at 0.618 = 34.72mm, and the overall sharpness score is calculated. If the overall sharpness score at 25.28mm is lower than the score at 34.72mm, it indicates that the sharpness peak may be to the right of 34.72mm. In this case, the new search interval can be updated to [25.28mm, 50mm]. Next, it is determined whether the length (24.72mm) of the new interval [25.28mm, 50mm] is less than the preset interval length (e.g., 0.1mm). If not, a new detection position is selected within [25.28mm, 50mm], for example, using the golden ratio again, and the above process is repeated. This iterative process continues until the search interval length is less than 0.1mm. For example, when the search interval shrinks to [32.15mm, 32.20mm], its length is 0.05mm, which is less than the preset 0.1mm. At this point, the center point of this interval, i.e. (32.15+32.20) / 2 = 32.175mm, can be taken as the final target focus position.
[0072] In some embodiments, the weight coefficient of the first sharpness evaluation feature is positively correlated with the texture level indicated by the image content feature, and the weight coefficient of the second sharpness evaluation feature is negatively correlated with the texture level indicated by the image content feature.
[0073] The weighting coefficient of the first sharpness evaluation feature is positively correlated with the texture level indicated by the image content features. That is, the richer the details and edge information of the image, the greater the proportion of the first sharpness evaluation feature in the calculation of the overall sharpness score. This positive correlation can be achieved in several ways. For example, a monotonically increasing function can be designed, taking the texture level as input and outputting the corresponding weighting coefficient; or, multiple texture level intervals can be preset, and an increasing weighting coefficient can be assigned to each interval.
[0074] The weighting coefficient of the second sharpness evaluation feature is negatively correlated with the texture level indicated by the image content features. That is, the richer the details and edge information of the image, the smaller the proportion of the second sharpness evaluation feature in the overall sharpness score calculation. This negative correlation can also be achieved in various ways. For example, a monotonically decreasing function can be designed, taking the texture level as input and outputting the corresponding weighting coefficient; or, multiple texture level intervals can be preset, and a decreasing weighting coefficient can be assigned to each interval.
[0075] This application's solution extracts the image content features of the projected image and dynamically configures the weight coefficients of the first and second sharpness evaluation features based on these features to calculate a comprehensive sharpness score. Furthermore, this application clarifies the specific relationship between the weight coefficients and the texture level indicated by the image content features. Specifically, when the image content features indicate a high texture level, the system increases the weight coefficient of the first sharpness evaluation feature, which is sensitive to image edge details, while decreasing the weight coefficient of the second sharpness evaluation feature, which is sensitive to the global texture distribution of the image. Conversely, when the image content features indicate a low texture level, the system decreases the weight coefficient of the first sharpness evaluation feature and increases the weight coefficient of the second sharpness evaluation feature. This adaptive weight configuration mechanism allows the calculation of the comprehensive sharpness score to be optimized according to the actual content characteristics of the current projected image. For example, for images containing a large amount of fine texture and sharp edges, the system will focus more on using the first sharpness evaluation feature to evaluate sharpness; while for images with less texture and relatively smoothness, the system will rely more on the second sharpness evaluation feature to evaluate sharpness. In this way, the solution proposed in this application can ensure that the overall sharpness score evaluation is more accurate and robust under various image content, thereby providing a more reliable basis for subsequent target focus position determination.
[0076] In a specific embodiment, the formula for calculating the weighting coefficients of the first sharpness evaluation feature and the second sharpness evaluation feature is as follows: α(H, R_spec) = α_max sigmoid(Ω_1 H+Ω_2 R_spec+b_1), β(H, R_spec) =β_max sigmoid(-Ω_1 H - Ω_2 R_spec+b_2), Where α(H, R_spec) is the weight coefficient of the first sharpness evaluation feature, β(H, R_spec) is the weight coefficient of the second sharpness evaluation feature, α_max and β_max are the upper limit parameters of the weight, sigmoid(·) is the sigmoid activation operation, Ω_1 and Ω_2 are adjustable parameters, b_1 and b_2 are bias parameters, H is the spatial gray-level distribution feature, and R_spec is the spectral energy distribution feature; The formulas for calculating both the first and second sharpness evaluation features are as follows: S_ten = sum_x sum_y [G_x(x,y)^2+G_y(x,y)^2], S_lap = (1 / (M N)) sum_x sum_y [L(x,y) - mu]^2, Wherein, S_ten is the first sharpness evaluation feature, S_lap is the second sharpness evaluation feature, G_x(x,y) and G_y(x,y) are the gradient values of the (x,y) position in the projected image after convolution with the Sobel operator in the horizontal and vertical directions, respectively, L(x,y) is the Laplacian filter response, mu is the mean response, and M and N are the width and height of the projected image.
[0077] In some embodiments, before calculating the overall sharpness score, the method further includes: Identify overexposed areas in the projected image where pixel values exceed a preset overexposure threshold; Generate a weighted mask to reduce the contribution of overexposed areas to the sharpness evaluation; Based on the weighted mask, the first sharpness evaluation feature and the second sharpness evaluation feature are spatially weighted to obtain the weighted first sharpness evaluation feature and the second sharpness evaluation feature.
[0078] To identify overexposed areas in a projected image where pixel values exceed a preset overexposure threshold, one can set an upper limit threshold for pixel values and mark all areas in the image with pixel values above that threshold as overexposed areas. Alternatively, one can perform local brightness statistical analysis on the image to identify areas where the local brightness far exceeds the average level and the pixel values are close to saturation.
[0079] Generating a weighted mask involves creating a two-dimensional matrix of the same size as the projected image, based on the identified overexposed areas. Each element in this matrix corresponds to a pixel in the image, and its value represents the weight of that pixel in the sharpness evaluation. For pixels within overexposed areas, their corresponding weight values are set to a smaller value to reduce their influence on subsequent sharpness feature calculations; while for pixels in non-overexposed areas, their weight values can be set to normal values (e.g., 1).
[0080] Spatially weighting the first and second sharpness evaluation features can be achieved by multiplying the feature contribution of each pixel or region in the image by its corresponding weight value in the weight mask. For example, when calculating the gradient-based first sharpness evaluation feature, the gradient magnitude of each pixel is multiplied by its corresponding weight mask value, and then all weighted gradient magnitudes are summed or averaged to obtain the weighted first sharpness evaluation feature. Similarly, when calculating the frequency domain energy-based second sharpness evaluation feature, the original image can be multiplied pixel-by-pixel with the weight mask to obtain an image where the contribution of overexposed areas is suppressed, and then features are extracted from this suppressed image.
[0081] The proposed solution identifies overexposed areas in the projected image and generates a corresponding weighted mask before calculating the overall sharpness score. This weighted mask effectively reduces the contribution of overexposed areas to the sharpness evaluation. Subsequently, when calculating the first sharpness evaluation feature, which is sensitive to image edge details, and the second sharpness evaluation feature, which is sensitive to the global texture distribution of the image, the weighted mask is used for spatial weighting. This means that the pixel information of overexposed areas is assigned a lower weight during feature calculation, thereby reducing its impact on the final sharpness evaluation result. In this way, even if overexposed areas exist in the projected image, they will not have a significant negative impact on the calculation of the overall sharpness score, making the sharpness evaluation more accurate and robust, and thus improving the accuracy of target focus position determination.
[0082] The following example illustrates this concept. In a projector focusing method, after acquiring a frame of projected image, the image processing unit first performs pixel value analysis. For example, a preset overexposure threshold of 230 is set (for an 8-bit image, the pixel value range is 0-255). Any region with a pixel value greater than 230 is identified as an overexposed region. Next, the system generates a weighted mask. For the identified overexposed regions, the weight value of the corresponding pixel position in the weighted mask can be set to 0.2, while for non-overexposed regions, the weight value is set to 1. When calculating the first sharpness evaluation feature (e.g., the image gradient magnitude calculated based on the Sobel operator), the gradient magnitude of each pixel is multiplied by the weight value of the corresponding position in the weighted mask. Then, all weighted gradient magnitudes are summed to obtain the weighted first sharpness evaluation feature. Similarly, when calculating the second sharpness evaluation features (e.g., high-frequency energy of the image based on Fourier transform), the original image can be multiplied pixel-by-pixel with a weighted mask to obtain an image where the contribution of overexposed areas is suppressed. Then, a Fourier transform is performed on this suppressed image, and the high-frequency energy is calculated to obtain the weighted second sharpness evaluation features. Finally, these weighted features are used to calculate the overall sharpness score.
[0083] In some embodiments, the projector focusing method further includes: During the search process, the gradient information of the overall sharpness score as the focus position changes is determined; The movement step size of the focusing lens group is adjusted based on gradient information, the texture level and high-frequency detail level indicated by the image content features; the movement step size is positively correlated with gradient information and negatively correlated with the texture level and high-frequency detail level indicated by the image content features. Based on the mapping relationship between the focus position of the focusing lens group and the lens parameters, the estimated projection distance is determined, and depth of field compensation is performed on the movement step size according to the estimated projection distance; the degree of depth of field compensation is negatively correlated with the estimated projection distance.
[0084] Determining the gradient information of the overall sharpness score as a function of focus position refers to obtaining the rate of change of the overall sharpness score relative to the focus position of the focusing lens group. This gradient information indicates the steepness and direction of change of the sharpness curve. A large gradient value indicates that the sharpness score changes rapidly with focus position, possibly indicating that the optimal focus position is far away; a small gradient value indicates that the sharpness score changes gradually, possibly indicating that the optimal focus position is approaching or already in place. This gradient information can be obtained by numerically differentiating the overall sharpness score of continuously acquired projected images with the corresponding focus positions. For example, the finite difference method can be used, which calculates the ratio of the difference in overall sharpness score between two adjacent focus positions to the difference in focus position. Alternatively, it can be obtained by curve fitting of sharpness score versus focus position data over a period of time and then differentiating the fitted curve.
[0085] Adjusting the movement step size of the focusing lens group refers to dynamically adjusting the distance the focusing lens group advances or retreats in each movement operation based on the focusing state, image content, and optical characteristics. When the focusing lens group is far from the optimal focusing position, a larger movement step size can be used to speed up the search; when approaching the optimal focusing position, a smaller movement step size should be used to improve focusing accuracy. This adjustment can be achieved through a preset lookup table, which queries the corresponding movement step size value based on different gradient information, texture level, and high-frequency detail level. Alternatively, it can be achieved through adaptive control algorithms, such as those based on fuzzy logic or PID control principles, to calculate and adjust the movement step size in real time.
[0086] Determining the estimated projection distance based on the mapping relationship between the focusing lens group's focus position and lens parameters means that the focusing lens group's focus position and the projector's lens parameters (such as focal length and aperture) jointly determine the focal plane position of the projection, thus allowing the calculation of the distance from the projector to the projection plane, i.e., the estimated projection distance. For example, the actual projection distance at different focus positions can be measured, and then a functional relationship between the focus position and the projection distance can be established using methods such as polynomial fitting or piecewise linear interpolation.
[0087] Depth-of-field compensation based on the estimated projection distance means that the depth of field is closely related to the projection distance; generally, the farther the projection distance, the greater the depth of field; and the closer the projection distance, the smaller the depth of field. Depth-of-field compensation involves adjusting the movement step size according to the estimated projection distance to adapt to the depth-of-field characteristics at different projection distances. For example, when the estimated projection distance is far, the depth of field is greater, so the step size requirement can be appropriately relaxed, allowing for a slightly larger movement step size; when the estimated projection distance is close, the depth of field is smaller, so a smaller movement step size is needed to ensure focusing accuracy.
[0088] During focusing, the system continuously monitors the changes in the overall sharpness score with the focus position and calculates its gradient information in real time. When the absolute value of the gradient is large, it indicates that the current focus position is still far from the optimal focus position, and the system will correspondingly increase the movement step size of the focusing lens group to achieve a fast coarse search. As the focusing lens group moves, when the absolute value of the gradient gradually decreases, it indicates that the focus position is close to the sharpness peak, and the system will correspondingly decrease the movement step size to switch to a fine search, thereby avoiding overshooting the optimal focus position. At the same time, the system also analyzes the image content features of the current projected image, extracting its texture and high-frequency detail. If the image content has rich texture and high-frequency detail, it indicates high image focus sensitivity, and the system will further reduce the movement step size to ensure focus accuracy. Conversely, if the image content is relatively smooth, the movement step size is allowed to be appropriately increased. In addition, the system will also determine the estimated projection distance in real time based on the current focus position of the focusing lens group and the preset lens parameter mapping relationship. Given the negative correlation between depth of field and projection distance (i.e., the greater the projection distance, the greater the depth of field), the system compensates for this by adjusting the movement step size based on the estimated projection distance. Specifically, when the estimated projection distance is far, the system appropriately relaxes the restriction on the movement step size due to the greater depth of field; conversely, when the estimated projection distance is short, the system further reduces the movement step size due to the smaller depth of field, ensuring accurate focusing within a narrow depth of field. Through this multi-dimensional, adaptive step size adjustment mechanism, the proposed solution dynamically optimizes the movement strategy of the focusing lens group based on the focusing state, image content, and optical characteristics, thereby significantly improving focusing speed and efficiency while maintaining focusing accuracy.
[0089] The following example illustrates this. Assume that during focusing, the system first calculates the overall sharpness score from the acquired projected image and then calculates the gradient information based on the score changes between adjacent focus positions. For example, when the focusing lens group moves from position P1 to P2, the overall sharpness score changes from S1 to S2, and the gradient information can be approximated as (S2-S1) / (P2-P1). Simultaneously, the system analyzes the image content features, such as evaluating texture by calculating the Laplacian variance of the image, or evaluating high-frequency detail by analyzing the energy of high-frequency components using Fourier transform. Assume the current absolute gradient value is G, the texture level is T, and the high-frequency detail level is H. The mapping relationship between the focus position of the focusing lens group and lens parameters can be a pre-stored lookup table; for example, when the focus position is X, the corresponding estimated projection distance is D. At this time, the movement step size of the focusing lens group can be dynamically calculated using the following formula: `Step size = K_g` |G| / (K_t T+K_h H) F_d(D)`. Where `K_g`, `K_t`, and `K_h` are preset adjustment coefficients, and `F_d(D)` is a depth-of-field compensation factor whose value decreases as the estimated projection distance D increases. For example, it can be designed as `F_d(D) = 1 / (1+C)`. D)`, where C is a constant. In this way, the step size increases when the gradient is large and decreases when the texture or high-frequency details are rich. At the same time, depth compensation is performed according to the projection distance D to ensure efficient and accurate focusing in different scenes.
[0090] In some embodiments, the projector focusing method further includes: During the search process, when the overall sharpness score is lower than the preset score threshold, and the number of consecutive times the rate of change of the overall sharpness score is lower than the rate of change threshold reaches the preset number, the search range is expanded, and the step of searching for the target focus range containing the sharpness peak is re-executed based on the changing trend of the overall sharpness scores of the multiple projected images.
[0091] This application's solution effectively solves the aforementioned problems by introducing an intelligent stagnation detection and recovery mechanism during the focus search process. While the focusing lens group moves and acquires projected images to calculate the overall sharpness score, the system continuously monitors these scores and their changing trends. Once it detects that the overall sharpness score remains consistently low and its rate of change is consistently below a preset threshold, it indicates that the current focus search may have fallen into a local optimum or ineffective region, failing to effectively approach the true sharpness peak. At this point, the system proactively triggers a "expand search range" strategy and restarts the search process for the target focus interval. This mechanism allows the focusing system to escape potential local optimum traps, avoiding focus failures caused by improper initial search interval selection or the complexity of the sharpness curve, ensuring that the globally optimal sharpness peak is re-found and locked within a wider range. In this way, the solution significantly enhances the robustness and accuracy of the focusing process, making it particularly suitable for complex and ever-changing application scenarios.
[0092] The following is a concrete example to illustrate this. When a projector is autofocusing, the focusing lens group moves according to a preset step size and captures the projected image in real time, calculating its overall sharpness score. Suppose that at a certain moment, the system detects that the overall sharpness scores of three consecutive captured projected images are 0.25, 0.24, and 0.23 (the preset score threshold is 0.3), and the rate of change (e.g., absolute difference) between adjacent scores are 0.01 and 0.01 (the preset rate of change threshold is 0.02), respectively. In this case, the "preset number of attempts" is set to 3. Because the overall sharpness score remains below the preset score threshold, and the number of consecutive times the rate of change remains below the rate of change threshold reaches the preset number, the system determines that the current focusing process may have entered a local optimum or stagnated. To avoid this situation, the system will immediately perform an operation to expand the search range. For example, the range of motion of the focusing lens group can be extended to both sides by 10% from the current position, or the focusing lens group can be quickly moved to the starting position of its mechanical travel and the initial focus range search step can be restarted, that is, the entire focus travel can be scanned from the beginning to redetermine the target focus range containing the sharpness peak.
[0093] In some embodiments, the projector focusing method further includes: During the search process, the structural similarity between two adjacent projected images is determined; When the structural similarity is lower than the preset similarity threshold, the current search process is paused and waited for a preset time before re-executing the step of searching for the target focus range containing the sharpness peak based on the changing trend of the comprehensive sharpness score of multiple acquired projection images.
[0094] This application's solution enhances the robustness of the focusing process by introducing a mechanism for judging the structural similarity of projected images. During the movement of the focusing lens group and the acquisition of projected images, the system continuously monitors the structural similarity between adjacent projected images. This monitoring mechanism reflects the stability of the projection environment in real time. When the structural similarity of adjacent images is detected to be lower than a preset similarity threshold, it indicates that the projected image may be subject to external interference. Continuing the focusing operation at this time may lead to incorrect judgments or invalid searches. Therefore, the system immediately pauses the current focusing search process, stops the movement of the focusing lens group and sharpness analysis, to avoid operating in an unstable state. After a pause period (i.e., waiting for a preset duration), the system restarts the focusing process, starting from the initial step of searching for the target focusing range containing sharpness peaks. This mechanism ensures that the focusing process always takes place in a relatively stable environment, avoiding focusing failure or accuracy degradation caused by instantaneous environmental changes. In this way, the solution of this application can effectively cope with the uncertainties in the projection environment, improve the reliability and adaptability of the focusing method, and enable the projector to accurately and stably complete focusing even in complex and ever-changing application scenarios.
[0095] The following is a concrete example to illustrate this. During the projector's focusing process, the system continuously acquires projected images. For instance, after the focusing lens group moves one step and acquires a new projected image, the image processing module immediately calculates the structural similarity between the current image and the previous image. This structural similarity can be calculated using the Structural Similarity Index (SSIM), with SSIM values typically ranging from -1 to 1, where 1 indicates that the two images are identical. The system can preset a similarity threshold, such as 0.7. If the calculated SSIM value is below 0.7, it is considered that the projected image has changed significantly and may have been interfered with. At this time, the focus control unit sends a stop command to the drive motor of the focusing lens group and pauses image acquisition and sharpness score calculation. The system enters a waiting state, for example, waiting for 3 seconds. After 3 seconds, the system reactivates the image acquisition module and the focus control unit and restarts the initial search phase of the focusing lens group, that is, restarts the search for the target focus range containing the sharpness peak.
[0096] This application also provides an electronic device. Figure 4 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application. For example... Figure 4As shown, the electronic device in this embodiment mainly includes a processor 401 and a memory 402. The memory 402 can be configured to store a program for executing the projector focusing method of the above-described method embodiments, and the processor 401 can be configured to execute the program in the memory 402. This program includes, but is not limited to, a program for executing the projector focusing method of the above-described method embodiments. For ease of explanation, only the parts related to the embodiments of this application are shown. For specific technical details not disclosed, please refer to the method section of the embodiments of this application.
[0097] In some embodiments, the electronic device may further include multiple processors 401 and multiple memories 402. The program executing the projector focusing method of the above method embodiments can be divided into multiple subroutines, each of which can be loaded and run by a processor 401 to perform different steps of the projector focusing method of the above method embodiments. Specifically, each subroutine can be stored in a different memory 402, and each processor 401 can be configured to execute programs in one or more memories 402 to jointly implement the projector focusing method of the above method embodiments; that is, each processor 401 executes different steps of the projector focusing method of the above method embodiments to jointly implement the projector focusing method of the above method embodiments.
[0098] The aforementioned multiple processors 401 can be processors deployed on the same device. For example, the aforementioned electronic device can be a high-performance device composed of multiple processors, and the aforementioned multiple processors 401 can be processors configured on that high-performance device. Alternatively, the aforementioned multiple processors 401 can also be processors deployed on different devices. For example, the aforementioned electronic device can be a server cluster, and the aforementioned multiple processors 401 can be processors on different servers within the server cluster.
[0099] This application also provides a computer-readable storage medium. In one embodiment of the computer-readable storage medium according to this application, the computer-readable storage medium can be configured to store a program that performs the projector focusing method of the above-described method embodiments. This program can be loaded and run by a processor to implement the above-described projector focusing method. For ease of explanation, only the parts related to the embodiments of this application are shown; for specific technical details not disclosed, please refer to the method section of the embodiments of this application. The computer-readable storage medium can be a memory formed by various electronic devices. Optionally, in the embodiments of this application, the computer-readable storage medium is a non-transitory computer-readable storage medium.
[0100] The projector focusing method, electronic device, and storage medium provided in this application introduce a comprehensive sharpness score calculation method with dynamically configured weight coefficients. This method dynamically adjusts the weights of sharpness evaluation features sensitive to edge details and sharpness evaluation features sensitive to global texture distribution based on the characteristics of the projected image content. This more accurately reflects the optimal sharpness under different image content, providing a more reliable basis for subsequent focus search. A two-stage focus search strategy is adopted: first, the target focus range is searched, and then the search for the peak sharpness is gradually approached within that range. While ensuring focusing accuracy, focusing efficiency is also improved, better adapting to focusing needs in different scenarios, avoiding focusing difficulties caused by changes in depth of field, and enhancing the overall user experience of the projector.
[0101] Exemplary embodiments of this disclosure have been specifically shown and described above. It should be understood that this disclosure is not limited to the detailed structures, arrangements, or implementations described herein; rather, this disclosure is intended to cover various modifications and equivalent arrangements contained within the spirit and scope of the appended claims.
Claims
1. A projector focusing method, characterized in that, include: As the focusing lens group moves along the peak direction, the target focusing range containing the sharpness peak is searched based on the changing trend of the overall sharpness score of multiple acquired projection images. Within the focus range, a progressive approximation method is used to search for the sharpness peak to determine the target focus position corresponding to the sharpness peak; The method for calculating the overall sharpness score includes: Extract the image content features, the first sharpness evaluation features that are sensitive to image edge details, and the second sharpness evaluation features that are sensitive to the global texture distribution of the image from the projected image; Based on the characteristics of the image content, dynamically configure the weight coefficients of the first clarity evaluation feature and the second clarity evaluation feature; The overall sharpness score of the projected image is calculated based on the first sharpness evaluation feature, the second sharpness evaluation feature, and the weighting coefficient.
2. The projector focusing method according to claim 1, characterized in that, The step of searching for the target focus range containing the sharpness peak based on the changing trend of the comprehensive sharpness score of multiple acquired projection images includes: When the projected image is not captured for the first time, the difference in the overall sharpness score between the two most recently captured projected images is calculated to obtain the sharpness score difference value. When the difference in sharpness score is negative for the first time, the target focus range is determined based on the focus positions of the two most recently acquired projected images.
3. The projector focusing method according to claim 1, characterized in that, The method of searching for the sharpness peak within the target focus range using a stepwise approximation approach includes: Select at least two detection positions within the current search range; during the first search, the current search range is the target focusing range, and during subsequent searches, the current search range is the search range updated in the last search. Based on the pairwise comparison results of the comprehensive sharpness scores at the detection locations, the current search interval is narrowed to obtain the updated search interval for the current search. Determine whether the length of the currently updated search interval is less than the preset interval length; If not, return to the step of selecting at least two probe locations within the current search interval; If so, determine the target focus position corresponding to the sharpness peak based on the search interval updated in the current search.
4. The projector focusing method according to claim 1, characterized in that, The weight coefficient of the first sharpness evaluation feature is positively correlated with the texture level indicated by the image content feature, and the weight coefficient of the second sharpness evaluation feature is negatively correlated with the texture level indicated by the image content feature.
5. The projector focusing method according to claim 1, characterized in that, Before calculating the overall sharpness score, the following is also included: Identify overexposed areas in the projected image where pixel values exceed a preset overexposure threshold; Generate a weighted mask to reduce the contribution of the overexposed areas to the sharpness evaluation; Based on the weighted mask, the first sharpness evaluation feature and the second sharpness evaluation feature are spatially weighted to obtain the weighted first sharpness evaluation feature and the second sharpness evaluation feature.
6. The projector focusing method according to claim 1, characterized in that, Also includes: During the search process, the gradient information of the overall sharpness score as a function of focus position is determined; The movement step size of the focusing lens group is adjusted based on the gradient information, the texture level and high-frequency detail level indicated by the image content features; the movement step size is positively correlated with the gradient information and negatively correlated with the texture level and high-frequency detail level indicated by the image content features. Based on the mapping relationship between the focus position of the focusing lens group and the lens parameters, the estimated projection distance is determined, and depth compensation is performed on the movement step size based on the estimated projection distance; the degree of depth compensation is negatively correlated with the estimated projection distance.
7. The projector focusing method according to claim 1, characterized in that, Also includes: During the search process, when the overall sharpness score is lower than a preset score threshold, and the number of consecutive times the rate of change of the overall sharpness score is lower than the rate of change threshold reaches a preset number, the search range is expanded, and the step of searching for the target focus range containing the sharpness peak based on the changing trend of the overall sharpness scores of the multiple projected images is re-executed.
8. The projector focusing method according to claim 1, characterized in that, Also includes: During the search process, the structural similarity between two adjacent projected images is determined; When the structural similarity is lower than a preset similarity threshold, the current search process is paused, and after a preset time, the step of searching for the target focus range containing the sharpness peak based on the changing trend of the comprehensive sharpness score of multiple acquired projection images is re-executed.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the projector focusing method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the projector focusing method according to any one of claims 1 to 8.