A sharpness calibration method, apparatus, terminal device, and storage medium based on moving head lights.

By automating image acquisition and focus adjustment, and employing image sharpness calculation and fitting functions, the accuracy and efficiency issues of traditional moving head light calibration methods have been resolved, enabling rapid and accurate sharpness calibration of moving head lights under different distances and scenarios.

CN119277203BActive Publication Date: 2025-10-28GUANGZHOU YAJIANG PHOTOELECTRIC EQUIP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411341345.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-10-28
Estimated Expiration
2044-09-25

AI Technical Summary

Technical Problem

Traditional moving head light sharpness calibration methods rely on human eye recognition and experience, resulting in inaccurate and time-consuming results, and are unable to quickly respond to pattern sharpness calibration needs under different distances and scenarios.

Method used

By automating image acquisition, sharpness assessment, and focus adjustment, and using image sharpness calculation formulas and fitting functions, the optimal focus channel value is determined iteratively, enabling rapid and accurate calibration of moving head light images.

Benefits of technology

It enables rapid and accurate calibration of moving head light image clarity, reduces labor costs, improves the accuracy and response speed of calibration results, and adapts to the pattern clarity requirements of different distances and scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119277203B_ABST
    Figure CN119277203B_ABST
Patent Text Reader

Abstract

This invention discloses a sharpness calibration method, device, terminal equipment, and storage medium based on a moving head light. First, based on the extraction of focus channel values ​​from a preset first focus channel value extraction interval and the corresponding image sharpness values, an initial reference focus channel value is determined for iterative extraction. Then, the focus channel values ​​within the first focus channel value extraction interval are iteratively extracted and compared for image sharpness. By continuously narrowing the extraction interval and automatically determining the target focus channel value corresponding to the highest sharpness at the current projection point position, the projected image is calibrated based on the target focus channel value. This invention overcomes the problems of high labor costs and susceptibility to subjective judgment in traditional methods through automated image acquisition, sharpness evaluation, and iterative focus channel value extraction, enabling rapid response to the automatic pattern sharpness calibration needs at different projection point positions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of camera focusing technology, and in particular to a sharpness calibration method, apparatus, terminal device, and storage medium based on a moving head light. Background Technology

[0002] To ensure optimal clarity of the pattern projected by a moving head light at various distances and enhance the viewer's visual experience, it is often necessary to calibrate the pattern's clarity. However, traditional clarity calibration methods typically rely on human eye recognition and accumulated experience for focusing, or require additional equipment to obtain information such as distance and orientation. This involves measuring the clarity of different patterns at different distances and orientations, finding and recording the highest clarity focus value, and then manually recording and focusing. However, traditional methods have several drawbacks, such as requiring significant manpower and time, being susceptible to visual fatigue and subjective judgment leading to inaccurate calibration results, and being unable to quickly respond to the need for pattern clarity calibration at different distances and in different scenarios. Summary of the Invention

[0003] This invention provides a method, apparatus, terminal device, and storage medium for calibrating the sharpness of moving head lights. Through automated image acquisition, sharpness assessment, and focus adjustment, it achieves rapid and accurate calibration of the sharpness of moving head light images, effectively solving the problems of high labor costs and susceptibility to subjective judgment in existing technologies.

[0004] One embodiment of the present invention provides a sharpness calibration method based on a moving head light, comprising:

[0005] Get the projection image of the moving head light at the current projection point position;

[0006] According to a preset interval, extract several first focus channel values ​​from a preset first focus channel value extraction interval;

[0007] Based on the image sharpness of the projected image at each first focus channel value, the first focus channel value corresponding to the highest image sharpness is selected as the second focus channel value:

[0008] The second focusing channel value is used as the initial reference focusing channel value. The focusing channel values ​​in the first focusing channel value extraction interval are iteratively extracted. In each iteration, a new reference focusing channel value is determined based on the image sharpness corresponding to each extracted focusing channel value. This process continues until the number of extractions reaches a preset threshold. Then, the reference focusing channel value for each iteration is output.

[0009] Compare the image sharpness of each reference focusing channel value, and take the reference focusing channel value with the highest image sharpness as the target focusing channel value;

[0010] Based on the target focus channel value, the projected image of the moving head light at the current distance is calibrated.

[0011] Preferably, the step of using the second focusing channel value as the initial reference focusing channel value, iteratively extracting focusing channel values ​​from the first focusing channel value extraction interval, and determining a new reference focusing channel value based on the image sharpness corresponding to each extracted focusing channel value in each iteration, until the number of extractions reaches a preset threshold, and then outputting the reference focusing channel value for each iteration, includes:

[0012] Repeat the following focus channel value extraction operation until the number of extracted values ​​equals a preset threshold, then output the baseline focus channel value for each iteration:

[0013] Obtain the current reference focusing channel value: where the initial reference focusing channel value is the second focusing channel value;

