Method and device for detecting comprehensive performance of optical lens
Through the dot matrix calibration plate and computer program, dot matrix images are taken and optical lens performance parameters are calculated, which solves the complexity and consistency problems of the existing technology and achieves efficient and accurate comprehensive performance detection of optical lenses.
Patent Information
- Application Number
- CN202411437620.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2024-12-24
AI Technical Summary
The existing optical lens performance detection methods are complex, and it is difficult to ensure consistency of multiple different types of calibration plates, which affects the accuracy of the test results.
The dot matrix calibration plate and computer program are used to obtain the center coordinates of the dots by taking the dot matrix image, calculate the performance parameters of the optical lens, and realize the comprehensive performance detection of low complexity.
It improves detection efficiency and accuracy, reduces complexity and errors in the detection process, and can complete the detection of multiple performance parameters at one time, simplifying the detection process.
Smart Images

Figure CN119178583A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of lens parameter detection, and in particular to a method and device for detecting comprehensive performance of an optical lens. Background Art
[0002] In the fields of image analysis, visual inspection, feature positioning, etc., if you need to determine the position and size of a specific object in an image, you need to obtain the corresponding parameters of the optical camera system, including the parameters of the optical lens.
[0003] The existing calibration methods require different types of calibration plates for different types of performance parameter characteristics, which increases the complexity of the optical lens performance testing process; and it is difficult to ensure the consistency of the positions between multiple different calibration plates, which will affect the accuracy of the final test results. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method and device for detecting the comprehensive performance of an optical lens, so as to realize low-complexity detection of the comprehensive performance of an optical lens.
[0005] In order to solve the above technical problems, a technical solution adopted by the present invention is:
[0006] A method for detecting the comprehensive performance of an optical lens comprises the following steps:
[0007] After receiving the detection signal, the dot matrix calibration plate is photographed through the optical lens to be detected to obtain a dot matrix image;
[0008] Acquire the first center coordinates of each first dot in the dot matrix image and the second center coordinates of each second dot in the dot matrix calibration plate, and store the association relationship between the first center coordinates and the second center;
[0009] Calculate the performance parameters of the optical lens to be tested according to the dot matrix calibration plate, the dot matrix image, the first circle center coordinates, the second circle center coordinates or the associated relationship;
[0010] The performance parameters are saved and returned.
[0011] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0012] An optical lens comprehensive performance testing device comprises a dot matrix calibration plate, a camera device comprising an optical lens to be tested, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0013] After receiving the detection signal, the dot matrix calibration plate is photographed through the optical lens to be detected to obtain a dot matrix image;
[0014] Acquire the first center coordinates of each first dot in the dot matrix image and the second center coordinates of each second dot in the dot matrix calibration plate, and store the association relationship between the first center coordinates and the second center;
[0015] Calculate the performance parameters of the optical lens to be tested according to the dot matrix calibration plate, the dot matrix image, the first circle center coordinates, the second circle center coordinates or the associated relationship;
[0016] The performance parameters are saved and returned.
[0017] The beneficial effects of the present invention are as follows: by setting a dot matrix calibration plate, photographing the dot matrix calibration plate to obtain a dot matrix image, the uniformly distributed dot matrix can better reflect the difference between the photographed dot matrix image and the dot matrix calibration plate, and the dots are convenient for automatic positioning by machine learning, and are also convenient for measuring the positions of the dots on the dot matrix calibration plate, so that the change of the center coordinates of the dots can be used as a reference for calculating the difference between the dot matrix calibration plate and the dot matrix image obtained by photographing by setting a coordinate system; in the process of calibrating performance parameters, there is no need to replace multiple different calibration plates according to the characteristics of each performance parameter, and multiple performance parameters can be tested by one clamping. The efficiency of the test is improved, and the accuracy of the test results is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A flowchart of a method for detecting comprehensive performance of an optical lens according to an embodiment of the present invention;
[0019] Figure 2 Schematic diagram of a dot matrix calibration plate according to an embodiment of the present invention;
[0020] Figure 3 A schematic diagram of a dot matrix image according to an embodiment of the present invention;
[0021] Figure 4 Schematic diagram of a distortion-image height curve according to an embodiment of the present invention;
[0022] Figure 5 A schematic diagram of a dot edge according to an embodiment of the present invention;
[0023] Figure 6 This is an enlarged schematic diagram of a dot edge according to an embodiment of the present invention;
[0024] Figure 7 is a schematic diagram of a step function according to an embodiment of the present invention;
[0025] Figure 8is a schematic diagram of a line spread function according to an embodiment of the present invention;
[0026] Fig. 9 is a schematic diagram of a modulation transfer function according to an embodiment of the present invention;
[0027] Fig.10 Another step flow chart of a method for detecting comprehensive performance of an optical lens according to an embodiment of the present invention;
[0028] Fig.11 It is a structural schematic diagram of an optical lens comprehensive performance detection device according to an embodiment of the present invention;
[0029] Description of labels:
[0030] 1. An optical lens comprehensive performance detection device; 2. A processor; 3. A memory. DETAILED DESCRIPTION
[0031] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0032] Please refer to Figure 1 , a method for detecting the comprehensive performance of an optical lens, comprising the steps of:
[0033] After receiving the detection signal, the dot matrix calibration plate is photographed through the optical lens to be detected to obtain a dot matrix image;
[0034] Acquire the first center coordinates of each first dot in the dot matrix image and the second center coordinates of each second dot in the dot matrix calibration plate, and store the association relationship between the first center coordinates and the second center;
[0035] Calculate the performance parameters of the optical lens to be tested according to the dot matrix calibration plate, the dot matrix image, the first circle center coordinates, the second circle center coordinates or the associated relationship;
[0036] The performance parameters are saved and returned.
[0037] From the above description, it can be seen that the beneficial effects of the present invention are: by setting a dot matrix calibration plate, photographing the dot matrix calibration plate to obtain a dot matrix image, the uniformly distributed dot matrix can better reflect the difference between the photographed dot matrix image and the dot matrix calibration plate, and the dots are convenient for machine learning to automatically locate, and it is also convenient to measure the position of the dots on the dot matrix calibration plate, so that the change of the center coordinates of the dots can be used as a reference for calculating the difference between the dot matrix calibration plate and the dot matrix image obtained by photographing by setting a coordinate system; in the process of calibrating performance parameters, there is no need to replace multiple different calibration plates according to the characteristics of each performance parameter, and multiple performance parameters can be tested in one clamping. The efficiency of the test is improved, and the accuracy of the test results is improved.
[0038] Furthermore, the calculating the performance parameters of the optical lens to be tested according to the dot matrix calibration plate, the dot matrix image, the first circle center coordinates, the second circle center coordinates or the associated relationship includes:
[0039] Acquire the first center coordinates of the dot matrix image and the second center coordinates of the dot matrix calibration plate;
[0040] Acquire the first circle center coordinates closest to the first center coordinates as first origin coordinates, and acquire the second circle center coordinates closest to the second center coordinates in the dot matrix calibration plate as second origin coordinates;
[0041] Calculate a first distance between each of the first circle center coordinates and the first origin coordinates and a second distance between a second circle center coordinate associated with the first circle center coordinates and the second origin coordinates;
[0042] The average magnification is obtained according to the average value of the ratio of the first distance to the second distance corresponding to each pair of the first circle center coordinates and the second circle center coordinates having the associated relationship.
[0043] From the above description, it can be seen that the first distance between each first circle center coordinate and the first center coordinate in the dot matrix image and the second distance between each second circle center coordinate and the second center coordinate on the dot matrix calibration plate are obtained, and the ratio of the first distance to the second distance is calculated according to the correlation between the first circle center coordinate and the second circle center coordinate. It can be seen that the second distance on the dot matrix calibration plate is the actual distance, and in the imaging process, the first distance in the final imaged dot matrix image is the final presented distance. In this way, the magnification of the imaging optical lens can be determined; and the center coordinate of the center position is obtained as a reference point, which is in line with the characteristics of optical lens imaging, that is, no distortion will be generated on the optical axis; thereby improving the accuracy of the calculation results.
[0044] Furthermore, the calculating the performance parameters of the optical lens to be tested according to the dot matrix calibration plate, the dot matrix image, the first circle center coordinates, the second circle center coordinates or the associated relationship includes:
[0045] Calculate the linear distortion D(x, y) corresponding to the target point on the dot matrix image
[0046]
[0047] In the formula, r (x,y) represents the first distance between the first center coordinate (x, y) and the first origin coordinate; L (U,V) represents a second distance between the second circle center coordinates (U, V) and the second origin coordinates;
[0048] A distortion-image height curve is obtained according to the first distance and the linear distortion.
[0049] From the above description, it can be seen that the linear distortion is obtained according to the ratio of the difference between the first distance and the second distance to the second distance, that is, the ratio of the error between the final presented image and the real object, and finally the distortion-image height curve is obtained according to the difference in the first distance, which can reflect the distortion conditions at different positions in the image.
[0050] Further, the detection signal also includes a working distance greater than one;
[0051] The method of acquiring a dot matrix image by photographing a dot matrix calibration plate through an optical lens to be detected comprises:
[0052] At each of the working distances, the dot matrix calibration plate is photographed by the optical lens to be detected to obtain a dot matrix image.
[0053] From the above description, it can be seen that during the detection process, the dot matrix images are obtained based on working distances greater than one, so that the changes in imaging of the optical lens at different distances can be obtained, further enriching the parameters that can be detected by the optical lens performance test.
[0054] Furthermore, after photographing the dot matrix calibration plate through the optical lens to be detected at each working distance to obtain the dot matrix image, the method further includes:
[0055] Obtaining the clarity of each of the dot matrix images;
[0056] Determine whether the clarity exceeds a clarity threshold, and if so, record the target working distance corresponding to the dot matrix image;
[0057] The maximum value and the minimum value of all the target working distances are obtained, and the difference between the maximum value and the minimum value is calculated as the depth of field.
[0058] From the above description, it can be seen that after obtaining the dot matrix images at different working distances, the clarity corresponding to each dot matrix image is obtained. If the clarity exceeds the clarity threshold, it means that the optical lens can obtain a clear image at the working distance, that is, the working distance is within the range of the depth of field. In this way, the range in which the optical lens can obtain a clear image can be determined, and the depth of field data of the optical lens can be obtained.
[0059] Furthermore, the calculating the performance parameters of the optical lens to be tested according to the dot matrix calibration plate, the dot matrix image, the first circle center coordinates, the second circle center coordinates or the associated relationship includes:
[0060] Acquire the dot matrix images taken at different working distances to obtain the linear distortion at different working distances;
[0061] According to the linear distortion, the rate of change T(x, y) in the direction of the working distance is obtained:
[0062]
[0063] D(z, x, y) is the linear distortion at the working distance z; z1 is the first working distance closest to the dot matrix calibration plate; zt is the second working distance farthest from the dot matrix calibration plate;
[0064] Convert the change rate T(x, y) into an angle value to obtain the telecentricity at the first circle center coordinate (x, y);
[0065] The maximum telecentricity among all the telecentricities is marked as telecentricity.
[0066] From the above description, it can be seen that the linear distortion changes differently at different working distances. By converting the change rate into the telecentricity ratio, the telecentricity ratio corresponding to different first circle center coordinates can be obtained. The maximum telecentricity ratio can mark the maximum change rate of the linear distortion when the optical lens changes at different working distances, that is, it can represent the telecentricity range of the optical lens. Therefore, obtaining the maximum telecentricity ratio as the telecentricity can reflect the degree of change of the linear distortion with the change of the working distance.
[0067] Furthermore, after acquiring the dot matrix image by photographing the dot matrix calibration plate through the optical lens to be detected, the method further comprises:
[0068] Converting the dot matrix image into a grayscale image;
[0069] Calculating the performance parameters of the optical lens to be tested according to the dot matrix calibration plate, the dot matrix image, the first circle center coordinates, the second circle center coordinates or the associated relationship comprises:
[0070] Obtaining an x-axis grayscale step function and a y-axis grayscale step function according to the grayscale image;
[0071] Selecting the grayscale step function with a greater change in the x-axis grayscale step function and the y-axis grayscale step function as the grayscale step function for calculating the line spread function
[0072] Derivative the grayscale step function to obtain a line spread function;
[0073] The line spread function is subjected to Fourier transformation to obtain a modulation transfer function.
[0074] From the above description, it can be seen that because a dot matrix image is constructed, the change in edge grayscale can be well obtained for each dot, thereby eliminating the influence of a small amount of error on the final detection result, and improving the accuracy of the modulation transfer function finally calculated. In addition, the edges of the dots are clearer, and the accuracy of the grayscale step function obtained is high, which further improves the accuracy of the modulation transfer function.
[0075] Furthermore, it also includes obtaining the number of pixel points spanned by the grayscale transition portion of the edge of the first dot along the x-axis and the y-axis respectively;
[0076] The step of obtaining an x-axis grayscale step function and a y-axis grayscale step function according to the grayscale image comprises:
[0077] Get the gray value Gray(p,q) at each pixel point (p,q);
[0078] Calculate the difference Gx(m,q) in the x direction of the pixel point:
[0079] Gx(m,q)=Gray(i,q)-Gray(i-1,q);
[0080] Calculate the difference Gy(p,n) in the y direction at the pixel point:
[0081] Gy(p,n)=Gray(p,j)-Gray(p,j-1);
[0082] Where i∈[1,m], j∈[1,n]; m represents the number of pixels spanned along the x-axis, and n represents the number of pixels spanned along the y-axis;
[0083] According to Gx(m, q) and Gy(p, n), an x-axis grayscale change curve and a y-axis grayscale change curve are drawn, and the x-axis grayscale change curve and the y-axis grayscale change curve are smoothed to obtain an x-axis grayscale step function ESF(x) and a y-axis grayscale step function ESF(y).
[0084] From the above description, it can be seen that for each point, the difference in the x direction and the y direction is calculated separately to obtain Gx and Gy including multiple elements, and the pixel points are exhausted. Then, when drawing the grayscale step function, the influence of the extreme value or error that may appear in a single value can be eliminated through multiple values, thereby improving the accuracy of the final modulation transfer function.
[0085] Further, performing Fourier transform on the line spread function to obtain a modulation transfer function MTF(v) comprises:
[0086]
[0087] In the formula, v represents the spatial frequency and i represents the imaginary unit.
[0088] From the above description, it can be seen that by converting the obtained line spread function into a modulation transfer function through Fourier transform, the relative amplitude of the transmitted components of different spatial frequencies is obtained, which can measure the spatial resolution capability of the optical lens.
[0089] Please refer to Fig.11 A device for detecting comprehensive performance of an optical lens comprises a dot matrix calibration plate, a camera device including an optical lens to be detected, a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step in the above-mentioned method for detecting comprehensive performance of an optical lens is implemented.
[0090] The above-mentioned method and device for detecting comprehensive performance of an optical lens of the present invention can be applied to detecting the performance of an optical lens, which will be described below through a specific implementation method.
[0091] Please refer to Figure 1-10 , Embodiment 1 of the present invention is:
[0092] A method for detecting the comprehensive performance of an optical lens comprises the following steps:
[0093] S1. After receiving the detection signal, the dot matrix calibration plate is photographed through the optical lens to be detected to obtain a dot matrix image; specifically, it is verified that the working surface of the calibration plate is perpendicular to the optical axis of the lens, and the camera exposure parameters are set to make the overall brightness of the image moderate, for example, the grayscale value of the bright part is 220±5 as the standard; when the working surface of the calibration plate is perpendicular to the optical axis of the lens, even if the captured dot matrix image is an incomplete calibration plate, because the arrangement of the matrix is the same, the center of the calibration plate can be directly used as the center of comparison, thereby simplifying the process of associating dots between the captured dot matrix image and the original dot matrix calibration plate; that is, the points are fixed at the center of the dot matrix calibration plate, but if the captured points are at other positions of the dot matrix calibration plate, the corresponding relationship can also be calculated using the points taken;
[0094] In an optional embodiment, the detection signal further includes more than one working distance; then at each of the working distances, the dot matrix calibration plate is photographed by the optical lens to be detected to obtain a dot matrix image;
[0095] In an optional implementation, if the acquired dot matrix image is a color image, the method further includes converting the dot matrix image into a grayscale image, and the resolution of the grayscale image is the same as the resolution of the dot matrix image, which is (m, n);
[0096] Gray=0.299R+0.587G+0.114B;
[0097] Where R, G and B are the grayscale values of the red, green and blue channels corresponding to the pixel point (p, q) to be converted respectively; please refer to Figure 2 , is a schematic diagram of the distribution of the second dots on a dot matrix calibration plate; please refer to Figure 3 , is a schematic diagram of a dot matrix image obtained by photographing the calibration plate;
[0098] S2, obtaining the first center coordinates (in pixels) of each first dot in the dot matrix image and the second center coordinates (in mm) of each second dot in the dot matrix calibration plate, and storing the association between the first center coordinates and the second center; the pixel size of the camera sensor is h×h, in units of mm (millimeter) / pixel; recording that the captured dot matrix image includes a total of k×l R first dots;
[0099] S3, calculating the performance parameters of the optical lens to be tested according to the dot matrix calibration plate, the dot matrix image, the first circle center coordinates, the second circle center coordinates or the associated relationship, including:
[0100] S30, obtain the average magnification:
[0101] S301, acquiring the first center coordinates of the dot matrix image and the second center coordinates of the dot matrix calibration plate;
[0102] S302, acquiring the first circle center coordinates closest to the first center coordinates as first origin coordinates, and acquiring the second circle center coordinates closest to the second center coordinates in the dot matrix calibration plate as second origin coordinates;
[0103] In an optional implementation, the first origin coordinate and the second origin coordinate may be marked as (0,0);
[0104] S303, calculating a first distance between each of the first circle center coordinates (x, y) and the first origin coordinates and a second distance between a second circle center coordinate (U, V) associated with the first circle center coordinates and the second origin coordinates;
[0105] In an optional embodiment, the first distance Where h is the pixel size mentioned above; it can unify the units;
[0106] Second distance
[0107] S304, obtaining an average magnification M according to an average value of the ratio of the first distance to the second distance corresponding to each pair of the first circle center coordinates and the second circle center coordinates having the associated relationship;
[0108] If there are multiple dot matrix images at working distances, the corresponding working distance M can be calculated for each working distance;
[0109]
[0110] Where R is the total number of coordinates of the first circle center;
[0111] S31. Obtain distortion-image height curve:
[0112] S311, calculating the linear distortion D(x, y) corresponding to the target point on the dot matrix image; since the imaging characteristic of the optical system is that no distortion will be generated on the optical axis, that is, it can be considered that the distortion at the center position of the acquired dot matrix image is 0, the distortion change process calculated by taking the center point as the reference 0 point is more accurate;
[0113]
[0114] In the formula, r (x,y) represents the first distance between the first center coordinate (x, y) and the first origin coordinate (0, 0); L (U,V) represents a second distance between the second circle center coordinates (U, V) and the second origin coordinates (0, 0);
[0115] The first point coordinate and the second origin coordinate may not be used as the origin of the coordinate system but only as a mark. For example, the actual coordinate of the first origin coordinate may be (10,12), which is marked as (0,0) to indicate that it is the first origin coordinate. The other first center coordinates (x, y) are used to calculate the first distance relative to (10,12); the r used for calculation (0,0) , L (0,0) For example, if (0,0) on the calibration plate is used as the reference origin, L (0,0)can be regarded as 0; however, the projection of this point on the image is difficult to accurately adjust to the origin of the image, so r (0,0) Determined by actual coordinates, not necessarily 0;
[0116] According to the positive and negative properties of the calculated image peripheral distortion, it can be determined whether the distortion belongs to barrel distortion or pincushion distortion; specifically, it is necessary to comprehensively determine whether it belongs to barrel distortion or pincushion distortion based on the positive and negative values calculated by the linear distortion D(x, y) and the position of xy;
[0117] Please refer to Figure 4 S312, obtaining a distortion-image height (r) curve according to the first distance and the linear distortion, wherein the abscissa represents the degree of distortion, i.e. the calculated linear distortion D(x, y), and the ordinate represents the image height, i.e. the first distance;
[0118] S32, obtaining depth of field:
[0119] S321, obtaining the clarity of each of the dot matrix images; that is, obtaining the clarity of the dot matrix images at different working distances;
[0120] S322, determining whether the clarity exceeds a clarity threshold, and if so, recording the target working distance corresponding to the dot matrix image;
[0121] S323, obtaining the maximum value and the minimum value of all the target working distances, and calculating the difference between the maximum value and the minimum value as the depth of field DoF;
[0122] S33. Obtain telecentricity. Telecentricity is the angle between the main ray and the optical axis at a certain point along the radial direction of the lens. It can be considered as the residual angular field of view of the lens and is usually expressed in degrees:
[0123] S331, acquiring the dot matrix images taken at different working distances to obtain the linear distortion at different working distances;
[0124] S332 obtains a rate of change T(x, y) in the direction of the working distance according to the linear distortion:
[0125]
[0126] D(z, x, y) is the linear distortion at the working distance z; z1 is the first working distance closest to the dot matrix calibration plate; zt is the second working distance farthest from the dot matrix calibration plate;
[0127] S333, converting the change rate T(x, y) into an angle value Tel(x, y) to obtain the telecentricity at the first circle center coordinate (x, y);
[0128]
[0129] S334, obtaining the maximum telecentricity among all the telecentricities and marking it as telecentricity; since the telecentricity is 0 at the center and maximum at the edge, the telecentricity of the image edge can be obtained by obtaining the maximum telecentricity;
[0130] S34. Calculate the modulation transfer function (MTF). The modulation transfer function (MTF) curve of the optical system is a function that reflects how the lens reproduces contrast as a spatial frequency (resolution). This is done by analyzing the image to obtain the grayscale step function ESF of the edge of the target dot, then deriving the ESF to obtain the line spread function LSF, and then Fourier transforming the LSF to obtain the MTF:
[0131] Please refer to Figure 5 , is a schematic diagram of the edge of the first dot in the dot matrix image; Figure 6 is a schematic diagram obtained by enlarging the edge of the first dot;
[0132] S341, obtaining an x-axis grayscale step function and a y-axis grayscale step function according to the grayscale image, including:
[0133] S3411, obtaining the gray value Gray(x, q) at each pixel point (p, q);
[0134] S3412, calculating the difference Gx(m, q) in the x direction of the pixel point:
[0135] Gx(m,q)=Gray(i,q)-Gray(i-1,q);
[0136] Calculate the difference Gy(x,n) in the y direction at the pixel point:
[0137] Gy(p,n)=Gray(p,j)-Gray(p,j-1);
[0138] Where, i∈[1,m], j∈[1,n];
[0139] S3413. Draw an x-axis grayscale change curve and a y-axis grayscale change curve according to Gx(m, q) and Gy(p, n), and perform smoothing operations on the x-axis grayscale change curve and the y-axis grayscale change curve to obtain an x-axis grayscale step function ESF(x) and a y-axis grayscale step function ESF(y); refer to Figure 7 , is a schematic diagram of the step function at the edge of the first dot finally obtained, wherein the abscissa is the value of j, and the ordinate is the value of Gy(p, n) corresponding to j;
[0140] After calculating the grayscale step functions in the x-axis direction and the y-axis direction respectively, a specific part with obvious edge features is generally selected to determine the ESF used to calculate the line spread function; Figure 5 , Figure 6 , at which the grayscale transition in the x direction is obvious, while there is basically no change in the y direction, so ESF(x) is used as the ESF for calculating the line spread function; if the selected calculation position has an obvious transition in the y direction (such as the lower edge of the dot), the calculated ESF(y) at this position is used as the ESF for calculating the line spread function; the ESF in the two directions can be calculated separately and then the degree of change can be compared, or the degree of change can be manually determined and only the direction with the largest degree of change can be calculated to reduce the calculation process;
[0141] S342, deriving the x-axis grayscale step function to obtain the line spread function LSF; please refer to Figure 8 , is the schematic diagram of the final line spread function;
[0142]
[0143] S343, performing Fourier transform on the line spread function to obtain a modulation transfer function, including:
[0144]
[0145] Where MTV is the modulation transfer function, v is the spatial frequency, and i is the imaginary unit; please refer to Fig. 9 , is the schematic diagram of the modulation transfer function finally obtained;
[0146] S4. Save and return the performance parameters.
[0147] Please refer to Fig.11 , Embodiment 2 of the present invention is:
[0148] An optical lens comprehensive performance testing device comprises a dot matrix calibration plate, a camera device comprising an optical lens to be tested, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements each step of an optical lens comprehensive performance testing method in Embodiment 1 when executing the computer program;
[0149] Among them, the dot matrix calibration plate has several circular patterns with the same diameter and equal spacing in the vertical and horizontal directions, among which several hollow circular rings at specific positions are used as position identification marks, and the diameter and spacing of the circular patterns can be configured with several specifications according to different lens fields of view; because the captured image may not be a complete dot matrix calibration plate, setting hollow circular rings on the dot matrix calibration plate can quickly confirm which part of the dot matrix calibration plate the captured image belongs to, so that the local image can be quickly matched with the position on the calibration plate, so that the parameters of the corresponding area on the dot matrix calibration plate can be obtained in a targeted manner, avoiding the influence of the printing error of the dot matrix calibration plate on the measurement results;
[0150] In an optional implementation, different dot matrix calibration plates are selected according to the size of the field of view that the lens can cover, and all the dot patterns on each specification of the calibration plate are the same; thereby minimizing the problem of only being able to capture a partial image on the dot matrix calibration plate.
[0151] In summary, the present invention provides a method and device for detecting the comprehensive performance of an optical lens, which obtains the performance data of the optical lens by analyzing and calculating the dot matrix image actually taken, which fits the actual use scenario and can reflect the true performance of the imaging system; and the implementation only requires the use of a set of installation and positioning devices that can ensure that the calibration plate is perpendicular to the optical axis of the camera, a dot matrix calibration plate and a camera, without the need for expensive instruments and equipment and special precision fixtures, which greatly reduces the detection cost; and multiple performance parameter tests can be completed by one clamping, avoiding the influence of positioning errors caused by repeated clamping of a single detection instrument, improving the repetition accuracy, and greatly improving the detection efficiency; in the measurement of magnification and distortion, the distance relative to the center of the image is used for calculation, which is more accurate than the calculation using the dot diameter; and the analysis and calculation process can be completely performed automatically by using software, avoiding the influence of subjective judgment of the detection personnel, with high certainty, and improving the accuracy of the detection results; at the same time, the original images and data in the detection and various intermediate process data are easy to save and have traceability value; the detection data can also be automatically saved into the database, which is convenient for production or commercial statistical management.
[0152] The detection method of the present invention is simple and quick in acquiring original detection information, and detection personnel only need to receive simple training to be competent, thus reducing the technical difficulty of detection operation.
[0153] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for detecting the comprehensive performance of an optical lens, characterized in that: Includes steps: After receiving the detection signal, the dot matrix calibration plate is photographed through the optical lens to be detected to obtain a dot matrix image; Acquire the first center coordinates of each first dot in the dot matrix image and the second center coordinates of each second dot in the dot matrix calibration plate, and store the association relationship between the first center coordinates and the second center; Calculate the performance parameters of the optical lens to be tested according to the dot matrix calibration plate, the dot matrix image, the first circle center coordinates, the second circle center coordinates or the associated relationship; The performance parameters are saved and returned.
2. The method for detecting comprehensive performance of an optical lens according to claim 1, characterized in that: Calculating the performance parameters of the optical lens to be tested according to the dot matrix calibration plate, the dot matrix image, the first circle center coordinates, the second circle center coordinates or the associated relationship comprises: Acquire the first center coordinates of the dot matrix image and the second center coordinates of the dot matrix calibration plate; Acquire the first circle center coordinates closest to the first center coordinates as first origin coordinates, and acquire the second circle center coordinates closest to the second center coordinates in the dot matrix calibration plate as second origin coordinates; Calculate a first distance between each of the first circle center coordinates and the first origin coordinates and a second distance between a second circle center coordinate associated with the first circle center coordinates and the second origin coordinates; The average magnification is obtained according to the average value of the ratio of the first distance to the second distance corresponding to each pair of the first circle center coordinates and the second circle center coordinates having the associated relationship.
3. The method for detecting comprehensive performance of an optical lens according to claim 2, characterized in that: Calculating the performance parameters of the optical lens to be tested according to the dot matrix calibration plate, the dot matrix image, the first circle center coordinates, the second circle center coordinates or the associated relationship comprises: Calculate the linear distortion D(x, y) corresponding to the target point on the dot matrix image In the formula, r (x,y) represents the first distance between the first center coordinate (x, y) and the first origin coordinate; L (U,V) represents a second distance between the second circle center coordinates (U, V) and the second origin coordinates; A distortion-image height curve is obtained according to the first distance and the linear distortion.
4. A method for detecting comprehensive performance of an optical lens according to any one of claims 1 to 3, characterized in that: The detection signal also includes a working distance greater than one; The method of acquiring a dot matrix image by photographing a dot matrix calibration plate through an optical lens to be detected comprises: At each of the working distances, the dot matrix calibration plate is photographed by the optical lens to be detected to obtain a dot matrix image.
5. The method for detecting comprehensive performance of an optical lens according to claim 4, characterized in that: After acquiring the dot matrix image by photographing the dot matrix calibration plate through the optical lens to be detected at each working distance, the method further comprises: Obtaining the clarity of each of the dot matrix images; Determine whether the clarity exceeds a clarity threshold, and if so, record the target working distance corresponding to the dot matrix image; The maximum value and the minimum value of all the target working distances are obtained, and the difference between the maximum value and the minimum value is calculated as the depth of field.
6. The method for detecting comprehensive performance of an optical lens according to claim 3, characterized in that: Calculating the performance parameters of the optical lens to be tested according to the dot matrix calibration plate, the dot matrix image, the first circle center coordinates, the second circle center coordinates or the associated relationship comprises: Acquire the dot matrix images taken at different working distances to obtain the linear distortion at different working distances; According to the linear distortion, the rate of change T(x, y) in the direction of the working distance is obtained: Wherein, D(z, x, y) is the linear distortion at the working distance z; z1 is the first working distance closest to the dot matrix calibration plate; zt is the second working distance farthest from the dot matrix calibration plate; Convert the change rate T(x, y) into an angle value to obtain the telecentricity at the first circle center coordinate (x, y); The maximum telecentricity among all the telecentricities is marked as telecentricity.
7. The method for detecting comprehensive performance of an optical lens according to claim 1, characterized in that: After the method uses the optical lens to be detected to photograph the dot matrix calibration plate to obtain the dot matrix image, it includes: Converting the dot matrix image into a grayscale image; Calculating the performance parameters of the optical lens to be tested according to the dot matrix calibration plate, the dot matrix image, the first circle center coordinates, the second circle center coordinates or the associated relationship comprises: Obtaining an x-axis grayscale step function and a y-axis grayscale step function according to the grayscale image; Select the grayscale step function with a larger change in the x-axis grayscale step function and the y-axis grayscale step function as the grayscale step function for calculating the line spread function Derivative the grayscale step function to obtain a line spread function; The line spread function is subjected to Fourier transformation to obtain a modulation transfer function.
8. The method for detecting comprehensive performance of an optical lens according to claim 7, characterized in that: It also includes obtaining the number of pixel points spanned by the grayscale transition portion of the edge of the first dot along the x-axis and the y-axis respectively; The step of obtaining an x-axis grayscale step function and a y-axis grayscale step function according to the grayscale image comprises: Get the gray value Gray(p,q) at each pixel point (p,q); Calculate the difference Gx(m,q) in the x direction of the pixel point: Gx(m,q)=Gray(i,q)-Gray(i-1,q); Calculate the difference Gy(p,n) in the y direction at the pixel point: Gy(p,n)=Gray(p,j)-Gray(p,j-1); Where i∈[1,m], j∈[1,n]; m represents the number of pixels spanned along the x-axis, and n represents the number of pixels spanned along the y-axis; According to Gx(m, q) and Gy(p, n), an x-axis grayscale change curve and a y-axis grayscale change curve are drawn, and the x-axis grayscale change curve and the y-axis grayscale change curve are smoothed to obtain an x-axis grayscale step function ESF(x) and a y-axis grayscale step function ESF(y).
9. The method for detecting comprehensive performance of an optical lens according to claim 7 or 8, characterized in that: The performing Fourier transform on the line spread function to obtain the modulation transfer function comprises: Where MTV represents the modulation transfer function, v represents the spatial frequency, and i represents the imaginary unit.
10. An optical lens comprehensive performance testing device, characterized in that: The invention comprises a dot matrix calibration plate, a camera device including an optical lens to be tested, a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of a method for testing the comprehensive performance of an optical lens as described in any one of claims 1 to 9 when executing the computer program.
Citation Information
Cited By
Calibration method and device, equipment and storage medium
CN121259118A
