CN112308933B - Method and device for calibrating camera internal reference and computer storage medium - Google Patents

Method and device for calibrating camera internal reference and computer storage medium Download PDF

Info

Publication number
CN112308933B
CN112308933B CN202011235516.6A CN202011235516A CN112308933B CN 112308933 B CN112308933 B CN 112308933B CN 202011235516 A CN202011235516 A CN 202011235516A CN 112308933 B CN112308933 B CN 112308933B
Authority
CN
China
Prior art keywords
camera
image
gray value
infrared light
calibration
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
CN202011235516.6A
Other languages
Chinese (zh)
Other versions
CN112308933A (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.)
Goertek Optical Technology Co Ltd
Original Assignee
Goertek Optical 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 Goertek Optical Technology Co Ltd filed Critical Goertek Optical Technology Co Ltd
Priority to CN202011235516.6A priority Critical patent/CN112308933B/en
Publication of CN112308933A publication Critical patent/CN112308933A/en
Application granted granted Critical
Publication of CN112308933B publication Critical patent/CN112308933B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10048Infrared image

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Studio Devices (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The invention discloses a method and a device for calibrating camera internal parameters and a computer storage medium, wherein the method comprises the following steps: collecting an infrared light grid image formed by a laser emitter; acquiring the corner position of the infrared light grid image, wherein the brightness of pixel points at the corner position is greater than that of other pixel points of the infrared light grid image except the pixel points at the corner position; and determining the internal parameters of the camera according to the corner position. Therefore, the calibration picture can be adjusted through the laser emitter at any time, the problem that the chessboard pattern is inconvenient to adjust is solved, and the effect that the laser beam can be flexibly adjusted according to the test requirements of the module to obtain different calibration pictures is achieved.

Description

Method and device for calibrating camera internal reference and computer storage medium
Technical Field
The invention relates to the field of computer vision, in particular to a method and a device for calibrating camera internal parameters and a computer storage medium.
Background
In image measurement or other applications of computer vision, the calibration of imaging parameters is a very critical link, which is a basic problem of a computer vision system, and the calibration precision directly affects the performance of subsequent vision tasks.
In a specific shooting project, although a manufacturer provides a camera and most parameters of a shooting lens used by the camera and corresponding to the camera, the precision of data provided by the manufacturer often cannot meet the application requirements in the actual project, for example, the image quality cannot meet the actual use requirements due to lens distortion, so that in the actual application process, computer vision workers often need to recalibrate the camera according to the actual use condition, obtain specific and accurate internal parameters, and obtain the orientation information of a shooting space to obtain a distortion-free image to meet the needs of a user.
At present, the method for performing internal reference calibration is a zhang's calibration method, which includes firstly shooting a calibration board to obtain a calibration picture, the calibration board being a chessboard pattern formed by black and white rectangles, then extracting angular point information of the calibration picture, the angular points being inner angular points on the calibration board, and the angular points not contacting with the edge of the calibration board. And then, carrying out a series of operations on the obtained corner point information to finally finish the calibration of the module internal parameters. The calibration plate is generally a chessboard figure formed by black and white alternate rectangles, but the size and dimension of the chessboard figure as the calibration plate need to be designed according to the requirements of module testing, and chessboard figures are marked with pictures and are inconvenient to adjust when the chessboard figures are tested under different modules.
Disclosure of Invention
The embodiment of the application aims to solve the problem that a chessboard diagram is inconvenient to adjust when the camera internal reference calibration process is tested under different modules in the prior art by providing a camera internal reference calibration method, a camera internal reference calibration device and a computer storage medium.
In order to achieve the above object, the present invention provides a camera internal reference calibration method, which comprises the following steps:
collecting an infrared light grid image formed by a laser transmitter;
acquiring the corner position of the infrared light grid image, wherein the brightness of pixel points at the corner position is greater than that of other pixel points of the infrared light grid image except the pixel points at the corner position;
and determining the internal parameters of the camera according to the corner position.
Optionally, before the step of acquiring the infrared light grid image formed by the laser emitter, the method further includes:
the method comprises the following steps of controlling two infrared laser transmitters with mutually vertical light emitting directions to emit parallel infrared beams so as to form an infrared light grid image, wherein the infrared laser transmitters are positioned in the same plane.
Optionally, the infrared laser emitter is located on the calibration board, and the step of acquiring the infrared light grid image formed by the laser emitter further includes:
adjusting the relative orientation between the calibration plate and the camera;
returning to execute the acquisition of the infrared light grating images formed by the laser transmitter until all the infrared light grating images in the preset directions are acquired;
the step of determining the internal parameters of the camera according to the corner positions comprises the following steps:
and determining the internal parameters of the camera according to the corner point positions corresponding to the infrared light grid images.
Optionally, the step of acquiring the corner positions of the infrared light grid image includes:
carrying out binarization processing on the infrared light grid image to obtain a binarized image;
and acquiring the corner position according to the binary image.
Optionally, the step of performing binarization processing on the infrared light grid image includes:
comparing the gray value of each pixel point with a preset gray value corresponding to the pixel point;
adjusting the gray value of the pixel point with the gray value greater than or equal to the preset gray value to be a first gray value;
adjusting the gray value of the pixel point with the gray value smaller than the preset gray value to be a second gray value;
the step of obtaining the corner position according to the binary image comprises the following steps:
and taking the position of the pixel point with the gray value of the first gray value in the binary image as the corner position.
Optionally, the preset gray value is an average gray value of an image area where the pixel point is located, and the infrared light grid image is equally divided into a plurality of image areas.
Optionally, the step of determining the internal parameters of the camera according to the corner positions includes:
determining the position of a pixel point corresponding to the angular point in a pixel coordinate system according to a preset mapping relationship and the position of the angular point in an image coordinate system, wherein the preset mapping relationship is a conversion relationship between the angular point in the infrared grating image and a pixel point corresponding to the image coordinate system;
and determining the internal parameters of the camera according to the preset mapping relation and the pixel point coordinate position corresponding to the corner point.
In order to achieve the above object, the present invention further provides a camera internal reference calibration apparatus, which includes a memory, a processor, and a camera internal reference calibration program stored in the memory and executable on the processor, where the processor executes the camera internal reference calibration program to implement the camera internal reference calibration method.
In order to achieve the above object, the present invention further provides a computer readable storage medium, on which a program for camera internal reference calibration is stored, and when the program is executed by a processor, the method for camera internal reference calibration is implemented.
The method, the device and the computer storage medium for calibrating the camera internal reference, provided by the embodiment of the invention, are used for acquiring an infrared light grid image formed by vertically intersected infrared light emitted by an adjustable laser emitter and a laser receiver as a calibration picture, and performing binarization processing on the calibration picture. Therefore, the position of the laser transmitter and the laser receiver and the density of the infrared beams can be adjusted in real time according to the pixel parameters of the camera, so that the size of the calibration picture can be adjusted, and the effect of flexibly adjusting the calibration picture when testing is carried out under different modules is achieved.
Drawings
Fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an infrared light grid image formed by a laser transmitter and a laser receiver according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for calibrating camera internal parameters according to a first embodiment of the present invention;
FIG. 4 is a flowchart illustrating a method for calibrating camera internal parameters according to a second embodiment of the present invention;
FIG. 5 is a flowchart illustrating a method for calibrating camera parameters according to a third embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating an infrared grating image being binarized according to an embodiment of the present invention;
FIG. 7 is a diagram of a mapping relationship between a world coordinate system and a pixel coordinate system according to the present invention;
FIG. 8 is a schematic diagram of a world coordinate system, a camera coordinate system, an image coordinate system, and a pixel coordinate system according to the present invention;
FIG. 9 is a schematic view of the corner points of the present invention converted from the world coordinate system to the camera coordinate system;
fig. 10 is a schematic diagram of the corner points projected from the camera coordinate system to the image coordinate system according to the present invention.
Detailed Description
For a better understanding of the above technical solutions, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As an implementation manner, the apparatus for camera internal reference calibration may be as shown in fig. 1.
The embodiment of the invention relates to a camera internal reference calibration device, which comprises a processor 101, such as a CPU (central processing unit), a memory 102 and a communication bus 103. Wherein a communication bus 103 is used for enabling the connection communication between these components.
The memory 102 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as a disk memory. As shown in fig. 1, the memory 103, which is a kind of computer storage medium, may include a control program of the apparatus for camera internal reference calibration; and the processor 101 may be configured to call a control program of the camera internal reference calibration apparatus stored in the memory 102, and perform the following operations:
collecting an infrared light grid image formed by a laser transmitter;
acquiring the corner position of the infrared light grid image, wherein the brightness of pixel points at the corner position is greater than that of other pixel points of the infrared light grid image except the pixel points at the corner position;
and determining the internal parameters of the camera according to the corner position.
Further, the processor 101 may be configured to call a control program of the apparatus for camera internal reference calibration stored in the memory 102, and perform the following operations:
the method comprises the following steps of controlling two infrared laser transmitters with mutually vertical light emitting directions to emit parallel infrared beams so as to form an infrared light grid image, wherein the infrared laser transmitters are positioned in the same plane.
Further, the processor 101 may be configured to call a control program of the apparatus for camera internal reference calibration stored in the memory 102, and perform the following operations:
adjusting the relative orientation between the calibration plate and the camera;
returning to execute the acquisition of the infrared light grating images formed by the laser transmitter until all the infrared light grating images in the preset directions are acquired;
further, the processor 101 may be configured to call a control program of the apparatus for camera internal reference calibration stored in the memory 102, and perform the following operations:
carrying out binarization processing on the infrared light grid image to obtain a binarized image;
and acquiring the corner position according to the binary image.
Further, the processor 101 may be configured to call a control program of the apparatus for camera internal reference calibration stored in the memory 102, and perform the following operations:
comparing the gray value of each pixel point with a preset gray value corresponding to the pixel point;
adjusting the gray value of the pixel point of which the gray value is greater than or equal to the preset gray value to be a first gray value;
adjusting the gray value of the pixel point with the gray value smaller than the preset gray value to be a second gray value;
the step of obtaining the corner position according to the binary image comprises the following steps:
and taking the position of the pixel point with the gray value of the first gray value in the binary image as the corner position.
Further, the processor 101 may be configured to call a control program of the apparatus for camera internal reference calibration stored in the memory 102, and perform the following operations:
determining the position of a pixel point corresponding to the angular point in a pixel coordinate system according to a preset mapping relationship and the position of the angular point in an image coordinate system, wherein the preset mapping relationship is a conversion relationship between the angular point in the infrared grating image and a pixel point corresponding to the image coordinate system;
and determining the internal parameters of the camera according to the preset mapping relation and the pixel point coordinate position corresponding to the corner point.
According to the scheme, an infrared light grid image formed by vertically intersected infrared light emitted by an adjustable laser emitter and an adjustable laser receiver is obtained as a calibration picture, binarization processing is carried out on the calibration picture, and as the gray value of a pixel point where the infrared light intersects is larger than that of a single light beam, the gray value of the pixel of the calibration picture can be adjusted in the binarization processing process, so that the calibration picture only displays position information of an infrared light intersection point, namely an angular point, and then camera internal parameters are determined according to the angular point position information. Therefore, the position of the laser transmitter and the laser receiver and the density of the infrared beams can be adjusted in real time according to the pixel parameters of the camera, so that the size of the calibration picture can be adjusted, and the effect of flexibly adjusting the calibration picture when testing is carried out under different modules is achieved.
Referring to fig. 2, fig. 2 is a schematic diagram of an infrared light grid image formed by a laser transmitter and a laser receiver according to the present invention:
two laser transmitters 201 which are perpendicular to each other and have intersecting end points are arranged on the plane of the calibration plate, the laser transmitters 201 transmit a plurality of infrared light beams 203 to be received by two corresponding laser receivers 202 which are perpendicular to each other and have intersecting end points, two rows of the perpendicularly intersecting infrared light beam sets form an infrared light grid, the intersection point 204 of the infrared light beams is an angular point, and the gray value of the pixel point of the angular point is larger than the gray value of the single infrared light beam. And taking the shot infrared light grid image as a marked picture. The laser transmitter 201 and the laser receiver 202 form a rectangle, and the laser transmitter 201 and the laser receiver 202 can increase or decrease in length. The size of the interval between each infrared beam can be adjusted by the laser transmitter 201 and the laser receiver 202, so that the size of the infrared light grid image can be adjusted according to the pixels of the camera.
In the embodiment of the invention, two rows of vertically intersected infrared beam sets emitted by laser emitters which are perpendicular to each other and end points of which are intersected form an infrared light grid calibration picture. The size of the infrared light grating can be adjusted by adjusting the position, the length and the infrared beam density of the laser transmitter according to the actual pixel requirement of the camera without changing a chessboard pattern every time a test module is changed, so that the convenience of using the calibration picture is improved, and the effect of flexibly adjusting the calibration picture when testing is carried out under different modules is achieved.
Based on the hardware architecture of the camera internal reference calibration device, the embodiment of the camera internal reference calibration method is provided.
Referring to fig. 3, fig. 3 is a first embodiment of the camera internal reference calibration method of the present invention, which includes the following steps:
s10, collecting an infrared light grid image formed by a laser transmitter;
further comprising, before step S10: two infrared laser transmitters with mutually vertical light emitting directions are controlled to emit parallel infrared beams so as to form an infrared light grid image, and the infrared laser transmitters are positioned in the same plane; further, the infrared laser transmitter is located on the calibration board.
The laser emitter is in a long strip shape and can be increased or shortened, and the laser emitter can emit a row of infrared beam sets and can adjust the density of the infrared beam sets. The two laser transmitters are vertically arranged on the plane of the calibration plate in an end point intersecting manner, and emit two rows of vertically intersecting infrared beam sets to the correspondingly arranged laser receivers so as to form an infrared light grating image, and the infrared light grating image is obtained and used as a calibration picture to calibrate the internal reference of the camera.
Step S20, acquiring the corner position of the infrared light grid image, wherein the brightness of pixel points at the corner position is greater than the brightness of other pixel points of the infrared light grid image except the pixel points at the corner position;
the luminance values generally correspond to the gray values, i.e. the larger the luminance value the larger the gray value, and the smaller the luminance value the smaller the gray value. The gray value of the pixel point of the infrared light intersection point is larger than the gray value of the pixel of the single beam of infrared light, so that the gray value of the pixel in the binarization process can be adjusted to enable the infrared light grid image to only display the infrared light beam intersection point, namely the position of the angular point, and then calculation is carried out according to the position relation of the angular point in the infrared light grid image to obtain the internal reference of the camera. The binarization processing of the image refers to setting the gray value of a pixel point on the image to be 0 or 255, that is, converting the whole image into a gray map, namely, displaying the visual effect of only displaying black and white.
And S30, determining the intrinsic parameters of the camera according to the corner position.
It is understood that step S30 includes:
determining the position of a pixel point corresponding to the angular point in a pixel coordinate system according to a preset mapping relationship and the position of the angular point in an image coordinate system, wherein the preset mapping relationship is a conversion relationship between the angular point in the infrared grating image and a pixel point corresponding to the image coordinate system;
and determining the internal parameters of the camera according to the preset mapping relation and the pixel point coordinate position corresponding to the corner point.
Firstly, the angular point position coordinates of a calibration picture are rotated and translated from a world coordinate system to obtain corresponding position coordinates in a camera coordinate system, after the position and the orientation of a camera in a three-dimensional space are determined, the angular point position is projected and perspectively transmitted from the camera coordinate system to an image coordinate system (imaging plane coordinate system), the step is the conversion from a three-dimensional point to a two-dimensional point, and then an internal reference matrix is listed according to the corresponding relation between the coordinates of an imaging point of the angular point in the image coordinate system and the coordinate position of the imaging point in a pixel coordinate system, namely the preset mapping relation, so as to obtain the internal reference of the camera.
Referring to fig. 7, fig. 7 is a mapping relationship diagram from a world coordinate system to a pixel coordinate system.
Specifically, referring to fig. 8, fig. 8 is a world coordinate system Xw, yw, zw; camera coordinate systems Xc, yc, zc; image coordinate systems x, y; pixel coordinate systems u, v.
The Zc axis of the camera coordinate system coincides with the optical axis of the camera, and is perpendicular to the plane of the image coordinate system and passes through the origin of the image coordinate system, and the distance between the camera coordinate system and the image coordinate system is the focal length f (that is, the origin of the image coordinate system coincides with the focal point). The pixel coordinate system plane u-v and the image coordinate system plane x-y coincide, but the origin of the pixel coordinate system is located in the upper left corner of the figure (which is so defined that reading and writing is started from the first address where information is stored).
The process of converting the corner points from the world coordinate system to the camera coordinate system can be obtained by rotation and translation, and we can represent the transformation matrix by a homogeneous coordinate matrix formed by combining a rotation matrix and a translation vector, as shown in the following formula
Figure BDA0002764763540000081
Wherein, [ Xw Yw Zw] T World coordinates representing corner points, [ Xc Yc Zc] T The camera coordinates representing the corner points, R is a rotation matrix, t is a translation matrix, and the two form a 3 × 4 matrix, namely an external reference matrix of the camera, because it is assumed that the plane of the object point in the world coordinate system passes through the origin of the world coordinate system and is perpendicular to the Zw axis (i.e., the plane of the calibration plate is coincident with the Xw-Yw plane), zw =0 can be directly converted into the form of formula 1. Wherein the transformation matrix is the frontThe reference to the external reference matrix, referred to herein as the external reference matrix, is to be understood as relating to only the camera external parameters, and the external reference matrix varies with the camera position.
Fig. 9 shows the process of converting the world coordinate system to the camera coordinate system with R, t.
From camera coordinate system to image coordinate system: this process performs a conversion from three-dimensional coordinates to two-dimensional coordinates, i.e., a projection perspective process (projecting an object onto a projection surface by a center projection method, thereby obtaining a single-sided projection drawing closer to a visual effect). The pinhole imaging procedure is used to illustrate: the pinhole plane (camera coordinate system) is between the image plane (image coordinate system) and the angular point plane (calibration plate plane), and the formed image is an inverted real image. For more convenient mathematical description, the positions of the camera coordinate system and the image coordinate system can be exchanged, and the arrangement mode is changed as shown in fig. 10, and assuming that the coordinates of the point M corresponding to the corner point in the camera coordinate system are M (Xm, ym, zm), the coordinates of the imaging point P (Xp, yp, f) in the image coordinate system are (can be obtained by the principle of similar triangle)
Figure BDA0002764763540000082
The above is expressed as a homogeneous coordinate representation:
Figure BDA0002764763540000091
from the image coordinate system to the pixel coordinate system: since the defined pixel coordinate system and the image coordinate system are in the same plane, and the origin of the pixel coordinate system is not coincident with the origin of the image coordinate system, the coordinate of the origin of the pixel coordinate system in the image coordinate system is assumed to be (u) 0 ,v 0 ) The size of each pixel point in the x-axis and y-axis directions of the image coordinate system is as follows: dx, dy, and the coordinates of the image point in the image coordinate system are (Xc, yc), so the coordinates of the imaging point corresponding to the corner point in the pixel coordinate system can be obtained as:
Figure BDA0002764763540000092
to a homogeneous coordinate representation available:
Figure BDA0002764763540000093
in formula 2, (Xp, yp) are coordinates in the image coordinate system, as in formula 4, (Xc, yc). The above-mentioned
Figure BDA0002764763540000094
I.e. the preset mapping relationship between the image coordinate system of the corner point and the pixel coordinate system. The conversion matrix multiplication of the formula 2 and the formula 4 is the internal reference matrix Q:
Figure BDA0002764763540000095
and (5) obtaining the internal reference of the camera according to the internal reference matrix.
In the technical scheme provided by this embodiment, a camera acquires an infrared light grid image formed by vertically intersecting infrared light emitted by an adjustable laser emitter and a laser receiver as a calibration picture, binarization processing is performed on the calibration picture, and since the brightness of pixel points where the infrared light intersects is greater than that of a single light beam, the gray value of pixels of the calibration picture can be adjusted in the binarization processing process so that the calibration picture only displays position information of infrared light intersection points, namely corner points, and then camera internal parameters are determined according to the corner point position information. Therefore, the position of the laser transmitter and the laser receiver and the density of the infrared beams can be adjusted in real time according to the pixel parameters of the camera, so that the size of the calibration picture can be adjusted, and the effect of flexibly adjusting the calibration picture when testing is carried out under different modules is achieved.
Referring to fig. 4, fig. 4 is a second embodiment of the control method of the camera internal reference calibration apparatus according to the present invention, and based on the first embodiment, after step S10, the method includes:
s11, adjusting the relative orientation between the calibration plate and the camera;
s12, returning to execute the acquisition of the infrared light grating images formed by the laser emitter until all the infrared light grating images in the preset directions are acquired; the preset orientation can be adjusted according to actual requirements.
The calibration object is needed to be selected according to the calculation of camera internal parameters by the Zhang calibration method, and the infrared grating image is selected as the calibration picture which is easier to process compared with a three-dimensional object, but at the same time, the two-dimensional calibration picture lacks a part of information relative to the three-dimensional object, so that the direction of the calibration picture needs to be changed to capture the infrared grating image so as to obtain richer coordinate information. Meanwhile, a homography matrix is determined according to the coordinates of the corner points of the calibration picture and the corresponding relation between the world coordinates of the corner points in the calibration picture, the image coordinates and the pixel coordinates to calculate the camera internal parameters. And determining an internal reference matrix Q according to the homography matrix, wherein the internal reference matrix Q comprises 5 parameters, so that 3 homography matrices are needed, and the 3 homography matrices can generate 6 equations under 2 constraints so as to solve 5 internal references. Therefore, three calibration pictures with different relative orientations between the camera and the calibration board are needed. In this embodiment, the relative orientation between the infrared light grid image and the camera is adjusted to obtain three different calibration pictures for calculating the camera internal parameters.
It is understood that the step S30 includes:
and S31, determining internal parameters of the camera according to the corner point positions corresponding to the infrared light grid images.
And determining a homography matrix according to the corresponding relation between the world coordinates of the corner points in the calibration pictures in different relative orientations with the camera and the image coordinates, wherein 8 unknowns are to be solved in the homography matrix, at least 8 equations are needed, and each corner point coordinate can provide two equations, so that four corner points are generally selected from each calibration picture as target corner points to calculate the internal reference of the camera.
In the technical solution provided by this embodiment, generally, at least three infrared light grid images with different relative orientations to the camera need to be collected as calibration pictures. Four corner points are selected for each calibration picture as target corner points, a matrix equation containing the internal reference can be established based on the world coordinates and the image coordinates of the target corner points, and the specific numerical value of the internal reference can be solved by simultaneously establishing the matrix equations of a plurality of calibration pictures.
Referring to fig. 5, fig. 5 is a third embodiment of the method for controlling a camera internal reference calibration apparatus according to the present invention, and based on the first or second embodiment, after step S20, the method includes:
s21, carrying out binarization processing on the infrared light grid image to obtain a binarized image;
and S22, acquiring the corner position according to the binarized image.
The person skilled in the art can perform binarization processing on the infrared light grid image by setting a preset gray value, i.e. step S21 includes:
comparing the gray value of each pixel point with a preset gray value corresponding to the pixel point;
further, adjusting the gray value of the pixel point of which the gray value is greater than or equal to the preset gray value to be a first gray value;
adjusting the gray value of the pixel point with the gray value smaller than the preset gray value to be a second gray value;
meanwhile, step S22 includes:
and taking the position of the pixel point with the gray value of the first gray value in the binary image as the corner position.
It is understood that the infrared light grid image is equally divided into a plurality of image areas; the preset gray value can be set to meet the condition that the preset gray value is larger than a second gray value, namely the gray value of a single-beam infrared beam pixel, and is simultaneously smaller than a first gray value, namely the gray value of a pixel of an infrared beam intersection point, namely an angular point, namely the gray value of the pixel, namely the average gray value of an image area where the pixel point is located; the preset gray value can also be directly set as the gray value corresponding to the single infrared ray.
Referring to fig. 6 (a), the marked picture obtained by the module is a picture in which two directions of the infrared beam are crossed with each other, the gray value of the crossed position of the two beams is higher than the gray value of the single beam, and in order to obtain the crossed point of the infrared beam, namely the corner point of the picture, a specific algorithm is as follows: and converting the obtained image into a gray scale image, and highlighting the corner points (infrared beam cross points) by adopting a threshold value binarization method, wherein the threshold value is a preset gray scale value. In this embodiment, the single beam is quantized to background color, and the crossing point, i.e., corner point, of the infrared beam is highlighted. Referring to fig. 6 (b), a single beam of light in the binarized image is colorless, and the intersection point, i.e., the corner point, of the infrared beam is black.
The preset gray value method is to determine whether each pixel point in the image belongs to a target area or a north background area by judging whether the characteristic attribute of each pixel point in the image meets the requirement of a preset gray value, so that a gray image is converted into a binary image. Expressed by a mathematical expression, the original image f (x, y) can be set, T is a preset gray value, and the following formula is satisfied when the image is divided:
Figure BDA0002764763540000111
there are many methods for obtaining the preset gray value, and here, an adaptive threshold method may be used to divide the picture into several regions, and obtain the maximum gray value and the minimum gray value of each region respectively, so as to obtain an average gray value, that is, the preset gray value of the region, pixels lower than the preset gray value, that is, pixels corresponding to the second gray value, are set to be colorless, pixels higher than the preset gray value, that is, pixels corresponding to the first gray value, are set to be black, and thus obtain a binary image of the whole image. In this embodiment, for example, in a certain region of the infrared light grid image, the minimum grayscale value is a pixel grayscale value 1 of a single beam of infrared light, the maximum grayscale value is a pixel grayscale value 3 of an infrared beam intersection, then the average grayscale value is T = (1 + 3)/2 =, the preset grayscale value is 2, only the corner position in the binarized image is displayed as black, the other single beams of infrared light are displayed as white background, and the position coordinates of the corner are determined according to the binarized image.
In the technical scheme provided by this embodiment, the gray value of the pixel point at the intersection of the infrared light is greater than the gray value of the pixel of the single beam of infrared light, so that the preset gray value of the pixel in the binarization process can be adjusted to enable only the intersection of the infrared beam, that is, the position of the corner point, to be displayed in the infrared light grid image. Therefore, only the position of the angular point is displayed in the calibration picture through binarization processing, so that the coordinate information of the angular point can be accurately extracted, and the angular point of the angular point region of the calibration picture can be introduced in the subsequent internal reference calibration calculation process, so that the angular point is prevented from being unclear, and the accuracy of the internal reference calibration result is improved.
The invention also provides a camera internal reference calibration device, which comprises a memory, a processor and a camera internal reference calibration program stored on the memory and capable of running on the processor, wherein the processor executes the camera internal reference calibration program to realize the camera internal reference calibration method of the above embodiment.
The present invention also provides a computer-readable storage medium, on which a program for camera internal reference calibration is stored, and when executed by a processor, the program for camera internal reference calibration implements the method for camera internal reference calibration as described in the above embodiments.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus, and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While alternative embodiments of the present invention have been described, additional variations and modifications of those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including alternative embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the invention without departing from the invention
The spirit and scope of which should be assessed. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (8)