[0014] Based on the preset shrinkage ratio and the number of the previous focus channel values ​​extracted, the number of the first focus channel values ​​to be extracted from the first focus channel value range is calculated. Initially, the number of the first focus channel values ​​to be extracted is calculated based on the number of the first focus channel values ​​in the first focus channel value range and the preset shrinkage ratio.

[0015] Based on the current reference focusing channel value, according to the number of extractions, extract several first focusing channel values ​​from the first focusing channel value interval to generate a second focusing channel value interval.

[0016] According to the preset interval, extract several third focus channel values ​​from the second focus channel value range, calculate the image sharpness corresponding to each third focus channel value, and take the third focus channel value corresponding to the highest image sharpness as the updated reference focus channel value.

[0017] When the number of extractions exceeds a preset threshold, the updated reference focus channel value will be used as the current reference focus channel value for the next focus channel value extraction operation.

[0018] Preferably, the step of extracting a number of first focusing channel values ​​from the first focusing channel value interval based on the current reference focusing channel value, and generating a second focusing channel value interval according to the number of extractions, includes:

[0019] Centered on the current reference focusing channel value, the number of extractions is divided equally to obtain several left focusing channel values ​​that are smaller than the current reference focusing channel value and several right focusing channel values ​​that are larger than the current reference focusing channel value.

[0020] A second focusing channel value range is generated based on each left-side focusing channel value, each right-side focusing channel value, and the current reference focusing channel value; wherein the total number of left-side focusing channel values ​​is equal to the total number of right-side focusing channel values.

[0021] Preferably, the generation of image sharpness under the first focusing channel value includes:

[0022] Obtain the projected image of the moving head light under the first focus channel value;

[0023] The projected image is converted to grayscale to generate a grayscale matrix corresponding to the projected image; wherein the grayscale matrix contains the grayscale value corresponding to each pixel of the projected image.

[0024] Based on the grayscale difference between the first target pixel and the second target pixel in the grayscale matrix, the image sharpness corresponding to the first focus channel value is generated; wherein, the number of pixels between the first target pixel and the second target pixel is a preset number of pixels.

[0025] Preferably, generating the image sharpness corresponding to the first focus channel value based on the grayscale difference between the first target pixel and the second target pixel in the grayscale matrix includes:

[0026] The image sharpness corresponding to the first focusing channel value is calculated using the following formula:

[0027] F(x)=∑ i=1,2...n-2,j=1,2...m mf(x) (i+s),j -f(x) i,j ) 2 ;

[0028] Where F(x) represents the image sharpness corresponding to the first focus channel value, f(x) i,j This represents the gray value at the first target pixel (i,j) in the gray-scale matrix, or the gray value at the second target pixel (i,j). s is a preset interval number, and the dimension of the gray-scale matrix is ​​n*m.

[0029] Preferably, the step of selecting the first focus channel value corresponding to the highest image sharpness at each first focus channel value as the second focus channel value includes:

[0030] Based on each first focus channel value and the corresponding image sharpness, a fitting function is generated to characterize the relationship between the first focus channel value and the image sharpness.

[0031] The focus channel value corresponding to the extreme point of the fitted function is used as the second focus channel value.

[0032] Preferably, the step of generating a fitting function to characterize the relationship between the first focus channel values ​​and the image sharpness corresponding to each first focus channel value includes:

[0033] A fitting function characterizing the relationship between the first focus channel value and image sharpness is generated according to the following formula:

[0034]

[0035] in, For the fitting function, l k Let F(x) be the interpolation function corresponding to the k-th first focus channel value. k Let x be the k-th image sharpness value. k Let be the k-th value of the first focusing channel, and c be the number of values ​​in the first focusing channel.

[0036] Based on the above method embodiments, the present invention provides corresponding apparatus embodiments.

[0037] An embodiment of the present invention provides a sharpness calibration device based on a moving head light, comprising: an image acquisition module, a focus channel value determination module, and a calibration module;

[0038] The image acquisition module is used to acquire the projected image of the moving head light at the current projection point position;

[0039] The focusing channel value determination module is used to extract several first focusing channel values ​​from a preset first focusing channel value extraction interval according to a preset interval.

[0040] Based on the image sharpness of the projected image at each first focus channel value, the first focus channel value corresponding to the highest image sharpness is selected as the second focus channel value:

[0041] The second focusing channel value is used as the initial reference focusing channel value. The focusing channel values ​​in the first focusing channel value extraction interval are iteratively extracted. In each iteration, a new reference focusing channel value is determined based on the image sharpness corresponding to each extracted focusing channel value. This process continues until the number of extractions reaches a preset threshold. Then, the reference focusing channel value for each iteration is output.

[0042] Compare the image sharpness of each reference focusing channel value, and take the reference focusing channel value with the highest image sharpness as the target focusing channel value;

[0043] The calibration module is used to calibrate the projected image of the moving head light at the current distance based on the target focusing channel value.

[0044] Based on the above method embodiments, the present invention provides corresponding terminal device embodiments.

[0045] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a sharpness calibration method based on a moving head light as described in the above-described embodiment of the invention.

