CN112153280B - Active alignment method applied to camera module - Google Patents

Active alignment method applied to camera module Download PDF

Info

Publication number
CN112153280B
CN112153280B CN202010906908.4A CN202010906908A CN112153280B CN 112153280 B CN112153280 B CN 112153280B CN 202010906908 A CN202010906908 A CN 202010906908A CN 112153280 B CN112153280 B CN 112153280B
Authority
CN
China
Prior art keywords
parameter
active alignment
value
image
camera
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.)
Active
Application number
CN202010906908.4A
Other languages
Chinese (zh)
Other versions
CN112153280A (en
Inventor
肖文平
程旭
石川
王立柱
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Heqian Electronic Technology Co ltd
Original Assignee
Zhejiang Heqian Electronic Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Zhejiang Heqian Electronic Technology Co ltd filed Critical Zhejiang Heqian Electronic Technology Co ltd
Priority to CN202010906908.4A priority Critical patent/CN112153280B/en
Publication of CN112153280A publication Critical patent/CN112153280A/en
Application granted granted Critical
Publication of CN112153280B publication Critical patent/CN112153280B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • H04N23/671Focus control based on electronic image sensor signals in combination with active ranging signals, e.g. using light or sound signals emitted toward objects

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

The invention provides an active alignment method applied to a camera module, which obtains the parameters of the optimal CMOS chip and ISP chip by adjusting the parameter of the CMOS chip and/or ISP chip of the camera to be matched with an active alignment graphic card and/or illumination environment in the active alignment process, wherein the matching process comprises the step of skipping to execute the image analysis of a calculation area or the real-time MTF calculation result analysis or the process of judging the optimal active alignment parameter to meet the preset condition so as to obtain the optimal active alignment parameter according to the quality analysis of an imaging image after continuously adjusting the parameters of the CMOS chip and/or ISP chip of the camera. By applying the technical scheme provided by the invention, the problem that in the prior art, when the LENS, CMOS and ISP matching types of different cameras are different or the illumination environment is different, the calculation precision of active alignment is greatly influenced, so that the imaging difference of the produced cameras is increased is solved.

Description

Active alignment method applied to camera module
Technical Field
The invention relates to the field of cameras, in particular to an active alignment method applied to a camera module.
Background
With the rapid development of the internet of things and the automatic driving technology, the application of a terminal sensor, particularly an image sensor, is greatly exploded, and the requirements of an on-vehicle camera and a wide-angle camera on the application are sharply improved. Meanwhile, the application of the camera is not limited to the field that images displayed on a display screen are used for subjectively observing the environment and more images are applied to image processing, recognition and the like, and the requirement of higher precision is put forward on the definition and consistency of the camera. Active Alignment (AA) production technology, called Active Alignment for short, comes to light under the demand, the Active Alignment technology automatically aligns the focal length and the optical axis of the camera and the focal plane by using image information acquired by the camera through a fine automatic assembly technology, greatly improves the definition and the optical axis Alignment precision of the camera relative to a manually assembled lens, reduces the inclination degree of the focal plane, greatly improves the image acquisition quality and the consistency of the camera, and an Active Alignment logic generally runs on an industrial control computer.
The existing active alignment technology is gradually developed, but due to the LENS, CMOS and ISP matching of different cameras, the difference of the image quality of the cameras is large, meanwhile, the difference of the active alignment environment is also large, the calculation precision of the active alignment is greatly influenced, the active alignment is carried out on the same module for many times, the difference of the final result of the active alignment is often caused due to the reasons, the imaging is obviously zoomed, the image is displaced, and the like, so that the imaging performance consistency of the finally produced camera is reduced, and the subsequent products are influenced on the high-precision image processing application. In the prior art, in order to improve the active alignment quality of different camera modules, active alignment equipment suppliers or module manufacturers often need to manually debug in advance for active alignment of different camera products, active alignment graphic cards are replaced according to the characteristics of cameras, the field illumination environment is adjusted and the like, so that the image quality of an active alignment calculation area can reach the best active alignment result, new requirements are brought to the material and diversity of the active alignment graphic cards and the diversity of illumination elements, higher requirements are provided for the professional of active alignment equipment debugging personnel, and the situation that the active alignment equipment debugging personnel can be stabilized due to repeated debugging of the difference of knowledge surfaces and trial production for many times often occurs. In the prior art, many attempts have been made to solve the problem, for example, patent 201610698589.6 discloses a multi-axis active alignment method for a mobile phone camera module, which calculates the deviation between the center of a lens and the center of a bottom plate of an image sensor in the X-Y direction according to the measured optimal image quality index values in all preset image local measurement areas; calculating the step number of a motor for controlling the lens to move in the X-Y direction; changing the position of the lens along the Z-axis direction, and recording the position of the lens after each change and the picture shot by the imaging system at the position on the image detection plate; calculating the corresponding lens position when the image quality index of the preset image local measurement area in all the obtained photos is optimal, and calculating the difference value between the lens position and the image center position when the optimal image quality index is obtained; according to the distance difference, the number of steps of a motor for controlling the rotation of the lens required by the parallel lens is calculated, the motor is moved to correct the inclination of the lens, however, a special customized active alignment chart matched with the module needs to be replaced aiming at camera modules of different manufacturers or camera groups of different models, and in addition, when the illumination environment of the active alignment process is changed, the precision of the assembled camera module is low. In order to solve the defects of the existing active alignment technology, the invention provides an improved method of the active alignment technology, so as to solve the technical problems of the existing active alignment technology.
Disclosure of Invention
In order to solve the technical defects in the prior art, the invention provides an active alignment method applied to a camera module, which comprises the following steps:
the parameters of the CMOS chip and/or ISP chip of the camera are adjusted to be matched with the active alignment graphic card and/or the illumination environment in the active alignment process, so that the parameters of the optimal CMOS chip and the optimal ISP chip are obtained;
the adapting comprises: acquiring conditions of an active alignment scene and an illumination environment, and when the preset conditions are not met in the process of analyzing the image of a calculation area or analyzing the real-time MTF calculation result or judging the optimal active alignment parameter, skipping to execute the process of analyzing the image of the calculation area or analyzing the real-time MTF calculation result or judging the optimal active alignment parameter to meet the preset conditions after continuously adjusting the parameters of a CMOS chip and/or an ISP chip of a camera so as to complete adaptation.
An active alignment method applied to a camera module, further, the conditions of the actively aligned scene and the illumination environment include:
the active alignment station is wrapped by a diffuse reflection material; the active alignment graphic card is made of diffuse reflection materials.
An active alignment method applied to a camera module, further, the conditions of the actively aligned scene and the illumination environment include:
carrying out laser centering on the positive center of the graphic card and the positive center of the lens by adopting a laser instrument;
after the active alignment chart is imaged by the camera, an included angle theta formed by the inclined edge of the MTF calculation area on the image and the vertical direction or the horizontal direction is 2-10 degrees.
An active alignment method applied to a camera module, further, actively aligning image analysis parameter indexes of each calculation area comprises the following steps: the image analysis sequence number SN, the average value BA and the average value WA of the corresponding gray level image of the calculated area image, the average value MSE of the image analysis reference value, the overall average value MTA and one or more of the upper and lower limit difference values MTS of the confidence interval.
An active alignment method applied to a camera module further comprises a step S23 that if the WA value of any image in each calculated area reference image is higher than a set threshold thre _ WA or the BA value is lower than a set threshold thre _ BA, the image quality of the calculated area is considered not to meet the preset condition;
step S24: if the image quality of the calculation area does not meet the preset condition, adjusting the parameters of a camera CMOS and an ISP by adopting a hardware communication interface switching module; and if the image quality of the calculation area meets the requirement, analyzing the MTF calculation result in real time, and recording the mean value MSE of the standard deviation of each calculation area image calculated at this time, WA and BA of the image of the center active alignment calculation area and the corresponding SN thereof.
An active alignment method applied to a camera module, further, real-time MTF calculation result analysis comprises:
step S31, obtaining an MTF curve, solving the MTF50, defining the MTF50 as the resolving capability MT of the current image of the camera, counting the distribution probability function p (MT) of the MTF curve, and obtaining the overall average value MTA of p (MT) and the upper and lower limit difference value MTS of the confidence interval;
step S32, if the current MT value is larger than 0.5, the parameter adjustment of the camera CMOS and ISP is realized by adopting a hardware communication interface switching module; otherwise, the MTA and MTS recorded by the current SN serial number are used for judging the optimal active alignment parameter.
An active alignment method applied to a camera module, further, the decision of the optimal active alignment parameter comprises: defining the first optimal condition as: there are MTS value less than the set threshold thre _ MTS and WA value greater than the set threshold thre _ WA1 and less than thre _ WA2, and MTA greater than thre _ MTA while MSE is less than the set threshold thre _ MSE;
s41, traversing the calculation data corresponding to each SN sequence number: MSE, WA, BA, MTA, MTS; if the result in the calculated data meets the first optimal condition, recording the currently traversed SN sequence number SN _ CHS; and extracting the finally judged parameters of the CMOS chip and/or the ISP chip of the camera corresponding to the serial number SN _ CHS as the optimal active alignment parameters.
An active alignment method applied to a camera module, further, the decision of the optimal active alignment parameter comprises:
in the first mode, if the SN reaches the set threshold thre _ SN or the configuration serial number m in the analog gain configuration table is equal to AN, traversing all the calculation data corresponding to the SN serial numbers: MSE, WA, BA, MTA, MTS; if the MTS value is smaller than the set threshold thre _ MTS and the WA value is larger than the set threshold thre _ WA1 in the calculation data, selecting the SN sequence number SN _ CHS with the maximum MTA; and extracting the finally judged camera CMOS chip and/or ISP chip corresponding to the serial number SN _ CHS as the optimal active alignment parameter.
An active alignment method applied to a camera module, further, the decision of the optimal active alignment parameter comprises: in the second mode, if the SN reaches a set threshold value thre _ SN or the configuration serial number m in the analog gain configuration table is not equal to AN, the SN is added by 1, and the parameter configuration of the camera CMOS chip and/or the ISP chip is realized by adopting a hardware communication interface switching module.
An active alignment method applied to a camera module, further, the decision of the optimal active alignment parameter comprises: and traversing all the calculated data corresponding to the SN sequence numbers in the mode III: MSE, WA, BA, MTA, MTS; if the MTS value is smaller than the set threshold thre _ MTS and the WA value is larger than the set threshold thre _ WA1 in the calculation data, selecting the SN sequence number SN _ CHS with the maximum MTA; and extracting the finally judged parameters of the CMOS chip and/or the ISP chip of the camera corresponding to the serial number SN _ CHS as the optimal active alignment parameters.
An active alignment method applied to a camera module further comprises the following steps that when the obtained image analysis parameter indexes of each calculation area do not meet a mode I, a mode II and a mode III, the judgment sequence of the optimal active alignment parameter comprises the following steps: preferentially selecting the SN serial number SN _ CHS with the minimum MTS under the condition that the MTA is larger than the set threshold thre _ MTA and the MSE is smaller than the set threshold thre _ MSE; secondly, selecting an SN serial number SN _ CHS with the minimum MTS under the condition that the MTA is larger than a set threshold value thre _ MTA; finally, selecting an SN serial number SN _ CHS corresponding to the MSE minimum value;
and extracting the finally judged camera CMOS chip parameter and ISP chip parameter corresponding to the serial number SN _ CHS as the optimal active alignment parameter.
An active alignment method applied to a camera module, further, adjusting parameters of a camera CMOS chip and/or an ISP chip comprises: according to the parameters calculated by the acquired image of the active alignment area, the parameter adjustment of the CMOS chip comprises the following steps: adjusting one or more of an exposure register parameter table, an analog gain register parameter table and a digital gain register parameter table; the parameter adjustment of the ISP chip comprises the following steps: sharpening function register parameter table, exposure function register parameter table, digital gain function register parameter table, gamma configuration register parameter table.
An active alignment method applied to a camera module, further, a gamma configuration parameter table comprises gm group gamma parameter register addresses and corresponding gamma parameters, and the corresponding gamma curve warpage is arranged from steep to moderate;
or the exposure parameter configuration table comprises the addresses of the exposure parameter registers and the values of the EN group exposure time parameters, and the exposure time is arranged from long to short in sequence;
or the gain parameter configuration table comprises analog gain parameter addresses and AN group analog gain values, and the analog gain values are arranged from large to small in sequence.
An active alignment method applied to a camera module further comprises the following steps of if the image quality of a first calculation area does not meet the requirement, adjusting camera CMOS and ISP parameters: configuring a parameter configuration table for closing automatic exposure and gain, reading an exposure gain parameter value from an exposure gain parameter address and recording the exposure gain parameter value as exp _ ini, selecting a transfer configuration value exp _ cur according to the currently recorded exposure gain parameter exp _ ini, sequentially comparing the exp _ ini with EN exposure gain parameter values in the exposure parameter configuration table, and if the nth exposure parameter value is less than or equal to exp _ ini, determining the exposure parameter value as exp _ cur.
An active alignment method applied to a camera module further comprises the following steps of if the image quality of a non-first-time calculation area does not meet the requirement, adjusting camera CMOS and ISP parameters: if WA is higher than thre _ WA, selecting the exposure parameter value in the exposure parameter configuration table corresponding to the min { n + exp _ step, EN } number as the adjusted transfer configuration value exp _ cur, and updating the value of n as min { n + exp _ step, EN }, wherein exp _ step is the set sequence number jump step.
An active alignment method applied to a camera module further comprises the following steps of if the image quality of a non-first-time calculation area does not meet the requirement, adjusting camera CMOS and ISP parameters: if BA is lower than the set threshold value thre _ BA, selecting the exposure parameter value in the exposure parameter configuration table corresponding to the max { n-exp _ step,1} th sequence number as the adjusted transfer configuration value exp _ cur, and updating the value of n as n-exp _ step, wherein exp _ step is the set sequence number jump step length.
An active alignment method applied to a camera module, further, parameter adjustment of a camera CMOS chip and/or an ISP chip comprises the following steps: the jumping times are N, and the initial value is 1; and configuring a configuration table for closing sharpening, configuring an Nth group of gamma curve related registers, recording the configuration of the gamma curve related registers corresponding to the current N, the configuration for closing sharpening and the current corresponding SN serial number, and carrying out active alignment calculation area image analysis by adding 1 to N.
An active alignment method applied to a camera module, further, if the image quality of a first calculation area does not meet the requirement, the adjustment of camera CMOS and ISP parameters comprises the following steps: the initial gain parameter serial number m is 1, the analog gain parameter currently records a first analog gain parameter value from the analog gain parameter list as a gain transmission configuration parameter alg _ cur, and records the first analog gain parameter value into the currently corresponding SN serial number, and configures the alg _ cur to a gain configuration address;
an active alignment method applied to a camera module further comprises the following steps of if the image quality of a non-first-time calculation area does not meet the requirement, adjusting camera CMOS and ISP parameters: selecting AN analog gain value with the sequence number min { m + alg _ step, AN } in a gain parameter configuration table as a gain transmission configuration parameter alg _ cur, updating the value of m to min { m + alg _ step, AN }, wherein alg _ step is AN artificially set sequence number jump step length, recording the adjusted alg _ cur and the current corresponding SN sequence number, configuring alg _ cur to a gain configuration address, and then entering the image analysis of AN active alignment calculation region.
Has the advantages that:
1. according to the technical scheme provided by the invention, when the image quality of the area involved in active alignment does not meet the preset condition or the MTF calculation result analysis does not meet the preset condition or the active alignment parameter does not meet the preset condition, the parameters of the assembled camera CMOS chip and/or ISP chip are configured in real time to enable the camera CMOS chip and/or ISP chip to meet the imaging requirement, the active alignment can be automatically realized, and the problem that the traditional active alignment method needs to replace an active alignment graphic card and adjust the active alignment illumination environment to manually adjust the active alignment graphic card according to the production properties of different types of lenses and CMOS chips or different batches of lenses is solved.
2. In the technical scheme provided by the invention, an MTF curve of the camera is calculated according to the blade edge image of the active alignment calculation area acquired by the camera, and the resolution capability of the current image of the camera is defined by MTF50, wherein the MTF50 is the value of the corresponding abscissa when the ordinate of the MTF curve is 0.5, and is recorded as MT. And multiplying the MT by 100, and performing subsequent parameter operation by using the MT to avoid the deviation of a calculation result from a true value caused by noise or certain disturbance, so that the error can be reduced.
3. In the active alignment, through the calculation processing of the image, the image analysis serial number SN, the mean BA and the mean WA of the corresponding gray-scale image of the calculation area image, the mean MSE of the image analysis reference value, the overall mean MTA, and the upper and lower limit difference value MTS of the confidence interval are obtained, through the solving of the values among the parameters, the corresponding interval range is set according to the solved values, and the parameters of the CMOS chip and the ISP chip are performed according to whether the solved parameter value range and the set interval range satisfy the conditions, so that the cycle is performed until the optimal active alignment parameter is obtained.
4. The traditional technology only calculates the value of MTF, and then adjusts the degree of freedom in X, Y, Z and other directions according to the value of MTF so as to completely and actively align, but the MTF is only one aspect, and when a blade edge image receives interference or non-blade edge image information appears, the parameter that the MTF obtains the value to adjust the position and angle between a lens barrel of a camera module and a PCB (on the PCB board mounted when a CMOS chip and an ISP chip) is deviated or even if aligned, poor quality is finally obtained. The invention fully considers the calculated values of the images of each area at different stages, and adjusts the configuration parameters of the CMOS chip and the ISP chip at different stages according to the calculated values, so that the CMOS chip and the ISP chip can obtain better imaging effect, and the imaging performance difference degree of the finally produced camera is increased, thereby reducing the influence on subsequent products on high-precision image processing application.
5. The modules of the existing camera are provided by different manufacturers, and due to the difference of LENS, CMOS and ISP matching types of different cameras, the difference of image quality of the camera is large, and meanwhile, the difference of an active alignment environment is also large, so that the calculation precision of the active alignment is greatly influenced. Multiple active alignments are performed on the same module, often resulting in differences in the final results of the active alignments due to the above reasons. If the imaging has obvious zooming, the image has displacement and the like, the imaging performance consistency of the finally produced camera is reduced, and when the preset conditions are not met in different stages, the method provided by the invention comprises the following steps: when the image quality of the area involved in active alignment does not meet the preset condition or the MTF calculation result analysis does not meet the preset condition or the active alignment parameter does not meet the preset condition, the parameters of a CMOS chip and/or an ISP chip of the camera for assembly are configured in real time, and the LENS, the CMOS and the ISP are optimally matched, so that the problems are avoided.
6. The invention calculates the value of the image area according to different threshold conditions and then gradually adopts the optimization principle to judge the optimal active alignment parameter so as to obtain the optimal adaptation, thereby avoiding the need of manual debugging after the picture card is replaced or the illumination environment is adjusted.
7. Traditional active alignment station flow: after the tray flows into the center, the thimble is electrified, the lens is automatically clamped, active alignment action, UV curing, NG judgment and tray outflow are carried out, and aiming at the traditional station process, in the parameter modulation stage, the UV curing, NG judgment and tray outflow are cancelled, and active alignment of image analysis of each calculation area is increased. The active alignment station process is modified only by enabling and adjusting the existing functions and steps of the active alignment equipment provider in the active alignment software and adding the image analysis logic of each calculation area in active alignment.
8. After configuring parameters for CMOS \ ISP, the configuration parameters are sent to a CMOS chip or an ISP chip at one time according to a CMOS \ ISP configuration protocol, and after each parameter is configured, the configuration parameters are confirmed to be issued to a target address of a device in a mode of reading back the parameters. Whether the parameters of the configuration are changed or not is confirmed again through a read-back mode, and the technical problem that the parameters of the configuration may not be changed due to the specificity of the device at present is solved.
9. According to the technical scheme, black flannelette or a curtain is selected as the diffuse reflection material, so that light is prevented from being reflected for multiple times in a station, and therefore illumination is not uniform in a part of the area actively aligned with the graph card. The laser instrument is adopted to carry out laser accurate centering on the positive center of the graphic card and the positive center of the lens, so that the offset between the center of the lens and the center of the actual graphic card is reduced, and the technical problem of inconsistent image quality under equivalent active alignment parameters is solved.
Drawings
The following drawings are only schematic illustrations and explanations of the present invention, and do not limit the scope of the present invention.
Fig. 1 is a schematic flow chart illustrating the adjustment of parameters of a CMOS chip and an IPS chip of a camera in an active alignment process according to an embodiment of the present invention.
FIG. 2 is an image of a card made of different reflective materials according to an embodiment of the present invention, and FIG. 2a is a schematic diagram of an active alignment calculation region affected by a reflection of a surrounding scene by the reflective material card; fig. 2b is a schematic diagram of an active alignment calculation area of a diffuse reflection material card under the condition that the diffuse reflection material wraps an active alignment station.
Fig. 3 is a schematic diagram illustrating adjustment and correction of lens module shift in an active alignment process according to an embodiment of the present invention, fig. 3a is an adjustment of CMOS mounting shift, and fig. 3b is an adjustment of lens barrel mounting shift.
FIG. 4 is a schematic diagram illustrating an embodiment of the present invention in which the active alignment process cannot be adjusted to correct assembly errors.
FIG. 5 is a flowchart illustrating an image analysis process for actively aligning each calculation region according to an embodiment of the present invention.
Fig. 6 is a process of processing a calculated area image in active alignment according to an embodiment of the present invention, in which fig. 6a is a gray-scale image, fig. 6b is a binary image, and fig. 6c is a reference image formed after processing.
FIG. 7 is a diagram illustrating MT values in an active alignment image according to an embodiment of the present invention.
FIG. 8 is a graph of the relationship between the image of the probability distribution function p (MT) and MT according to an embodiment of the present invention.
Fig. 9 is a flowchart illustrating an exemplary active alignment parameter determination process according to an embodiment of the present invention.
Fig. 10 is an image contrast of turning the ISP sharpening function off or on in an embodiment of the present invention, fig. 10a is an image with the sharpening function off, and fig. 10b is an image with the sharpening function on.
FIG. 11 is a schematic diagram of a first set of gamma curves when the image quality of the N (N >1) th calculated region does not meet the requirement in an embodiment of the present invention.
FIG. 12 is a schematic diagram of a second set of gamma curves when the image quality of the N (N >1) th calculated region does not meet the requirement in an embodiment of the present invention.
FIG. 13 is a schematic diagram of the gamma curve of the gm group when the image quality of the N (N >1) th calculation region does not meet the requirement in the embodiment of the present invention.
FIG. 14 is a flowchart illustrating the operation of the calibrated active alignment device according to an embodiment of the present invention.
Detailed Description
For a more clear understanding of the technical features, objects, and effects herein, embodiments of the present invention will now be described with reference to the accompanying drawings, in which like reference numerals refer to like parts throughout. For the sake of simplicity, the drawings are schematic representations of relevant parts of the invention and are not intended to represent actual structures as products. In addition, for simplicity and clarity of understanding, only one of the components having the same structure or function is schematically illustrated or labeled in some of the drawings.
As for the control system, the functional module, application program (APP), is well known to those skilled in the art, and may take any suitable form, either hardware or software, and may be a plurality of functional modules arranged discretely, or a plurality of functional units integrated into one piece of hardware. In its simplest form, the control system may be a controller, such as a combinational logic controller, a micro-programmed controller, or the like, so long as the operations described herein are enabled. Of course, the control system may also be integrated as a different module into one physical device without departing from the basic principle and scope of the invention.
The term "connected" in the present invention may include direct connection, indirect connection, communication connection, and electrical connection, unless otherwise specified.
Specifically, the embodiment provides an active alignment method applied to a camera module, including:
the parameters of the CMOS chip and/or ISP chip of the camera are adjusted to be matched with the active alignment graphic card and/or the illumination environment in the active alignment process, so that the parameters of the optimal CMOS chip and the optimal ISP chip are obtained;
the adapting comprises: acquiring conditions of an active alignment scene and an illumination environment, and when the preset conditions are not met in the process of analyzing the image of a calculation area or analyzing the real-time MTF calculation result or judging the optimal active alignment parameter, skipping to execute the process of analyzing the image of the calculation area or analyzing the real-time MTF calculation result or judging the optimal active alignment parameter to meet the preset conditions after continuously adjusting the parameters of a CMOS chip and/or an ISP chip of a camera so as to complete adaptation.
Specifically, referring to fig. 1, it can be seen that the process of adaptation is continuously attempted, and at different stages, according to the result analysis, when the preset condition is not satisfied, the parameter adjustment of the CMOS chip and/or the ISP chip needs to be performed, and then the process is cycled until the optimal active alignment parameter is obtained.
Conditions of the actively aligned scene and lighting environment include:
wrapping the actively aligned station with a black diffuse reflection material; the graph card material of the active alignment adopts a diffuse reflection material graph card.
The diffuse reflection material can be black flannelette or a curtain, so that light rays are prevented from being reflected for multiple times in a station, and illumination of partial areas of the active alignment chart is not uniform;
the diffuse reflection material graphic card is adopted to avoid the phenomenon that the graphic card reflects an image of a lighting device or an image of an active alignment device under illumination, so that image information of non-edge appears in an active alignment calculation area, the reflection material graphic card reflects surrounding scenes to influence the situation of the active alignment calculation area as shown in fig. 2a, and the diffuse reflection material graphic card only has edge information in the active alignment calculation area as shown in fig. 2b under the condition that the diffuse reflection material wraps an active alignment station.
Carrying out laser accurate centering on the positive center of the graphic card and the positive center of the lens by adopting a laser instrument;
as shown in fig. 3a and 3b, when there is a CMOS mounting position shift or a lens barrel shift during the assembly process, the active alignment requires moving and rotating lens to correct the influence of the error on the optical path, and the range of the movement between the actual lens barrel and the lens is very small, when the feeding error is controlled within a certain range, the degree of freedom of the active alignment can meet the production requirement, in which case if other production or mounting errors are introduced, the degree of freedom of one side is not enough to meet the accuracy of the active alignment assembly. When all modules are in the correct position for adjustment, some camera module images in certain batches after active alignment still have certain errors, which affect the active alignment assembly accuracy as shown in fig. 4. After a lot of experiments and data analysis, the inventor finds that the reason is caused by inaccurate alignment of the active alignment chart and the camera module. In order to solve the problem, the invention adopts the laser instrument to carry out laser accurate centering on the positive center of the graphic card and the positive center of the lens, and can reduce the offset of the lens center and the actual graphic card center, thereby solving the problem.
Specifically, by rotating the card so that the edge of the active alignment calculation region where the image is acquired forms an angle θ, the value of θ can be within 2-10 degrees of vertical or horizontal offset.
The calculation of MTF (modulation Transfer function) is carried out by adopting a card edge area, MTF calculation methods integrated by different active alignment equipment suppliers are diversified for the performance of the edge, and the angle of the edge has correlation on the actual fit with the MTF calculation method, so that the MTF convergence is better for a certain rotation angle range. Therefore, the graph card is rotated to enable the edge of the active alignment calculation area of the collected image to form an angle theta, so that the MTF calculation accuracy is higher, the specific theta value can be within the range of 2-10 degrees of vertical or horizontal deviation, and a better effect can be obtained.
At least 2 surface array light sources are adopted for active alignment;
calculating the image quality of the area involved in the active alignment, specifically comprising:
referring to fig. 5, after the tray flows into the rear thimble, the thimble is powered on, the lens is automatically clamped, active alignment action is carried out, the images of all calculation areas are actively aligned for analysis, and the active alignment action and the analysis of the images of all calculation areas are repeatedly carried out;
actively aligning the image analysis parameter indexes of each calculation area comprises the following steps: the image analysis sequence number SN, one or more of the average value BA and the average value WA of the corresponding gray level image of the calculated area image, the image analysis reference value MSE, the overall average value MTA and the upper and lower limit difference value MTS of the confidence interval;
specifically, the present embodiment changes the conventional active alignment station process: after the tray flows into the rear thimble, the thimble is electrified, the lens is automatically clamped, active alignment action, UV curing, NG judgment and tray outflow are carried out, and aiming at the traditional station flow, in the parameter modulation stage, the UV curing, NG judgment and tray outflow are cancelled, and active alignment of image analysis of each calculation area is increased.
The active alignment station process is modified only by enabling the existing functions of the active alignment equipment provider in the active alignment software, adjusting the existing steps and adding the image analysis process of each calculation area in active alignment.
As shown in fig. 6a to 6c, in the analysis process of the image of each calculation region for active alignment, the image of the calculation region for active alignment is first converted into a gray scale map, and as shown in fig. 6a, the formula can be adopted:
Y=0.299R+0.567G+0.114B
where Y is the image gray scale and R, G, B are the red, green, and blue components of the image, respectively.
Then, binarizing the gray map of the active alignment calculation region, as shown in fig. 6b, an adaptive binarization method such as the Otsu method can be adopted, first, a gray threshold T is selected, the total number of pixel points P _ SUM in the active alignment calculation region is recorded, and the gray image is defined as P, PiIs the gray value of pixel i.
Recording the number P of pixels with the gray value less than T in the active alignment calculation regionLT
Figure BDA0002657943360000131
And its average gray value ALT
Figure BDA0002657943360000132
Wherein P isjCalculating the gray value of the pixel with the gray value smaller than T in the active alignment area; recording the number P of pixels with the gray value more than or equal to T in the active alignment calculation areaGT
Figure BDA0002657943360000133
And its average gray value AGT
Figure BDA0002657943360000134
Wherein P iskThe gray values of pixels in the area with the gray values larger than or equal to T are calculated for the active alignment.
Calculating the inter-class variance CV corresponding to the gray threshold TT
CVT=PLTPGT(ALT-AGT)2
Traversing all the gray level threshold values, and finally obtaining a binarization threshold value TB which is the gray level threshold value corresponding to the maximum inter-class variance and meets the formula
Figure BDA0002657943360000141
Wherein A isGTIs WA, ALTNamely BA. Will PjAssigned as BA, PkThe value is assigned WA, i.e. a reference image Ref is obtained, as shown in fig. 6 c.
FIG. 6 is a reference image, which can be used to obtain the image analysis reference value of each calculation region idv of active alignment according to the standard deviation formula
Figure BDA0002657943360000142
Then calculating the mean value of the image analysis reference values of all the calculation areas, wherein area _ num is the number of the active alignment calculation areas
Figure BDA0002657943360000143
Recording MSE (with SN initial value of 1) according to current SN serial numberSNCentering the WA of the active alignment calculation areaSN
Specifically, if any one of the active alignment calculation regions:
WA>thre_WA||BA<thre_BA
the image quality of the calculated area is considered to not meet the preset condition, the real-time configuration of the CMOS and the ISP of the camera is realized by adopting a hardware communication interface switching module, the reason is that if the white area is over-exploded or the black area is over-dark, the real image information is annihilated, the error of the subsequent MTF calculation result is larger, the real image information can be more correctly acquired by adjusting the configuration parameters of the CMOS and the ISP, and the error of the subsequent MTF calculation result is reduced; otherwise, the image quality of the calculation area is considered to meet the requirement, and real-time MTF calculation result analysis is carried out.
The real-time MTF calculation result analysis specifically comprises the following steps:
and calculating an MTF curve of the camera according to the edge image of the AA calculation area acquired by the camera, and defining the resolution capability of the current image of the camera by using the MTF50, wherein the ordinate of the MTF curve is an MTF value, the effective range is [0, 1], the abscissa is an effective range of the resolution power of the camera [0, 0.5], and the abscissa unit is cy/px. The camera resolution MTF50 is a value of an abscissa corresponding to the MTF curve with the ordinate of 0.5;
calculating an image of an AA calculation area acquired by each frame of camera to calculate MTF50, selecting the maximum MTF50 as the basis for finishing the AA movement during the AA movement, finally obtaining the final MTF50, and multiplying the value MT value of the horizontal coordinate camera resolution force by 100 for expanding the calculation value range;
setting a statistical time length as T1, continuously counting MT values of each frame of image in T1 and multiplying by 100 after the AA motion is completed, acquiring f-15 frames of images within 1s after the AA motion is completed, wherein the central AA calculation area of each image has values of 2 MT multiplied by 100, and obtaining values of 2 f fn multiplied by 100, which are MT _1, MT _2, … … and MT _ fn respectively, and the MT values are distributed in a certain range due to image noise, as shown in Table 1-1 and FIG. 7.
TABLE 1-1_ MT distribution of values
MT_1 MT_2 MT_3 MT_4 MT_5 MT_6 MT_7 MT_8 MT_9 MT_10
37.6 38.7 38.2 37.4 36.1 36.4 36.1 36.9 34.0 34.7
MT_11 MT_12 MT_13 MT_14 MT_15 MT_16 MT_17 MT_18 MT_19 MT_20
37.9 33.2 36.5 35.6 34.5 32.8 34.4 34.8 32.0 35.3
MT_21 MT_22 MT_23 MT_24 MT_25 MT_26 MT_27 MT_28 MT_29 MT_30
33.3 34.8 35.6 33.1 34.4 35.7 31.3 37.0 39.8 36.9
The probability distribution function p (MT) is obtained by taking the MT value as the abscissa and the number of occurrences of the value as the ordinate, as shown in fig. 8.
Calculating the mean MTA and the mean square deviation MTD thereof according to the following formula, selecting a confidence coefficient 1.96 corresponding to the confidence coefficient of 95% to calculate the error range VAR, and obtaining the upper and lower limit difference MTS of the confidence interval:
Figure BDA0002657943360000161
MTS=2×VAR
MTF calculation result definition: the preset conditions are as follows: when the value of MT is greater than 0.5, that is, when MT is less than 0.5, the calculation result of MTF does not satisfy the preset condition, and adjustment is required.
If the current MT value is larger than 0.5, a hardware communication interface switching module is adopted to realize real-time configuration of a camera CMOS chip and an ISP chip;
if the MT values are all within 0.5, the current MTF value has reference significance, and therefore the MTA is recorded according to the current SN sequence numberSN、MTSSNJudging whether the active alignment parameter is the optimal active alignment parameter;
when MTF calculation is completed, judging whether the current active alignment parameter is the optimal active alignment parameter according to the obtained result;
the best AA parameter decision is: comparing the calculated values of the parameters MSE, WA and MTA with a preset threshold value, and gradually and preferably selecting the configuration parameters most suitable for AA precision according to the priority;
referring to fig. 9, fig. 9 is a flowchart for judging the optimal AA parameter, and according to the analysis of the calculation structure of the calculation area image analysis parameter and the MTF, the parameter under different conditions is selected to configure the CMOS and the ISP.
In order to select the optimal AA parameter, in this embodiment, an appropriate value is selected from a plurality of non-related parameters MES, WA, and MTA, and the first optimal condition is defined as: there are MTS value less than the set threshold thre _ MTS and WA value greater than the set threshold thre _ WA1 and less than thre _ WA2, and MTA greater than thre _ MTA while MSE is less than the set threshold thre _ MSE;
when the calculated parameters meet the first optimal condition, considering that the image quality and the calculated resolving power value reach the optimal value by the CMOS/ISP configuration parameter combination corresponding to the current SN serial number, wherein the current SN serial number is the SN _ CHS, and then, the CMOS/ISP parameter configuration is not changed;
wherein each decision threshold is an empirical threshold, thre _ mts is 0.1-0.4, thre _ mta is reduced by 0.1-0.3 according to the upper limit of the designed resolution of lens, thre _ WA1 is set to 170-190, thre _ WA2 is set to 210-240, and thre _ MSE is set to 1.5-2.2;
preferably, thre _ mts is 0.2, thre _ mta is reduced by 0.2 according to the design resolution upper limit of lens, thre _ WA1 is set to 180, thre _ WA2 is set to 230, and thre _ MSE is set to 2.
Specifically, if the first optimal condition does not exist in the calculated data, the SN value is added by 1, the real-time configuration of the CMOS and the ISP of the camera is realized by adopting a hardware communication interface switching module, and the image quality is changed by updating the CMOS/ISP configuration parameters, so that new calculation parameters are obtained. Correspondingly, in order to avoid endless CMOS/ISP parameter configuration, AN empirical value thre _ SN is set to limit the adjustment times, the CMOS/ISP configuration is not continuously updated when the threshold is reached, in addition, the CMOS/ISP configuration is not continuously updated when the configuration parameters of the analog gain configuration table are traversed, namely the configuration serial number M is equal to the total number AN of the configuration parameters, and SN _ CHS is screened out from all SN according to AN optimal rule at present.
When the value of SN reaches a set threshold value thre _ SN or the configuration serial number M of the analog gain parameters is equal to the total number AN of the configuration parameters, screening MSE, WA, BA, MTA and MTS in the calculated data corresponding to each SN according to AN optimal rule to obtain SN _ CHS corresponding to a more appropriate CMOS/ISP configuration parameter;
selecting a WA value larger than a set threshold thre _ WA1, selecting a corresponding MTS value as the influence of image noise on the resolving power calculated by the AA software is smaller when the corresponding MTS value is smaller, and selecting the SN sequence number with the maximum MTA as SN _ CHS;
the optimal condition is three, the MTA value is larger than a set threshold thre _ MTA, the MSE is smaller than the set threshold thre _ MSE, and SN corresponding to the minimum MTS when the conditions are met is selected as SN _ CHS;
the optimal condition four is that the MTA value is larger than the set threshold thre _ MTA, and SN corresponding to the minimum MTS when the conditions are met is selected as SN _ CHS;
selecting SN corresponding to the minimum MSE as SN _ CHS under the optimal condition five;
a hardware communication module interface switching template is adopted to realize the real-time configuration of a camera CMOS and an ISP;
specifically, according to the SN _ CHS obtained under different optimal conditions, parameters corresponding to the SN _ CHS are selected to configure the CMOS chip and the ISP chip of the camera in real time;
the key hardware of the camera is CMOS and ISP chips, wherein the CMOS is responsible for image acquisition, the ISP chip is responsible for image quality processing, the basic functions are realized by register configuration, the CMOS has the necessary functions of exposure time, analog gain and digital gain setting, different CMOS corresponds to different register addresses and configuration value ranges, the ISP chip also has the functions of sharpening, automatic exposure, automatic gain control and gamma curve configuration, and different ISP chips have different register addresses and configuration values. One of the functions corresponds to a group of register addresses, different configuration values enable the function to have different expressions, such as exposure time register addresses, the exposure time is changed from short to long when the configuration values of the exposure time register addresses are changed from small to large, an image is changed from dark to bright under the condition that other register values are not changed, and a parameter configuration table is formed by presetting a plurality of groups of configuration values for one function register address.
According to the parameters of the acquired active alignment area image, the parameter adjustment of the CMOS chip comprises the following steps: adjusting one or more of an exposure register parameter table, an analog gain register parameter table and a digital gain register parameter table, wherein the specific adjustment comprises the adjustment of parameters and also comprises certain functions of opening or closing, such as closing an automatic exposure function, closing an automatic gain function and the like;
the parameter adjustment of the ISP chip comprises the following steps: sharpening function register parameter list, exposure function register parameter list, gain function register parameter list, gamma configuration register parameter list, wherein the specific adjustment comprises the adjustment of parameters, and also comprises the opening or closing of certain functions, such as the closing of automatic sharpening function, the closing of automatic exposure function, the closing of automatic configuration function, and the like;
the method comprises the steps of setting a CMOS chip register table and an ISP chip configuration parameter table corresponding to the camera hardware needing active alignment, and setting one or more of a preset parameter configuration table for closing sharpening parameters, automatic exposure parameters and automatic gain related registers, an exposure parameter configuration table, a gain parameter configuration table and a gamma configuration combination parameter table. Specifically, a parameter configuration table for closing a sharpening related register of the ISP chip includes a sharpening enabling register address and a sharpening closing register value, and a parameter configuration table for closing an automatic exposure related register includes an automatic exposure enabling register address and an automatic exposure closing register value; the parameter configuration table for turning off the agc-related register includes an agc-enable register address and a register value for turning off the agc, specifically, setting 0 and 1 for a bit corresponding to a configuration value of an enable address of a functional register, may implement an enable operation of a certain function, for example, writing 0 for a sharpening bit corresponding to an ISP functional register address may turn off sharpening, and writing 1 may turn on sharpening. Let the ISP chip function register address of a certain model be 0x40008001, and the corresponding configuration value be 16 ' b1101001011111101, wherein bit number 5 is sharpening switch, then configure the configuration value as 16 ' b1101001011011101 and turn off sharpening function, combine the function register address and the configuration value of turning off sharpening function according to a certain format to become a register configuration table related to turning off sharpening, for example (0x40008001, 16 ' b 1101001011101). Similarly, the register configuration table for turning off automatic exposure and turning off automatic gain can also be generated according to the rule, for example, (0x200021f3,0x 0000; 0x200021f4,0x0000), the address of the exposure function register is set to be 0x200021f3, the bit number 0 is an enable switch, the address of the gain function register is 0x200021f4, and the bit number 0 is an enable switch;
wherein the exposure parameter configuration table comprises AN exposure parameter register address and EN group exposure time parameter values, the sequence is arranged from long to short, the gain parameter configuration table comprises AN analog gain parameter address and AN group analog gain values, the sequence is arranged from large to small,
setting the exposure register address of a certain model of CMOS as 0x3218, the corresponding configuration value as 16bit, and arranging the exposure parameter address and a plurality of configuration values from long to short according to the exposure time to form an exposure parameter configuration table, for example (0x3218, 0xfff 0; 0x3218,0xffe 0; 0x3218,0xffd 0; 0x3218,0xffc 0; … …; 0x3218,0x 0080; 0x3218,0x0070 … …; 0x3218,0x 0000); similarly, a gain parameter configuration table can be generated according to the method.
Wherein, the gamma configuration parameter table includes gm group gamma parameter register addresses and corresponding gamma parameters, the warping degree of the corresponding gamma curve is arranged from steep to moderate, for example, there are 16 gamma parameter configuration registers, which respectively correspond to register addresses 0x0010 to 0x001f, the corresponding configuration values are gamma 1_1, gamma 1_2, … … and gamma 1_16, which represent the first gamma curve with the maximum curve steepness, and the configuration values gamma 2_1, gamma 2_2, … … and gamma 2_16 represent the second gamma curve with the second maximum curve steepness; similarly, the configuration values of gammm _1, gammm _2, … … and gammm _16 represent the gamma curve of the first gm type, and the steepness of the curve is the least. And combining the gamma parameter configuration register address corresponding to each curve with the corresponding configuration value to form a gamma configuration combination parameter table. For example
Figure BDA0002657943360000191
Figure BDA0002657943360000201
The video data of the camera needs to be transmitted to the industrial personal computer running the AA software through the LVDS interface or the Ethernet interface, the video signals need to be subjected to interface switching and can be converted into the HDMI or VGA interface from the LVDS interface or the Ethernet interface to be connected onto the industrial personal computer, so that the data link of the AA computing software is transmitted into the camera signals, the hardware for completing the switching function is a hardware communication interface switching module, and the video signals are transmitted singly.
The hardware communication interface switching module is used for communicating according to a camera configuration interface, a PC network interface and a USB interface except an original video link hardware channel, particularly a PC Ethernet interface, and the camera has bidirectional communication capability, so that video signals can be transmitted to the industrial personal computer and control instructions sent by the industrial personal computer to the camera, such as CMOS/ISP parameter configuration, the industrial personal computer generally outputs the control instructions through a USB port or a serial port, the industrial personal computer sends the control instructions to the camera through the USB port or the serial port and is switched to the camera configuration interface through the hardware communication interface switching module, video signals of the camera are transmitted to the hardware communication interface switching module through an LVDS interface and then are converted into HDMI or VGA signals to the industrial personal computer through the communication interface switching module; the hardware communication interface switching module transmits a control command to the camera through receiving the control command sent by the industrial personal computer through the Ethernet, receives a video signal sent by the camera through the Ethernet and transmits the video signal to the industrial personal computer through the Ethernet, and realizes a bidirectional communication link configured from the industrial personal computer and the camera, thereby completing the real-time configuration of the required CMOS/ISP parameters.
The method comprises the steps of configuring parameters of CMOS \ ISP, sending the configuration parameters to a CMOS chip or ISP chip at one time according to a CMOS \ ISP configuration protocol, and after each parameter is configured, confirming that the configuration parameters are issued to a target address of a device in a mode of reading back the parameters.
Specifically, since semiconductor devices of different manufacturers have different types of semiconductor device types and have different performances, in the parameter configuration process, although setting parameters are set and stored, the target device workflow characteristics cannot be configured correctly. In order to solve the problem, after each configuration parameter is issued, the configuration parameter can be confirmed to be issued to the target address of the device by reading back the parameter, so that the uncontrollable phenomenon caused by missing of parameter configuration is avoided. For example, the configuration value 0x0010, gam1_1,0x0011, gam1_2, … …,0x001 f and gam1_16 of a gamma curve in the gamma configuration parameter table are sent to the ISP chip, after the gamma 1_1 is written into the address 0x0010, the address 0x0010 is read again, and if the return value is gam1_1, the address 0x0011 is configured continuously; if the return value is not gam1_1, writing gam1_1 into the address 0x0010 again until the configuration value read back from the address 0x0010 is gam1_1, then configuring the subsequent addresses, and adopting the same read-back comparison mechanism after configuring the corresponding address each time until configuring the last register address;
if the image quality of the first calculation area does not meet the requirement, skipping to execute the CMOS and ISP parameter configuration, specifically closing the automatic exposure and the automatic gain, and configuring a closed automatic exposure related register configuration table and a closed automatic gain related register configuration table; reading a current exposure parameter value from an exposure parameter register address in an exposure parameter configuration table, defining the read-out exposure parameter value of a current image as exp _ in, comparing an exp _ ini sequence with all exposure parameter values because the exposure parameter values listed in the exposure parameter table are sequential from large to small but may be discrete, and selecting the exposure parameter value as a transfer configuration value exp _ cur when an nth sequentially arranged exposure parameter value is just changed from being larger than exp _ ini to being smaller than or equal to exp _ ini, for example, an exposure parameter configuration table of a certain CMOS is as follows: (0x3218, 0xf 000; 0x3218,0xe 000; 0x3218,0xd 000; 0x3218,0xc 000; 0x3218,0xb 000; 0x3218,0xa 000; 0x3218,0x 9000; 0x3218,0x 8000; 0x3218,0x 7000; 0x3218,0x 5000; 0x3218,0x 3000; 0x3218,0x 1000;);
after the configuration of the automatic exposure related register closing configuration table and the automatic gain related register closing configuration table are completed, reading that the current configuration value of an exposure parameter register address 0x3218 is 0x48a0 (exp _ ini), and sequentially comparing the exposure parameter configuration table, wherein if the 11 th configuration value 0x3000 is just less than or equal to exp _ ini, the transfer configuration value exp _ cur is 0x 3000;
correspondingly, if WA is higher than thre _ WA, the representation image is too bright, so the exposure parameter value needs to be reduced to reduce the exposure time, and the exposure values of the exposure parameter configuration table are arranged from large to small in sequence, so the number of the configuration parameter table is increased to meet the requirement, the specific increasing step size is determined according to exp _ step, the setting value of exp _ step is 2, the 13 th configuration value should be selected according to n + exp _ step for the transfer configuration value, and the configuration parameter table only has 12 configuration values, namely EN is 12, so only the 12 th configuration value, namely the transfer configuration parameter exp _ cur is 0x1000, and the number n of the configuration table is changed to 12.
Correspondingly, if BA is smaller than thre _ BA, the characterization image is too dark, and therefore the exposure parameter value needs to be increased to increase the exposure time, so that the decrease of the configuration parameter table number can satisfy the requirement, if exp _ step is 2, the 9 th configuration value 0x7000 is selected as the transfer configuration parameter exp _ cur, and at the same time, the configuration table number n is changed to 9. If the current SN is 1, recording the current SN corresponding to exp _ cur as exp _ cur1Then, an AA calculation area image analysis step is carried out again;
correspondingly, if the image quality of the area is not satisfied with the requirement calculated for the first time, skipping to execute the CMOS and ISP parameter configuration, specifically, the automatic exposure and the automatic gain are already closed, the current configuration table serial number n is known, the same configuration parameter selection operation as the first time is carried out, the configuration table serial number n and the exp _ cur are finally updated and recorded corresponding to the current SN serial number, and then the AA calculates the area image analysis.
When the current MT value is greater than 0.5, skipping to execute CMOS and ISP parameter configuration, specifically, turning off the sharpening function of the ISP chip, is realized by configuring a parameter configuration table related to turning off sharpening, and sharpening the calculated difference of MTF in on and off states, as shown in fig. 10a and fig. 10b, where fig. 10a is an imaging diagram of a sharpening off condition when MTF50 is 0.448Cy/Pxl, and fig. 10b is an imaging diagram of a sharpening on condition when MTF50 is 0.689 Cy/Pxl.
If the image quality of the N (N >1) th calculation region does not meet the requirement, the gamma curve is respectively corresponding to gamma curves in the gamma curve related register parameter configuration table, wherein the steepness of the gamma curve is from steep to gentle, for example, the first group of gamma curve related register parameter configurations 0x0010, gamma 1_1,0x0011, gamma 1_2, … …,0x001 f, gamma 1_16 are corresponding to the gamma curves as shown in FIG. 11, the second group of gamma curve related register parameter configurations 0x0010, gamma 2_1,0x0011, gamma 2_2, … …,0x001 f, and gamma 2_16 are corresponding to the gamma curves as shown in FIG. 12; the configuration of the gamma curve related register parameters of the gm group is 0x0010, gamma _1,0x0011, gamma _2, … …,0x001 f and gamma _16 corresponding to the gamma curve as shown in FIG. 13.
Recording the current jump times N when the image quality of the calculation area does not meet the requirement every time, recording the configuration value of a gamma curve related register corresponding to the jump times N corresponding to the SN serial number at the moment, closing a sharpening configuration table, assigning N as gm to be no longer self-added with 1 if the jump times are larger than the total number gm of the gamma curves, or else, self-added with 1, and then entering AA calculation area image analysis.
Specifically, if the SN reaches a set threshold thre _ SN or the configuration number m in the analog gain configuration table is not equal to AN, parameter configuration of the CMOS and the ISP is entered, which represents completion of a feedback loop, the SN number is added by 1, and the remaining calculation parameters meet the requirements under the current analog gain parameter, so that the analog gain is configured step by step, and the combination expression form of the image quality is increased. If the first circulation is performed, setting the initial gain parameter number m to be 1, selecting a configuration value in a gain configuration parameter table corresponding to the gain parameter number m as a gain transmission configuration parameter alg _ cur, configuring the gain transmission configuration parameter alg _ cur to a gain register, and recording the alg _ cur according to the current SN number, for example, the gain parameter configuration table is as follows: (0x3010,0 xffff; 0x3010,0 xeeee; 0x3010,0 xdddd; 0x3010,0 xccc; 0x3010,0 xbbbb; 0x3010,0 xaaaa; 0x3010,0x 9999; 0x3010,0x 8888; 0x3010,0x 7777; 0x3010,0x 6666; 0x3010,0x 5555; 0x3010,0x 4444; 0x3010,0x 3333; 0x3010,0x 2222; 0x3010,0x 1111;);
if the first circulation is performed, the value m is 1, the value 0xffff of the first gain configuration parameter table is configured to the gain register 0x3010, and the value 0xffff is used as the gain transmission configuration parameter alg _ cur and is recorded as alg _ cur corresponding to the current SN 22Then, the AA calculation area image analysis is carried out; and after each circulation, adding 1 by m, correspondingly selecting a configuration value in the gain configuration parameter table as a new gain transmission configuration parameter alg _ cur, configuring the new gain transmission configuration parameter alg _ cur to the gain register, adding 1 by SN, recording alg _ curSN, and then entering AA calculation area image analysis.
The final image representation corresponding to the SN serial numbers (from left to right) under different CMOS/ISP configuration parameters and the MTF value calculated by the AA software, the CMOS/ISP configuration parameter of the image with the SN _ CHS of 4 is the optimal AA link to modify the CMOS/ISP parameter of the camera.
After acquiring the parameters of the optimal CMOS \ ISP actively aligned, in the assembly process of the AA manufacturing process, the parameters of the CMOS \ ISP of the camera are required to be modified and updated to the parameters of the CMOS \ ISP corresponding to SN-CHS;
specifically, the conventional AA device operation flow is: after the tray flows into the rear ejector pin, the ejector pin is electrified, the lens is automatically clamped, AA action, UV curing and NG judgment are carried out. The implementation judges the optimal CMOS \ ISP configuration parameters suitable for the AA environment, so that the optimal CMOS \ ISP configuration parameters are configured on the scene for the camera by adopting a hardware communication interface conversion module, the image quality of the camera is most suitable for the on-site AA environment, the AA software can obtain the optimal image for AA assembly, the AA production effect is greatly improved, and the optimized AA equipment operation flow is as follows, see FIG. 14: after the tray flows into the tray, the thimble is powered on, the hardware communication interface switching module is adopted to configure the determined CMOS \ ISP parameters (referring to the specific embodiment, the CMOS \ ISP configuration parameters with SN _ CHS of 4) in real time, the lens is automatically clamped, and AA action, UV curing and NG judgment are carried out.
The real-time configuration may cause a situation that the configuration parameters cannot be written in all at one time due to different working characteristics of the camera product, and therefore round-robin bidirectional handshake communication needs to be performed on the operated CMOS \ ISP register, that is, a set value is written in a certain register, then a return value of the register is read, and then the register is compared with the written set value to judge whether the register is consistent with the set value, or else, the register is rewritten in the current state until the read-back value is consistent with the written value, and so on until all relevant registers are written in.
What has been described above is only a preferred embodiment of the present invention, and the present invention is not limited to the above examples. It is clear to those skilled in the art that the form in this embodiment is not limited thereto, and the adjustable manner is not limited thereto. It is to be understood that other modifications and variations, which may be directly derived or suggested to one skilled in the art without departing from the basic concept of the invention, are to be considered as included within the scope of the invention.

Claims (18)

1. An active alignment method applied to a camera module is characterized by comprising the following steps:
the parameters of the CMOS chip and/or ISP chip of the camera are adjusted to be matched with the active alignment graphic card and/or the illumination environment in the active alignment process, so that the parameters of the optimal CMOS chip and the optimal ISP chip are obtained;
the adapting comprises: acquiring conditions of an active alignment scene and an illumination environment, and when the preset conditions are not met in the process of analyzing the image of a calculation area or analyzing the real-time MTF calculation result or judging the optimal active alignment parameter, skipping to execute the process of analyzing the image of the calculation area or analyzing the real-time MTF calculation result or judging the optimal active alignment parameter by continuously adjusting the parameters of a CMOS chip and/or an ISP chip of a camera so as to meet the preset conditions to finish adaptation;
calculating the regional image analysis parameters and the optimal active alignment parameters at least comprises: one or more of an image analysis serial number SN, a mean value BA and a mean value WA, a mean value MSE of an image analysis reference value, a total mean value MTA, a confidence interval upper and lower limit difference value MTS and an extraction serial number SN _ CHS; wherein WA is a pixel average value of the corresponding gray map of the calculated area image which is greater than a preset threshold value, and BA is a pixel average value of the corresponding gray map of the calculated area image which is less than the preset threshold value.
2. The active alignment method applied to the camera module as claimed in claim 1, wherein the conditions of the scene and the lighting environment of the active alignment include:
the active alignment station is wrapped by a diffuse reflection material; the active alignment graphic card is made of diffuse reflection materials.
3. The active alignment method applied to the camera module as claimed in claim 1, wherein the conditions of the scene and the lighting environment of the active alignment include:
carrying out laser centering on the positive center of the graphic card and the positive center of Lens by adopting a laser instrument;
after the active alignment chart is imaged by the camera, an included angle theta formed by the inclined edge of the MTF calculation area on the image and the vertical direction or the horizontal direction is 2-10 degrees.
4. The active alignment method as claimed in claim 1, wherein the computing area image analysis comprises:
if the mean WA value of the corresponding gray-scale map of any image in each calculation area reference image is higher than a set threshold thre _ WA or the mean BA of the corresponding gray-scale map of the calculation area image is lower than the set threshold thre _ BA, the quality of the calculation area image is considered not to meet the preset condition;
if the image quality of the calculation area does not meet the preset condition, adjusting the parameters of a camera CMOS and an ISP by adopting a hardware communication interface switching module; and if the image quality of the calculation area meets the requirement, analyzing the MTF calculation result in real time, and recording the mean value MSE of the standard deviation of each calculation area image, the mean value WA of the corresponding gray scale image of the center active alignment calculation area image, the mean value BA of the corresponding gray scale image and the corresponding image analysis serial number SN thereof.
5. The active alignment method as claimed in claim 1, wherein the real-time MTF calculation result analysis comprises:
step S31, obtaining an MTF curve, solving the MTF50, defining the MTF50 as the resolving capability MT of the current image of the camera, counting the distribution probability function p (MT) of the MTF curve, and obtaining the overall average value MTA of p (MT) and the upper and lower limit difference value MTS of the confidence interval;
step S32, if the current MT value is larger than 0.5, the parameter adjustment of the camera CMOS and ISP is realized by adopting a hardware communication interface switching module; otherwise, the MTA and MTS recorded by the current SN serial number are used for judging the optimal active alignment parameter.
6. The active alignment method as claimed in claim 1, wherein the optimal active alignment parameter decision comprises: defining the first optimal condition as: the upper and lower limit difference MTS value of the confidence interval is smaller than the set threshold thre _ MTS, the mean value WA of the corresponding gray level image of the calculated area image is larger than the set threshold thre _ WA1 and smaller than thre _ WA2, the overall mean value MTA is larger than thre _ MTA, and the MSE is smaller than the set threshold thre _ MSE;
s41, traversing the calculation data corresponding to each SN sequence number: the method comprises the following steps of (1) calculating a mean value MSE of an image analysis reference value, a mean value WA of a corresponding gray scale image of a calculated area image, a mean value BA of a corresponding gray scale image of a calculated area image, a total mean value MTA and a confidence interval upper and lower limit difference value MTS; if the result in the calculated data meets the first optimal condition, recording the currently traversed SN sequence number SN _ CHS; and extracting the finally judged parameters of the CMOS chip and/or the ISP chip of the camera corresponding to the serial number SN _ CHS as the optimal active alignment parameters.
7. The active alignment method as claimed in claim 1, wherein the optimal active alignment parameter decision comprises:
in the first mode, if the image analysis sequence number SN reaches the set threshold thre _ SN or the configuration sequence number m in the analog gain configuration table is equal to AN, traversing all the calculation data corresponding to the SN sequence numbers: the method comprises the following steps of (1) calculating a mean value MSE of an image analysis reference value, a mean value WA of a corresponding gray scale image of a calculated area image, a mean value BA of a corresponding gray scale image of a calculated area image, a total mean value MTA and a confidence interval upper and lower limit difference value MTS; if the MTS value is smaller than the set threshold thre _ MTS and the WA value is larger than the set threshold thre _ WA1 in the calculation data, selecting the SN sequence number SN _ CHS with the maximum MTA; and extracting the finally judged camera CMOS chip and/or ISP chip corresponding to the serial number SN _ CHS as the optimal active alignment parameter.
8. The active alignment method as claimed in claim 1, wherein the optimal active alignment parameter decision comprises: in the second mode, if the SN reaches a set threshold value thre _ SN or the configuration serial number M in the analog gain configuration table is not equal to AN, the SN is added by 1, and the parameter configuration of the camera CMOS chip and/or the ISP chip is realized by adopting a hardware communication interface switching module.
9. The active alignment method as claimed in claim 1, wherein the optimal active alignment parameter decision comprises: and a third mode, traversing all the calculation data corresponding to the SN sequence numbers of the image analysis: the method comprises the following steps of (1) calculating a mean value MSE of an image analysis reference value, a mean value WA of a corresponding gray scale image of a calculated area image, a mean value BA of a corresponding gray scale image of a calculated area image, a total mean value MTA and a confidence interval upper and lower limit difference value MTS; if the MTS value is smaller than the set threshold thre _ MTS and the WA value is larger than the set threshold thre _ WA1 in the calculation data, selecting the SN sequence number SN _ CHS with the maximum MTA; and extracting the finally judged parameters of the CMOS chip and/or the ISP chip of the camera corresponding to the serial number SN _ CHS as the optimal active alignment parameters.
10. The active alignment method as claimed in any one of claims 7 to 9, wherein when none of the obtained image analysis parameter indexes of the respective calculation regions satisfies the first, second and third modes, the determination sequence of the optimal active alignment parameter comprises: preferentially selecting the SN serial number SN _ CHS with the minimum MTS under the condition that the MTA is larger than the set threshold thre _ MTA and the MSE is smaller than the set threshold thre _ MSE; secondly, selecting an SN serial number SN _ CHS with the minimum MTS under the condition that the MTA is larger than a set threshold value thre _ MTA; finally, selecting an SN serial number SN _ CHS corresponding to the MSE minimum value;
and extracting the finally judged camera CMOS chip parameter and ISP chip parameter corresponding to the serial number SN _ CHS as the optimal active alignment parameter.
11. The active alignment method applied to the camera module as claimed in claim 1, wherein the adjusting parameters of the camera CMOS chip and/or the ISP chip comprises: according to the parameters calculated by the acquired image of the active alignment area, the parameter adjustment of the CMOS chip comprises the following steps: adjusting one or more of an exposure register parameter table, an analog gain register parameter table and a digital gain register parameter table; the parameter adjustment of the ISP chip comprises the following steps: sharpening function register parameter table, exposure function register parameter table, digital gain function register parameter table, gamma configuration register parameter table.
12. The active alignment method for camera module according to claim 11, wherein the gamma configuration parameter table includes gm groups of gamma parameter register addresses and corresponding gamma parameters, and the warpage of the corresponding gamma curves is arranged from steep to moderate;
or the exposure parameter configuration table comprises the addresses of the exposure parameter registers and the values of the EN group exposure time parameters, and the exposure time is arranged from long to short in sequence;
or the gain parameter configuration table comprises analog gain parameter addresses and AN group analog gain values, and the analog gain values are arranged from large to small in sequence.
13. The active alignment method as claimed in claim 4, wherein if the image quality of the first calculation region does not meet the requirement, the adjusting of the parameters of the camera CMOS and ISP comprises: configuring a parameter configuration table for closing automatic exposure and gain, reading an exposure gain parameter value from an exposure gain parameter address and recording the exposure gain parameter value as exp _ ini, selecting a transfer configuration value exp _ cur according to the currently recorded exposure gain parameter exp _ ini, sequentially comparing the exp _ ini with EN exposure gain parameter values in the exposure parameter configuration table, and if the nth exposure parameter value is less than or equal to exp _ ini, determining the exposure parameter value as exp _ cur.
14. The active alignment method applied to a camera module as claimed in claim 4, wherein if the image quality of the area is not calculated for the first time, the adjustment of the parameters of the camera CMOS and ISP comprises: if WA is higher than thre _ WA, selecting the exposure parameter value in the exposure parameter configuration table corresponding to the min { n + exp _ step, EN } number as the adjusted transfer configuration value exp _ cur, and updating the value of n as min { n + exp _ step, EN }, wherein exp _ step is the set sequence number jump step.
15. The active alignment method applied to a camera module as claimed in claim 4, wherein if the image quality of the area is not calculated for the first time, the adjustment of the parameters of the camera CMOS and ISP comprises: if BA is lower than the set threshold value thre _ BA, selecting the exposure parameter value in the exposure parameter configuration table corresponding to the max { n-exp _ step,1} th sequence number as the adjusted transfer configuration value exp _ cur, and updating the value of n as n-exp _ step, wherein exp _ step is the set sequence number jump step length.
16. The active alignment method applied to the camera module as claimed in claim 5, wherein the parameter adjustment of the camera CMOS chip and/or ISP chip comprises: the jumping times are N, and the initial value is 1; and configuring a configuration table for closing sharpening, configuring an Nth group of gamma curve related registers, recording the configuration of the gamma curve related registers corresponding to the current N, the configuration for closing sharpening and the current corresponding SN serial number, and carrying out active alignment calculation area image analysis by adding 1 to N.
17. The active alignment method for camera modules according to claim 5, wherein if the image quality of the first calculation region does not meet the requirement, the adjustment of the parameters of the camera CMOS and ISP comprises: the initial gain parameter serial number m is 1, the analog gain parameter currently records the first analog gain parameter value from the analog gain parameter list as the gain transmission configuration parameter alg _ cur, and records the parameter into the currently corresponding SN serial number, and configures alg _ cur to the gain configuration address.
18. The active alignment method applied to a camera module as claimed in claim 5, wherein if the image quality of the area is not calculated for the first time, the adjustment of the parameters of the camera CMOS and ISP comprises: selecting AN analog gain value with the sequence number min { m + alg _ step, AN } in a gain parameter configuration table as a gain transmission configuration parameter alg _ cur, updating the value of m to min { m + alg _ step, AN }, wherein alg _ step is AN artificially set sequence number jump step length, recording the adjusted alg _ cur and the current corresponding SN sequence number, configuring alg _ cur to a gain configuration address, and then entering the image analysis of AN active alignment calculation region.
CN202010906908.4A 2020-08-31 2020-08-31 Active alignment method applied to camera module Active CN112153280B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010906908.4A CN112153280B (en) 2020-08-31 2020-08-31 Active alignment method applied to camera module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010906908.4A CN112153280B (en) 2020-08-31 2020-08-31 Active alignment method applied to camera module

Publications (2)

Publication Number Publication Date
CN112153280A CN112153280A (en) 2020-12-29
CN112153280B true CN112153280B (en) 2022-02-15

Family

ID=73890554

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010906908.4A Active CN112153280B (en) 2020-08-31 2020-08-31 Active alignment method applied to camera module

Country Status (1)

Country Link
CN (1) CN112153280B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113592810B (en) * 2021-07-29 2022-04-19 东莞市亚太未来软件有限公司 Student learning data screening method and device based on image data processing
CN115103124B (en) * 2022-07-14 2023-07-04 上海研鼎信息技术有限公司 Active alignment method for camera module

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107452048A (en) * 2016-05-30 2017-12-08 网易(杭州)网络有限公司 The computational methods and device of global illumination

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101446485B (en) * 2008-08-27 2011-02-09 中国科学院光电技术研究所 Surveymeter for parallelism of optical axis of visible light and infrared light wave
CN102865998A (en) * 2011-07-04 2013-01-09 奇景光电股份有限公司 Lens quality detection method
US9009952B2 (en) * 2011-08-29 2015-04-21 Asm Technology Singapore Pte. Ltd. Apparatus for assembling a lens module and an image sensor to form a camera module, and a method of assembling the same
CN103581564B (en) * 2012-08-08 2016-12-21 慧友电子股份有限公司 The aperture control system of camera head and method thereof
US20150062422A1 (en) * 2013-08-27 2015-03-05 Semiconductor Components Industries, Llc Lens alignment in camera modules using phase detection pixels
CN106296711B (en) * 2016-08-22 2019-04-09 华南理工大学 A kind of multiaxis active alignment method of mobile phone camera module group
CN109887040B (en) * 2019-02-18 2020-04-14 北京航空航天大学 Moving target active sensing method and system for video monitoring

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107452048A (en) * 2016-05-30 2017-12-08 网易(杭州)网络有限公司 The computational methods and device of global illumination

Also Published As

Publication number Publication date
CN112153280A (en) 2020-12-29

Similar Documents

Publication Publication Date Title
CN112153280B (en) Active alignment method applied to camera module
US10630906B2 (en) Imaging control method, electronic device and computer readable storage medium
US8760445B2 (en) Method of correcting brightness of electronic display
CN102823236B (en) Imaging device and image processing method
US8368803B2 (en) Setting exposure attributes for capturing calibration images
US9706189B2 (en) Image capturing device and method for calibrating image defection thereof
US11277564B2 (en) Method for compensating for image quality of optical system by means of lens adjustment
WO2017054689A1 (en) Correction device for camera module optical image stabilizer system and correction method therefor
CN109714535A (en) A kind of auto-focusing machine vision metrology device and method based on color difference
CN109348129A (en) A kind of the clarity detection method and system of cameras with fixed focus
CN103475820B (en) PI method for correcting position and system in a kind of video camera
CN103402056A (en) Compensation processing method and system applied to image capture device
CN108419026A (en) camera exposure time adjusting method, device and equipment
CN112150556B (en) Active alignment method and assembly method of image quality feedback loop and camera
US20130162983A1 (en) Lens Test Device And Method
CN106973223B (en) Device for adjusting lens aperture
CN101179661A (en) Methods and apparatuses for generating information regarding spatial relationship between a lens and an image sensor
CN108270958B (en) Camera module self-adaptive system and self-adaptive method thereof
CN103353345A (en) Motor vehicle headlamp detector light intensity detection method
CN111638042A (en) DLP optical characteristic test analysis method
WO2021212435A1 (en) Infrared image processing method and apparatus, and movable platform and computer readable medium
TW201404120A (en) Method and system for testing digital imaging devices
CN114152610A (en) Slide cell scanning method based on visual target marker
CN213342427U (en) Active alignment system of camera module
WO2023206186A1 (en) Led lamp panel correction method and apparatus, electronic device, and storage medium

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