1. A method for calibrating camera internal parameters is characterized by comprising the following steps:
collecting an infrared light grid image formed by a laser emitter;
carrying out binarization processing on the infrared light grid image to obtain a binarized image;
acquiring a corner position according to the binary image, wherein the brightness of the pixel point at the corner position is greater than the brightness of other pixel points of the infrared light grid image except the pixel point at the corner position;
and determining the internal parameters of the camera according to the corner position.
2. The method for camera internal reference calibration according to claim 1, wherein the step of acquiring the image of the infrared light grid formed by the laser emitter further comprises:
the method comprises the following steps of controlling two infrared laser transmitters with mutually vertical light emitting directions to emit parallel infrared beams so as to form an infrared light grid image, wherein the infrared laser transmitters are positioned in the same plane.
3. The method for camera internal reference calibration according to claim 2, wherein the infrared laser emitter is located on a calibration board, and the step of acquiring the infrared light grid image formed by the laser emitter further comprises:
adjusting the relative orientation between the calibration plate and the camera;
returning to execute the acquisition of the infrared light grating images formed by the laser transmitter until all the infrared light grating images in the preset directions are acquired;
the step of determining the internal parameters of the camera according to the corner positions comprises the following steps:
and determining the internal parameters of the camera according to the corner point positions corresponding to the infrared light grid images.
4. The method for calibrating the camera internal reference according to claim 1, wherein the step of binarizing the infrared light grid image comprises:
comparing the gray value of each pixel point with a preset gray value corresponding to the pixel point;
adjusting the gray value of the pixel point with the gray value greater than or equal to the preset gray value to be a first gray value;
adjusting the gray value of the pixel point with the gray value smaller than the preset gray value to be a second gray value;
the step of obtaining the corner position according to the binary image comprises the following steps:
and taking the position of the pixel point with the gray value of the first gray value in the binary image as the corner position.
5. The method for camera internal reference calibration as claimed in claim 4, wherein the preset gray-level value is an average gray-level value of image areas where the pixels are located, and the infrared light grid image is equally divided into a plurality of the image areas.
6. The method for camera internal reference calibration according to claim 1, wherein the step of determining the camera internal parameters according to the corner positions comprises:
determining the position of a pixel point corresponding to the angular point in a pixel coordinate system according to a preset mapping relationship and the position of the angular point in an image coordinate system, wherein the preset mapping relationship is a conversion relationship between the angular point in the infrared grating image and a pixel point corresponding to the image coordinate system;
and determining the internal parameters of the camera according to the preset mapping relation and the pixel point coordinate position corresponding to the corner point.
7. An apparatus for camera reference calibration, comprising a memory, a processor, and a program for camera reference calibration stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1-6 when executing the program for camera reference calibration.
8. A computer-readable storage medium, on which a program for camera internal reference calibration is stored, wherein the program for camera internal reference calibration, when executed by a processor, implements the method of any one of claims 1-6.
CN202011235516.6A 2020-11-06 2020-11-06 Method and device for calibrating camera internal reference and computer storage medium Active CN112308933B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011235516.6A CN112308933B (en) 2020-11-06 2020-11-06 Method and device for calibrating camera internal reference and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011235516.6A CN112308933B (en) 2020-11-06 2020-11-06 Method and device for calibrating camera internal reference and computer storage medium