[0046] Based on the above method embodiments, the present invention provides corresponding storage medium embodiments.

[0047] Another embodiment of the present invention provides a storage medium, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform a sharpness calibration method based on a moving head light as described in the above-described embodiment of the invention.

[0048] The following benefits can be obtained by implementing the present invention:

[0049] This invention provides a sharpness calibration method, device, terminal equipment, and storage medium based on a moving head light. This invention can automatically calibrate images at different projection positions. First, according to a preset interval, several first focus channel values ​​are extracted from a preset first focus channel value extraction interval. Based on the image sharpness under each first focus channel value, a second focus channel value is determined. This second focus channel value is used as the initial reference point for iteration. Then, focus channel values ​​in the first focus channel value extraction interval can be iteratively extracted. In each iteration, the image sharpness corresponding to each extracted focus channel value is determined. A new reference focus channel value is generated until the number of samples reaches a preset threshold, at which point the reference focus channel value for each iteration is output. By comparing the image sharpness of each reference focus channel value, the reference focus channel value with the highest image sharpness is taken as the target focus channel value. This automatically determines the focus channel value (i.e., the target focus channel value) corresponding to the optimal sharpness achievable by the moving head light at the current projection point and scene. Finally, based on the determined target focus channel value, the projected image of the moving head light at the current projection point is calibrated to reach the position corresponding to the target focus channel value, thus achieving automatic image sharpness calibration. Compared with existing technologies, this invention achieves rapid and accurate calibration of moving head light image sharpness through automated image acquisition, sharpness evaluation, and focus adjustment. It overcomes the problems of high labor costs and susceptibility to subjective judgment in traditional methods, resulting in more accurate image calibration results and faster response to pattern sharpness calibration needs at different distances and scenes. Attached Figure Description

[0050] Figure 1 This is a schematic flowchart of a sharpness calibration method based on a moving head light, provided by an embodiment of the present invention.

[0051] Figure 2 This is a schematic diagram of a clarity calibration device based on a moving head light, provided in an embodiment of the present invention. Detailed Implementation

[0052] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0053] like Figure 1 The diagram shown is a flowchart illustrating a sharpness calibration method based on a moving head light according to an embodiment of the present invention. The sharpness calibration method based on a moving head light includes:

[0054] Step S1: Obtain the projection image of the moving head light at the current projection point position;

[0055] Step S2: Extract several first focus channel values ​​from the preset first focus channel value extraction interval according to the preset interval;

[0056] Based on the image sharpness of the projected image at each first focus channel value, the first focus channel value corresponding to the highest image sharpness is selected as the second focus channel value;

[0057] The second focusing channel value is used as the initial reference focusing channel value. The focusing channel values ​​in the first focusing channel value extraction interval are iteratively extracted. In each iteration, a new reference focusing channel value is determined based on the image sharpness corresponding to each extracted focusing channel value. This process continues until the number of extractions reaches a preset threshold. Then, the reference focusing channel value for each iteration is output.

[0058] Compare the image sharpness of each reference focusing channel value, and take the reference focusing channel value with the highest image sharpness as the target focusing channel value;

[0059] Step S3: Based on the target focus channel value, calibrate the projected image of the moving head light at the current distance.

[0060] For step S1, in a preferred embodiment, the present invention can achieve image calibration at different distances, and what is obtained is a key frame or static image in the video stream that is projected or illuminated by a moving head light and captured by an imaging device (such as a camera) at the current projection point position.

[0061] As an illustration, an image and video stream of a pattern can be captured by a camera device, transmitted to a host computer via a serial data interface, and displayed on a desktop monitor. Then, the image clarity can be analyzed.

[0062] In a preferred embodiment, each time an image corresponding to the moving head light is acquired, an image that accurately reflects the clarity performance of the moving head light at the current projection point position and in the focusing state can be extracted from the video stream. Then, key frames in the video can be selected or specific image processing operations (such as noise reduction, contrast enhancement, etc.) can be performed, thereby improving the accuracy of subsequent image clarity assessment.

[0063] For step S2, after obtaining the image at the current distance, the present invention can focus the image at the current projection point position. First, the focus channel value with the highest sharpness is obtained by automatically iteratively comparing the focus channel values.

[0064] In a preferred embodiment, the present invention can extract several first focus channel values ​​uniformly from a preset first focus channel value extraction interval containing multiple focus channel values ​​according to a preset interval, and then calculate the clarity of the projected image of the moving head light under each first focus channel value.

[0065] The generation of the image sharpness value for each of the first focusing channel values ​​includes:

[0066] Obtain the projected image of the moving head light under the first focus channel value;

[0067] The projected image is converted to grayscale to generate a grayscale matrix corresponding to the projected image; wherein the grayscale matrix contains the grayscale value corresponding to each pixel of the projected image.

[0068] Based on the grayscale difference between the first target pixel and the second target pixel in the grayscale matrix, the image sharpness corresponding to the first focus channel value is generated; wherein, the number of pixels between the first target pixel and the second target pixel is a preset number of pixels.

