Intelligent Focusing Method Of Intelligent Moving Head Light Based On Machine Vision
20210172589 · 2021-06-10
Assignee
Inventors
Cpc classification
H04N23/673
ELECTRICITY
G02B7/36
PHYSICS
G03B21/53
PHYSICS
F21Y2115/10
MECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
International classification
Abstract
An intelligent focusing method of an intelligent moving head light based on machine vision includes the following steps: prestoring coordinate positions Z.sub.21 and Z.sub.22 of the focusing assembly corresponding to stage light projection distances S.sub.max and S.sub.min respectively, moving the focusing assembly to a position between Z.sub.21 and Z.sub.22 after the controller receives a command to start an automatic focusing function; gradually moving the focusing assembly between Z.sub.21 and Z.sub.22 by a focusing search strategy, calculating a sharpness evaluation value T.sub.n of a current projected image according to an image sharpness evaluation function, and determining whether T.sub.n is greater than a preset high sharpness threshold T.sub.H if yes, completing the focusing, otherwise determining whether T.sub.n is less than or equal to T.sub.n-1, if yes, driving the stepper motor by the driver to operate in an opposite direction, otherwise driving the stepper motor by the driver to operate in an original direction, until T.sub.n is greater than T.sub.H.
Claims
1. An intelligent focusing method of an intelligent moving head light based on machine vision, wherein the intelligent moving head light comprises a controller, a camera, a driver, a stepper motor and an optical lens assembly that includes a focusing assembly and a zooming assembly; the intelligent focusing method comprising the following steps: S1, prestoring coordinate positions Z.sub.21 and Z.sub.22 of the focusing assembly corresponding to stage light projection distances S.sub.max and S.sub.min respectively, and moving the zooming assembly to a position between Z.sub.21 and Z.sub.22 after the controller receives a command to start an automatic focusing function; S2, gradually moving the focusing assembly between Z.sub.21 and Z.sub.22 by a focusing search strategy, calculating a sharpness evaluation value T.sub.n of a current projected image according to an image sharpness evaluation function, and determining whether T.sub.n is greater than a preset high sharpness threshold T.sub.H, if yes, the focusing step is completed, otherwise executing step S3; and S3, determining whether T.sub.n is less than or equal to T.sub.n-1, if yes, driving the stepper motor by the driver to operate in an opposite direction, otherwise driving the stepper motor by the driver to operate in an original direction, and then repeatedly executing step S2 until the sharpness evaluation value T.sub.n is greater than the preset high sharpness threshold T.sub.H to complete the focusing step.
2. The intelligent focusing method of the intelligent moving head light based on machine vision according to claim 1, wherein the step S1 further includes: S11, obtaining a coordinate position Z.sub.1 of the zooming assembly in the intelligent moving head light when the controller receives the command to start the automatic focusing function, calculating a coordinate position Z.sub.2 of the focusing assembly correspondingly, and driving the stepper motor by the driver to position the focusing assembly to the coordinate position Z.sub.2; and S12, the controller acquiring current projected image data and calculating the sharpness evaluation value T.sub.n of the current projected image according to the image sharpness evaluation function.
3. The intelligent focusing method of the intelligent moving head light based on machine vision according to claim 1, further comprising: S4, when the intelligent moving head light works normally, the controller monitoring a coordinate position Z.sub.1 of the zooming assembly, and when the position of the zooming assembly changes, repeatedly executing the steps S1 to S3 until the focusing step is completed.
4. The intelligent focusing method of the intelligent moving head light based on machine vision according to claim 1, further comprising: S5, when the intelligent moving head light works normally, the controller monitoring a coordinate position Z.sub.1 of the zooming assembly, and when the zooming assembly position does not change, determining whether the sharpness evaluation value T.sub.n of the current projected image is greater than or equal to a preset low sharpness threshold T.sub.L, if yes, the focusing step is completed, otherwise repeatedly executing step S2 until the focusing step is completed.
5. The intelligent focusing method of the intelligent moving head light based on machine vision according to claim 2, wherein the step S11 specifically comprises: acquiring the coordinate position Z.sub.x of the zooming assembly in the intelligent moving head light, and calculating the coordinate position Z.sub.2 of the focusing assembly through a cam curve of a two-component zoom optical system.
6. The intelligent focusing method of the intelligent moving head light based on machine vision according to claim 1, wherein the focusing search strategy is a hill-climbing search method.
7. The intelligent focusing method of the intelligent moving head light based on machine vision according to claim 1, wherein the image sharpness evaluation function adopts a spectral function, and spectral values of an image is calculated by a Fourier transform function, that is,
Y.sub.(n,m)=X.sub.(n,m).Math.exp(−j2π.Math.n/N).Math.exp(−j2π.Math.m/M) where n=0, 1, . . . , N−1, m=0, 1, . . . , M−1, N represents rows of a sampled two-dimensional discrete image area N×M, M represents columns of the sampled two-dimensional discrete image area N×M, X.sub.(n,m) represents pixel points, and Y.sub.(n,m) represents frequency points.
8. The intelligent focusing method of the intelligent moving head light based on machine vision according to claim 7, wherein the calculation of the sharpness evaluation value T.sub.n of the current projected image according to the spectral values of the image specifically includes:
9. The intelligent focusing method of the intelligent moving head light based on machine vision according to claim 1, wherein a distance between Z.sub.21 and Z.sub.22 occupies 15% of a maximum route of the focusing assembly.
10. The intelligent focusing method of the intelligent moving head light based on machine vision according to claim 1, wherein a maximum value of S.sub.max is less than or equal to 50 m, and a minimum value of S.sub.min is greater than or equal to 3 m.
11. The intelligent focusing method of the intelligent moving head light based on machine vision according to claim 1, wherein a distance in which the focusing assembly moves gradually is from 0.2% to 0.6% of the maximum route of the focusing assembly.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0038]
[0039]
[0040]
EMBODIMENTS
[0041] The drawings of the present invention are for illustration purpose only and are not intended to limit the present invention. Some components in the drawings may be omitted, enlarged, or reduced for better illustrating the following embodiments, and sizes of these components do not represent that of actual products. For those skilled in the art, it will be understood that some known structures and descriptions thereof in the drawings may be omitted.
[0042] As shown in
[0043] S1, prestoring coordinate positions Z.sub.21 and Z.sub.22 of the focusing assembly corresponding to stage light projection distances S.sub.max and S.sub.min respectively, and moving the zooming assembly to a position between Z.sub.21 and Z.sub.22 after the controller receives a command to start an automatic focusing function;
[0044] S11, obtaining a coordinate position Z.sub.x of the zooming assembly in the intelligent moving head light when the controller receives the command to start the automatic focusing function, calculating a coordinate position Z.sub.2 of the focusing assembly correspondingly, and driving the stepper motor by the driver to position the focusing assembly to the coordinate position Z.sub.2; and
[0045] S12, the controller acquiring current projected image data and calculating the sharpness evaluation value T.sub.n of the current projected image according to an image sharpness evaluation function;
[0046] S2, gradually moving the focusing assembly between Z.sub.21 and Z.sub.22 by a focusing search strategy, calculating a sharpness evaluation value T.sub.n of a current projected image according to an image sharpness evaluation function, and determining whether T.sub.n is greater than a preset high sharpness threshold T.sub.H, if yes, the focusing step is completed, otherwise executing step S3;
[0047] S3, determining whether T.sub.n is less than or equal to T.sub.n-1, if yes, driving the stepper motor by the driver to operate in an opposite direction, otherwise driving the stepper motor by the driver to operate in an original direction, and then repeatedly executing step S2 until the sharpness evaluation value T.sub.n is greater than the preset high sharpness threshold T.sub.H to complete the focusing step;
[0048] S4, when the intelligent moving head light works normally, the controller monitoring the coordinate position Z.sub.1 of the zooming assembly, and when the position of the zooming assembly changes, repeatedly executing the steps S1 to S3 until the focusing step is completed; and
[0049] S5, when the intelligent moving head light works normally, the controller monitoring the coordinate position Z.sub.x of the zooming assembly, and determining whether the sharpness evaluation value T.sub.n of the current projected image is greater than or equal to a preset low sharpness threshold T.sub.L when the zooming assembly position does not change, if yes, the focusing step if completed, otherwise repeatedly executing step S2 until the focusing step is completed.
[0050] Preferably, the step S11 in the present embodiment specifically includes: acquiring the coordinate position Z.sub.1 of the zooming assembly in the intelligent moving head light, and calculating and obtaining the coordinate position Z.sub.2 of the focusing assembly through a cam curve of a two-component zoom optical system.
[0051] Preferably, the focusing search strategy described in the present embodiment is a hill-climbing search method.
[0052] Preferably, the image sharpness evaluation function in the embodiment adopts a spectral function, and spectral values of an image adopts a Fourier transform function for calculation, that is,
Y.sub.(n,m)=X.sub.(n,m).Math.exp(−j2π.Math.n/N).Math.exp(−j2π.Math.m/M)
where n=0, 1, . . . , N−1, m=0, 1, . . . , M−1, N represents rows of a sampled two-dimensional discrete image area N×M, M represents columns of the sampled two-dimensional discrete image area N×M, X.sub.(n,m) represents pixel points, and Y.sub.(n,m) represents frequency points.
[0053] Preferably, the calculation of the sharpness evaluation value T.sub.n of the current projected image in the embodiment according to the spectral values of the image specifically includes:
[0054] where E{Y(n,m)} represents an average value of the frequency points, σ represents a standard deviation value, namely the sharpness evaluation value T.sub.n of the current projected image.
[0055] Preferably, a distance between Z.sub.21 and Z.sub.22 in this embodiment occupies 15% of a maximum route of the focusing assembly.
[0056] Preferably, in this embodiment, a maximum value of S.sub.max is less than or equal to 50 m, and a minimum value of S.sub.min is greater than or equal to 3 m.
[0057] Preferably, a distance in which the focusing assembly moves gradually in this embodiment is from 0.2% to 0.6% of the maximum route of the focusing assembly.
[0058] In order to verify the application effect of the intelligent focusing method of the intelligent moving head light based on machine vision, the following three groups of experiments were carried out on the performance thereof.
[0059] Preferably, the experiments used a CMOS camera model MER-500-7UM/UC-L, which has a maximum operating resolution of 2592×1944, about 500,000 pixels, a minimum frame rate of 7 fps, and a pixel size of 2.2 um×2.2 um. A maximum route of the zooming assembly of the selected intelligent moving head light is about 130 mm, a maximum route of the focusing assembly is about 5 mm, and a resolution of the route is 8 bits, totaling 256 equal parts. An image acquisition resolution of the camera was set to 640*480 to increase an acquisition frame rate to 60 fps; the camera was set to an auto-exposure mode to prevent over-exposure of the acquired image.
[0060] Experiment 1 aimed to verify the image sharpness of automatic focusing. In actual situations, the position of the zooming assembly was fixed for different projection distances, and the same intelligent moving head light was used to carry out automatic focusing test experiments for several times. Experiment 1 selected a projection distance of 4 to 35 meters for testing since such projection range had met most stage application requirements. The results of Experiment 1 are shown in Table 1.
TABLE-US-00001 TABLE 1 Average values of multiple tests at different focusing positions with different projection distances when fixing zooming assembly position Auto- Actual focusing Focusing focusing focusing Focusing Projection evaluation plane plane plane distance/ function position/ position/ deviation/ m value mm mm mm 4.0 1.34270 4.078 4.066 −0.012 5.0 1.32839 3.922 3.940 0.018 6.0 1.34218 3.843 3.858 0.015 7.0 1.33548 3.765 3.749 −0.016 8.0 1.34631 3.686 3.695 0.009 9.0 1.33725 3.529 3.535 0.006 10.0 1.35344 3.373 3.363 −0.010 11.0 1.32987 3.294 3.286 −0.008 12.0 1.33469 3.216 3.235 0.019 13.0 1.28865 3.137 3.149 0.012 14.0 1.32680 3.059 3.052 −0.007 15.0 1.34319 2.980 2.970 −0.010 20.0 1.31864 2.824 2.837 0.013 25.0 1.32383 2.745 2.724 −0.020 30.0 1.30515 2.667 2.687 0.023 35.0 1.31187 2.588 2.571 −0.017
[0061] From the experimental data in Table 1, it can be seen that: a maximum deviation between the auto-focusing focusing plane position and the actual focusing plane position was ±0.023 mm, which indicates that the intelligent moving head light based on machine vision in the present invention can meet the requirements of focusing precision and image sharpness.
[0062] Experiment 2 aimed to obtain the cam curve of the two-component zoom optical system by calculating a focusing assembly coordinate position Z.sub.2 corresponding to a zooming assembly coordinate position Z.sub.1, and limit a search range ΔZ.sub.2. From average values of multiple test data, the cam curve as shown in
TABLE-US-00002 TABLE 2 Coordinate positions of zooming assembly and focusing assembly and limited search range 4-meter 35-meter distance distance Zooming focusing focusing assembly assembly assembly Limited coordinate coordinate coordinate search position position position range ΔZ.sub.2/ Z.sub.1/mm Z.sub.2_4/mm Z.sub.2_35/mm mm 0.0 0.000 0.000 0.000 5.0 1.307 0.844 0.462 10.0 2.347 1.724 0.622 15.0 3.147 2.498 0.649 20.0 3.733 3.129 0.604 25.0 4.062 3.556 0.507 30.0 4.213 3.778 0.436 35.0 4.267 3.831 0.436 40.0 4.222 3.813 0.409 45.0 4.089 3.760 0.329 50.0 3.884 3.600 0.284 55.0 3.636 3.360 0.276 60.0 3.360 3.093 0.267 65.0 3.067 2.800 0.267 70.0 2.756 2.507 0.249 75.0 2.462 2.204 0.258 80.0 2.169 1.911 0.258 85.0 1.867 1.627 0.240 90.0 1.582 1.333 0.249 95.0 1.289 1.049 0.240 100.0 0.987 0.756 0.231 105.0 0.711 0.498 0.213 110.0 0.444 0.258 0.187 115.0 0.222 0.062 0.160
[0063] From the experimental data in
[0064] Experiment 3 aimed to compare the automatic focusing time with and without a cam curve algorithm for several times by using the same intelligent moving head light as to different projection distances in a case where the zooming assembly coordinate position was fixed. The experimental data is shown in Table 3.
TABLE-US-00003 TABLE 3 Average values of multiple tests of automatic focusing time for programs with and without cam curve algorithm Automatic Automatic Time- Projection focusing time focusing time consuming distance/m without cam curve/s with cam curve/s ratio/% 4.0 4.1 0.7 17 10.0 3.9 0.5 13 15.0 4.0 0.6 15 20.0 4.2 0.9 21 25.0 4.5 1.0 22 30.0 4.3 0.9 21 35.0 4.4 0.8 18
[0065] From the experimental data in Table 3, it can be seen that: automatic focusing time-consuming ratio with and without cam curve algorithm=(automatic focusing time with cam curve/automatic focusing time without cam curve)×100%. Therefore, in a projection range of 4 to 35 meters, the time-consuming ratio is about 13 to 22%, that is, the program with the cam curve algorithm takes less time to complete the automatic focusing and has higher focusing efficiency.
[0066] According to the intelligent focusing method of the intelligent moving head light based on machine vision, the cam curve of the two-component zoom optical system is used to calculate a limited search range, and positioning the focusing assembly to a position close to an optimal focusing plane achieves rough focusing; an automatic focusing technology of a digital image processing technology is adopted, and a spectral evaluation function with threshold determination and the hill-climbing search method are selected to achieve fine focusing. Through the above three experiments, it can be seen that: in the projection range of 4 to 35 meters, the maximum deviation between the auto-focusing focusing plane position and the actual focusing plane position was ±0.023 mm, which can meet the requirements of focusing precision and image sharpness; in the worst case, a ratio of the maximum search range to the maximum route of the focusing assembly was about 15%, which shortens the search range and avoids searching for invalid sections; the time-consuming ratio for completing the automatic focusing by the programs with and without cam curve algorithm is about 13 to 22%, that is, the program with the cam curve algorithm takes less time to complete the automatic focusing, and improves the real-time performance of the automatic focusing.
[0067] Obviously, the above embodiments of the present invention are merely examples for clear illustration of the technical solution in the invention, and are not intended to limit the implementations of the present invention. Any modification, equivalent substitution, improvement, or the like within the spirit and principle of the claims of the invention should be included in the scope of the claims of the invention.