Disclosure of Invention
The invention aims to solve the defects in the prior art, and provides a calibration plate and a calibration method for the combined calibration of a visible light camera and an infrared camera, which have the characteristics of simple structure, easiness in manufacturing, low cost, high precision and the like, can be directly applied to the calibration and calibration fields of infrared cameras such as automatic driving, battlefield environment detection, aviation and the like, have good market competitiveness and are worthy of recommendation.
In order to achieve the purpose, the invention adopts the following technical scheme:
the utility model provides a calibration plate for visible light and infrared camera jointly mark, includes the base plate, the base plate upper surface is covered and is equipped with the calibration thing, the calibration thing upper surface is equipped with a plurality of circular black lumps, surface mounting has the foamed plastic board under the base plate, a plurality of mounting holes have been seted up with the perpendicular corresponding position in circular black lump centre of a circle to the foamed plastic board upper surface, the mounting hole internally mounted has small-size tungsten filament bulb, foamed plastic board internally mounted has DC power supply, and is a plurality of small-size tungsten filament bulb all is connected between wire and the DC power supply.
Preferably, the substrate is made of a black opaque acrylic plate, and the ratio of the length to the width of the substrate is 1: 1.
Preferably, the length of the calibration object is shorter than the length of the substrate, and the width of the calibration object is shorter than the length of the calibration object.
Preferably, the circular black blocks have a total of twenty.
Preferably, the ratio of the length to the width of the foam plastic board is 1: 1, and the length and the width of the foam plastic board are the same as those of the substrate.
A method for jointly calibrating a visible light camera and an infrared camera comprises the following four parts: s1: and switching on a power supply, and simultaneously acquiring visible light images and thermal infrared images of the calibration plate in different directions by adjusting the direction of the calibration plate.
S2: and acquiring the coordinates of the central point of the circular black block in the visible light image and calibrating the visible light camera by taking the coordinates as input parameters.
S3: and repeating the step of S2 by using the coordinates of the center point of the white circle in the thermal infrared image to calibrate the thermal infrared camera.
S4: and inputting the internal parameters of the two cameras, calculating the external parameters, and carrying out binocular joint calibration.
A method for visible light and infrared camera joint calibration, the S4 comprising: s41: the internal reference matrix and distortion coefficient matrix of each of the two cameras are input.
S42: the rotation matrix and translation vector between the two cameras are calculated by the stereoCalibrate () function.
S43: the images of the two cameras are corrected by a stereoRectify () function.
The invention provides a calibration plate and a calibration method for the combined calibration of a visible light camera and an infrared camera, which have the advantages that: the invention adopts a mode of arranging mounting holes on the surface of a plastic foam plate and mounting small tungsten filament bulbs in the mounting holes to simulate an infrared heat source in order to realize the calibration of the thermal infrared camera, the position of each small tungsten filament bulb is superposed with the circle center of the corresponding circular black block, the picture shot by the visible light camera is only provided with the circular black block, the light emitted by the bulb can not penetrate through the circular black block and can not influence the calibration of the visible light camera, the white point of the picture shot by the thermal infrared camera is the same as the circle center of the circular black block shot by the visible light camera, the calibration of the visible light camera and the thermal infrared camera can be completed only by obtaining a plurality of pictures with different angles at the same time, the operation is simple, the calibration is quick and convenient, the time required by the calibration is greatly saved, the efficiency of the calibration work is improved, and the calibration plate is very convenient to manufacture and has lower cost, the calibration device can be directly applied to the calibration field of infrared cameras such as automatic driving, battlefield environment detection and aviation, and the practicability of the calibration plate is improved.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
Referring to fig. 1-3, a calibration plate and a calibration method for the combined calibration of a visible light and infrared camera comprise a substrate 1, wherein the substrate 1 is made of a black opaque acrylic plate, the ratio of the length to the width of the substrate 1 is 1: 1, light emitted by a small tungsten filament bulb 6 when the small tungsten filament bulb is electrified can be isolated, a picture shot by the visible light camera is only a circular black block, and the light emitted by the bulb cannot penetrate through the circular black block.
The upper surface of the base plate 1 is covered with a calibration object 2, the length of the calibration object 2 is shorter than that of the base plate 1, and the width of the calibration object 2 is shorter than that of the calibration object 2.
The upper surface of the calibration object 2 is provided with a plurality of circular black blocks 3, the circular black blocks 3 are twenty in number, the surface of the base plate 1 is provided with a foam plastic plate 4, the length and the width of the foam plastic plate 4 are 1: 1, and the length and the width of the foam plastic plate 4 are identical to those of the base plate 1, so that the position of the small tungsten filament bulb 6 can correspond to the circle center of the circular black blocks 3 one to one, and the practical plastic material is low in cost and can isolate heat transfer as much as possible.
A plurality of mounting holes 5 have been seted up with 3 centre of a circle vertical corresponding positions of circular black piece to the 4 upper surfaces of foamed plastic board, and 5 internally mounted of mounting hole have small-size tungsten filament bulb 6, and 4 internally mounted of foamed plastic board has DC power supply 7, and DC power supply can adopt 6V dry battery, and a plurality of small-size tungsten filament bulbs 6 are all connected between wire and DC power supply 7.
A method for jointly calibrating a visible light camera and an infrared camera comprises the following four parts: s1: and switching on a power supply, and simultaneously acquiring visible light images and thermal infrared images of the calibration plate in different directions by adjusting the direction of the calibration plate, wherein the visible light images and the thermal infrared images of the calibration plate in different directions can be shot by 20 or other numbers at the same time.
S2: obtaining the coordinate of the central point of a circular black block 3 in a visible light image and using the coordinate as an input parameter to calibrate the visible light camera, utilizing opencv to calculate an internal reference matrix of the visible light camera according to a Zhang-Yongyou calibration method, firstly obtaining the coordinates of the circle center of the circular black block 3 in a calibration plate, then obtaining the three-dimensional coordinates of each circle center point in the environment, namely world coordinates, then obtaining the coordinates of the camera through rotation and translation, and finally calling an opencv function to calculate the internal reference matrix, wherein the known transformation relationship between the image coordinates and pixel coordinates is that
Wherein u is0,v0Typically half the size of an image pixel, f is the focal length, dx and dy are the physical width and height, respectively, of a pixel, fx=f/dx,fyThe relationship between world coordinates and camera coordinates is known as f/dy:
R3×3as a rotation matrix, t3×1For the translation matrix, simplification yields:
k is a camera internal reference matrix and [ R t ] is an external reference matrix, and during the calibration calculation process, the problem of camera distortion needs to be considered, because the pinhole model is an approximate model of the camera, and the lens of the camera is placed not parallel to the photosensitive film, the image will be distorted, that is, the pixel coordinate actually corresponding to the world coordinate deviates from the theoretical position, and the camera distortion is expressed as:
judging whether a search image contains a circular calibration plate or not by a findCirclesgrid () function, if so, calculating the center coordinates of each circular black block 3, drawing corner point coordinates in an original image by a drawChessboardCorrers () function, refining the corner point coordinates of the circular calibration plate by a find4 QuadCornerSux () function, and then determining a world coordinate system, wherein the world coordinate system is arbitrarily specified manually, so that a simpler coordinate system can be selected as the world coordinate system in the actual operation process, considering that the circular black blocks 3 are a plane and the size intervals of each circle are the same, the first inner corner point at the upper left corner is taken as the coordinate origin, the plane where the calibration plate is located is taken as a plane z ═ 0, and the lines and the columns of the inner corner points are taken as an x axis and a y axis, so that the three-dimensional coordinates of the world coordinate system of each circular center can be directly given according to the size of the circular black blocks 3, for example, the center interval of each circle is 10cm, then the coordinates of the first inner corner point are (0,0,0), the coordinates of the second inner corner point in the same row are (10,0,0), the coordinates of the second inner corner point in the same column are (0,10,0), and finally the calibretacarama () function is called to calculate the internal parameter matrix and the distortion coefficient matrix of the visible light camera.
S3: the method comprises the steps of repeating the step S2 by using the center point coordinate of the white circle in the thermal infrared image to calibrate the thermal infrared camera, obtaining the center point coordinate of the white circle in the infrared image and using the center point coordinate as an input parameter for calibrating the thermal infrared camera, calibrating the thermal infrared camera through opencv according to the principle of the Zhang Zhengyou calibration method, and calculating an internal reference matrix and a distortion coefficient matrix of the thermal infrared camera.
S4: inputting internal parameters of the two cameras, calculating external parameters, and performing binocular joint calibration, wherein the step S4 further comprises the following steps: s41: the internal reference matrix and distortion coefficient matrix of each of the two cameras are input.
S42: the rotation matrix and the translation vector between the two cameras are calculated through a stereoCalibrate () function, imaging planes of the two cameras can be transformed to the same plane according to a transformation relation, and meanwhile, the x axes of the images are collinear, so that projection points of coordinate points in the space on the two images have the same height, namely, y coordinates are the same.
S43: the images of the two cameras are corrected by a stereoRectify () function.
In conclusion, the calibration plate is based on the Zhangyingyou monocular calibration and the binocular calibration methods, calibration is carried out by searching the circular center through opencv, the calibration plate has the characteristics of simple calibration method and high precision, and the calibration plate has the characteristics of low cost and simplicity in manufacturing due to the fact that the small tungsten filament bulb 6 is adopted to generate heat to simulate an infrared heat source, and the calibration plate can be used for carrying out high-precision calibration on visible light and thermal infrared cameras at the same time.
The working principle is as follows: after the power is switched on, a visible light camera and a thermal infrared camera can be used for simultaneously shooting images of a plurality of calibration plates under different angles, the visible light camera is calibrated in the visible light image according to the position of a circular black block 3, the thermal infrared camera calibrates the thermal infrared camera according to the position of the center of a white dot in the shot image as an input parameter, an inner reference matrix of the visible light camera can be calculated by utilizing opencv according to the Zhang Zhengyou calibration method, the calibration of the camera adopts the Zhang Zhengyou calibration method, firstly, the central coordinates of the circular black block 3 in the visible light image are obtained, then, the three-dimensional coordinates of each central point in the environment, namely, world coordinates are obtained, then, the camera coordinates are obtained through rotation and translation, finally, the inner reference matrix and the distortion coefficient matrix of the visible light camera can be calculated by calling an opencv function, the central coordinates of a white circle in the thermal infrared image are obtained in the same manner, and then, the camera coordinates are obtained, calling an opencv function to calculate an internal reference matrix and a distortion coefficient matrix of the thermal infrared camera, calling a binocular camera calibration function to calculate a rotation amount and a translation amount between the two cameras after the two cameras respectively finish monocular calibration, namely an external reference matrix, and finally correcting images of the two cameras to enable the two images to have the same y coordinate.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and the inventive concepts thereof according to the present invention should be equivalent or changed within the scope of the present invention.