[0069] As an illustration, the image sharpness corresponding to the first focus channel value can be calculated using the following formula:

[0070] F(x)=∑ i=1,2…n-2,j=1,2…m (f(x) (i+s),j -f(x) i,j ) 2 ;

[0071] Where F(x) represents the image sharpness corresponding to the first focus channel value, f(x) i,jThis represents the gray value at the first target pixel (i,j) in the gray-scale matrix, or the gray value at the second target pixel (i,j). s is a preset interval number, and the dimension of the gray-scale matrix is ​​n*m.

[0072] Specifically, in this embodiment of the invention, a pattern with corresponding sharpness can be obtained by changing the first focus value x. Then, the image video stream is extracted by frame extraction using host computer software, converted into an image, and subjected to grayscale conversion, noise reduction, and other operations to obtain a grayscale matrix G. n×m Then, the gray values ​​f(x)i,j of the pixels in the grayscale image are extracted, the square of the gray value difference between two pixels is calculated, and the sum is obtained to obtain F(x). F(x) can be used to evaluate the image clarity.

[0073] Then we have:

[0074]

[0075] The formula for calculating image sharpness analysis, F(x), is:

[0076] F(x)=∑ i=1,2...n-2,j=1,2...m (f(x) (i+s),j -f(x) i,j ) 2 .

[0077] Understandably, this invention can detect image edges based on grayscale changes between two pixels. Compared to traditional sharpness evaluation algorithms that are strongly insensitive to isolated noise points in images, this invention's process of obtaining the image sharpness value of the first focusing channel based on the grayscale difference between the first and second target pixels in the grayscale matrix can reduce the impact of dust spots generated in the air to a certain extent. Furthermore, in experimental testing, focusing on grayscale changes between two pixels provides a better reflection of pattern sharpness.

[0078] Furthermore, the present invention can, based on various image sharpness values, use the first focusing channel value with the highest image sharpness value as the second focusing channel value, specifically:

[0079] Based on each first focus channel value and the corresponding image sharpness, a fitting function is generated to characterize the relationship between the first focus channel value and the image sharpness.

[0080] The focus channel value corresponding to the extreme point of the fitted function is used as the second focus channel value.

[0081] Specifically, a fitting function characterizing the relationship between the first focus channel value and image sharpness can be generated according to the following formula:

[0082]

[0083] in, For the fitting function, l k Let F(x) be the interpolation function corresponding to the k-th first focus channel value. k Let x be the k-th image sharpness value. k Let be the k-th value of the first focusing channel, and c be the number of values ​​in the first focusing channel.

[0084] Wherein, the interpolation function l corresponding to the kth first focus channel value k Possible forms:

[0085]

[0086] After obtaining multiple different first focus channel values ​​and their corresponding image sharpness values, a curve can be fitted based on each data point to obtain the second focus channel value corresponding to the maximum image sharpness value.

[0087] Furthermore, using the second focus channel value as the midpoint, multiple different focus channel values ​​can be extracted evenly within half of the previously acquired range. This process is repeated until the number of extractions in the final focus channel value extraction interval reaches a preset threshold. Then, the focus channel value corresponding to the highest sharpness evaluation value is output.

[0088] In a preferred embodiment, the second focusing channel value is used as the initial reference focusing channel value. Focusing channel values ​​within the first focusing channel value extraction interval are iteratively extracted. At each iteration, a new reference focusing channel value is determined based on the image sharpness corresponding to each extracted focusing channel value. This process continues until the number of extractions reaches a preset threshold. The reference focusing channel value for each iteration is then output. The specific process includes:

[0089] Repeat the following focus channel value extraction operation until the number of extracted values ​​equals a preset threshold, then output the baseline focus channel value for each iteration:

[0090] Obtain the current reference focusing channel value: where the initial reference focusing channel value is the second focusing channel value;

[0091] Based on the preset shrinkage ratio and the number of the previous focus channel values ​​extracted, the number of the first focus channel values ​​to be extracted from the first focus channel value range is calculated. Initially, the number of the first focus channel values ​​to be extracted is calculated based on the number of the first focus channel values ​​in the first focus channel value range and the preset shrinkage ratio.

[0092] Based on the current reference focusing channel value, according to the number of extractions, extract several first focusing channel values ​​from the first focusing channel value interval to generate a second focusing channel value interval.

[0093] According to the preset interval, extract several third focus channel values ​​from the second focus channel value range, calculate the image sharpness corresponding to each third focus channel value, and take the third focus channel value corresponding to the highest image sharpness as the updated reference focus channel value.

[0094] When the number of extractions exceeds a preset threshold, the updated reference focus channel value will be used as the current reference focus channel value for the next focus channel value extraction operation.

[0095] Then, based on each reference focusing channel value and the image sharpness value of the image under each reference focusing channel value, the reference focusing channel value with the highest image sharpness value can be used as the target focusing channel value.

