Moving-head-lamp-based definition calibration method and device, terminal equipment and storage medium
Through the method of automatically obtaining and iteratively extracting the focus channel value, the problems of high labor costs and subjective influence in the traditional shaking head lamp calibration method are solved, and the rapid and accurate calibration of the shaking head lamp image is achieved to adapt to the needs of different distances and scenarios. .
Patent Information
- Application Number
- CN202411341345.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-09-25
AI Technical Summary
The traditional movable headlight pattern clarity calibration method relies on human judgment and additional equipment, resulting in high labor costs, low efficiency and susceptible to subjective influence, and is unable to quickly respond to needs in different distances and scenarios.
Using automated image acquisition and clarity evaluation methods, the focus channel value is iteratively extracted, and the reference focus channel value with the highest image clarity is determined, so as to achieve fast and accurate calibration of the moving headlight image.
It realizes fast and accurate calibration of the image clarity of the headlight, reduces labor costs, improves the calibration ability of pattern clarity in different distances and scenarios, and overcomes the problems of subjective judgment and inefficiency of traditional methods.
Smart Images

Figure CN119277203A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of camera focusing, and in particular to a method, a device, a terminal device and a storage medium for calibrating clarity based on a moving head light. Background Art
[0002] In order to ensure that the pattern projected by the moving head light can maintain the best clarity at different distances and enhance the audience's visual experience, it is often necessary to calibrate the pattern clarity of the moving head light. However, the traditional clarity calibration method is generally based on human eye recognition and experience accumulation for focusing, or requires the use of additional equipment to obtain information such as distance and direction, and then measure the clarity of different patterns at different distances and directions, find and record the focus value with the highest clarity, and then perform manual recording and manual focusing. However, the traditional method has many shortcomings, such as requiring a lot of manpower and time, and being easily affected by visual fatigue and subjective judgment, resulting in inaccurate calibration results, and unable to quickly respond to the needs of pattern clarity calibration at different distances and scenes. Summary of the invention
[0003] The embodiments of the present invention provide a method, device, terminal equipment and storage medium for clarity calibration based on a moving head light. Through automated image acquisition, clarity evaluation and focus adjustment, rapid and accurate calibration of the image clarity of a moving head light is achieved, which can effectively solve the problems existing in the prior art such as high labor costs and susceptibility to subjective judgment.
[0004] An embodiment of the present invention provides a method for calibrating clarity based on a moving head light, comprising:
[0005] Get the projection image of the moving head light at the current projection point;
[0006] Extracting a plurality of first focusing channel values from a preset first focusing channel value extraction interval according to a preset interval;
[0007] According to the image clarity of the projected image at each first focus channel value, the first focus channel value corresponding to the highest image clarity is selected as the second focus channel value:
[0008] The second focus channel value is used as the initial reference focus channel value, and the focus channel values in the first focus channel value extraction interval are iteratively extracted, and a new reference focus channel value is determined in each iteration according to the image clarity corresponding to each extracted focus channel value, until the number of extractions reaches a preset number threshold, and the reference focus channel value in each iteration is output;
[0009] Compare the image clarity of each reference focus channel value, and use the reference focus channel value with the highest image clarity as the target focus channel value;
[0010] According to the target focus channel value, the projection image corresponding to the moving head light at the current distance is calibrated.
[0011] Preferably, the second focus channel value is used as the initial reference focus channel value, the focus channel values in the first focus channel value extraction interval are iteratively extracted, and a new reference focus channel value is determined in each iteration according to the image clarity corresponding to each extracted focus channel value, until the number of extractions reaches a preset number threshold, and the reference focus channel value in each iteration is output, including:
[0012] Repeat the following focusing channel value extraction operation until the number of extractions is equal to the preset number threshold, and output the baseline focusing channel value at each iteration:
[0013] Get the current reference focus channel value: wherein the initial reference focus channel value is the second focus channel value;
[0014] The number of first focus channel values currently to be extracted from the first focus channel value interval is calculated according to the preset reduction ratio and the number of focus channel values extracted last time; wherein the number of first focus channel values extracted is initially calculated according to the number of first focus channel values in the first focus channel value interval and the preset reduction ratio;
[0015] Taking the current reference focus channel value as a reference, extracting a number of first focus channel values from the first focus channel value interval according to the extraction number, to generate a second focus channel value interval;
[0016] According to a preset interval, a number of third focus channel values are extracted from the second focus channel value interval, the image clarity corresponding to each third focus channel value is calculated, and the third focus channel value corresponding to the highest image clarity is used as the updated reference focus channel value;
[0017] When it is determined that the extracted number is greater than the preset number threshold, the updated reference focus channel value is used as the current reference focus channel value for the next execution of the focus channel value extraction operation.
[0018] Preferably, taking the current reference focus channel value as a reference and extracting a plurality of first focus channel values from the first focus channel value interval according to the extraction number to generate the second focus channel value interval includes:
[0019] Taking the current reference focusing channel value as the center, the extracted number is evenly divided to obtain a number of left focusing channel values that are smaller than the current reference focusing channel value and a number of right focusing channel values that are larger than the current reference focusing channel value;
[0020] A second focusing channel value interval is generated according to each left focusing channel value, each right focusing channel value and the current reference focusing channel value; wherein the total number of the left focusing channel values is equal to the total number of the right focusing channel values.
[0021] Preferably, the generation of the image clarity under the first focus channel value includes:
[0022] Obtain the projection image corresponding to the moving head light under the first focus channel value;
[0023] Performing a grayscale operation on the projection image to generate a grayscale matrix corresponding to the projection image; wherein the grayscale matrix includes a grayscale value corresponding to each pixel of the projection image;
[0024] Based on the grayscale difference between the first target pixel and the second target pixel in the grayscale matrix, the image clarity corresponding to the first focusing channel value is generated; wherein the number of pixel points between the first target pixel and the second target pixel is a preset number of pixel points.
[0025] Preferably, the step of generating the image definition 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 clarity corresponding to the first focus channel value is calculated according to 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] Among them, F(x) is the image clarity corresponding to the first focus channel value, f(x) i,j It represents the grayscale value at the first target pixel point (i, j) in the grayscale matrix, or represents the grayscale value at the second target pixel point (i, j), s is the preset number of intervals, and the dimension of the grayscale matrix is n*m.
[0029] Preferably, the selecting, according to the image clarity of the projected image at each first focus channel value, the first focus channel value corresponding to the highest image clarity as the second focus channel value comprises:
[0030] According to each first focus channel value and the image definition corresponding to each first focus channel value, generating a fitting function for characterizing the relationship between the first focus channel value and the image definition;
[0031] The focus channel value corresponding to the extreme point of the fitting function is used as the second focus channel value.
[0032] Preferably, generating a fitting function for characterizing the relationship between the first focus channel value and the image clarity according to each first focus channel value and the image clarity corresponding to each first focus channel value includes:
[0033] According to the following formula, a fitting function is generated to characterize the relationship between the first focus channel value and the image clarity:
[0034]
[0035] in, is the fitting function, l k is the interpolation function corresponding to the kth first focus channel value, F(x k ) is the kth image clarity value, x k is the kth first focusing channel value, and c is the number of first focusing channel values.
[0036] Based on the above method embodiments, the present invention provides corresponding device embodiments.
[0037] An embodiment of the present invention provides a clarity 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 projection image of the moving head light at the current projection point position;
[0039] The focusing channel value determination module is used to extract a plurality of first focusing channel values from a preset first focusing channel value extraction interval according to a preset interval;
[0040] According to the image clarity of the projected image at each first focus channel value, the first focus channel value corresponding to the highest image clarity is selected as the second focus channel value:
[0041] The second focus channel value is used as the initial reference focus channel value, and the focus channel values in the first focus channel value extraction interval are iteratively extracted, and a new reference focus channel value is determined in each iteration according to the image clarity corresponding to each extracted focus channel value, until the number of extractions reaches a preset number threshold, and the reference focus channel value in each iteration is output;
[0042] Compare the image clarity of each reference focus channel value, and use the reference focus channel value with the highest image clarity as the target focus channel value;
[0043] The calibration module is used to calibrate the projection image corresponding to the moving head light at the current distance according to the target focus 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, and when the processor executes the computer program, it implements the clarity calibration method based on the moving head light described in the above-mentioned embodiment of the invention.
[0046] Based on the above method embodiments, the present invention provides corresponding storage medium item embodiments.
[0047] Another embodiment of the present invention provides a storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute a clarity calibration method based on a moving head light as described in the above-mentioned embodiment of the invention.
[0048] The following beneficial effects are achieved by implementing the present invention:
[0049] The embodiment of the present invention provides a method, device, terminal device and storage medium for calibrating clarity based on a moving head lamp. The present invention can automatically calibrate images at different projection positions. First, a plurality of first focus channel values can be extracted from a preset first focus channel value extraction interval according to a preset interval, and after a second focus channel value is determined based on the image clarity at each first focus channel value, the second focus channel value is used as an initial reference point for iteration, and then the focus channel values in the first focus channel value extraction interval can be iteratively extracted, and in each iteration, the image clarity corresponding to each extracted focus channel value can be determined. A new benchmark focus channel value is obtained until the number of extractions reaches a preset number threshold, and the benchmark focus channel value for each iteration is output; by comparing the image clarity of each benchmark focus channel value, the benchmark focus channel value with the highest image clarity is used as the target focus channel value, and the focus channel value (i.e., the target focus channel value) corresponding to the best clarity that the moving head light can achieve under the current projection point position and scene can be automatically obtained, so that finally, according to the determined target focus channel value, the projection image of the moving head light under the current projection point position can be calibrated to reach the position corresponding to the target focus channel value, thereby realizing automatic clarity calibration of the image. Compared with the prior art, the present invention can realize fast and accurate calibration of the image clarity of the moving head light through automated image acquisition, clarity evaluation and focus adjustment, and overcomes the problems of high labor cost and susceptibility to subjective judgment in traditional methods, so that not only the calibration result of the image can be made more accurate, but also the pattern clarity calibration requirements under different distances and scenes can be quickly responded to. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 The figure is a flow chart of a method for calibrating clarity based on a moving head light provided in one embodiment of the present invention.
[0051] Figure 2 It is a structural schematic diagram of a clarity calibration device based on a moving head light provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] like Figure 1 FIG. 1 is a flow chart of a method for calibrating clarity based on a moving head light provided by an embodiment of the present invention. The method for calibrating clarity based on a moving head light comprises:
[0054] Step S1: Obtain the projection image of the moving head light at the current projection point position;
[0055] Step S2: extracting a plurality of first focusing channel values from a preset first focusing channel value extraction interval according to a preset interval;
[0056] According to the image clarity of the projected image at each first focus channel value, selecting the first focus channel value corresponding to the highest image clarity as the second focus channel value;
[0057] The second focus channel value is used as the initial reference focus channel value, and the focus channel values in the first focus channel value extraction interval are iteratively extracted, and a new reference focus channel value is determined in each iteration according to the image clarity corresponding to each extracted focus channel value, until the number of extractions reaches a preset number threshold, and the reference focus channel value in each iteration is output;
[0058] Compare the image clarity of each reference focus channel value, and use the reference focus channel value with the highest image clarity as the target focus channel value;
[0059] Step S3: calibrating the projection image corresponding to the moving head light at the current distance according to the target focus channel value.
[0060] For step S1, in a preferred embodiment, the present invention can realize image calibration at different distances, and what is obtained is the key frame or static image in the video stream projected or illuminated by the moving head light and captured by some imaging device (such as a camera) at the current projection point position.
[0061] Illustratively, the image video stream of the pattern can be captured by a camera device, transmitted to a host computer through a serial data interface, displayed on a desktop monitor, and then the image clarity is analyzed.
[0062] In a preferred embodiment, each time an image corresponding to a moving head light is acquired, an image that accurately reflects the clarity performance of the moving head light at the current projection 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 denoising, contrast enhancement, etc.) can be performed, thereby improving the accuracy of subsequent image clarity assessments.
[0063] For step S2, after obtaining the image at the current distance, the present invention can focus the image at the current projection position, firstly by automatically iterating and comparing the focus channel values to obtain the focus channel value with the highest definition.
[0064] In a preferred embodiment, the embodiment of the present invention can evenly extract several first focusing channel values from a preset first focusing channel value extraction interval containing multiple focusing channel values according to a preset interval, and then calculate the clarity of the projection image of the moving head light under each first focusing channel value.
[0065] The generation of the image clarity value at each of the first focus channel values includes:
[0066] Obtain the projection image corresponding to the moving head light under the first focus channel value;
[0067] Performing a grayscale operation on the projection image to generate a grayscale matrix corresponding to the projection image; wherein the grayscale matrix includes a grayscale value corresponding to each pixel of the projection image;
[0068] Based on the grayscale difference between the first target pixel and the second target pixel in the grayscale matrix, the image clarity corresponding to the first focusing channel value is generated; wherein the number of pixel points between the first target pixel and the second target pixel is a preset number of pixel points.
[0069] Indicatively, the image clarity corresponding to the first focus channel value can be calculated according to 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] Among them, F(x) is the image clarity corresponding to the first focus channel value, f(x) i,jIt represents the grayscale value at the first target pixel point (i, j) in the grayscale matrix, or represents the grayscale value at the second target pixel point (i, j), s is the preset number of intervals, and the dimension of the grayscale matrix is n*m.
[0072] Specifically, in the embodiment of the present invention, the first focus value x can be changed to obtain a pattern of corresponding clarity, and then the host computer software is used to extract the image video stream by frame extraction, convert it into a picture, and perform grayscale, noise reduction and other operations to obtain the grayscale matrix G n×m , then extract the grayscale value f(x)i,j of the pixel point of the grayscale image, calculate the square value of the grayscale difference between two pixels, and add them up to get F(x), which can be used to evaluate the clarity of the image.
[0073] Then we have:
[0074]
[0075] The calculation formula F(x) for image clarity analysis is:
[0076] F(x)=∑ i=1,2...n-2,j=1,2...m (f(x) (i+s),j -f(x) i,j ) 2 .
[0077] It can be understood that the present invention can detect the edge of the image based on the grayscale change between two pixels. Compared with the traditional clarity evaluation algorithm, which is insensitive to the strong response to isolated noise points in the picture, the present invention obtains the image clarity value of the first focus channel value based on the grayscale difference between the first target pixel and the second target pixel in the grayscale matrix, which can reduce the influence of dust spots in the air to a certain extent. In experimental tests, paying attention to the grayscale change between two pixels can better feedback the clarity of the pattern.
[0078] Furthermore, the present invention can use the first focus channel value with the highest image clarity value as the second focus channel value based on each image clarity value, specifically:
[0079] According to each first focus channel value and the image definition corresponding to each first focus channel value, generating a fitting function for characterizing the relationship between the first focus channel value and the image definition;
[0080] The focus channel value corresponding to the extreme point of the fitting function is used as the second focus channel value.
[0081] Specifically, a fitting function for characterizing the relationship between the first focus channel value and the image clarity may be generated according to the following formula:
[0082]
[0083] in, is the fitting function, l k is the interpolation function corresponding to the kth first focus channel value, F(x k ) is the kth image clarity value, x k is the kth first focusing channel value, and c is the number of first focusing channel values.
[0084] Among them, the interpolation function l corresponding to the kth first focus channel value k Can be:
[0085]
[0086] After obtaining a plurality of different first focus channel values and their corresponding image clarity values, a curve may be fitted based on the respective data, thereby obtaining the second focus channel value corresponding to the maximum image clarity value.
[0087] Furthermore, the second focus channel value can be taken as the midpoint, and multiple different focus channel values can be evenly extracted in half of the range obtained last time, and the cycle can be repeated until the number of extractions in the final focus channel value extraction interval reaches a preset number threshold, and the focus channel value corresponding to the highest clarity evaluation value is output.
[0088] In a preferred embodiment, the second focus channel value is used as the initial reference focus channel value, and the focus channel values in the first focus channel value extraction interval are iteratively extracted. In each iteration, a new reference focus channel value is determined according to the image clarity corresponding to each extracted focus channel value, until the number of extractions reaches a preset number threshold, and the reference focus channel value in each iteration is output. The specific process includes:
[0089] Repeat the following focusing channel value extraction operation until the number of extractions is equal to the preset number threshold, and output the baseline focusing channel value at each iteration:
[0090] Get the current reference focus channel value: wherein the initial reference focus channel value is the second focus channel value;
[0091] The number of first focus channel values currently to be extracted from the first focus channel value interval is calculated according to the preset reduction ratio and the number of focus channel values extracted last time; wherein the number of first focus channel values extracted is initially calculated according to the number of first focus channel values in the first focus channel value interval and the preset reduction ratio;
[0092] Taking the current reference focus channel value as a reference, extracting a number of first focus channel values from the first focus channel value interval according to the extraction number, to generate a second focus channel value interval;
[0093] According to a preset interval, a number of third focus channel values are extracted from the second focus channel value interval, the image clarity corresponding to each third focus channel value is calculated, and the third focus channel value corresponding to the highest image clarity is used as the updated reference focus channel value;
[0094] When it is determined that the extracted number is greater than the preset number threshold, the updated reference focus channel value is used as the current reference focus channel value for the next execution of the focus channel value extraction operation.
[0095] Then, based on each reference focus channel value and the image clarity value of the image at each reference focus channel value, the reference focus channel value with the highest image clarity value may be used as the target focus channel value.
[0096] Illustratively, at each iteration, the number of first focus channel values that need to be extracted from the first focus channel value interval is calculated based on a preset reduction ratio and the number of focus channel values extracted last time, and then, based on the current benchmark focus channel value, a number of first focus channel values are extracted from the first focus channel value interval according to the number of extractions to generate a second focus channel value interval; it can be understood that as the number of extractions continues to shrink, the corresponding second focus channel value interval also shrinks accordingly.
[0097] The image clarity value of each third focus channel value is calculated, and the focus channel value with the highest clarity value can be found and used as the reference focus channel value for the next iteration;
[0098] It is understandable that if the number of focus channel values in the newly determined second focus channel value extraction interval is still greater than the preset number threshold (the preset number threshold may be 0), the interval range is further narrowed with the reference focus channel value as the center, and the above process is repeated.
[0099] Through the above steps, the present invention can automatically and efficiently find the optimal focus setting of the moving head light at different distances and scenes by iteratively narrowing the search range, thereby achieving clear calibration of the image.
[0100] The present invention can find a focus setting that is closer to the optimal solution by finely iteratively narrowing the search range and based on quantitative evaluation of image clarity values, thereby improving the accuracy of calibration and ensuring that the moving head light can project clear, high-quality images at different distances and scenes.
[0101] Since the method of the present invention is based on the evaluation of the image clarity value, it has strong adaptability. No matter facing different distances, scenes or light conditions, the present invention can adapt to the changes by automatically acquiring the focus channel value to achieve clear calibration of the image.
[0102] It can be understood that, in the process of repeatedly executing the focus channel value determination operation, multiple third focus channel values can be continuously extracted from the determined second focus channel value extraction interval, and a reference focus channel value can be determined from each third focus channel value through the corresponding image clarity values. The implementation principle is consistent with the principle of determining a second focus channel value from each first focus channel value as mentioned above, and both use the calculation function formula of the image clarity value and the fitting function generation method to determine the focus channel value corresponding to the extreme point.
[0103] In a preferred embodiment, the method 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 the number of extractions to generate the second focusing channel value interval includes:
[0104] Taking the current reference focusing channel value as the center, the extracted number is evenly divided to obtain a number of left focusing channel values that are smaller than the current reference focusing channel value and a number of right focusing channel values that are larger than the current reference focusing channel value;
[0105] A second focusing channel value interval is generated according to each left focusing channel value, each right focusing channel value and the current reference focusing channel value; wherein the total number of the left focusing channel values is equal to the total number of the right focusing channel values.
[0106] Schematically, the first focus channel value extraction interval is arranged as [0~255][0~255][0~255]…; then the total number of left focus channel values can be equal to the total number of right focus channel values, that is, with the current benchmark focus channel value as the center, the extracted number can be evenly divided, and then the total number of left focus channel values of the second focus channel value interval is equal to the total number of right focus channel values.
[0107] In a preferred embodiment, the number of focus channel values extracted is 5. In the last round of iteration, the best focus channel value (reference focus channel value) of 30 was found.
[0108] Then we have:
[0109] Calculate the number of focus channel values: According to the preset reduction ratio and the number of focus channel values extracted last time, calculate that the number of first focus channel values that need to be extracted from the first focus channel value interval is 5 focus channel values.
[0110] Determine the center value: The center value is the best focus channel value 30 found in the previous iteration.
[0111] Evenly divide the focus channel values: With 30 as the center, there are 2 focus channel values on the left and right sides. Select the integers on both sides of 30 as the focus channel values, and keep their differences with 30 equal.
[0112] Therefore, the two focus channel values on the left can be selected as 28 and 29, and the two focus channel values on the right can be selected as 31 and 32. Then the new target focus channel value extraction interval is [28, 29, 30, 31, 32].
[0113] In a preferred embodiment, when the arrangement of the first focus channel value extraction interval is only [0-255], the reference focus channel value will appear at the edge of the interval, and the following second focus channel value interval determination process is performed:
[0114] Taking the reference focusing channel value as the center, the extracted number is evenly divided to obtain a number of left focusing channel values that are smaller than the current reference focusing channel value and a number of right focusing channel values that are larger than the current reference focusing channel value;
[0115] When it is determined that the total number of the left focus channel values is equal to the total number of the right focus channel values, each left focus channel value, each right focus channel value and the reference focus channel value are used as focus channel values in a second focus channel value interval;
[0116] When it is determined that the total number of the left focus channel values is less than the total number of the right focus channel values, each left focus channel value, a plurality of first focus channel values to be selected, and the reference focus channel value are used as focus channel values in the second focus channel value interval; wherein the first focus channel value to be selected is the right focus channel value, and the total number of the first focus channel values to be selected is equal to the total number of the left focus channel values;
[0117] When it is determined that the total number of the left focus channel values is greater than the total number of the right focus channel values, each right focus channel value, a plurality of second focus channel values to be selected, and the reference focus channel value are used as focus channel values in the second focus channel value interval; wherein the second focus channel value to be selected is a left focus channel value, and the total number of the second focus channel values to be selected is equal to the total number of the right focus channel values;
[0118] The center value of the second focus channel value interval is the reference focus channel value; and the difference between any two adjacent focus channel values in the second focus channel value interval is equal.
[0119] It can be understood that the above process describes how to determine a new, smaller target focus channel value extraction interval according to the current focus channel value extraction interval and the preset ratio value at each iteration. This process is achieved by allocating the focus channel values on the left and right sides with the best focus channel value (i.e., the reference focus channel value) found in the current iteration as the center.
[0120] Specifically, if the number of first focus channel values to be extracted from the first focus channel value interval is calculated to be 6 focus channel values according to the preset reduction ratio and the number of focus channel values extracted last time, and the best focus channel value (i.e., the reference focus channel value, assuming it is 30) found in the current iteration is still taken as the center, then the process of determining the new second focus channel value extraction interval will be as follows:
[0121] Determine the center value: The center value is still the best focus channel value 30 found in the previous iteration;
[0122] Calculate the number of focus channel values on the left and right sides: Since the newly extracted interval should contain 6 focus channel values and the center value occupies one position, theoretically 2.5 focus channel values should be allocated to each side. However, the focus channel value cannot be a decimal. When dividing the focus channel value equally, one more or one less focus channel value can be added to the left of the optimal focus channel value 30 to keep the total number 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 left focus channel values is less than the total number of right focus channel values. Assuming that the step size of the focus channel value is 1, 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 focus channel values that can be selected on the left side are 28 and 29 (because they are the two integers smaller than and closest to 30). Since the difference between any two adjacent focus channel values in the final second focus channel value extraction interval is equal, when selecting the right focus channel value, it should start from 30 and gradually select backwards, so the right focus channel values 31 and 32 can be selected as the right focus channel values to be selected;
[0126] Thus, the final target focus channel value extraction interval is determined to be: [28, 29, 30, 31, 32].
[0127] It can be understood that the selection method of the present invention, when the best focus channel value of the center value is 2, can determine that 1 focus channel value on the right should be selected (such as selecting 3) based on the focus channel value 1 on the left, thereby realizing the generation of a target focus channel value extraction interval centered on the best focus channel value 2 (which should be [1,2,3] at this time).
[0128] If the optimal focus channel value corresponding to the center value is not at the edge of the interval, the embodiment of the present invention can preferentially divide the number of samples on the left and right sides equally according to the result of the current focus channel value extraction interval and the preset ratio value, so as to achieve an equal number of focus channel values extracted on the left and right sides.
[0129] Therefore, the present invention can obtain the selection interval for the next iteration based on the best focus channel value (i.e., the reference focus channel value) at each iteration. Then, by iterating based on the best focus channel value, the search range can be quickly narrowed, and unnecessary focus channel value tests can be reduced, thereby improving the focusing efficiency. Blind search in the entire focus range is avoided, and fine adjustment is performed in a targeted manner near the best value.
[0130] Since each iteration is performed around the best focus channel value (reference focus channel value), it can more accurately approach the optimal solution, that is, by gradually narrowing the search range, the focus error can be gradually reduced and the focus accuracy can be improved. Even in the presence of noise or interference, since the search range is always around the best value, the impact of external factors on the focus result can be reduced.
[0131] Moreover, the present invention can flexibly adjust the size of the search interval according to a preset reduction ratio (based on different numbers of extractions), thereby being able to adapt to different focusing requirements and scenarios and implement a more personalized focusing strategy.
[0132] In each iteration, only the focus channel value within the newly extracted interval needs to be calculated, without traversing the entire focus range, which reduces the amount of calculation and improves the execution efficiency of the algorithm.
[0133] In a preferred embodiment, the preset first focus channel value extraction interval includes 255 focus channel values, and then c values can be evenly selected to calculate each value x. i The corresponding clarity evaluation value F(xi) can be obtained by obtaining a series of data points (x1, F(x1)), (x2, F(x2)), (x3, F(x3))…(x1, F(x1)), and a fitting curve can be obtained to obtain the fitting function calculate The maximum point is selected, and then multiple values are evenly selected with the maximum point as the center to repeat the above steps until the selected maximum point can meet the requirements of the image clarity of the moving head light and obtain the best focus channel value.
[0134] For step S3, in a preferred embodiment, the present invention can calibrate the projection image of the moving head light at the current projection point position according to the target focusing channel value obtained in the previous steps. Since the clarity corresponding to the target focusing channel value is the highest, the determination of the optimal focusing channel value at the current projection point position and the image clarity calibration of the moving head light can be completed.
[0135] The present invention automatically determines the optimal focusing channel value and performs calibration, thereby enhancing the performance stability of the moving head light under different projection positions and lighting conditions. This not only makes the image calibration result more accurate, but also can quickly respond to pattern clarity calibration requirements under different distances and scenes.
[0136] like Figure 2 As shown, based on the above-mentioned various embodiments of the clarity calibration method based on the moving head light, the present invention provides a corresponding device embodiment;
[0137] An embodiment of the present invention provides a clarity 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 projection image of the moving head light at the current projection point position;
[0139] The focusing channel value determination module is used to extract a plurality of first focusing channel values from a preset first focusing channel value extraction interval according to a preset interval;
[0140] According to the image clarity of the projected image at each first focus channel value, the first focus channel value corresponding to the highest image clarity is selected as the second focus channel value:
[0141] The second focus channel value is used as the initial reference focus channel value, and the focus channel values in the first focus channel value extraction interval are iteratively extracted, and a new reference focus channel value is determined in each iteration according to the image clarity corresponding to each extracted focus channel value, until the number of extractions reaches a preset number threshold, and the reference focus channel value in each iteration is output;
[0142] Compare the image clarity of each reference focus channel value, and use the reference focus channel value with the highest image clarity as the target focus channel value;
[0143] The calibration module is used to calibrate the projection image corresponding to the moving head light at the current distance according to the target focus channel value.
[0144] It should be noted that the device embodiments described above are merely schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, and may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art can understand and implement it without paying creative labor.
[0145] Those skilled in the art can clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0146] Based on the above-mentioned various embodiments of the clarity calibration method based on the moving head light, the present invention provides corresponding embodiments of the terminal device item.
[0147] An 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, wherein when the processor executes the computer program, a clarity calibration method based on a moving head light as described in any method embodiment of the present invention is implemented.
[0148] The terminal device may be a computing terminal device such as a desktop computer, a notebook, a palm computer, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0149] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device.
[0150] The memory can be used to store the computer program, and the processor realizes various functions of the terminal device by running or executing the computer program stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device or other volatile solid-state storage device.
[0151] Based on the above-mentioned various embodiments of the clarity calibration method based on the moving head light, the present invention provides a corresponding storage medium item embodiment.
[0152] An embodiment of the present invention provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute a clarity calibration method based on a moving head light as described in any method 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 the computer program is executed by the processor, the steps of each method embodiment described above can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0154] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for calibrating clarity based on a moving head light, characterized in that: include: Get the projection image of the moving head light at the current projection point; Extracting a plurality of first focusing channel values from a preset first focusing channel value extraction interval according to a preset interval; According to the image clarity of the projected image at each first focus channel value, the first focus channel value corresponding to the highest image clarity is selected as the second focus channel value: The second focus channel value is used as the initial reference focus channel value, and the focus channel values in the first focus channel value extraction interval are iteratively extracted, and a new reference focus channel value is determined in each iteration according to the image clarity corresponding to each extracted focus channel value, until the number of extractions reaches a preset number threshold, and the reference focus channel value in each iteration is output; Compare the image clarity of each reference focus channel value, and use the reference focus channel value with the highest image clarity as the target focus channel value; According to the target focus channel value, the projection image corresponding to the moving head light at the current distance is calibrated.
2. A method for calibrating clarity based on a moving head light as claimed in claim 1, characterized in that: The second focus channel value is used as the initial reference focus channel value, and the focus channel values in the first focus channel value extraction interval are iteratively extracted, and a new reference focus channel value is determined according to the image clarity corresponding to each extracted focus channel value in each iteration, until the number of extractions reaches a preset number threshold, and the reference focus channel value in each iteration is output, including: Repeat the following focusing channel value extraction operation until the number of extractions is equal to the preset number threshold, and output the baseline focusing channel value at each iteration: Get the current reference focus channel value: wherein the initial reference focus channel value is the second focus channel value; The number of first focus channel values currently to be extracted from the first focus channel value interval is calculated according to the preset reduction ratio and the number of focus channel values extracted last time; wherein the number of first focus channel values extracted is initially calculated according to the number of first focus channel values in the first focus channel value interval and the preset reduction ratio; Taking the current reference focus channel value as a reference, extracting a number of first focus channel values from the first focus channel value interval according to the extraction number, to generate a second focus channel value interval; According to a preset interval, a number of third focus channel values are extracted from the second focus channel value interval, the image clarity corresponding to each third focus channel value is calculated, and the third focus channel value corresponding to the highest image clarity is used as the updated reference focus channel value; When it is determined that the extracted number is greater than the preset number threshold, the updated reference focus channel value is used as the current reference focus channel value for the next execution of the focus channel value extraction operation.
3. A method for calibrating clarity based on a moving head light as claimed in claim 2, characterized in that: The method of taking the current reference focus channel value as a reference and extracting a plurality of first focus channel values from the first focus channel value interval according to the extraction number to generate a second focus channel value interval includes: Taking the current reference focusing channel value as the center, the extracted number is evenly divided to obtain a number of left focusing channel values that are smaller than the current reference focusing channel value and a number of right focusing channel values that are larger than the current reference focusing channel value; A second focusing channel value interval is generated according to each left focusing channel value, each right focusing channel value and the current reference focusing channel value; wherein the total number of the left focusing channel values is equal to the total number of the right focusing channel values.
4. A method for calibrating clarity based on a moving head light as claimed in claim 3, characterized in that: The generation of the image clarity under the first focus channel value includes: Obtain the projection image corresponding to the moving head light under the first focus channel value; Performing a grayscale operation on the projection image to generate a grayscale matrix corresponding to the projection image; wherein the grayscale matrix includes a grayscale value corresponding to each pixel of the projection image; Based on the grayscale difference between the first target pixel and the second target pixel in the grayscale matrix, the image clarity corresponding to the first focusing channel value is generated; wherein the number of pixel points between the first target pixel and the second target pixel is a preset number of pixel points.
5. A method for calibrating clarity based on a moving head light as claimed in claim 4, characterized in that: The step of generating the image definition 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 clarity corresponding to the first focus channel value is calculated according to the following formula: F(x)=∑ i=1,2…n-2,j=1,2…m (f(x) (i+s),j -f(x) i,j ) 2 ; Among them, F(x) is the image clarity corresponding to the first focus channel value, f(x) i,j It represents the grayscale value at the first target pixel point (i, j) in the grayscale matrix, or represents the grayscale value at the second target pixel point (i, j), s is the preset number of intervals, and the dimension of the grayscale matrix is n*m.
6. A method for calibrating clarity based on a moving head light as claimed in claim 5, characterized in that: The selecting, according to the image clarity of the projection image at each first focus channel value, the first focus channel value corresponding to the highest image clarity as the second focus channel value comprises: According to each first focus channel value and the image definition corresponding to each first focus channel value, generating a fitting function for characterizing the relationship between the first focus channel value and the image definition; The focus channel value corresponding to the extreme point of the fitting function is used as the second focus channel value.
7. The method for calibrating clarity based on a moving head light according to claim 5, characterized in that: The generating, according to each first focus channel value and the image definition corresponding to each first focus channel value, a fitting function for characterizing the relationship between the first focus channel value and the image definition includes: According to the following formula, a fitting function is generated to characterize the relationship between the first focus channel value and the image clarity: in, is the fitting function, l k is the interpolation function corresponding to the kth first focus channel value, F(x k ) is the kth image clarity value, x k is the kth first focusing channel value, and c is the number of first focusing channel values.
8. A clarity calibration device based on a moving head light, characterized in that: include: Image acquisition module, focusing channel value determination module and calibration module; The image acquisition module is used to acquire the projection image of the moving head light at the current projection point position; The focusing channel value determination module is used to extract a plurality of first focusing channel values from a preset first focusing channel value extraction interval according to a preset interval; According to the image clarity of the projected image at each first focus channel value, the first focus channel value corresponding to the highest image clarity is selected as the second focus channel value: The second focus channel value is used as the initial reference focus channel value, and the focus channel values in the first focus channel value extraction interval are iteratively extracted, and a new reference focus channel value is determined in each iteration according to the image clarity corresponding to each extracted focus channel value, until the number of extractions reaches a preset number threshold, and the reference focus channel value in each iteration is output; Compare the image clarity of each reference focus channel value, and use the reference focus channel value with the highest image clarity as the target focus channel value; The calibration module is used to calibrate the projection image corresponding to the moving head light at the current distance according to the target focus channel value.
9. A terminal device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, a clarity calibration method based on a moving head light as claimed in any one of claims 1 to 7 is implemented.
10. A storage medium, characterized in that: The storage medium includes a stored computer program, wherein when the computer program is executed, the device where the storage medium is located is controlled to execute a clarity calibration method based on a moving head light as claimed 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
Light modulator zoom balancing method and device and storage medium
CN116916508A