Summary of the invention
It is an object of the invention to provide the method and system of a kind of automatic calibration optical camera, it is intended to solve existing skill
Generally making the two parallel with adjustment by being manually directed at the photographic head after preliminary assembling in art, assembly precision depends entirely on
The proficiency level of operator, the problem of the rigging error that assembling speed is slow, defect rate is high and existence is bigger.
The present invention is achieved in that a kind of method of automatic calibration optical camera, is used for calibrating described optical camera
The depth of parallelism between camera lens module and the photosensitive module of head, described method includes:
Detect the mtf value in all regions in the film image of described optical camera shooting respectively, choose mtf value minimum
Region is as region to be adjusted;
Calculate the MTF difference between other each regions and described region to be adjusted respectively, according to described region to be adjusted
Between the maximum region of MTF difference choose default rotating shaft;
Mtf value, preset standard mtf value and the calibration factor in described region to be adjusted according to described region to be adjusted, meter
That calculates described camera lens module treats the anglec of rotation;
Control described camera lens module and treat the anglec of rotation along described in described default rotating shaft rotation, so that other regions arbitrary and institute
State the MTF difference percentage ratio between region to be adjusted and be respectively less than default MTF difference percentage threshold;
Return and calculate the step of the mtf value in all regions in the film image that described optical camera shoots respectively, until
In described film image, MTF difference percentage ratio between all regions is only respectively less than when presetting MTF difference percentage threshold.
In one embodiment, the MTF in all regions in the described film image calculating the shooting of described optical camera respectively
Before the step of value, also include:
Precalculate described camera lens module along its all default rotating shafts rotate time, in described film image all regions institute right
The calibration factor answered;
Pre-set standard mtf value and MTF difference percentage threshold.
The present invention also provides for the system of a kind of automatic calibration optical camera, for calibrating the camera lens of described optical camera
The depth of parallelism between module and photosensitive module, described system includes:
Mtf value detection module, the MTF in all regions in the film image detecting the shooting of described optical camera respectively
Value, chooses the minimum region of mtf value as region to be adjusted;
MTF difference calculating module, for calculating the MTF difference between other each regions and described region to be adjusted respectively,
Default rotating shaft is chosen according to the region that MTF difference between described region to be adjusted is maximum;
Anglec of rotation computing module, for according to the mtf value in described region to be adjusted, preset standard mtf value with described treat
The calibration factor of adjustment region, calculate described camera lens module treats the anglec of rotation;
Control module, is used for controlling described camera lens module and treats the anglec of rotation along described in described default rotating shaft rotation, so that appointing
MTF difference percentage ratio between one other regions and described region to be adjusted is respectively less than presets MTF difference percentage threshold;
Return module, for returning the MTF in all regions in the film image calculating the shooting of described optical camera respectively
The step of value, until the MTF difference percentage ratio between all regions is respectively less than default MTF difference percentage ratio in described film image
During threshold value only.
In one embodiment, described system also includes:
Calibration factor computing module, be used for precalculating described camera lens module along its all default rotating shafts rotate time, described
Calibration factor corresponding to all regions in film image;
MTF parameter setting module, is used for pre-setting standard mtf value and MTF difference percentage threshold.
Compared with prior art, it has the beneficial effects that the present invention:
By repeating the mtf value in each region in the film image that detection optical camera shoots, choose mtf value minimum
Region as region to be adjusted, choose default rotating shaft, root according to the region that MTF difference between described region to be adjusted is maximum
Described camera lens module is calculated according to the calibration factor in mtf value, preset standard mtf value and the region to be adjusted in described region to be adjusted
Treat the anglec of rotation, control described camera lens module along described default rotating shaft rotate described in treat the step of the anglec of rotation, until described phenanthrene
In woods image, the MTF difference percentage ratio between all regions is only respectively less than default MTF difference percentage threshold.Can effectively reduce light
Learn the mtf value difference between each region of camera lens module of photographic head, it is achieved the automatic calibration to optical camera, it is not necessary to manually grasp
Make, assembling speed is fast and assembly precision is high.
Detailed description of the invention
In order to make the purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, right
The present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, not
For limiting the present invention.
MTF (modulation transfer function (MTF)), is used to evaluate whether optical camera assembles one of major criterion accurately, MTF
Can present demand pairs amount in the range of a millimeter, measuring the image quality of optical camera, MTF more high imaging quality is more
Good, optical camera assembling is the highest.During assembling, if the depth of parallelism between camera lens module and photosensitive module, directly affect
Difference size between the mtf value of different imaging regions in image captured by optical camera, MTF difference is the biggest, then illustrate
The depth of parallelism between camera lens module and photosensitive module is the lowest.The present invention rotates specific by controlling camera lens module along presetting rotating shaft
Angle adjusts the depth of parallelism between camera lens module and photosensitive module, reduces the difference between the mtf value of different imaging region big
Little, to realize the automatic calibration to optical camera.
As it is shown in figure 1, the method automatically calibrating optical camera that the present embodiment provides, including:
Step S101: detect the mtf value in all regions in the film image of described optical camera shooting respectively, choose
The region of mtf value minimum is as region to be adjusted.
In the present embodiment, described all regions include the top left region of film image, lower left region, right regions and the right side
Lower region
In one embodiment, step S101 also includes: compare the size of the mtf value in the described all regions detected.
Step S102: calculate the MTF difference between other each regions and described region to be adjusted respectively, treat according to described
Default rotating shaft is chosen in the region that between adjustment region, MTF difference is maximum.
In the present embodiment, described default rotating shaft from the horizontal rotating shaft overlapped with the cross-section center line of described camera lens module,
The transit axle that overlaps with the longitudinal section centrage of described camera lens module and respectively with in two oblique sections of described camera lens module
The main diagonal axis that heart line overlaps is chosen in secondary diagonal axis, and described cross section, described longitudinal section and said two oblique section are all worn
Crossing the geometric center of described camera lens module, wherein, main diagonal axis passes described camera lens module top left region and lower right area, secondary right
Angle axle passes described camera lens module lower left region and right regions.
In one embodiment, step S102 also includes: relatively other each regions calculated and described region to be adjusted
Between the size of MTF difference.
In one embodiment, step S102, specifically include:
When described region to be adjusted is top left region, and the region that between described region to be adjusted, MTF difference is maximum is respectively
During for lower left region, right regions and lower right area, selected default rotating shaft is respectively horizontal rotating shaft, transit axle and secondary diagonal angle
Axle;
When described region to be adjusted is lower left region, and the region that between described region to be adjusted, MTF difference is maximum is respectively
During for top left region, right regions and lower right area, selected default rotating shaft is respectively horizontal rotating shaft, main diagonal axis and transit
Axle;
When described region to be adjusted is right regions, and the region that between described region to be adjusted, MTF difference is maximum is respectively
During for top left region, lower left region and lower right area, selected default rotating shaft is respectively transit axle, main diagonal axis and horizontal turn
Axle;
When described region to be adjusted is lower right area, and the region that between described region to be adjusted, MTF difference is maximum is respectively
During for top left region, lower left region and right regions, selected default rotating shaft is respectively secondary diagonal axis, transit axle and horizontal turn
Axle.
Step S103: according to mtf value, preset standard mtf value and the school in described region to be adjusted in described region to be adjusted
Quasi-coefficient, calculate described camera lens module treats the anglec of rotation.
In the present embodiment, the computing formula treating the anglec of rotation described in is:
Treat the anglec of rotation=(presetting the mtf value in MTF standard value-region to be adjusted) * calibration factor.
In a particular application, described preset standard mtf value is according to the imaging precision requirement setting to optical camera, to one-tenth
As required precision is high, then preset standard mtf value is high;Require low to imaging precision, then preset standard mtf value is low.
In a particular application, when camera lens module rotates the different anglecs of rotation along different rotating shafts, region to be adjusted
Mtf value is also continually changing, and exists certain between anglec of rotation variable quantity and the mtf value variable quantity in region to be adjusted of rotating shaft
Linear relationship, define calibration factor=mtf value variable quantity/anglec of rotation variable quantity, be used for weighing this linear relationship.
Step S104: control described camera lens module along described default rotating shaft rotate described in treat the anglec of rotation so that arbitrary its
MTF difference percentage ratio between he region and described region to be adjusted is respectively less than presets MTF difference percentage threshold.
In a particular application, preset MTF difference percentage threshold and require setting according to the imaging precision of optical camera,
Imaging precision is required height, then presets MTF difference percentage threshold low;Imaging precision is required low, then presets MTF difference percentage
Higher than threshold value.
The computing formula defining the MTF difference percentage ratio between described other regions arbitrary and described region to be adjusted is:
MTF difference percentage ratio=(mtf value in the mtf value in other regions arbitrary-region to be adjusted)/other regions arbitrary
Mtf value.
Step S105: return step S101, until the MTF difference percentage ratio between all regions is equal in described film image
Stop less than when presetting MTF difference percentage threshold.
In one embodiment, also include before step S102 and S103:
Calculate the MTF difference percentage ratio between other each regions and described region to be adjusted respectively, and judge other each districts
Whether the MTF difference percentage ratio between territory and described region to be adjusted is respectively less than is preset MTF difference percentage threshold, the most then
Judge that described optical camera has been calibrated, if otherwise entering step S103.
In one embodiment, also include before step S101:
Precalculate described camera lens module along its all default rotating shafts rotate time, in described film image all regions institute right
The calibration factor answered;
Pre-set standard mtf value and MTF difference percentage threshold.
As in figure 2 it is shown, in the present embodiment, described in precalculate described camera lens module and rotate along its all default rotating shafts
Time, in described film image, the step of calibration factor corresponding to all regions specifically includes:
Step S201: tentatively assemble camera lens module and photosensitive module, sets the most described camera lens module along its institute
The anglec of rotation having default rotating shaft to rotate is 0;
Step S202: with predetermined angle increment, controls described camera lens module along rotating shaft default it described respectively in preset angle
Rotate in the range of degree, and detect the mtf value excursion in all regions in described film image respectively;
In one embodiment, step S202 also includes: with predetermined angle increment, detects described camera lens module respectively along different
During rotating shaft different rotation angle, different mtf values corresponding to zones of different in described film image.
Step S203: according to described predetermined angle scope and described mtf value excursion, calculates described camera lens module along it
When all default rotating shafts rotate, calibration factor corresponding to all regions in described film image.
The computing formula of the most described calibration factor is:
Calibration factor=(lower limit of the higher limit of mtf value excursion-mtf value excursion)/(predetermined angle scope
The lower limit of higher limit-predetermined angle scope).
In a particular application, predetermined angle increment and predetermined angle scope all can be arranged according to actual needs, the present embodiment
In preferably predetermined angle increment be 0.1 °, predetermined angle scope is [-5 ° ,+5 °].
In the present embodiment, set each rotating shaft in default rotating shaft and be respectively transverse axis a, longitudinal axis b, main diagonal axis ab, secondary diagonal axis
ba;
Set camera lens module along transverse axis a rotate time, predetermined angle scope that in film image, top left region is corresponding, mtf value
Excursion and calibration factor are respectively [a1, a2], [x1, x2] and ka Upper left, then calibration factor ka Upper left=(x2–x1)/(a2–a1);
Set camera lens module along main longitudinal axis b rotate time, predetermined angle scope that in film image, top left region is corresponding, MTF
Value excursion and calibration factor are respectively [b1, b2], [y1, y2] and kb Upper left, then calibration factor kb Upper left=(y2–y1)/(b2–
b1);
Set camera lens module along main diagonal axis ab rotate time, predetermined angle scope that in film image, top left region is corresponding,
Mtf value excursion and calibration factor are respectively [ab1, ab2], [xy1, xy2] and kab Upper left, then calibration factor kab Upper left=(xy2–
xy1)/(ab2–ab1);
Set camera lens module along secondary diagonal axis ba rotate time, predetermined angle scope that in film image, top left region is corresponding,
Mtf value excursion and calibration factor are respectively [ba1, ba2], [yx1, yx2] and kba Upper left, then calibration factor kba Upper left=(yx2–
yx1)/(ba2–ba1)。
The rest may be inferred for the parameter setting method in other each regions.
Enumerate a specific embodiment below and illustrate to calculate the concrete steps of the anglec of rotation of camera lens module:
When the mtf value of film image top left region is minimum, during the MTF difference maximum of lower left region and top left region, determine
The default rotating shaft that camera lens module should rotate is transverse axis a;
Set and preset MTF standard value as MTFStandard, the mtf value of top left region be MTFMeasure, treat that the anglec of rotation is Δ a, it is known that
Calibration factor ka Upper left=(x2–x1)/(a2–a1), then treat the anglec of rotation=(preset MTF standard value-region to be adjusted according to formula
Mtf value) * calibration factor is calculated:
Δ a=(MTFStandard-MTFMeasure)*ka Upper left=(MTFStandard-MTFMeasure)*(x2–x1)/(a2–a1)。
As it is shown on figure 3, the system automatically calibrating optical camera that the present embodiment provides, including:
Mtf value detection module 101, all regions in the film image detecting the shooting of described optical camera respectively
Mtf value, chooses the minimum region of mtf value as region to be adjusted;
MTF difference calculating module 102, poor for calculating the MTF between other each regions and described region to be adjusted respectively
Value, chooses default rotating shaft according to the region that MTF difference between described region to be adjusted is maximum;
Anglec of rotation computing module 103, for according to the mtf value in described region to be adjusted, preset standard mtf value and described
The calibration factor in region to be adjusted, calculate described camera lens module treats the anglec of rotation;
Control module 104, is used for controlling described camera lens module and treats the anglec of rotation along described in described default rotating shaft rotation, so that
MTF difference percentage ratio between other regions arbitrary and described region to be adjusted is respectively less than presets MTF difference percentage threshold;
Return module 105, be used for returning mtf value detection module 101, until in described film image between all regions
MTF difference percentage ratio is respectively less than when presetting MTF difference percentage threshold and stops.
In the present embodiment, described all regions include the top left region of film image, lower left region, right regions and the right side
Lower region.
In one embodiment, mtf value detection module 101 is additionally operable to: compare the mtf value in the described all regions detected
Size.
In the present embodiment, described default rotating shaft from the horizontal rotating shaft overlapped with the cross-section center line of described camera lens module,
The transit axle that overlaps with the longitudinal section centrage of described camera lens module and respectively with in two oblique sections of described camera lens module
The main diagonal axis that heart line overlaps is chosen in secondary diagonal axis, and described cross section, described longitudinal section and said two oblique section are all worn
Crossing the geometric center of described camera lens module, wherein, main diagonal axis passes described camera lens module top left region and lower right area.
In one embodiment, MTF difference calculating module 102 is additionally operable to: relatively other each regions calculated are with described
The size of the MTF difference between region to be adjusted.
In one embodiment, MTF difference calculating module 102, specifically for:
When described region to be adjusted is top left region, and the region that between described region to be adjusted, MTF difference is maximum is respectively
During for lower left region, right regions and lower right area, selected default rotating shaft is respectively horizontal rotating shaft, transit axle and secondary diagonal angle
Axle;
When described region to be adjusted is lower left region, and the region that between described region to be adjusted, MTF difference is maximum is respectively
During for top left region, right regions and lower right area, selected default rotating shaft is respectively horizontal rotating shaft, main diagonal axis and transit
Axle;
When described region to be adjusted is right regions, and the region that between described region to be adjusted, MTF difference is maximum is respectively
During for top left region, lower left region and lower right area, selected default rotating shaft is respectively transit axle, main diagonal axis and horizontal turn
Axle;
When described region to be adjusted is lower right area, and the region that between described region to be adjusted, MTF difference is maximum is respectively
During for top left region, lower left region and right regions, selected default rotating shaft is respectively secondary diagonal axis, transit axle and horizontal turn
Axle.
In one embodiment, described system also includes:
MTF difference percentage calculation module, for calculating the MTF between other each regions and described region to be adjusted respectively
Difference percentage ratio, and it is default to judge whether the MTF difference percentage ratio between other each regions and described region to be adjusted is respectively less than
MTF difference percentage threshold, the most then judge that described optical camera has been calibrated, if otherwise returning the anglec of rotation to calculate mould
Block 103.
In one embodiment, described system also includes:
Calibration factor computing module, be used for precalculating described camera lens module along its all default rotating shafts rotate time, described
Calibration factor corresponding to all regions in film image;
MTF parameter setting module, is used for pre-setting standard mtf value and MTF difference percentage threshold.
As shown in Figure 4, in the present embodiment, described calibration factor computing module includes:
Preliminary assembly unit 201, for tentatively assembling camera lens module and photosensitive module, sets the most described camera lens
The anglec of rotation that module rotates along its all default rotating shafts is 0;
Mtf value excursion computing unit 202, for predetermined angle increment, controls described camera lens module respectively along it
Described default rotating shaft rotates in the range of predetermined angle, and detects the mtf value change in all regions in described film image respectively
Scope;
Calibration factor computing unit 203, for according to described predetermined angle scope and described mtf value excursion, calculates
Described camera lens module along its all default rotating shafts rotate time, calibration factor corresponding to all regions in described film image.
In one embodiment, mtf value excursion computing unit 202, it is additionally operable to, with predetermined angle increment, detect institute respectively
When stating camera lens module along different rotating shaft different rotation angle, different mtf values corresponding to zones of different in described film image.
Mtf value detection module 101 in the present invention, MTF difference calculating module 102, anglec of rotation computing module 103, control
Molding block 104 and return module 105 may each be physical storage disk or controller, the control chip etc. with corresponding function,
Wherein control module 104 can also is that the mechanical arm being mechanically connected with camera lens module, drives motor etc. can control camera lens module
The machinery rotated.
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all essences in the present invention
Any amendment, equivalent and the improvement etc. made within god and principle, should be included within the scope of the present invention.