[0096] Indicatively, in each iteration, based on the preset shrinkage ratio and the number of focusing channel values ​​extracted in the previous iteration, the number of first focusing channel values ​​to be extracted from the first focusing channel value interval is calculated. Then, based on the current baseline focusing channel value, several first focusing channel values ​​are extracted from the first focusing channel value interval according to the extraction number to generate the second focusing channel value interval. It can be understood that as the extraction number continuously decreases, the corresponding second focusing channel value interval also decreases accordingly.

[0097] The image sharpness value is calculated for each third focus channel value. The focus channel value with the highest sharpness value can be found and used as the reference focus channel value for the next iteration.

[0098] Understandably, if the number of focusing channel values ​​within the newly determined second focusing channel value extraction interval is still greater than the preset quantity threshold (the preset quantity threshold can be 0), the interval range will continue to be narrowed around the reference focusing channel value, and the above process will be repeated.

[0099] Through the above steps, this invention iteratively narrows the search range, enabling it to automatically and efficiently find the optimal focusing settings for the moving head light under different distances and scenes, thereby achieving clear image calibration.

[0100] This invention, through fine-grained iteration to narrow the search range and quantitative evaluation based on image sharpness values, can find a focusing setting closer to the optimal solution, thereby improving the accuracy of calibration and ensuring that the moving head light can project clear, high-quality images under different distances and scenes.

[0101] Since the method of the present invention is based on the evaluation of image sharpness values, it has strong adaptability. Regardless of different distances, scenes, or lighting conditions, the present invention can adapt to changes by automatically acquiring the focus channel value and achieve image sharpness calibration.

[0102] It is understandable that in the process of repeatedly performing the focus channel value determination operation, multiple third focus channel values ​​can be continuously extracted from the determined second focus channel value extraction interval. Through the corresponding image sharpness values, a reference focus channel value is determined from each third focus channel value. The principle is the same as the principle of determining a second focus channel value from each first focus channel value, both of which use the image sharpness value calculation function and the fitting function generation method to determine the focus channel value corresponding to the extreme point.

[0103] In a preferred embodiment, the step of extracting a plurality of first focusing channel values ​​from the first focusing channel value interval based on the current reference focusing channel value and according to the number of extractions to generate a second focusing channel value interval includes:

[0104] Centered on the current reference focusing channel value, the number of extractions is divided equally to obtain several left focusing channel values ​​that are smaller than the current reference focusing channel value and several right focusing channel values ​​that are larger than the current reference focusing channel value.

[0105] A second focusing channel value range is generated based on each left-side focusing channel value, each right-side focusing channel value, and the current reference focusing channel value; wherein the total number of left-side focusing channel values ​​is equal to the total number of right-side focusing channel values.

[0106] Indicatively, the first focusing channel value extraction interval is arranged as [0~255][0~255][0~255]…; this allows the total number of focusing channel values ​​on the left side to be equal to the total number of focusing channel values ​​on the right side. That is, with the current reference focusing channel value as the center, the number of extracted values ​​can be evenly divided, and then the total number of focusing channel values ​​on the left side of the second focusing channel value interval is equal to the total number of focusing channel values ​​on the right side.

[0107] In a preferred embodiment, five focus channel values ​​are extracted. In the previous iteration, the optimal focus channel value (reference focus channel value) was found to be 30.

[0108] Then we have:

[0109] Calculate the number of focus channel values: Based on the preset shrinkage ratio and the number of focus channel values ​​extracted in the previous extraction, the number of focus channel values ​​to be extracted from the first focus channel value range is calculated to be 5.

[0110] Determine the center value: The center value is 30, which is the optimal focusing channel value found in the previous iteration.

[0111] Evenly distribute the focus channel values: With 30 as the center, there are 2 focus channel values ​​on each side. Select the integers on both sides of 30 as the focus channel values, and keep their difference from 30 equal.

[0112] Therefore, we can select the two focusing channels on the left as values ​​28 and 29, and the two focusing channels on the right as values ​​31 and 32. The new target focusing channel value extraction range is then [28, 29, 30, 31, 32].

[0113] In a preferred embodiment, when the arrangement of the first focusing channel value extraction interval is only [0~255], the reference focusing channel value will appear at the edge of the interval, and the following process for determining the second focusing channel value interval is followed:

[0114] Centered on the reference focusing channel value, the number of extractions is divided equally to obtain several left focusing channel values ​​that are smaller than the current reference focusing channel value and several right focusing channel values ​​that are larger than the current reference focusing channel value.

[0115] When it is determined that the total number of left-side focusing channel values ​​is equal to the total number of right-side focusing channel values, each left-side focusing channel value, each right-side focusing channel value, and the reference focusing channel value are used as focusing channel values ​​in the second focusing channel value interval.

[0116] When it is determined that the total number of left-side focusing channel values ​​is less than the total number of right-side focusing channel values, each left-side focusing channel value, several first candidate focusing channel values, and the reference focusing channel value are used as focusing channel values ​​in the second focusing channel value range; wherein, the first candidate focusing channel values ​​are right-side focusing channel values, and the total number of the first candidate focusing channel values ​​is equal to the total number of left-side focusing channel values;

