CN117850032A - Optical lens adjusting method and system - Google Patents
Optical lens adjusting method and system Download PDFInfo
- Publication number
- CN117850032A CN117850032A CN202410263269.2A CN202410263269A CN117850032A CN 117850032 A CN117850032 A CN 117850032A CN 202410263269 A CN202410263269 A CN 202410263269A CN 117850032 A CN117850032 A CN 117850032A
- Authority
- CN
- China
- Prior art keywords
- ideal
- matrix
- actual
- adjustment
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 230000003287 optical effect Effects 0.000 title claims abstract description 77
- 238000000034 method Methods 0.000 title claims abstract description 70
- 239000011159 matrix material Substances 0.000 claims abstract description 169
- 238000003384 imaging method Methods 0.000 claims abstract description 101
- 238000004088 simulation Methods 0.000 claims abstract description 10
- 238000012545 processing Methods 0.000 claims description 17
- 230000008569 process Effects 0.000 claims description 11
- 238000004422 calculation algorithm Methods 0.000 claims description 5
- 238000004458 analytical method Methods 0.000 claims description 4
- 238000011156 evaluation Methods 0.000 claims description 4
- 238000004364 calculation method Methods 0.000 description 8
- 238000012549 training Methods 0.000 description 4
- 238000005457 optimization Methods 0.000 description 3
- 238000012937 correction Methods 0.000 description 2
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000018109 developmental process Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 230000008030 elimination Effects 0.000 description 1
- 238000003379 elimination reaction Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000003709 image segmentation Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G02—OPTICS
- G02B—OPTICAL ELEMENTS, SYSTEMS OR APPARATUS
- G02B27/00—Optical systems or apparatus not provided for by any of the groups G02B1/00 - G02B26/00, G02B30/00
- G02B27/0012—Optical design, e.g. procedures, algorithms, optimisation routines
-
- G—PHYSICS
- G02—OPTICS
- G02B—OPTICAL ELEMENTS, SYSTEMS OR APPARATUS
- G02B7/00—Mountings, adjusting means, or light-tight connections, for optical elements
- G02B7/02—Mountings, adjusting means, or light-tight connections, for optical elements for lenses
-
- G—PHYSICS
- G02—OPTICS
- G02B—OPTICAL ELEMENTS, SYSTEMS OR APPARATUS
- G02B7/00—Mountings, adjusting means, or light-tight connections, for optical elements
- G02B7/02—Mountings, adjusting means, or light-tight connections, for optical elements for lenses
- G02B7/023—Mountings, adjusting means, or light-tight connections, for optical elements for lenses permitting adjustment
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Optics & Photonics (AREA)
- Automatic Focus Adjustment (AREA)
Abstract
The invention discloses a method and a system for adjusting an optical lens, which belong to the technical field of adjustment of the optical lens, and the method comprises the following steps: setting a target object, acquiring a target image based on the target object, and determining a plurality of target areas according to the target image; performing optical lens adjustment simulation to obtain an actual imaging image and an ideal imaging image; determining an actual matrix and an ideal matrix according to each target area; calculating a difference matrix according to the actual matrix and the ideal matrix, and carrying out initial adjustment of the optical lens according to each difference matrix; determining an actual imaging image, an ideal imaging image, an actual matrix and an ideal matrix after initial adjustment; determining corresponding actual resolution, ideal resolution, actual contrast and ideal contrast according to the actual imaging image and the ideal imaging image; determining a difference matrix, and integrating the difference matrix, the actual resolution, the ideal resolution, the actual contrast and the ideal contrast into adjustment reference data; and adjusting the optical lens according to the adjustment reference data.
Description
Technical Field
The invention belongs to the technical field of adjustment and correction of optical lenses, and particularly relates to an adjustment and correction method and system of an optical lens.
Background
In recent years, with the rapid development of technology, optical technology plays an increasingly important role in various fields such as photography, medical instruments, scientific research instruments, and the like. In these applications, high quality imaging systems are an integral part. However, due to factors such as manufacturing accuracy, material characteristics, and the like, lenses often have various aberrations, which directly affect imaging quality.
To solve this problem, an optical lens adjustment system has been developed. Conventional optical lens tuning systems typically fine tune the lens by mechanical tuning means to optimize imaging quality. However, this method has problems such as low adjustment accuracy and complicated operation. Although existing optical lens tuning systems have achieved certain results, there are challenges and problems. For example, how to improve the adjustment accuracy and efficiency, how to achieve effective adjustment of a complex lens system, how to reduce the cost of the adjustment process, and so on. Therefore, further improvement and development of the optical lens adjustment system, improvement of performance and convenience in use thereof, is an important research direction in the current optical field.
Based on the above, the invention provides a method and a system for adjusting an optical lens.
Disclosure of Invention
In order to solve the problems of the above-mentioned scheme, the present invention provides a method and a system for adjusting an optical lens.
The aim of the invention can be achieved by the following technical scheme:
a method of tuning an optical lens, the method comprising:
step SA1: setting a target object, acquiring a corresponding target image based on the target object in a preset standard environment, and determining a plurality of target areas according to the obtained target image;
further, the method for determining the target area includes:
step SC1: carrying out gray scale processing on the target image to form a target gray scale image; presetting a standard matrix template;
step SC2: extracting a plurality of matrixes to be selected from the target gray level image according to the standard matrix template, and marking the element in the matrixes to be selected as d ij The method comprises the steps of carrying out a first treatment on the surface of the i=1, 2, … …, n being a positive integer; j=1, 2, … …, m being a positive integer; the candidate matrix is marked as;
Identifying adjacent elements of each element in the matrix to be selected, and marking the adjacent elements as d ijc C=1, 2, … …, v is a positive integer, v has a value in the range of [3,8];
Step SC3: according to the formulaCalculating the area value of each matrix to be selected; wherein: QZ is the area value of the corresponding matrix to be selected;
step SC4: determining a target area according to the matrix to be selected with the largest area value, and removing the corresponding matrix to be selected from the target gray level image to form a new target gray level image;
identifying the determined number of target areas, ending analysis when the number of target areas reaches a threshold value X2, and outputting each target area; when the number of target areas does not reach the threshold value X2, the process returns to step SC2.
Further, in step SC2, the target gray-scale image is clipped before determining the matrix to be selected.
Step SA2: performing adjustment simulation of the optical lens to obtain a corresponding actual imaging image and an ideal imaging image; determining a corresponding actual matrix and an ideal matrix according to each target area;
further, the method for determining the actual matrix and the ideal matrix comprises the following steps:
acquiring an actual imaging image and an ideal imaging image, and identifying an actual target area and an ideal target area corresponding to each target area in the actual imaging image and the ideal imaging image;
carrying out gray processing on the images corresponding to the actual target area and the ideal target area to obtain a corresponding gray image of the actual target area and a corresponding gray image of the ideal target area;
recognizing gray values of pixels in the target area gray image and the ideal target area gray image; and generating a corresponding actual matrix and an ideal matrix according to the standard matrix template.
Step SA3: calculating corresponding difference matrixes according to the actual matrixes and the ideal matrixes, and carrying out initial adjustment of the optical lens according to each difference matrix;
further, the method for calculating the difference matrix includes:
marking the actual matrix and the ideal matrix as respectivelyAndthe corresponding elements in the actual matrix and the ideal matrix are respectively marked as s ij And l ij The method comprises the steps of carrying out a first treatment on the surface of the i=1, 2, … …, n being a positive integer; j=1, 2, … …, m being a positive integer;
marking the element in the difference matrix as c ij The method comprises the steps of carrying out a first treatment on the surface of the According to formula c ij =s ij -l ij Calculating corresponding elements in the difference matrix; the difference matrix is。
Further, the method for performing initial adjustment of the optical lens according to each difference matrix comprises the following steps:
step SD1: analyzing each difference matrix according to a preset initial adjustment algorithm, and determining corresponding adjustment parameters;
step SD2: adjusting the optical lens according to the adjustment parameters, and performing adjustment simulation on the optical lens after adjustment to obtain a corresponding actual matrix and an ideal matrix; calculating a corresponding difference matrix;
step SD3: step SD1 is returned until the estimated adjustment parameter reaches the initial standard.
Step SA4: determining an actual imaging image, an ideal imaging image, an actual matrix and an ideal matrix after initial adjustment; determining corresponding actual resolution, ideal resolution, actual contrast and ideal contrast according to the initially adjusted actual imaging image and ideal imaging image;
further, the calculation method of the actual contrast ratio and the ideal contrast ratio is as follows:
gray processing is carried out on the actual imaging image and the ideal imaging image, a corresponding actual gray imaging image and an ideal gray imaging image are obtained, and corresponding actual resolution and ideal resolution are calculated according to the corresponding pixel number;
marking corresponding elements in the actual gray imaging image and the ideal gray imaging image as ya and yz respectively; a and z respectively represent corresponding elements in the actual gray scale imaging image and the ideal gray scale imaging image;
according to the formulaCalculating the actual contrast;
according to the formulaThe actual contrast is calculated.
Step SA5: determining a corresponding difference matrix according to the initially adjusted actual matrix and the ideal matrix; integrating the obtained difference matrix, the actual resolution, the ideal resolution, the actual contrast and the ideal contrast into adjustment reference data;
step SA6: and adjusting the optical lens according to the obtained adjustment reference data.
Further, the method for adjusting the optical lens according to the adjustment reference data comprises the following steps:
analyzing according to the adjustment reference data to obtain a corresponding adjustment target; determining a corresponding adjustment step according to the adjustment target;
performing adjustment according to the adjustment step, and acquiring a new adjustment target after adjustment; and so on, until the evaluation stops optimizing, the loop is stopped.
An optical lens adjusting system comprises a region positioning module, an initial adjusting module and an adjusting module;
the region positioning module is used for positioning the actual imaging image and the ideal imaging image and determining a corresponding actual target region and an ideal target region; and determining corresponding actual matrixes and ideal matrixes according to the actual target areas and the ideal target areas.
Setting a target object, acquiring a corresponding target image based on the target object in a preset standard environment, and determining a plurality of target areas according to the obtained target image; and performing adjustment simulation of the optical lens to obtain a corresponding actual imaging image and an ideal imaging image.
The initial adjustment module is used for initially adjusting the optical lens, calculating corresponding difference matrixes according to the actual matrixes and the ideal matrixes, and initially adjusting the optical lens according to each difference matrix.
The adjusting module is used for adjusting after the optical lens is initially adjusted, and determining a corresponding difference matrix according to the actual matrix and the ideal matrix; integrating the obtained difference matrix, the actual resolution, the ideal resolution, the actual contrast and the ideal contrast into adjustment reference data; and adjusting the optical lens according to the obtained adjustment reference data.
Compared with the prior art, the invention has the beneficial effects that:
the invention can realize intelligent adjustment of the optical lens, effectively improve the adjustment precision and efficiency and reduce the adjustment cost to a greater extent; the method is convenient for most small and medium-sized micro enterprises to perform adjustment and optimization of the optical lens.
By determining a plurality of target areas according to the target image, the corresponding actual matrix and ideal matrix can be conveniently and rapidly identified in the subsequent adjustment process, and meanwhile, the target areas are screened by calculating corresponding area values, so that the image areas with larger difference are preferentially selected, the identification is convenient, and the processing precision is improved; and the target gray level image is cut before the matrix to be selected is determined, so that the data calculation amount in the process of determining the target area is reduced, and the data processing efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings can be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
The technical solutions of the present invention will be clearly and completely described in connection with the embodiments, and it is obvious that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1, a method for adjusting an optical lens includes:
step SA1: setting a target object, collecting a target image of the target object under a preset standard environment, and determining a plurality of target areas according to the obtained target image;
the target object is a reference for comparing and adjusting the imaging images later and is used as a background in the images.
The method comprises the steps of collecting target images of a target object under a preset standard environment, namely, presetting a collecting environment of the target images, and then collecting the target images, so that the actual imaging images and the ideal imaging images can be collected under the same environment adjustment; and the influence of environmental factors on the adjustment precision is avoided.
The method for determining the target area comprises the following steps:
step SC1: performing gray scale processing on the target image to form a target gray scale image, such as image segmentation, image denoising, image enhancement and gray scale transformation; recognizing the gray value of each pixel in the target gray image;
presetting a standard matrix template, wherein the standard matrix template is a blank matrix, namely presetting the number of rows and columns in the matrix; such asDirectly filling gray values of pixels at corresponding positions;
step SC2: according to a presetThe standard matrix template extracts a plurality of matrixes to be selected from the target gray level image, and the element in the matrixes to be selected is marked as d ij The method comprises the steps of carrying out a first treatment on the surface of the i=1, 2, … …, n being a positive integer; j=1, 2, … …, m being a positive integer; the candidate matrix is marked as;
Identifying adjacent elements of each element in the matrix to be selected, and marking the adjacent elements as d ijc C=1, 2, … …, v being a positive integer, and v being at most 8 and at least 3; i.e. v has a value in the range of [3,8 ]];
Step SC3: according to the formulaCalculating the area value of each matrix to be selected; wherein: QZ is the area value of the corresponding matrix to be selected; />Refers to selecting the maximum value of the differences between one element and its neighboring elements, not the maximum value of the differences of all elements.
Step SC4: determining target areas according to the matrix to be selected with the largest area value, removing the corresponding matrix to be selected from the target gray level image to form a new target gray level image, identifying the number of the determined target areas, ending analysis when the number of the target areas reaches a threshold value X2, and outputting each target area; when the number of target areas does not reach the threshold value X2, the process returns to step SC2.
Extracting a plurality of matrixes to be selected from the target gray level image according to a preset standard matrix template, and reducing the calculated amount before extracting the matrixes to be selected; the extraction can be concretely performed in various modes, one is to divide and reject areas with smaller gray value difference of some obvious pixels according to the distribution condition of gray values of all pixels, and keep areas with larger gray value fluctuation; for example, intelligent recognition and elimination are carried out based on the existing artificial intelligent algorithm; the other is to identify the matrixes one by one according to the standard matrix template, synchronously calculate the corresponding area value in the identification process, directly reject the matrixes with the area value lower than the threshold value X1, and only reserve the matrixes with the area value higher than the threshold value X1 as the matrixes to be selected; other existing modes can also be adopted to perform early-stage deletion, so that the data processing amount is reduced.
Step SA2: performing adjustment simulation of the optical lens to obtain a corresponding actual imaging image and an ideal imaging image; determining corresponding actual matrixes and ideal matrixes in the actual imaging image and the ideal imaging image according to the corresponding positions of the target areas;
the ideal imaging image refers to an image which can completely restore the real appearance of an object after passing through an optical lens. The image has the characteristics of high resolution, high contrast, accurate color reproduction and the like, and can provide the truest and clearest visual information.
The actual imaging image is the image obtained in practice after passing through the optical lens.
The method for determining the actual matrix and the ideal matrix comprises the following steps:
acquiring corresponding actual imaging images and ideal imaging images, identifying the corresponding positions of each target area in the actual imaging images and the ideal imaging images, respectively marking the positions as an actual target area and an ideal target area, carrying out gray processing on the images corresponding to the actual target area and the ideal target area to obtain corresponding actual target area gray images and ideal target area gray images, identifying the number of pixels in the target area gray images and the ideal target area gray images, respectively calculating the corresponding resolutions, and marking the positions as actual resolution and ideal resolution; and generating a corresponding actual matrix and an ideal matrix according to the actual resolution, the ideal resolution and the standard matrix template. The method comprises the steps of determining elements to be deleted according to actual resolution, ideal resolution and a standard matrix template, screening according to pixel similarity caused by difference of resolution, and determining a matrix corresponding to the actual resolution; the method has a higher allowable error range, so that deletion can be performed, and initial adjustment can be performed only by determining few groups of paired elements from multiple groups of data.
Specifically, a corresponding intelligent model can be established based on a CNN network or a DNN network, and a corresponding training set is established for training in a manual mode, wherein the training set comprises input data and output data, and the input data is an actual target area gray level image, an ideal target area gray level image and a standard matrix template; the output data are an actual matrix and an ideal matrix; and analyzing through the intelligent model after the training is successful.
By determining a plurality of target areas according to the target image, the corresponding actual matrix and ideal matrix can be conveniently and rapidly identified in the subsequent adjustment process, and meanwhile, the target areas are screened by calculating corresponding area values, so that the image areas with larger difference are preferentially selected, the identification is convenient, and the processing precision is improved; and the target gray level image is cut before the matrix to be selected is determined, so that the data calculation amount in the process of determining the target area is reduced, and the data processing efficiency is improved.
Step SA3: calculating corresponding difference matrixes according to the actual matrixes and the ideal matrixes, and carrying out initial adjustment on the optical lens according to each difference matrix;
the method for calculating the difference matrix comprises the following steps:
marking the actual matrix and the ideal matrix as respectivelyAnd->The corresponding elements in the actual matrix and the ideal matrix are s respectively ij And l ij ;
Marking the element in the difference matrix as c ij The method comprises the steps of carrying out a first treatment on the surface of the According to formula c ij =s ij -l ij Calculating corresponding elements in the difference matrix; the difference matrix is。
The initial adjustment of the optical lens is carried out according to each difference matrix by utilizing the existing mathematical calculation method, the position angle and other differences of the optical lens are determined according to each difference matrix, then corresponding adjustment is carried out, if the angle of the optical lens is deflected, the actual imaging deviation is caused, the difference of the corresponding difference matrix in a certain direction is further increased, the corresponding adjustment parameters such as the adjustment angle are determined according to the size of the difference, and the adjustment is carried out according to the obtained adjustment parameters; specifically, the corresponding initial adjustment algorithm is preset by using the existing mathematical calculation mode to carry out adjustment; although the difference of the number of pixels will be caused by the difference of the resolutions, some pixels which are determined to be paired can still be identified through a plurality of difference matrixes, and the pixels which change are similar to the gray values of the adjacent pixels, so that adjustment is performed in the determination process of the actual matrixes and the ideal matrixes; the corresponding difference value of the paired pixels is obtained, and further subsequent calculation is performed; after the adjustment is completed, the corresponding difference matrix is re-acquired, whether the adjustment is needed again is analyzed, and when the initial standard is not reached, the adjustment is performed again until the initial standard is reached; the initial standard is set by staff in advance, and the current adjusting device of the finger adjusts the upper limit, namely when the upper limit is reached, the optimization is difficult to carry out, and the adjustment is stopped.
Step SA4: determining an actual imaging image, an ideal imaging image, an actual matrix and an ideal matrix after initial adjustment according to the steps SA1 to SA 3; determining corresponding actual resolution, ideal resolution, actual contrast and ideal contrast according to the actual imaging image and the ideal imaging image;
the difference matrix is a matrix after the resolution is optimized.
The calculation method of the actual contrast ratio and the ideal contrast ratio comprises the following steps:
gray processing is carried out on the actual imaging image and the ideal imaging image, a corresponding actual gray imaging image and an ideal gray imaging image are obtained, and corresponding actual resolution and ideal resolution are calculated according to the corresponding pixel number;
marking corresponding elements in the actual gray imaging image and the ideal gray imaging image as ya and yz respectively; a and z respectively represent corresponding elements in the actual gray scale imaging image and the ideal gray scale imaging image;
according to the formulaCalculating the actual contrast;
according to the formulaThe actual contrast is calculated.
Step SA5: determining a corresponding difference matrix according to the actual matrix and the ideal matrix; integrating the obtained difference matrix, the actual resolution, the ideal resolution, the actual contrast and the ideal contrast into adjustment reference data;
step SA6: and adjusting the optical lens according to the obtained adjustment reference data.
The invention can realize intelligent adjustment of the optical lens, effectively improve the adjustment precision and efficiency and reduce the adjustment cost to a greater extent; the method is convenient for most small and medium-sized micro enterprises to perform adjustment and optimization of the optical lens.
The method for adjusting the optical lens according to the adjustment reference data comprises the following steps:
analyzing according to the obtained calibration reference data to obtain a corresponding calibration target, namely, the difference to be overcome is required to be adjusted, and the difference between the actual resolution and the ideal resolution is the corresponding resolution adjustment target; determining a corresponding adjustment step according to the obtained adjustment target;
performing adjustment according to the obtained adjustment step, and obtaining a new adjustment target after adjustment; and so on, stopping the loop until the evaluation is difficult to optimize based on the current calibration equipment data;
i.e. no recirculation is performed when the calibration target has reached its accuracy range according to the calibration device data analysis.
The method for determining the adjustment step according to the adjustment target comprises the following steps:
acquiring related detail data of the adjusting equipment, such as data of the adjusting equipment components, the types, the models, the purposes, related parameters and the like of the various component equipment; integrating the data into tuning equipment data;
determining the corresponding steps for realizing the adjustment target or overcoming the related difference according to the obtained adjustment equipment data, and integrating the steps into an adjustment step; by way of example, by increasing the brightness of the light source, increasing the angle of incidence of the light, increasing the aperture of the imaging lens, etc., more light is allowed to enter the imaging system, improving the signal-to-noise ratio and contrast of the image, and thus improving the sharpness and color saturation of the image.
An optical lens adjusting system comprises a region positioning module, an initial adjusting module and an adjusting module;
the region positioning module is used for positioning the actual imaging image and the ideal imaging image and determining a corresponding actual target region and an ideal target region; and determining corresponding actual matrixes and ideal matrixes according to the actual target areas and the ideal target areas.
Setting a target object, acquiring a corresponding target image based on the target object in a preset standard environment, and determining a plurality of target areas according to the obtained target image; and performing adjustment simulation of the optical lens to obtain a corresponding actual imaging image and an ideal imaging image.
The method for determining the target area comprises the following steps:
step SC1: carrying out gray processing on the target image to form a target gray image; presetting a standard matrix template;
step SC2: extracting a plurality of matrixes to be selected from the target gray level image according to the standard matrix template, and marking the element in the matrixes to be selected as d ij The method comprises the steps of carrying out a first treatment on the surface of the i=1, 2, … …, n being a positive integer; j=1, 2, … …, m being a positive integer; the candidate matrix is marked as;
Identifying adjacent elements of each element in the matrix to be selected, and marking the adjacent elements as d ijc C=1, 2, … …, v is a positive integer, v has a value in the range of [3,8];
Step SC3: according to the formulaCalculating the area value of each matrix to be selected; wherein: QZ is the area value of the corresponding matrix to be selected;
step SC4: determining a target area according to the matrix to be selected with the largest area value, and removing the corresponding matrix to be selected from the target gray level image to form a new target gray level image;
identifying the determined number of target areas, ending analysis when the number of target areas reaches a threshold value X2, and outputting each target area; when the number of target areas does not reach the threshold value X2, the process returns to step SC2.
The method for determining the actual matrix and the ideal matrix comprises the following steps:
acquiring an actual imaging image and an ideal imaging image, and identifying an actual target area and an ideal target area corresponding to each target area in the actual imaging image and the ideal imaging image;
carrying out gray processing on images corresponding to the actual target area and the ideal target area to obtain a corresponding gray image of the actual target area and a corresponding gray image of the ideal target area;
recognizing gray values of pixels in the gray image of the target area and the gray image of the ideal target area; and generating a corresponding actual matrix and an ideal matrix according to the standard matrix template.
The initial adjustment module is used for carrying out initial adjustment on the optical lens, calculating corresponding difference matrixes according to the actual matrixes and the ideal matrixes, and carrying out initial adjustment on the optical lens according to each difference matrix.
The method for carrying out initial adjustment of the optical lens according to each difference matrix comprises the following steps:
step SD1: analyzing each difference matrix according to a preset initial adjustment algorithm, and determining corresponding adjustment parameters;
step SD2: adjusting the optical lens according to the adjustment parameters, and performing adjustment simulation on the optical lens after adjustment to obtain a corresponding actual matrix and an ideal matrix; calculating a corresponding difference matrix;
step SD3: step SD1 is returned until the estimated adjustment parameter reaches the initial standard.
Step SA4: determining an actual imaging image, an ideal imaging image, an actual matrix and an ideal matrix after initial adjustment; determining corresponding actual resolution, ideal resolution, actual contrast and ideal contrast according to the actual imaging image and the ideal imaging image;
the calculation method of the actual contrast ratio and the ideal contrast ratio comprises the following steps:
gray processing is carried out on the actual imaging image and the ideal imaging image, a corresponding actual gray imaging image and an ideal gray imaging image are obtained, and corresponding actual resolution and ideal resolution are calculated according to the corresponding pixel number;
marking corresponding elements in the actual gray imaging image and the ideal gray imaging image as ya and yz respectively; a and z respectively represent corresponding elements in the actual gray scale imaging image and the ideal gray scale imaging image;
according to the formulaCalculating the actual contrast;
according to the formulaThe actual contrast is calculated.
The adjusting module is used for adjusting after the optical lens is initially adjusted, and determining a corresponding difference matrix according to the actual matrix and the ideal matrix; integrating the obtained difference matrix, the actual resolution, the ideal resolution, the actual contrast and the ideal contrast into adjustment reference data; and adjusting the optical lens according to the obtained adjustment reference data.
The method for adjusting the optical lens according to the adjustment reference data comprises the following steps:
analyzing according to the adjustment reference data to obtain a corresponding adjustment target; determining a corresponding adjustment step according to the adjustment target;
performing adjustment according to the adjustment step, and acquiring a new adjustment target after adjustment; and so on, until the evaluation stops optimizing, the loop is stopped.
In the specific undisclosed part of this embodiment, reference is made to an embodiment of a method for adjusting an optical lens.
The above formulas are all formulas with dimensions removed and numerical values calculated, the formulas are formulas which are obtained by acquiring a large amount of data and performing software simulation to obtain the closest actual situation, and preset parameters and preset thresholds in the formulas are set by a person skilled in the art according to the actual situation or are obtained by simulating a large amount of data.
The above embodiments are only for illustrating the technical method of the present invention and not for limiting the same, and it should be understood by those skilled in the art that the technical method of the present invention may be modified or substituted without departing from the spirit and scope of the technical method of the present invention.
Claims (9)
1. A method of calibrating an optical lens, the method comprising:
step SA1: setting a target object, acquiring a corresponding target image based on the target object, and determining a plurality of target areas according to the obtained target image;
step SA2: performing adjustment simulation of the optical lens to obtain a corresponding actual imaging image and an ideal imaging image; determining a corresponding actual matrix and an ideal matrix according to each target area;
step SA3: calculating corresponding difference matrixes according to the actual matrixes and the ideal matrixes, and carrying out initial adjustment of the optical lens according to each difference matrix;
step SA4: determining an actual imaging image, an ideal imaging image, an actual matrix and an ideal matrix after initial adjustment; determining corresponding actual resolution, ideal resolution, actual contrast and ideal contrast according to the initially adjusted actual imaging image and ideal imaging image;
step SA5: determining a corresponding difference matrix according to the initially adjusted actual matrix and the ideal matrix; integrating the obtained difference matrix, the actual resolution, the ideal resolution, the actual contrast and the ideal contrast into adjustment reference data;
step SA6: and adjusting the optical lens according to the obtained adjustment reference data.
2. The method of adjusting an optical lens according to claim 1, wherein in step SA1, the method of determining the target area includes:
step SC1: carrying out gray scale processing on the target image to form a target gray scale image; presetting a standard matrix template;
step SC2: extracting a plurality of matrixes to be selected from the target gray level image according to the standard matrix template, and marking the element in the matrixes to be selected as d ij The method comprises the steps of carrying out a first treatment on the surface of the i=1, 2, … …, n being a positive integer; j=1, 2, … …, m being a positive integer; the candidate matrix is marked as;
Identifying adjacent elements of each element in the matrix to be selected, and marking the adjacent elements as d ijc C=1, 2, … …, v is a positive integer, v has a value in the range of [3,8];
Step SC3: according to the formulaCalculating the area value of each matrix to be selected; wherein: QZ is the area value of the corresponding matrix to be selected;
step SC4: determining a target area according to the matrix to be selected with the largest area value, and removing the corresponding matrix to be selected from the target gray level image to form a new target gray level image;
identifying the determined number of target areas, ending analysis when the number of target areas reaches a threshold value X2, and outputting each target area; when the number of target areas does not reach the threshold value X2, the process returns to step SC2.
3. The method according to claim 2, wherein in step SC2, the target gray-scale image is cut before determining the matrix to be selected.
4. The method of adjusting an optical lens according to claim 2, wherein in step SA2, the method of determining the actual matrix and the ideal matrix comprises:
acquiring an actual imaging image and an ideal imaging image, and identifying an actual target area and an ideal target area corresponding to each target area in the actual imaging image and the ideal imaging image;
carrying out gray processing on the images corresponding to the actual target area and the ideal target area to obtain a corresponding gray image of the actual target area and a corresponding gray image of the ideal target area;
recognizing gray values of pixels in the target area gray image and the ideal target area gray image; and generating a corresponding actual matrix and an ideal matrix according to the standard matrix template.
5. The method of adjusting an optical lens according to claim 1, wherein in step SA3, the method of calculating the difference matrix comprises:
marking the actual matrix and the ideal matrix as respectivelyAnd->The corresponding elements in the actual matrix and the ideal matrix are respectively marked as s ij And l ij The method comprises the steps of carrying out a first treatment on the surface of the i=1, 2, … …, n being a positive integer; j=1, 2, … …, m being a positive integer;
marking the element in the difference matrix as c ij The method comprises the steps of carrying out a first treatment on the surface of the According to formula c ij =s ij -l ij Calculating corresponding elements in the difference matrix; the difference matrix is。
6. The method of adjusting an optical lens as claimed in claim 5, wherein the method of performing initial adjustment of the optical lens according to each difference matrix comprises:
step SD1: analyzing each difference matrix according to a preset initial adjustment algorithm, and determining corresponding adjustment parameters;
step SD2: adjusting the optical lens according to the adjustment parameters, and performing adjustment simulation on the optical lens after adjustment to obtain a corresponding actual matrix and an ideal matrix; calculating a corresponding difference matrix;
step SD3: step SD1 is returned until the estimated adjustment parameter reaches the initial standard.
7. The method of adjusting an optical lens as claimed in claim 1, wherein in step SA4, the actual contrast and the ideal contrast are calculated by:
gray processing is carried out on the actual imaging image and the ideal imaging image, a corresponding actual gray imaging image and an ideal gray imaging image are obtained, and corresponding actual resolution and ideal resolution are calculated according to the corresponding pixel number;
marking corresponding elements in the actual gray imaging image and the ideal gray imaging image as ya and yz respectively; a and z respectively represent corresponding elements in the actual gray scale imaging image and the ideal gray scale imaging image;
according to the formulaCalculating the actual contrast;
according to the formulaThe actual contrast is calculated.
8. The method of adjusting an optical lens according to claim 1, wherein in step SA6, the method of adjusting an optical lens according to adjustment reference data comprises:
analyzing according to the adjustment reference data to obtain a corresponding adjustment target; determining a corresponding adjustment step according to the adjustment target;
performing adjustment according to the adjustment step, and acquiring a new adjustment target after adjustment; and so on, until the evaluation stops optimizing, the loop is stopped.
9. An optical lens adjustment system, characterized in that an optical lens adjustment method according to any one of claims 1 to 8 is performed, comprising: the device comprises a region positioning module, an initial adjusting module and an adjusting module;
the region positioning module is used for positioning the actual imaging image and the ideal imaging image and determining a corresponding actual target region and an ideal target region; determining a corresponding actual matrix and an ideal matrix according to the actual target area and the ideal target area;
setting a target object, acquiring a corresponding target image based on the target object in a preset standard environment, and determining a plurality of target areas according to the obtained target image; performing adjustment simulation of the optical lens to obtain a corresponding actual imaging image and an ideal imaging image;
the initial adjustment module is used for carrying out initial adjustment on the optical lens, calculating corresponding difference matrixes according to the actual matrixes and the ideal matrixes, and carrying out initial adjustment on the optical lens according to each difference matrix;
the adjusting module is used for adjusting after the optical lens is initially adjusted, and determining a corresponding difference matrix according to the actual matrix and the ideal matrix; integrating the obtained difference matrix, the actual resolution, the ideal resolution, the actual contrast and the ideal contrast into adjustment reference data; and adjusting the optical lens according to the obtained adjustment reference data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410263269.2A CN117850032B (en) | 2024-03-08 | 2024-03-08 | Optical lens adjusting method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410263269.2A CN117850032B (en) | 2024-03-08 | 2024-03-08 | Optical lens adjusting method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117850032A true CN117850032A (en) | 2024-04-09 |
CN117850032B CN117850032B (en) | 2024-06-21 |
Family
ID=90536737
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410263269.2A Active CN117850032B (en) | 2024-03-08 | 2024-03-08 | Optical lens adjusting method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117850032B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118397107A (en) * | 2024-06-14 | 2024-07-26 | 北京崭珀科技有限公司 | Calibration method and system for micro lens array |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019176349A1 (en) * | 2018-03-14 | 2019-09-19 | ソニー株式会社 | Image processing device, imaging device, and image processing method |
CN111024229A (en) * | 2019-11-28 | 2020-04-17 | 天津津航技术物理研究所 | Single-chip integrated spectral imaging micro-system spectral data correction method |
CN112118388A (en) * | 2020-08-04 | 2020-12-22 | 绍兴埃瓦科技有限公司 | Image processing method, image processing device, computer equipment and storage medium |
CN112393882A (en) * | 2020-04-21 | 2021-02-23 | 哈尔滨工业大学 | Fly-eye imaging adjusting method based on micro-imaging micro-lens parameter detection |
CN113156659A (en) * | 2021-04-16 | 2021-07-23 | 京东方科技集团股份有限公司 | Micro-lens array, pixel island 3D display device and preparation method thereof |
-
2024
- 2024-03-08 CN CN202410263269.2A patent/CN117850032B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019176349A1 (en) * | 2018-03-14 | 2019-09-19 | ソニー株式会社 | Image processing device, imaging device, and image processing method |
CN111024229A (en) * | 2019-11-28 | 2020-04-17 | 天津津航技术物理研究所 | Single-chip integrated spectral imaging micro-system spectral data correction method |
CN112393882A (en) * | 2020-04-21 | 2021-02-23 | 哈尔滨工业大学 | Fly-eye imaging adjusting method based on micro-imaging micro-lens parameter detection |
CN112118388A (en) * | 2020-08-04 | 2020-12-22 | 绍兴埃瓦科技有限公司 | Image processing method, image processing device, computer equipment and storage medium |
CN113156659A (en) * | 2021-04-16 | 2021-07-23 | 京东方科技集团股份有限公司 | Micro-lens array, pixel island 3D display device and preparation method thereof |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118397107A (en) * | 2024-06-14 | 2024-07-26 | 北京崭珀科技有限公司 | Calibration method and system for micro lens array |
Also Published As
Publication number | Publication date |
---|---|
CN117850032B (en) | 2024-06-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111007661B (en) | Microscopic image automatic focusing method and device based on deep learning | |
CN110059586B (en) | Iris positioning and segmenting system based on cavity residual error attention structure | |
US6768509B1 (en) | Method and apparatus for determining points of interest on an image of a camera calibration object | |
CN103093215B (en) | Human-eye positioning method and device | |
CN113592911B (en) | Apparent enhanced depth target tracking method | |
CN108537751B (en) | Thyroid ultrasound image automatic segmentation method based on radial basis function neural network | |
CN109345597B (en) | Camera calibration image acquisition method and device based on augmented reality | |
CN110363196B (en) | Method for accurately recognizing characters of inclined text | |
CN117850032B (en) | Optical lens adjusting method and system | |
CN112365497A (en) | High-speed target detection method and system based on Trident Net and Cascade-RCNN structures | |
CN114764189A (en) | Microscope system and method for evaluating image processing results | |
CN117970595A (en) | Microscope automatic focusing method based on deep learning and image processing | |
CN112381751A (en) | Online intelligent detection system and method based on image processing algorithm | |
CN118134818B (en) | Scanning and AI fluorescent image processing method based on fluorescent slide and application thereof | |
CN117392127B (en) | Method and device for detecting display panel frame and electronic equipment | |
CN116681879B (en) | Intelligent interpretation method for transition position of optical image boundary layer | |
CN112468721A (en) | Visual acquisition method and device with automatic focusing function | |
CN117495827A (en) | Image evaluation method based on skin detector | |
Zhao et al. | A Practical Unified Network for Localization and Recognition of Arbitrary-oriented Container code and type | |
CN212646436U (en) | Artificial board surface flaw detection device | |
CN114120318A (en) | Dark field image target point accurate extraction method based on integrated decision tree | |
CN114358131A (en) | Digital photo frame intelligent photo optimization processing system | |
CN118397621B (en) | Multi-focal length embryo cell prokaryotic detection method based on optical flow feature fusion | |
CN117809162B (en) | Method and device for correcting imaging non-uniformity of lens and extracting lens parameters | |
CN118196790B (en) | Chromosome split phase image screening method, system, equipment and storage medium under low power lens |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |