Summary of the invention
In view of this, the invention proposes a kind of TDI-CCD camera binocular vision system visual fields pair of view-based access control model feedbackNeat method can conveniently, efficiently, accurately realize the alignment of binocular vision system visual field.
To achieve the above object, the invention proposes a kind of TDI-CCD camera binocular vision systems of view-based access control model feedbackVisual field alignment schemes, include the following steps:
Step 1, two TDI-CCD cameras in binocular vision system are staggered relatively, by the calibration gridiron pattern of this cameraOn fixed camera over there;
Step 2, the holder of two TDI-CCD cameras is adjusted, this camera acquires the calibration chessboard table images on the camera of opposite,Judge to demarcate whether chessboard table images meet the requirements, if satisfied, then identifying X-comers, otherwise returns to two TDI- of adjustmentThe holder of CCD camera, until calibration chessboard table images are met the requirements;
Step 3, the chessboard angular coordinate identified according to step 2 calculates the optical center imaging position O ' of opposite camera and visitsSurvey face projection imaging direction vectorPass through the optical center imaging position O ' of opposite camera and O pairs of the optical imagery position of this cameraThan obtaining optical center location error;Pass through the test surface projection imaging direction vector of opposite cameraIt is thrown with the test surface of this cameraShadow imaging direction vectorAngle calcu-lation, obtain test surface projection imaging slope error;
Based on the optical center location error and test surface projection imaging slope error, adjusted by Fuzzy PIDThe pitch angle of this camera and opposite camera head, azimuth and roll angle, eliminate the optical center location error and test surface is thrownShadow imaging slopes error completes visual field alignment.
Wherein, it in the step 2, is identified, is obtained using image coordinate of the sub-pix recognition methods to X-comersObtain X-comers coordinate.
Wherein, in the step 2, after acquisition image is carried out binaryzation, according to the topological relation in connection region, judge to markDetermine whether chessboard table images meet the requirements.
Wherein, in the step 3, the optical center location error and test surface projection imaging slope error form error vectorWherein, eyIt is the direction the y distance of optical center location error, indicates azimuth angle error;exIt is optical center location errorThe direction x distance, indicate pitching angle error;eθIt is test surface projection imaging slope error, indicates rolling angle error;Based on errorVectorObtain the conditional parameter K of Fuzzy PIDP, KI, KD;By error vectorWith conditional parameter KP, KI, KDInputPid control algorithm determines the pitch angle of this camera and opposite camera head, the adjustment amount at azimuth and roll angle and adjustment sideTo.
Wherein, in the step 2, the roll angle of this camera is fixed on set angle;
During the adjustment of the pitch angle of this camera and opposite camera head, azimuth and roll angle, this camera is only adjustedWhole pitch angle and azimuth, opposite camera adjust pitch angle, azimuth and roll angle;It is detected when in opposite camera acquisition imageFace projection imaging slope is zero, then camera roll angle in opposite is adjusted in place, then according to gridiron pattern center pixel and camera lens circleThe azimuth of imago element Coordinate Adjusting both sides and pitch angle make other side's lens imaging to the center pixel of face system of battle formations picture, then and twoThe visual field of camera is aligned.
Wherein, during to the adjustment of the pitch angle of this camera and opposite camera head, azimuth and roll angle, work as errorVector1 normIt is adjusted less than holder is stopped after given threshold;After two camera heads stop adjustment, according to testDemand adjusts holder pitch angle, so that camera optical axis intersects, forms binocular vision system.
Wherein, in the Fuzzy PID, the output quantity of PID controller is u (t), input quantity is deviation e (t),Meet:
Wherein, KP, KI, KDFor the conditional parameter of PID;
KP, KI, KDThe fuzzy rule of parameter regulation is as shown in table 1- table 3:
Table 1 adjusts KPFuzzy control rule
Table 2 adjusts KIFuzzy control rule
Table 3 adjusts KDFuzzy control rule
In table L, M, S, ZO respectively indicate cover all variables fuzzy subset it is large, medium and small, zero.
The utility model has the advantages that
The present invention is based on the coplanar quick adjustings of TDI-CCD camera test surface of visual feedback fuzzy control, to camera imageThe imaging position of middle opposite side scaling board identifies, automatically confirms that the optical center imaging position of opposite camera and test surface projection imaging are obliqueRate, and then the pitch angle of electronic adjustment camera is controlled using FUZZY ALGORITHMS FOR CONTROL, so that two cameras are in optical axis coincidence, polar curve phaseTogether, be conducive to building for big test surface, and the positioning accuracy of the binocular vision system can be improved, it is bis- to solve TDI-CCDMesh vision system target surface builds the problem of coplanar adjusting low efficiency of middle test surface, low precision, avoids manual operations due to artificialPrecision caused by difference is unstable, when testing especially for big target surface, keeps TDI-CCD camera binocular vision system high-precisionDegree, high efficiency completion are built.Use the present invention that can make TDI-CCD camera binocular vision using visual feedback fuzzy control technologyTwo viewing field of camera alignment in feel system, so that TDI-CCD camera binocular vision system builds more quick, positioning accuracy moreIt is high.
Specific embodiment
The present invention will now be described in detail with reference to the accompanying drawings and examples.
The invention proposes the fuzzy PID control methods of view-based access control model feedback, make photoelectric test system at the scene can be fastSpeed carries out the coplanar adjustment of camera test surface, and solution conventional laser mutually takes aim at or the adjustment time of gun sight manual aiming length, low precisionThe problem of.
Fig. 1 is the hardware composition of TDI-CCD camera test surface, the first CCD and the 2nd CCD of two of them TDI-CCD cameraFor main sensing device, industry control portable computer is used to carry out the algorithm control of visual feedback, and each camera has a cloudPlatform is controlled and a gridiron pattern is for visual feedback.When first CCD camera is this ground camera, the second CCD camera is oppositeCamera, on the contrary also set up.
Fig. 2 is the coplanar quickly regulating method flow chart of TDI-CCD camera test surface of view-based access control model feedback fuzzy control.PacketInclude following steps:
Step 1, the binocular vision system, including this camera, opposite camera and its corresponding cloud are arranged according to testing requirementPlatform, two TDI-CCD cameras in binocular vision system are staggered relatively, by the fixed phase over there of the calibration gridiron pattern of this cameraOn machine;
Wherein, photoelectricity test equipment is laid according to testing requirement as shown in Figure 1, and fixed gridiron pattern scaling board.
Step 2, the holder of two TDI-CCD cameras is adjusted, this camera acquires the calibration chessboard table images of opposite camera, sentencesWhether disconnected calibration chessboard table images meet the requirements, if satisfied, then identifying X-comers, otherwise return to two TDI-CCD of adjustmentThe holder of camera, until calibration chessboard table images are met the requirements;
The roll angle of this camera can be fixed on set angle, by adjusting the holder of this camera and opposite camera, madeThe calibration gridiron pattern imaging of the other-party camera is at this end in image;
Roll angle to the zero-bit that the first CCD camera is manually adjusted in the present embodiment makes its test surface vertical, guarantees firstTest surface where CCD is in vertical direction.The azimuth for manually adjusting the first CCD and the second CCD camera makes above other side's camera lensCalibration gridiron pattern be imaged in respective image, reduction mutually search for the tessellated time.
After acquisition image being carried out binaryzation, according to the topological relation in connection region, judge whether there is scheduledGridiron pattern.
Wherein, it is identified using image coordinate of the sub-pix recognition methods to X-comers, obtains X-comersCoordinate.
Step 3, the chessboard angular coordinate identified according to step 2 calculates the optical center imaging position O ' of opposite camera and visitsSurvey face projection imaging direction vectorPass through the optical center imaging position O ' of opposite camera and O pairs of the optical imagery position of this cameraThan obtaining optical center location error;Pass through the test surface projection imaging direction vector of opposite cameraIt is thrown with the test surface of this cameraShadow imaging direction vectorAngle calcu-lation, obtain test surface projection imaging slope error;
Based on the optical center location error and test surface projection imaging slope error, adjusted by Fuzzy PIDThe pitch angle of this camera and opposite camera head, azimuth and roll angle, eliminate the optical center location error and test surface is thrownShadow imaging slopes error completes visual field alignment.
Wherein, the optical center location error and test surface projection imaging slope error form error vector
Wherein, eyIt is the direction the y distance of optical center location error, indicates azimuth angle error;exIt is the side x of optical center location errorTo distance, pitching angle error is indicated;eθIt is test surface projection imaging slope error, indicates rolling angle error;Based on error vectorIt must obtain the conditional parameter K of Fuzzy PIDP, KI, KD;By error vectorWith conditional parameter KP, KI, KDInput PID controlAlgorithm processed determines the adjustment amount and adjustment direction of the pitch angle of this camera and opposite camera head, azimuth and roll angle, toolBody process are as follows:
If the output quantity of PID controller is u (t), input quantity is deviation e (t), relationship between them are as follows:
K in formulaP、KI、KDIt is ratio, integral and the differential gain respectively.To obtain Satisfactory Control effect, these three parameters are needed(fuzzy control) is adjusted in real time according to system mode.However for interfering the system changeable, load is changeable, often do not determineMathematical model or rule can be followed, and are difficult on-line identification and go out these parameters, such as the mutual negative-feedback regu- lation three-axle table in system two sides,Space Coupling relationship between turntable can not indicate calibration with tessellated corner location relationship with mathematical model.Fuzzy controlDevice can control inaccurate motion mathematical model, can accommodate uncertain input variable, and can generate smooth control outputAmount, can carry out real time nonlinear adjusting, and system is made to be optimal adjusting and quickly control.
The advantages of the present embodiment combination PID control and fuzzy control, using three on fuzzy-adaptation PID control or so detection target bodyThe movement of axis electrical turntable.The basic thought of fuzzy PID regulation control is:
The initial stage is responded in system, deviation | e (t) | it is larger, to accelerate system response time, take biggish KP, make beThe time constant and damped coefficient of system reduce.Simultaneously to avoid integral from being saturated, there is larger overshoot, integral gain KIIt should not mistakeGreatly, it is the over range control for avoiding system from may cause when starting, lesser K should be takenD.With deviation | e (t) | reduce, isShorten regulating time and suitably reduces KP, reduce system overshoot.At this time it is the response speed of guarantee system, can suitably increases KI, KDValue is appropriate.When deviation | e (t) | when smaller, to make system have good steady-state performance, system works in overdamp shapeState can use biggish KPAnd KI.When system steady operation, adjusting target is to inhibit the variation of e (t) and de (t), appropriate to increaseKD, system is avoided to vibrate in equalization point.
Based on the above thought, and previous work experience is combined, considers visual feedback input variable e (t) and deviation variation rateThe influence of de (t), synthesis obtain the fuzzy rule that pid parameter shown in 1~table of table 3 is adjusted, and L, M, S, ZO are respectively indicated in tableThe fuzzy subset for covering all variables is large, medium and small, zero.
Table 1 adjusts KPFuzzy control rule
Table 2 adjusts KIFuzzy control rule
Table 3 adjusts KDFuzzy control rule
For electrical turntable fuzzy-adaptation PID control structure as shown in figure 3, by Fuzzy processing, fuzzy controller adjusts the ginseng of PIDIt counts, electric pulse number is exported to the three-axle table of holder after PID controller anti fuzzy method, is adjusted in place to three-axle table, afterContinuous acquisition image carries out next successive step, includes the following steps:
This camera only adjusts pitch angle and azimuth, and opposite camera adjusts pitch angle, azimuth and roll angle;Work as oppositeIt is zero that camera, which acquires test surface projection imaging slope in image, then camera roll angle in opposite is adjusted in place, then according to gridiron patternThe azimuth and pitch angle of center pixel and camera lens center pixel Coordinate Adjusting both sides, make other side's lens imaging to face system of battle formations pictureCenter pixel, then the visual field alignment of two cameras.
Wherein, during the adjustment, work as error vector1 normIt is adjusted less than holder is stopped after given threshold;WhenAfter two camera heads stop adjustment, according to testing requirement, holder pitch angle is adjusted, so that camera optical axis intersects, forms binocularVision system.
In conclusion the above is merely preferred embodiments of the present invention, being not intended to limit the scope of the present invention.All within the spirits and principles of the present invention, any modification, equivalent replacement, improvement and so on should be included in of the inventionWithin protection scope.