[0117] When it is determined that the total number of left-side focusing channel values ​​is greater than the total number of right-side focusing channel values, each right-side focusing channel value, several second candidate focusing channel values, and the reference focusing channel value are used as focusing channel values ​​in the second focusing channel value range; wherein, the second candidate focusing channel values ​​are left-side focusing channel values, and the total number of second candidate focusing channel values ​​is equal to the total number of right-side focusing channel values;

[0118] The center value of the second focusing channel value interval is the reference focusing channel value; the difference between any two adjacent focusing channel values ​​in the second focusing channel value interval is equal.

[0119] It can be understood that the above process describes how, in each iteration, a new, smaller target focus channel value extraction range is determined based on the current focus channel value extraction range and a preset ratio value. This process is achieved by allocating focus channel values ​​to the left and right sides, centered on the optimal focus channel value found in the current iteration (i.e., the reference focus channel value).

[0120] Specifically, if, based on the preset narrowing ratio and the number of focusing channel values ​​extracted in the previous iteration, the number of focusing channel values ​​to be extracted from the first focusing channel value interval is calculated to be 6, and the optimal focusing channel value found in the current iteration (i.e., the reference focusing channel value, assumed to be 30) is still used as the center, then the process of determining the new second focusing channel value extraction interval will be as follows:

[0121] Determine the center value: The center value remains the optimal focusing channel value of 30 found in the previous iteration;

[0122] Calculate the number of focusing channel values ​​on the left and right sides: Since the newly extracted interval should contain 6 focusing channel values ​​and the center value occupies one position, theoretically, 2.5 focusing channel values ​​should be allocated to each side. However, the focusing channel values ​​cannot be decimals. Therefore, when the focusing channel values ​​are evenly distributed, it is possible to have one more or one less focusing channel value to the left of the optimal focusing channel value 30, so as to keep the total number of focusing channel values ​​at 6.

[0123] Randomly assign the number of focus channel values ​​on the left and the number of focus channel values ​​on the right.

[0124] If there are 2 focus channel values ​​on the left and 3 focus channel values ​​on the right, it can be determined that the total number of focus channel values ​​on the left is less than the total number of focus channel values ​​on the right. Assuming the step size of the focus channel values ​​is 1, then 2 left focus channel values ​​can be selected, and 2 right focus channel values ​​can be selected from the 3 right focus channel values.

[0125] That is, the selectable focusing channel values ​​on the left are 28 and 29 (because they are the two closest integers to 30). Since the difference between any two adjacent focusing channel values ​​in the final second focusing channel value extraction interval is equal, when selecting the focusing channel value on the right, we should start from 30 and select gradually. Therefore, the right focusing channel values ​​31 and 32 can be selected as the candidate right focusing channel values.

[0126] Therefore, the final target focusing channel value extraction range is determined to be: [28, 29, 30, 31, 32].

[0127] It is understood that, in the selection method of the present invention, when the optimal focusing channel value 2 is the center value, the focusing channel value 1 on the left can be used to determine that one focusing channel value should be selected on the right (such as selecting 3), thereby realizing the generation of the target focusing channel value extraction interval centered on the optimal focusing channel value 2 (which should be [1,2,3] at this time).

[0128] If the optimal focusing channel value corresponding to the center value is not at the edge of the interval, the embodiment of the present invention can extract the interval and the preset ratio value according to the current focusing channel value, and preferentially sample the number of left and right sides equally to achieve the same number of focusing channel values ​​extracted on the left and right sides.

[0129] Therefore, in each iteration, this invention can determine the selection range for the next iteration based on the optimal focusing channel value (i.e., the reference focusing channel value). By iterating around the optimal focusing channel value, the search range can be quickly narrowed, reducing unnecessary focusing channel value tests and thus improving focusing efficiency. It avoids blindly searching across the entire focusing range, instead allowing for targeted, fine-tuning near the optimal value.

[0130] Because each iteration revolves around the optimal focusing channel value (the reference focusing channel value), it can more accurately approximate the optimal solution. That is, by gradually narrowing the search range, focusing error can be gradually reduced, improving focusing accuracy. Even in the presence of noise or interference, the search range always revolves around the optimal value, thus reducing the impact of external factors on the focusing results.

[0131] Furthermore, the present invention can flexibly adjust the size of the search interval according to the preset narrowing ratio (based on different extraction numbers), which can adapt to different focusing needs and scenarios and realize a more personalized focusing strategy.

[0132] In each iteration, only the focusing channel value within the newly extracted interval needs to be calculated, instead of traversing the entire focusing range, which reduces the amount of computation and improves the execution efficiency of the algorithm.