Publications (2)

Publication Number Publication Date
CN112308933A CN112308933A (en) 2021-02-02
CN112308933B true CN112308933B (en) 2023-01-20

Family

ID=74326497

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011235516.6A Active CN112308933B (en) 2020-11-06 2020-11-06 Method and device for calibrating camera internal reference and computer storage medium

Country Status (1)

Country Link
CN (1) CN112308933B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113420732B (en) * 2021-08-23 2022-02-01 深圳市城市交通规划设计研究中心股份有限公司 Pavement disease detection method and device and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106097348A (en) * 2016-06-13 2016-11-09 大连理工大学 A kind of three-dimensional laser point cloud and the fusion method of two dimensional image
CN106197321A (en) * 2016-07-06 2016-12-07 太原科技大学 Projector calibrating method based on red blue gridiron pattern scaling board
CN107063130A (en) * 2017-05-26 2017-08-18 西南石油大学 A kind of workpiece automatic soldering method based on optical grating projection three-dimensionalreconstruction
CN108964777A (en) * 2018-07-25 2018-12-07 南京富锐光电科技有限公司 A kind of high speed camera calibration system and method
CN109215108A (en) * 2017-06-30 2019-01-15 深圳先进技术研究院 Panorama three-dimensional reconstruction system and method based on laser scanning
WO2019080229A1 (en) * 2017-10-25 2019-05-02 南京阿凡达机器人科技有限公司 Chess piece positioning method and system based on machine vision, storage medium, and robot
CN110796708A (en) * 2019-10-24 2020-02-14 中国科学院上海光学精密机械研究所 Projector calibration method based on Gold matrix projection
CN111429532A (en) * 2020-04-30 2020-07-17 南京大学 Method for improving camera calibration accuracy by utilizing multi-plane calibration plate

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106097348A (en) * 2016-06-13 2016-11-09 大连理工大学 A kind of three-dimensional laser point cloud and the fusion method of two dimensional image
CN106197321A (en) * 2016-07-06 2016-12-07 太原科技大学 Projector calibrating method based on red blue gridiron pattern scaling board
CN107063130A (en) * 2017-05-26 2017-08-18 西南石油大学 A kind of workpiece automatic soldering method based on optical grating projection three-dimensionalreconstruction
CN109215108A (en) * 2017-06-30 2019-01-15 深圳先进技术研究院 Panorama three-dimensional reconstruction system and method based on laser scanning
WO2019080229A1 (en) * 2017-10-25 2019-05-02 南京阿凡达机器人科技有限公司 Chess piece positioning method and system based on machine vision, storage medium, and robot
CN108964777A (en) * 2018-07-25 2018-12-07 南京富锐光电科技有限公司 A kind of high speed camera calibration system and method
CN110796708A (en) * 2019-10-24 2020-02-14 中国科学院上海光学精密机械研究所 Projector calibration method based on Gold matrix projection
CN111429532A (en) * 2020-04-30 2020-07-17 南京大学 Method for improving camera calibration accuracy by utilizing multi-plane calibration plate

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
光栅投影式三维摄影测量仪的几何标定方法;罗剑等;《光电工程》;20051130(第11期);全文 *