[0133] In a preferred embodiment, if the preset first focus channel value extraction interval contains 255 focus channel values, then c values ​​can be evenly selected, and x can be calculated for each value. i The corresponding sharpness evaluation value F(xi) yields a series of data points (x1,F(x1)), (x2,F(x2)), (x3,F(x3))…(x1,F(x1)). A fitting curve is then plotted to obtain the fitting function. calculate Find the maximum value point, and then, using the maximum value point as the center, uniformly select multiple values ​​and repeat the above steps until the selected maximum value point can meet the requirements of the moving head light image clarity, thus obtaining the optimal focusing channel value.

[0134] In a preferred embodiment, for step S3, the present invention can calibrate the projected image of the moving head light at the current projection point position based on the target focus channel value obtained in the previous steps. Since the target focus channel value corresponds to the highest clarity, the optimal focus channel value at the current projection point position and the image clarity calibration of the moving head light can be completed.

[0135] This invention enhances the performance stability of moving head lights under different projection positions and lighting conditions by automatically determining and calibrating the optimal focusing channel value. This not only makes the image calibration results more accurate, but also allows for rapid response to pattern sharpness calibration needs under different distances and scenes.

[0136] like Figure 2 As shown, based on the above embodiments of various clarity calibration methods based on moving head lights, the present invention provides corresponding device embodiments;

[0137] An embodiment of the present invention provides a sharpness calibration device based on a moving head light, comprising: an image acquisition module, a focus channel value determination module, and a calibration module;

[0138] The image acquisition module is used to acquire the projected image of the moving head light at the current projection point position;

[0139] The focusing channel value determination module is used to extract several first focusing channel values ​​from a preset first focusing channel value extraction interval according to a preset interval.

[0140] Based on the image sharpness of the projected image at each first focus channel value, the first focus channel value corresponding to the highest image sharpness is selected as the second focus channel value:

[0141] The second focusing channel value is used as the initial reference focusing channel value. The focusing channel values ​​in the first focusing channel value extraction interval are iteratively extracted. In each iteration, a new reference focusing channel value is determined based on the image sharpness corresponding to each extracted focusing channel value. This process continues until the number of extractions reaches a preset threshold. Then, the reference focusing channel value for each iteration is output.

[0142] Compare the image sharpness of each reference focusing channel value, and take the reference focusing channel value with the highest image sharpness as the target focusing channel value;

[0143] The calibration module is used to calibrate the projected image of the moving head light at the current distance based on the target focusing channel value.

[0144] It should be noted that the device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0145] Those skilled in the art will understand that, for convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0146] Based on the above embodiments of various clarity calibration methods based on moving head lights, the present invention provides corresponding embodiments of terminal devices.

[0147] One embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a sharpness calibration method based on a moving head light as described in any embodiment of the present invention.

[0148] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0149] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.

[0150] The memory can be used to store the computer program. The processor implements various functions of the terminal device by running or executing the computer program stored in the memory and calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc.; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0151] Based on the above embodiments of various clarity calibration methods based on moving head lights, the present invention provides corresponding embodiments of storage media.

[0152] One embodiment of the present invention provides a storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute a sharpness calibration method based on a moving head light as described in any embodiment of the present invention.

[0153] The storage medium is a computer-readable storage medium, and the computer program is stored in the computer-readable storage medium. When executed by a processor, the computer program can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0154] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A sharpness calibration method based on a moving head light, characterized in that, include: Get the projection image of the moving head light at the current projection point position; According to a preset interval, extract several first focus channel values ​​from a preset first focus channel value extraction interval; Based on the image sharpness of the projected image at each first focus channel value, the first focus channel value corresponding to the highest image sharpness is selected as the second focus channel value: The second focusing channel value is used as the initial reference focusing channel value. The focusing channel values ​​in the first focusing channel value extraction interval are iteratively extracted. In each iteration, a new reference focusing channel value is determined based on the image sharpness corresponding to each extracted focusing channel value. This process continues until the number of extractions reaches a preset threshold. Then, the reference focusing channel value for each iteration is output. Compare the image sharpness of each reference focusing channel value, and take the reference focusing channel value with the highest image sharpness as the target focusing channel value; Based on the target focus channel value, the projected image of the moving head light at the current distance is calibrated.

2. The sharpness calibration method based on a moving head light as described in claim 1, characterized in that, The process involves using the second focusing channel value as the initial reference focusing channel value, iteratively extracting focusing channel values ​​from the first focusing channel value extraction interval, and determining a new reference focusing channel value based on the image sharpness corresponding to each extracted focusing channel value in each iteration, until the number of extractions reaches a preset threshold. The reference focusing channel value for each iteration is then output, including: Repeat the following focus channel value extraction operation until the number of extracted values ​​equals a preset threshold, then output the baseline focus channel value for each iteration: Obtain the current reference focusing channel value: where the initial reference focusing channel value is the second focusing channel value; Based on the preset shrinkage ratio and the number of the previous focus channel values ​​extracted, the number of the first focus channel values ​​to be extracted from the first focus channel value range is calculated. Initially, the number of the first focus channel values ​​to be extracted is calculated based on the number of the first focus channel values ​​in the first focus channel value range and the preset shrinkage ratio. Based on the current reference focusing channel value, according to the number of extractions, extract several first focusing channel values ​​from the first focusing channel value interval to generate a second focusing channel value interval. According to the preset interval, extract several third focus channel values ​​from the second focus channel value range, calculate the image sharpness corresponding to each third focus channel value, and take the third focus channel value corresponding to the highest image sharpness as the updated reference focus channel value. When the number of extractions exceeds a preset threshold, the updated reference focus channel value will be used as the current reference focus channel value for the next focus channel value extraction operation.