Also Published As

Publication number Publication date
CN112308933A (en) 2021-02-02

Similar Documents

Publication Publication Date Title
US10872439B2 (en) Method and device for verification
US10924729B2 (en) Method and device for calibration
CN108020825B (en) Fusion calibration system and method for laser radar, laser camera and video camera
CN107993263B (en) Automatic calibration method for panoramic system, automobile, calibration device and storage medium
CN107505324B (en) 3D scanning device and scanning method based on binocular collaborative laser
US7124046B2 (en) Method and apparatus for calibration of camera system, and method of manufacturing camera system
CN108074237B (en) Image definition detection method and device, storage medium and electronic equipment
CN113146073B (en) Vision-based laser cutting method and device, electronic equipment and storage medium
JP2001524228A (en) Machine vision calibration target and method for determining position and orientation of target in image
CN111161358B (en) Camera calibration method and device for structured light depth measurement
JP2022528301A (en) Calibration method, positioning method, equipment, electronic devices and storage media
CN112308933B (en) Method and device for calibrating camera internal reference and computer storage medium
CN113298886A (en) Calibration method of projector
JP2672509B2 (en) Method and apparatus for automatically calibrating camera model
CN116524022B (en) Offset data calculation method, image fusion device and electronic equipment
CN114792343B (en) Calibration method of image acquisition equipment, method and device for acquiring image data
CN111857623A (en) Calibration apparatus, calibration system, and display apparatus calibration method
CN112995641B (en) 3D module imaging device and method and electronic equipment
CN111105365A (en) Color correction method, medium, terminal and device for texture image
CN116051652A (en) Parameter calibration method, electronic equipment and storage medium
US20220083071A1 (en) Relative positioning device, and corresponding relative positioning method
CN105989587B (en) Automatic calibration method of multifunctional OCT system
CN113759346B (en) Laser radar calibration method and device, electronic equipment and storage medium
CN110852278B (en) Ground identification line recognition method, ground identification line recognition equipment and computer-readable storage medium
CN109754365B (en) Image processing method and device

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