3. The sharpness calibration method based on a moving head light as described in claim 2, characterized in that, The step of using the current reference focusing channel value as a reference, and extracting a number of first focusing channel values ​​from the first focusing channel value interval according to the number of extractions, to generate a second focusing channel value interval includes: Centered on the current reference focusing channel value, the number of extractions is divided equally to obtain several left focusing channel values ​​that are smaller than the current reference focusing channel value and several right focusing channel values ​​that are larger than the current reference focusing channel value. A second focusing channel value range is generated based on each left-side focusing channel value, each right-side focusing channel value, and the current reference focusing channel value; wherein the total number of left-side focusing channel values ​​is equal to the total number of right-side focusing channel values.

4. The sharpness calibration method based on a moving head light as described in claim 3, characterized in that, The generation of image sharpness at the first focusing channel value includes: Obtain the projected image of the moving head light under the first focus channel value; The projected image is converted to grayscale to generate a grayscale matrix corresponding to the projected image; wherein the grayscale matrix contains the grayscale value corresponding to each pixel of the projected image. Based on the grayscale difference between the first target pixel and the second target pixel in the grayscale matrix, the image sharpness corresponding to the first focus channel value is generated; wherein, the number of pixels between the first target pixel and the second target pixel is a preset number of pixels.

5. The sharpness calibration method based on a moving head light as described in claim 4, characterized in that, The step of generating the image sharpness corresponding to the first focus channel value based on the grayscale difference between the first target pixel and the second target pixel in the grayscale matrix includes: The image sharpness corresponding to the first focusing channel value is calculated using the following formula: F(x)=∑ i=1,2…n-2,j=1,2…m (f(x) (i+s),j -f(x) i,j ) 2 ; Where F(x) represents the image sharpness corresponding to the first focus channel value, f(x) i,j This represents the gray value at the first target pixel (i,j) in the gray-scale matrix, or the gray value at the second target pixel (i,j). s is a preset interval number, and the dimension of the gray-scale matrix is ​​n*m.

6. The sharpness calibration method based on a moving head light as described in claim 5, characterized in that, The step of selecting the first focus channel value corresponding to the highest image sharpness at each first focus channel value, based on the image sharpness of the projected image at each first focus channel value, as the second focus channel value includes: Based on each first focus channel value and the corresponding image sharpness, a fitting function is generated to characterize the relationship between the first focus channel value and the image sharpness. The focus channel value corresponding to the extreme point of the fitted function is used as the second focus channel value.

7. The sharpness calibration method based on a moving head light as described in claim 5, characterized in that, The step of generating a fitting function to characterize the relationship between the first focus channel values ​​and the image sharpness corresponding to each first focus channel value includes: A fitting function characterizing the relationship between the first focus channel value and image sharpness is generated according to the following formula: in, For the fitting function, l k Let F(x) be the interpolation function corresponding to the k-th first focus channel value. k Let x be the k-th image sharpness value. k Let be the k-th value of the first focusing channel, and c be the number of values ​​in the first focusing channel.

8. A sharpness calibration device based on a moving head light, characterized in that, include: Image acquisition module, focus channel value determination module, and calibration module; The image acquisition module is used to acquire the projected image of the moving head light at the current projection point position; The focusing channel value determination module is used to extract several first focusing channel values ​​from a preset first focusing channel value extraction interval according to a preset interval. Based on the image sharpness of the projected image at each first focus channel value, the first focus channel value corresponding to the highest image sharpness is selected as the second focus channel value: The second focusing channel value is used as the initial reference focusing channel value. The focusing channel values ​​in the first focusing channel value extraction interval are iteratively extracted. In each iteration, a new reference focusing channel value is determined based on the image sharpness corresponding to each extracted focusing channel value. This process continues until the number of extractions reaches a preset threshold. Then, the reference focusing channel value for each iteration is output. Compare the image sharpness of each reference focusing channel value, and take the reference focusing channel value with the highest image sharpness as the target focusing channel value; The calibration module is used to calibrate the projected image of the moving head light at the current distance based on the target focusing channel value.

9. A terminal device, characterized in that, The device includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements a sharpness calibration method based on a moving head light as described in any one of claims 1 to 7.

10. A storage medium, characterized in that, The storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device containing the storage medium to perform a sharpness calibration method based on a moving head light as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • System and method for determining and controlling focal distance in vision system camera

    CN103576280A

  • Automatic focusing method and device based on detector channel, equipment and storage medium

    CN114040069A