[go: up one dir, main page]

CN118397108B - A calibration method for combining underwater acoustic and optical information - Google Patents

A calibration method for combining underwater acoustic and optical information Download PDF

Info

Publication number
CN118397108B
CN118397108B CN202410832136.2A CN202410832136A CN118397108B CN 118397108 B CN118397108 B CN 118397108B CN 202410832136 A CN202410832136 A CN 202410832136A CN 118397108 B CN118397108 B CN 118397108B
Authority
CN
China
Prior art keywords
coordinates
coordinate system
camera
matrix
world
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
CN202410832136.2A
Other languages
Chinese (zh)
Other versions
CN118397108A (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.)
Ocean University of China
Original Assignee
Ocean University of China
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 Ocean University of China filed Critical Ocean University of China
Priority to CN202410832136.2A priority Critical patent/CN118397108B/en
Publication of CN118397108A publication Critical patent/CN118397108A/en
Application granted granted Critical
Publication of CN118397108B publication Critical patent/CN118397108B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S15/00Systems using the reflection or reradiation of acoustic waves, e.g. sonar systems
    • G01S15/86Combinations of sonar systems with lidar systems; Combinations of sonar systems with systems not using wave reflection
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S15/00Systems using the reflection or reradiation of acoustic waves, e.g. sonar systems
    • G01S15/88Sonar systems specially adapted for specific applications
    • G01S15/89Sonar systems specially adapted for specific applications for mapping or imaging
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S7/00Details of systems according to groups G01S13/00, G01S15/00, G01S17/00
    • G01S7/52Details of systems according to groups G01S13/00, G01S15/00, G01S17/00 of systems according to group G01S15/00
    • G01S7/52004Means for monitoring or calibrating
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Measurement Of Velocity Or Position Using Acoustic Or Ultrasonic Waves (AREA)

Abstract

The invention provides a calibration method for underwater acousto-optic information combination, and belongs to the technical field of underwater acoustics and optical imaging. The invention establishes a camera imaging model according to the pinhole imaging principle, utilizes a checkerboard calibration plate as a standard reference object, and solves an internal matrix of the camera through coordinate conversion and a maximum likelihood methodAnd a distortion matrix; according to Zhang Zhengyou calibration method, using a function in openCV to obtain a rotation matrix and a translation matrix between a world coordinate system and a camera coordinate system which take sonar as an origin; and calculating the conversion relation among the four coordinate systems by using an imaging model of the camera, thereby completing calibration. According to the sonar image acquisition method, the sonar image can be obtained only by obtaining the position coordinates of the target object, so that the sonar image acquisition cost is reduced, and the algorithm calculation complexity is low. By the establishment of the method, the combination of acoustic information and optical information is realized, and the purpose of improving the underwater imaging quality is achieved.

Description

一种用于水下声光信息结合的标定方法A calibration method for combining underwater acoustic and optical information

技术领域Technical Field

本发明属于水下声学及光学成像技术领域,尤其涉及一种用于水下声光信息结合的标定方法。The invention belongs to the technical field of underwater acoustic and optical imaging, and in particular relates to a calibration method for combining underwater acoustic and optical information.

背景技术Background Art

在海洋勘探活动中,自主水下航行器(Autonomous Underwater Vehicles, AUV)和有缆水下机器人(Remote Operated Vehicle, ROV)是主要的探测工具,通常配备声呐和摄像机。声呐不受水体浑浊程度的影响,可以探测到距离相对较远的目标物,摄像机可以直观地得到高分辨率的目标图像,但由于海水中光的散射和介质对其吸收的影响,导致光学图像模糊,颜色失真,成像距离受到严重限制。自主水下航行器(AUV)和有缆水下机器人(ROV)驶近目标物,根据目标位置信息及采集到的图像信息进行灯光亮度调节。这两种成像技术具有互补性。因此,声光融合技术近年来发展迅速,在水下领域得到了广泛的应用,是提高整体成像能力的一种很有潜力的方法。In marine exploration activities, autonomous underwater vehicles (AUV) and remote operated vehicles (ROV) are the main detection tools, usually equipped with sonar and cameras. Sonar is not affected by the turbidity of the water and can detect targets at a relatively long distance. The camera can intuitively obtain high-resolution target images, but due to the scattering of light in seawater and the influence of the medium on its absorption, the optical image is blurred, the color is distorted, and the imaging distance is severely limited. Autonomous underwater vehicles (AUV) and remote operated vehicles (ROV) approach the target and adjust the light brightness according to the target position information and the collected image information. These two imaging technologies are complementary. Therefore, the acoustic-optical fusion technology has developed rapidly in recent years and has been widely used in the underwater field. It is a very potential method to improve the overall imaging capability.

目前水下声光融合主要的研究方向是水下声光图像空间配准算法,主要分为基于区域和基于特征的配准方法。At present, the main research direction of underwater acoustic and optical fusion is the underwater acoustic and optical image spatial registration algorithm, which is mainly divided into region-based and feature-based registration methods.

基于区域的水下声光图像配准方法主要利用光声两幅图像的灰度统计信息,通过搜索其最优化全局参数来得到配准测度函数,从而实现两幅图像在空间上的配准。这种遍历式的搜索匹配算法计算量和复杂度较高,而且匹配精度与原数据质量有关,需要图像之间存在较大的重叠区域。The region-based underwater photoacoustic image registration method mainly uses the grayscale statistical information of the two photoacoustic images to obtain the registration measurement function by searching for its optimal global parameters, thereby realizing the spatial registration of the two images. This traversal search and matching algorithm has high computational complexity and matching accuracy, and the matching accuracy is related to the quality of the original data, requiring a large overlapping area between the images.

基于特征的配准方法以基于特征描述符的配准方法和基于深度学习的配准方法为主。基于特征的配准算法受到水下声光影像显著的结构差异影响,如目标物在声光图像中发生旋转或比例存在差异等都会降低特征描述符的稳健性,影响配准精度。 对于基于深度学习的配准方法,需要大量数据集训练泛化能力强的网络。因此,基于特征的配准方法需要统一的水下声光数据集,水下光学场景数据集获取简单,而声呐图像采集实验成本高。Feature-based registration methods are mainly based on feature descriptor-based registration methods and deep learning-based registration methods. Feature-based registration algorithms are affected by the significant structural differences of underwater acoustic and optical images. For example, if the target object is rotated or has different proportions in the acoustic and optical images, the robustness of the feature descriptor will be reduced and the registration accuracy will be affected. For deep learning-based registration methods, a large number of data sets are required to train a network with strong generalization ability. Therefore, feature-based registration methods require a unified underwater acoustic and optical data set. Underwater optical scene data sets are easy to obtain, while sonar image acquisition experiments are costly.

发明内容Summary of the invention

基于上述亟待解决的问题,本发明提出了一种多物理场标定方法,通过相机标定方法将声呐探测到的目标物的坐标,即以声呐为原点的世界坐标系下的坐标,转换为目标物在光学图像中的像素坐标,从而实现声学信息与光学信息结合,达到提高水下成像质量的目的。Based on the above problems to be solved urgently, the present invention proposes a multi-physical field calibration method, which converts the coordinates of the target object detected by sonar, that is, the coordinates in the world coordinate system with sonar as the origin, into the pixel coordinates of the target object in the optical image through a camera calibration method, thereby realizing the combination of acoustic information and optical information and achieving the purpose of improving the quality of underwater imaging.

本发明提出了一种用于水下声光信息结合的标定方法,包括以下步骤:The present invention proposes a calibration method for combining underwater sound and light information, comprising the following steps:

步骤1,根据小孔成像原理建立摄像机成像模型,设定以声呐为原点的世界坐标系,摄像机坐标系,图像物理坐标系,图像像素坐标系Step 1: Establish a camera imaging model based on the pinhole imaging principle, and set the sonar as the origin World coordinate system , camera coordinate system , image physical coordinate system , image pixel coordinate system ;

步骤2,利用一个棋盘格标定板作为标准参照物,通过变换它的位置,摄像机采集多幅图像,已知棋盘格的尺寸和每个格子的大小,建立棋盘格上角点的图像物理坐标与对应的图像点在摄像机坐标系下的二维图像坐标之间的关系,经过坐标转换和最大似然法,求解出摄像机内部矩阵和畸变矩阵;Step 2: Use a checkerboard calibration plate as a standard reference. By changing its position, the camera collects multiple images. Given the size of the checkerboard and the size of each grid, establish the relationship between the image physical coordinates of the corner points on the checkerboard and the two-dimensional image coordinates of the corresponding image points in the camera coordinate system. After coordinate transformation and maximum likelihood method, solve the camera internal matrix and the distortion matrix;

步骤3,根据张正友标定法,利用求解出的摄像机内部矩阵和畸变矩阵以及已知的目标物特征点的世界坐标和目标物特征点在图像中的像素坐标,使用openCV中的函数得到以声呐为原点的世界坐标系和摄像机坐标系之间的旋转矩阵和平移矩阵;Step 3: According to Zhang Zhengyou calibration method, use the solved camera internal matrix And the distortion matrix and the known world coordinates of the target feature points and the pixel coordinates of the target feature points in the image, use the function in openCV to get the rotation matrix and translation matrix between the world coordinate system with the sonar as the origin and the camera coordinate system;

步骤4,利用摄像机的成像模型计算四个坐标系之间的转换关系;即推导得到世界坐标系中的目标物特征点的坐标与其在摄像机成像平面上的像素坐标之间的数学关系,将内部矩阵、畸变矩阵、旋转矩阵和平移矩阵代入关系式中,得到已知的声呐识别的目标位置的坐标和目标物的像素坐标之间的映射关系,从而完成标定。Step 4: Use the imaging model of the camera to calculate the transformation relationship between the four coordinate systems; that is, derive the mathematical relationship between the coordinates of the feature points of the target object in the world coordinate system and its pixel coordinates on the imaging plane of the camera, and convert the internal matrix , distortion matrix, rotation matrix and translation matrix are substituted into the relationship to obtain the coordinates of the target position identified by the known sonar. and the pixel coordinates of the target The mapping relationship between them is established to complete the calibration.

优选的,所述步骤1中设定以声呐为原点的世界坐标系,摄像机坐标系,图像物理坐标系,图像像素坐标系,具体为:Preferably, in step 1, the sonar is set as the origin World coordinate system , camera coordinate system , image physical coordinate system , image pixel coordinate system , specifically:

以声呐为坐标原点建立世界坐标系 轴满足右手螺旋定则;Sonar is the coordinate origin Establishing the world coordinate system ; , and The axis satisfies the right-hand screw rule;

设定摄像机坐标系,以摄像机光心作为坐标系的原点,经过光心垂直于成像平面的直线作轴,轴和轴所形成的平面与成像平面平行来建立摄像机坐标系;Set the camera coordinate system , with the camera optical center As the origin of the coordinate system, a straight line passing through the optical center and perpendicular to the imaging plane is drawn axis, Axis and The plane formed by the axes is parallel to the imaging plane to establish the camera coordinate system;

设定图像物理坐标系,图像物理坐标系建立在摄像机二维成像面上,原点为摄像机光轴与成像面的交点,轴分别平行于摄像机坐标系的轴;Set the image physical coordinate system , the image physical coordinate system is established on the two-dimensional imaging surface of the camera, and the origin is the intersection of the camera optical axis and the imaging surface, axis The axes are parallel to the camera coordinate system axis axis;

设定图像像素坐标系;图像像素坐标系以图像左上角为原点,轴为坐标轴,坐标轴的单位为像素pixel,像素的横坐标与纵坐标分别表示图像数组中所在的行数与列数。Set the image pixel coordinate system ; The image pixel coordinate system takes the upper left corner of the image as the origin, axis The axis is the coordinate axis, the unit of the coordinate axis is pixel, and the horizontal coordinate of the pixel is With vertical coordinate Respectively represent the row and column numbers in the image array.

优选的,所述步骤2的具体过程为:Preferably, the specific process of step 2 is:

利用一个已知尺寸和每个格子大小的棋盘格标定板作为标准参照物,为保证标定的精度,采集N张不同位置不同角度的棋盘格标定板图像;A checkerboard calibration plate with known dimensions and grid size is used as a standard reference. To ensure the accuracy of calibration, N images of the checkerboard calibration plate at different positions and angles are collected.

使用openCV库中内置的calibrateCamera函数进行标定,标定程序读取角点的像素坐标和世界坐标,所述角点的像素坐标是角点在采集的图像中的像素坐标;所述角点的世界坐标是角点在以棋盘格标定板为z平面,以棋盘格左上角点为原点,以棋盘格长、宽分别为x、y轴建立的世界坐标系中的世界坐标;Use the built-in calibrateCamera function in the openCV library for calibration. The calibration program reads the pixel coordinates and world coordinates of the corner points. The pixel coordinates of the corner points are the pixel coordinates of the corner points in the acquired image; the world coordinates of the corner points are the world coordinates of the corner points in a world coordinate system established with the chessboard calibration plate as the z plane, the upper left corner of the chessboard as the origin, and the length and width of the chessboard as the x and y axes respectively;

摄像机标定的原理为:The principle of camera calibration is:

其中分别表示分别表示水平方向和垂直方向上单位距离内像素的个数,表示焦距,摄像机坐标系的轴与图像交点的像素坐标为in , Respectively and , , Respectively represent the number of pixels per unit distance in the horizontal and vertical directions, Represents the focal length, in the camera coordinate system The pixel coordinates of the intersection of the axis and the image are ;

标定时将世界坐标系的平面定义在标定板平面上,表示在这种世界坐标系下棋盘格角点的世界坐标,是棋盘格角点的像素坐标;的投影矩阵;表示摄像机的外参矩阵;分别表示标定时定义的世界坐标系相对于摄像机坐标系的旋转矩阵和平移矩阵;根据最大似然法计算摄相机的内部矩阵和畸变矩阵。During calibration, the world coordinate system The plane is defined on the calibration plate plane. represents the world coordinates of the corner points of the chessboard in this world coordinate system, are the pixel coordinates of the corner points of the chessboard; for The projection matrix; Represents the extrinsic parameter matrix of the camera; and Respectively represent the rotation matrix and translation matrix of the world coordinate system defined during calibration relative to the camera coordinate system; the internal matrix of the camera is calculated according to the maximum likelihood method and the distortion matrix.

优选的,所述步骤3的具体过程为:Preferably, the specific process of step 3 is:

获取以声呐为原点的世界坐标系下目标物特征点的世界坐标;获取目标物特征点的像素坐标;Obtain the world coordinates of the feature points of the target object in the world coordinate system with the sonar as the origin; obtain the pixel coordinates of the feature points of the target object;

用求解出的摄像机内部参数和畸变矩阵以及已知的目标物特征点的世界坐标和目标物特征点在图像中的像素坐标,使用openCV中内置的solvePnP函数求出旋转向量和平移矩阵,并用Rodrigues函数将旋转向量转换为旋转矩阵The camera internal parameters are solved The built-in solvePnP function in openCV is used to find the rotation vector and translation matrix using the distortion matrix, the world coordinates of the known target feature points, and the pixel coordinates of the target feature points in the image. , and use the Rodrigues function to convert the rotation vector into a rotation matrix .

优选的,所述获取以声呐为原点的世界坐标系下目标物特征点的世界坐标是使用以下三种方法中的任意一种:Preferably, the world coordinates of the feature points of the target object in the world coordinate system with the sonar as the origin are obtained by using any one of the following three methods:

利用卷尺测量 轴上的坐标表示以声呐为原点的世界坐标系下目标物特征点的世界坐标;Measuring with a tape measure , and The coordinates on the axis represent the world coordinates of the feature points of the target object in the world coordinate system with the sonar as the origin;

或用二维声呐获取影像,测量得到极坐标,用卷尺得到轴上的坐标,将二维声呐得到的极坐标转换为测量 轴上的世界坐标,结合轴上的世界坐标,得到以声呐为原点的世界坐标系下目标物特征点的世界坐标;Or use 2D sonar to obtain images, measure polar coordinates, and use a tape measure to obtain The coordinates on the axis are converted into the polar coordinates obtained by the two-dimensional sonar. , The world coordinates on the axis, combined The world coordinates on the axis are obtained to obtain the world coordinates of the feature points of the target object in the world coordinate system with the sonar as the origin;

或直接用三维声呐测量获得以声呐为原点的世界坐标系下目标物特征点的世界坐标。Or directly use three-dimensional sonar measurement to obtain the world coordinates of the target feature points in the world coordinate system with the sonar as the origin.

优选的,所述步骤4的具体过程为:Preferably, the specific process of step 4 is:

S1,将已知的声呐识别的目标位置的坐标转换为摄像机坐标系中的坐标S1, the coordinates of the target position identified by the known sonar Convert to camera coordinates ;

S2,将已知的声呐识别的目标位置在摄像机坐标系中的齐次坐标转换为图像物理坐标系中的齐次坐标,通过针孔相机模型有:S2, the homogeneous coordinates of the target position identified by the sonar in the camera coordinate system Convert to homogeneous coordinates in the image's physical coordinate system , through the pinhole camera model:

其中,为摄像机的焦距;in, is the focal length of the camera;

S3,推导摄像机坐标系中的坐标同像素坐标系中的坐标的关系,并完成坐标转换;包括以下过程:S3, derive the coordinates in the camera coordinate system Coordinates in the same pixel coordinate system The relationship between the two is established and the coordinate transformation is completed; including the following processes:

S31,转换时首先考虑偏移,设摄像机坐标系的轴与图像交点的像素坐标为,则在图像物理坐标系下的点所成的像在像素坐标系中的坐标为:S31, when converting, first consider the offset, assuming that the camera coordinate system The pixel coordinates of the intersection of the axis and the image are , then the point in the image physical coordinate system is The coordinates of the resulting image in the pixel coordinate system are:

S32,将物理单位和像素单位进行转换:S32, converting physical units and pixel units:

其中, 分别表示水平方向和垂直方向上单位距离内像素的个数,焦距的单位是in, , Respectively represent the number of pixels per unit distance in the horizontal and vertical directions, focal length The unit is ;

S33,使用 表示,可得:S33, use , express and , we can get:

得到摄像机坐标系中的坐标同像素坐标系中坐标的关系:Get the coordinates in the camera coordinate system The relationship between the coordinates in the pixel coordinate system:

由于摄像机的内参数矩阵为:Since the intrinsic parameter matrix of the camera is:

则有:Then we have:

S34,将摄像机坐标系中的坐标转换为像素坐标系中坐标;即将内部矩阵与得到的摄像机坐标相乘,并对得到的矩阵作归一化,将其中的每一个元素除以,得到矩阵的前两行为求得的像素坐标;利用openCV库函数中的undistortPoints函数将得到的像素坐标进行畸变矫正,矫正后像素坐标取整得到最终的目标物的像素坐标S34, the coordinates in the camera coordinate system Convert to pixel coordinates ; The internal matrix With the obtained camera coordinates Multiply and normalize the resulting matrix by dividing each element by , the first two lines of the matrix are the obtained pixel coordinates; the undistortPoints function in the openCV library function is used to correct the distortion of the obtained pixel coordinates, and the corrected pixel coordinates are rounded to obtain the final pixel coordinates of the target object. .

优选的,所述S1的具体过程为:Preferably, the specific process of S1 is:

将已知的目标物在以声呐为原点的世界坐标系下的坐标转换为齐次坐标并进行转置并将旋转矩阵连接组成新的矩阵,即:Convert the known target's coordinates in the world coordinate system with the sonar as the origin into homogeneous coordinates and transpose them and rotate the matrix and Connect to form a new matrix ,Right now:

其中, 分别为以声呐为原点的世界坐标系相对于摄像机坐标系的旋转矩阵和平移矩阵,是3×3的正交单位矩阵,有3个独立变量,为3×1的平移矩阵,是4×4的摄像机外部参数矩阵;in, , They are the rotation matrix and translation matrix of the world coordinate system with the sonar as the origin relative to the camera coordinate system, is a 3×3 orthogonal identity matrix with 3 independent variables, is a 3×1 translation matrix, is a 4×4 camera extrinsic parameter matrix;

根据声呐识别的目标位置的坐标和摄像机坐标系中的坐标之间的关系,将矩阵与已知的目标物在以声呐为原点的世界坐标系下的坐标的齐次坐标相乘得到摄像机坐标系中的齐次坐标;两者之间的关系为:According to the relationship between the coordinates of the target position identified by the sonar and the coordinates in the camera coordinate system, the matrix Multiply the homogeneous coordinates of the known target in the world coordinate system with the sonar as the origin to obtain the homogeneous coordinates in the camera coordinate system ; The relationship between the two is:

其中,是点在以声呐为原点的世界坐标系下的齐次坐标,是点在摄像机坐标系下的齐次坐标。in, Yes The homogeneous coordinates in the world coordinate system with the sonar as the origin are: Yes Homogeneous coordinates in the camera coordinate system.

与现有技术相比,本发明具有如下有益效果:Compared with the prior art, the present invention has the following beneficial effects:

实验结果显示,将不同的棋盘格角点的世界坐标输入,根据将计算出的像素坐标可视化的图像,可以看出与图像上的目标物特征点基本吻合,准确的声光物理场标定方法可以用于新型光、声联合探测技术,具体可以用于根据目标物在图像中的像素坐标来计算目标物所在区域的曝光度,从而对光源能量投送大小进行调节,提高水下成像质量,为水下机器人在不同水体环境中进行作业系统提供良好的光场环境和视觉效果。The experimental results show that by inputting the world coordinates of different checkerboard corner points and visualizing the calculated pixel coordinates, it can be seen that they are basically consistent with the characteristic points of the target object on the image. The accurate acoustic-optical physical field calibration method can be used for new light and acoustic joint detection technology. Specifically, it can be used to calculate the exposure of the target area based on the pixel coordinates of the target in the image, thereby adjusting the energy delivery of the light source, improving the underwater imaging quality, and providing a good light field environment and visual effects for underwater robots to operate in different water environments.

本发明所提出的方法充分利用了张正友标定法的优势,避免了标定需要高精度的标定物和操作繁琐等问题,同时达到了比其他标定方法更高的精度,而且还可以避免成本高的问题。该方法制作简单,在标定过程中考虑了镜头畸变,增加了标定的精确性,同时还具有很好的稳定性。The method proposed in the present invention makes full use of the advantages of Zhang Zhengyou's calibration method, avoids the problems of high-precision calibration objects and cumbersome operation, and achieves higher accuracy than other calibration methods, and can also avoid the problem of high cost. The method is simple to make, takes lens distortion into account during the calibration process, increases the accuracy of calibration, and also has good stability.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本发明整体过程流程示意图。FIG1 is a schematic diagram of the overall process flow of the present invention.

图2为摄像机成像模型示意图。FIG2 is a schematic diagram of a camera imaging model.

图3为实施例中棋盘格标定板示意图。FIG. 3 is a schematic diagram of a checkerboard calibration plate in an embodiment.

图4为实施例中声呐获得的影像。FIG. 4 is an image obtained by sonar in the embodiment.

图5为实施例中声呐图像对应的光学图像。FIG. 5 is an optical image corresponding to the sonar image in the embodiment.

图6为实施例中读取以声呐为原点的世界坐标系下的世界坐标的声呐图像。FIG. 6 is a sonar image of the world coordinates in the world coordinate system with the sonar as the origin in the embodiment.

图7为实施例中第一个目标物特征点的世界坐标转换为像素坐标的结果图。FIG. 7 is a diagram showing the result of converting the world coordinates of the first target feature point into pixel coordinates in the embodiment.

图8为实施例中第二个目标物特征点的世界坐标转换为像素坐标的结果图。FIG. 8 is a diagram showing the result of converting the world coordinates of the feature point of the second target object into pixel coordinates in the embodiment.

图9为实施例中第三个角点转换为像素坐标的结果图。FIG. 9 is a diagram showing the result of converting the third corner point into pixel coordinates in the embodiment.

具体实施方式DETAILED DESCRIPTION

本发明提出了一种将声呐探测到的目标物的坐标(即以声呐为原点的世界坐标系下的坐标)转换为目标物在光学图像中的像素坐标的方法。该方法所用声呐图像只需要能够得到目标物的位置坐标就可以,降低了声呐图像获取成本,且算法计算复杂度不高。通过该方法的建立,实现声学信息与光学信息结合,达到提高水下成像质量的目的。整体过程如图1所示:The present invention proposes a method for converting the coordinates of a target object detected by sonar (i.e., the coordinates in the world coordinate system with sonar as the origin) into the pixel coordinates of the target object in an optical image. The sonar image used in this method only needs to be able to obtain the position coordinates of the target object, which reduces the cost of obtaining sonar images, and the algorithm calculation complexity is not high. By establishing this method, the combination of acoustic information and optical information is achieved, thereby achieving the purpose of improving the quality of underwater imaging. The overall process is shown in Figure 1:

步骤1,根据小孔成像原理建立摄像机成像模型,设定以声呐为原点的世界坐标系,摄像机坐标系,图像物理坐标系,图像像素坐标系Step 1: Establish a camera imaging model based on the pinhole imaging principle, and set the sonar as the origin World coordinate system , camera coordinate system , image physical coordinate system , image pixel coordinate system ;

步骤2,利用一个棋盘格标定板作为标准参照物,通过变换它的位置,摄像机采集多幅图像,已知棋盘格的尺寸和每个格子的大小,建立棋盘格上角点的图像物理坐标与对应的图像点在摄像机坐标系下的二维图像坐标之间的关系,经过坐标转换和最大似然法,求解出摄像机内部矩阵和畸变矩阵;Step 2: Use a checkerboard calibration plate as a standard reference. By changing its position, the camera collects multiple images. Given the size of the checkerboard and the size of each grid, establish the relationship between the image physical coordinates of the corner points on the checkerboard and the two-dimensional image coordinates of the corresponding image points in the camera coordinate system. After coordinate transformation and maximum likelihood method, solve the camera internal matrix and the distortion matrix;

步骤3,根据张正友标定法,利用求解出的摄像机内部矩阵和畸变矩阵以及已知的目标物特征点的世界坐标和目标物特征点在图像中的像素坐标,使用openCV中的函数得到以声呐为原点的世界坐标系和摄像机坐标系之间的旋转矩阵和平移矩阵;Step 3: According to Zhang Zhengyou calibration method, use the solved camera internal matrix And the distortion matrix and the known world coordinates of the target feature points and the pixel coordinates of the target feature points in the image, use the function in openCV to get the rotation matrix and translation matrix between the world coordinate system with the sonar as the origin and the camera coordinate system;

步骤4,利用摄像机的成像模型计算四个坐标系之间的转换关系;即推导得到世界坐标系中的目标物特征点的坐标与其在摄像机成像平面上的像素坐标之间的数学关系,将内部矩阵、畸变矩阵、旋转矩阵和平移矩阵代入关系式中,得到已知的声呐识别的目标位置的坐标和目标物的像素坐标之间的映射关系,从而完成标定。Step 4: Use the imaging model of the camera to calculate the transformation relationship between the four coordinate systems; that is, derive the mathematical relationship between the coordinates of the feature points of the target object in the world coordinate system and its pixel coordinates on the imaging plane of the camera, and convert the internal matrix , distortion matrix, rotation matrix and translation matrix are substituted into the relationship to obtain the coordinates of the target position identified by the known sonar. and the pixel coordinates of the target The mapping relationship between them is established to complete the calibration.

下面结合具体实施例对发明进行进一步说明。The invention will be further described below in conjunction with specific embodiments.

一、摄像机成像模型建立:1. Camera imaging model establishment:

建立的摄像机成像模型如图2所示。The established camera imaging model is shown in Figure 2.

设定世界坐标系,以声呐为坐标原点建立世界坐标系,轴和轴所形成的平面与地面平行,轴垂直于轴和轴所形成的平面建立世界坐标系。 轴满足右手螺旋定则。Set the world coordinate system , with the sonar as the coordinate origin Establish the world coordinate system. Axis and The plane formed by the axes is parallel to the ground. Axis perpendicular to Axis and The plane formed by the axes establishes the world coordinate system. , and The shaft satisfies the right-hand screw rule.

设定摄像机坐标系,以摄像机光心作为坐标系的原点,经过光心垂直于成像平面的直线作轴,轴和轴所形成的平面与成像平面平行来建立摄像机坐标系。Set the camera coordinate system , with the camera optical center As the origin of the coordinate system, a straight line passing through the optical center and perpendicular to the imaging plane is drawn axis, Axis and The camera coordinate system is established by making the plane formed by the axes parallel to the imaging plane.

设定图像物理坐标系,图像物理坐标系建立在摄像机二维成像面上,原点为摄像机光轴与成像面的交点,轴分别平行于摄像机坐标系的轴。Set the image physical coordinate system , the image physical coordinate system is established on the two-dimensional imaging surface of the camera, and the origin is the intersection of the camera optical axis and the imaging surface, axis The axes are parallel to the camera coordinate system axis axis.

设定图像像素坐标系。图像像素坐标系以图像左上角为原点,轴为坐标轴,坐标轴的单位为像素(pixel),像素的横坐标与纵坐标分别表示图像数组中所在的行数与列数。Set the image pixel coordinate system The image pixel coordinate system takes the upper left corner of the image as its origin. axis The axis is the coordinate axis, the unit of the coordinate axis is pixel (pixel), and the horizontal coordinate of the pixel With vertical coordinate Respectively represent the row and column numbers in the image array.

二、求解出摄像机内部矩阵和畸变矩阵:2. Solve the camera internal matrix And the distortion matrix:

摄像机标定的一般原理为:The general principle of camera calibration is:

其中 分别表示 分别表示水平方向和垂直方向上单位距离内像素的个数表示焦距,摄像机坐标系的轴与图像交点的像素坐标为,为了计算方便,标定时将世界坐标系的平面定义在标定板平面上,表示在这种世界坐标系下棋盘格角点的世界坐标,是棋盘格角点的像素坐标。的投影矩阵。表示摄像机的外参矩阵。分别表示标定时定义的世界坐标系相对于摄像机坐标系的旋转矩阵和平移矩阵。利用标定原理求解摄像机内参矩阵的具体步骤包括:in , Respectively and , , Represents the number of pixels per unit distance in the horizontal and vertical directions respectively , Represents the focal length, in the camera coordinate system The pixel coordinates of the intersection of the axis and the image are For the convenience of calculation, the world coordinate system is calibrated The plane is defined on the calibration plate plane. represents the world coordinates of the corner points of the chessboard in this world coordinate system, are the pixel coordinates of the corner points of the chessboard. for The projection matrix. Represents the extrinsic parameter matrix of the camera. and They represent the rotation matrix and translation matrix of the world coordinate system relative to the camera coordinate system defined during calibration. The specific steps of solving the camera intrinsic parameter matrix using the calibration principle include:

标定板选择材质为氧化铝的棋盘格标定板,角点数为,每个正方形小格的边长为20mm。使用摄像机型号为Deepsea IPMSC-3105,摄像机分辨率为1080p。为了保证标定的精度,采集了14张不同位置不同角度的棋盘格标定板图像。图3为棋盘格标定板示意图。The calibration plate is made of aluminum oxide and has a checkerboard grid. , the side length of each square grid is 20mm. The camera model used is Deepsea IPMSC-3105, and the camera resolution is 1080p. In order to ensure the accuracy of calibration, 14 images of the checkerboard calibration board at different positions and angles are collected. Figure 3 is a schematic diagram of the checkerboard calibration board.

摄像机标定所采用的软件是python,使用openCV库中内置的calibrateCamera函数进行标定,标定程序读取角点的像素坐标和世界坐标,根据最大似然估计计算摄相机的内参和畸变矩阵。The software used for camera calibration is python, and the built-in calibrateCamera function in the openCV library is used for calibration. The calibration program reads the pixel coordinates and world coordinates of the corner points, and calculates the intrinsic parameters and distortion matrix of the camera based on the maximum likelihood estimation.

运行标定程序获得标定结果,本实施例中内参矩阵为Run the calibration program to obtain the calibration results. In this embodiment, the internal parameter matrix is

将标定结果保存在文件camera.pkl中。Save the calibration results in the file camera.pkl.

三、求解以声呐为原点的世界坐标系和摄像机坐标系之间的旋转矩阵和平移矩阵:3. Solve the rotation matrix and translation matrix between the world coordinate system with the sonar as the origin and the camera coordinate system:

根据相机标定原理,利用标定得到的内参矩阵和畸变矩阵求解以声呐为原点的世界坐标系和摄像机坐标系之间的旋转矩阵和平移矩阵的具体步骤为:According to the camera calibration principle, the rotation matrix between the world coordinate system with the sonar as the origin and the camera coordinate system is solved using the intrinsic parameter matrix and distortion matrix obtained by calibration. and translation matrix The specific steps are:

S1,获取以声呐为原点的世界坐标系下目标物特征点的世界坐标。S1, obtain the world coordinates of the feature points of the target object in the world coordinate system with the sonar as the origin.

用二维声呐获取影像,图4是声呐获得的影像。The image was obtained using two-dimensional sonar. Figure 4 is the image obtained by sonar.

根据ProViewer软件测量得到极坐标,用卷尺得到轴上的坐标,将二维声呐得到的极坐标转换为测量 轴上的世界坐标,结合轴上的世界坐标,得到以声呐为原点的世界坐标系下目标物特征点的世界坐标。目标物特征点的极坐标与世界坐标之间的转换关系为:Polar coordinates were obtained by measuring with ProViewer software and using a tape measure. The coordinates on the axis are converted into the polar coordinates obtained by the two-dimensional sonar. , The world coordinates on the axis, combined The world coordinates on the axis are obtained to obtain the world coordinates of the target feature point in the world coordinate system with the sonar as the origin. The conversion relationship between the polar coordinates and the world coordinates of the target feature point is:

式中,是ProViewer软件测量的目标物特征点距声呐的距离,是目标物特征点偏离声呐中轴的角度。In the formula, It is the distance between the feature point of the target object and the sonar measured by the ProViewer software. It is the angle at which the feature point of the target deviates from the central axis of the sonar.

S2,获取目标物特征点的像素坐标。S2, obtaining the pixel coordinates of the feature points of the target object.

利用摄像机获取声呐影像对应的光学影像。图5是与声呐对应的光学图像。The optical image corresponding to the sonar image is obtained by using a camera. Figure 5 is the optical image corresponding to the sonar image.

利用python手动选取目标物特征点的像素坐标,每个特征点的像素坐标读取5次,取平均值得到最终的像素坐标,以此减少人工标定的误差。Python is used to manually select the pixel coordinates of the feature points of the target object. The pixel coordinates of each feature point are read 5 times, and the average value is taken to obtain the final pixel coordinates to reduce the error of manual calibration.

S3,使用openCV中内置的solvePnP函数求出旋转向量和平移矩阵,并用Rodrigues函数将旋转向量转换为旋转矩阵。旋转向量为:S3, use the solvePnP function built into openCV to find the rotation vector and translation matrix , and use the Rodrigues function to convert the rotation vector into a rotation matrix The rotation vector is:

转换为旋转矩阵:Convert to rotation matrix:

平移矩阵为:The translation matrix is:

.

四、利用摄像机的成像模型计算四个坐标系之间的转换关系,完成标定:4. Use the camera's imaging model to calculate the conversion relationship between the four coordinate systems and complete the calibration:

S1,将已知的声呐识别的目标位置的坐标转换为摄像机坐标系中的坐标S1, the coordinates of the target position identified by the known sonar Convert to camera coordinates ;

将已知的目标物在以声呐为原点的世界坐标系下的坐标转换为齐次坐标并进行转置并将旋转矩阵连接组成新的矩阵,即:Convert the known target's coordinates in the world coordinate system with the sonar as the origin into homogeneous coordinates and transpose them and rotate the matrix and Connect to form a new matrix ,Right now:

其中 分别为以声呐为原点的世界坐标系相对于摄像机坐标系的旋转矩阵和平移矩阵,是3×3的正交单位矩阵,有3个独立变量,为3×1的平移矩阵,是4×4的摄像机外部参数矩阵;in , , They are the rotation matrix and translation matrix of the world coordinate system with the sonar as the origin relative to the camera coordinate system, is a 3×3 orthogonal identity matrix with 3 independent variables, is a 3×1 translation matrix, is a 4×4 camera extrinsic parameter matrix;

根据声呐识别的目标位置的坐标和摄像机坐标系中的坐标之间的关系,将矩阵与已知的目标物在以声呐为原点的世界坐标系下的坐标的齐次坐标相乘得到摄像机坐标系中的齐次坐标;两者之间的关系为:According to the relationship between the coordinates of the target position identified by the sonar and the coordinates in the camera coordinate system, the matrix Multiply the homogeneous coordinates of the known target in the world coordinate system with the sonar as the origin to obtain the homogeneous coordinates in the camera coordinate system ; The relationship between the two is:

其中,是点在以声呐为原点的世界坐标系下的齐次坐标,是点在摄像机坐标系下的齐次坐标。in, Yes The homogeneous coordinates in the world coordinate system with the sonar as the origin are: Yes Homogeneous coordinates in the camera coordinate system.

S2,将已知的声呐识别的目标位置在摄像机坐标系中的齐次坐标转换为图像物理坐标系中的齐次坐标,通过针孔相机模型有:S2, the homogeneous coordinates of the target position identified by the sonar in the camera coordinate system Convert to homogeneous coordinates in the image's physical coordinate system , through the pinhole camera model:

其中,为摄像机的焦距;in, is the focal length of the camera;

S3,推导摄像机坐标系中的坐标同像素坐标系中的坐标的关系,并完成坐标转换;包括以下过程:S3, derive the coordinates in the camera coordinate system Coordinates in the same pixel coordinate system The relationship between the two is established and the coordinate transformation is completed; including the following processes:

S31,转换时首先考虑偏移,设摄像机坐标系的轴与图像交点的像素坐标为,则在图像物理坐标系下的点所成的像在像素坐标系中的坐标为:S31, when converting, first consider the offset, assuming that the camera coordinate system The pixel coordinates of the intersection of the axis and the image are , then the point in the image physical coordinate system is The coordinates of the resulting image in the pixel coordinate system are:

S32,将物理单位和像素单位进行转换:S32, converting physical units and pixel units:

其中, 分别表示水平方向和垂直方向上单位距离内像素的个数,焦距的单位是in, , Represents the number of pixels per unit distance in the horizontal and vertical directions respectively ,focal length The unit is ;

S33,使用表示,可得:S33, use , express and , we can get:

得到摄像机坐标系中的坐标同像素坐标系中坐标的关系:Get the coordinates in the camera coordinate system The relationship between the coordinates in the pixel coordinate system:

由于摄像机的内参数矩阵为:Since the intrinsic parameter matrix of the camera is:

则有:Then we have:

S34,将摄像机坐标系中的坐标转换为像素坐标系中坐标;即将内部矩阵与得到的摄像机坐标相乘,并对得到的矩阵作归一化,将其中的每一个元素除以,得到矩阵的前两行为求得的像素坐标;利用openCV库函数中的undistortPoints函数将得到的像素坐标进行畸变矫正,矫正后像素坐标取整得到最终的目标物的像素坐标S34, the coordinates in the camera coordinate system Convert to pixel coordinates ; The internal matrix With the obtained camera coordinates Multiply and normalize the resulting matrix by dividing each element by , the first two lines of the matrix are the obtained pixel coordinates; the undistortPoints function in the openCV library function is used to correct the distortion of the obtained pixel coordinates, and the corrected pixel coordinates are rounded to obtain the final pixel coordinates of the target object. .

五、实验结果:5. Experimental results:

本实施例中,读取图6声呐图像中的第一、二、三个特征点在以声呐为原点的世界坐标系下的坐标输入,计算得到的像素坐标表示在图7、图8、图9的光学图像。根据图像将计算出的像素坐标可视化,可以看出与图像上的特征点基本吻合。In this embodiment, the coordinate input of the first, second and third feature points in the sonar image of FIG6 in the world coordinate system with the sonar as the origin is read, and the calculated pixel coordinates are represented in the optical images of FIG7, FIG8 and FIG9. The calculated pixel coordinates are visualized according to the image, and it can be seen that they are basically consistent with the feature points on the image.

以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

上述虽然对本发明的具体实施方式进行了描述,但并非对本发明保护范围的限制,所属领域技术人员应该明白,在本发明的技术方案的基础上,本领域技术人员不需要付出创造性劳动即可做出的各种修改或变形仍在本发明的保护范围以内。Although the above describes the specific implementation methods of the present invention, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.

Claims (6)

1.一种用于水下声光信息结合的标定方法,其特征在于,包括以下步骤:1. A calibration method for combining underwater sound and light information, characterized in that it comprises the following steps: 步骤1,根据小孔成像原理建立摄像机成像模型,设定以声呐为原点的世界坐标系,摄像机坐标系,图像物理坐标系,图像像素坐标系Step 1: Establish a camera imaging model based on the pinhole imaging principle, and set the sonar as the origin World coordinate system , camera coordinate system , image physical coordinate system , image pixel coordinate system ; 步骤2,利用一个棋盘格标定板作为标准参照物,通过变换它的位置,摄像机采集多幅图像,已知棋盘格的尺寸和每个格子的大小,建立棋盘格上角点的图像物理坐标与对应的图像点在摄像机坐标系下的二维图像坐标之间的关系,经过坐标转换和最大似然法,求解出摄像机内部矩阵和畸变矩阵;Step 2: Use a checkerboard calibration plate as a standard reference. By changing its position, the camera collects multiple images. Given the size of the checkerboard and the size of each grid, establish the relationship between the image physical coordinates of the corner points on the checkerboard and the two-dimensional image coordinates of the corresponding image points in the camera coordinate system. After coordinate transformation and maximum likelihood method, solve the camera internal matrix and the distortion matrix; 步骤3,根据张正友标定法,利用求解出的摄像机内部矩阵和畸变矩阵以及已知的目标物特征点的世界坐标和目标物特征点在图像中的像素坐标,使用openCV中的函数得到以声呐为原点的世界坐标系和摄像机坐标系之间的旋转矩阵和平移矩阵;Step 3: According to Zhang Zhengyou calibration method, use the solved camera internal matrix And the distortion matrix and the known world coordinates of the target feature points and the pixel coordinates of the target feature points in the image, use the function in openCV to get the rotation matrix and translation matrix between the world coordinate system with the sonar as the origin and the camera coordinate system; 步骤4,利用摄像机的成像模型计算四个坐标系之间的转换关系;推导得到世界坐标系中的目标物特征点的坐标与其在摄像机成像平面上的像素坐标之间的数学关系,将内部矩阵、畸变矩阵、旋转矩阵和平移矩阵代入关系式中,得到已知的声呐识别的目标位置的坐标和目标物的像素坐标之间的映射关系,从而完成标定;Step 4: Use the imaging model of the camera to calculate the transformation relationship between the four coordinate systems; derive the mathematical relationship between the coordinates of the feature points of the target object in the world coordinate system and its pixel coordinates on the camera imaging plane, and convert the internal matrix , distortion matrix, rotation matrix and translation matrix are substituted into the relationship to obtain the coordinates of the target position identified by the known sonar. and the pixel coordinates of the target The mapping relationship between them is used to complete the calibration; 具体过程为:The specific process is: S1,将已知的声呐识别的目标位置的坐标转换为摄像机坐标系中的坐标S1, the coordinates of the target position identified by the known sonar Convert to camera coordinates ; S2,将已知的声呐识别的目标位置在摄像机坐标系中的齐次坐标转换为图像物理坐标系中的齐次坐标,通过针孔相机模型有:S2, the homogeneous coordinates of the target position identified by the sonar in the camera coordinate system Convert to homogeneous coordinates in the image's physical coordinate system , through the pinhole camera model: 其中,为摄像机的焦距;in, is the focal length of the camera; S3,推导摄像机坐标系中的坐标同像素坐标系中的坐标的关系,并完成坐标转换;包括以下过程:S3, derive the coordinates in the camera coordinate system Coordinates in the same pixel coordinate system The relationship between the two is established and the coordinate transformation is completed; including the following processes: S31,转换时首先考虑偏移,设摄像机坐标系的轴与图像交点的像素坐标为,则在图像物理坐标系下的点所成的像在像素坐标系中的坐标为:S31, when converting, first consider the offset, assuming that the camera coordinate system The pixel coordinates of the intersection of the axis and the image are , then the point in the image physical coordinate system is The coordinates of the resulting image in the pixel coordinate system are: S32,将物理单位和像素单位进行转换:S32, converting physical units and pixel units: 其中, 分别表示水平方向和垂直方向上单位距离内像素的个数,焦距的单位是in, , Respectively represent the number of pixels per unit distance in the horizontal and vertical directions, focal length The unit is ; S33,使用 表示,可得:S33, use , express and , we can get: 得到摄像机坐标系中的坐标同像素坐标系中坐标的关系:Get the coordinates in the camera coordinate system The relationship between the coordinates in the pixel coordinate system: 由于摄像机的内参数矩阵为:Since the intrinsic parameter matrix of the camera is: 则有:Then we have: S34,将摄像机坐标系中的坐标转换为像素坐标系中坐标;即将内部矩阵与得到的摄像机坐标相乘,并对得到的矩阵作归一化,将其中的每一个元素除以,得到矩阵的前两行为求得的像素坐标;利用openCV库函数中的undistortPoints函数将得到的像素坐标进行畸变矫正,矫正后像素坐标取整得到最终的目标物的像素坐标S34, the coordinates in the camera coordinate system Convert to pixel coordinates ; The internal matrix With the obtained camera coordinates Multiply and normalize the resulting matrix by dividing each element by , the first two lines of the matrix are the obtained pixel coordinates; the undistortPoints function in the openCV library function is used to correct the distortion of the obtained pixel coordinates, and the corrected pixel coordinates are rounded to obtain the final pixel coordinates of the target object. . 2.如权利要求1所述的一种用于水下声光信息结合的标定方法,其特征在于,所述步骤1中设定以声呐为原点的世界坐标系,摄像机坐标系,图像物理坐标系,图像像素坐标系,具体为:2. A calibration method for combining underwater sound and light information according to claim 1, characterized in that the sonar is set as the origin in step 1. World coordinate system , camera coordinate system , image physical coordinate system , image pixel coordinate system , specifically: 以声呐为坐标原点建立世界坐标系 轴满足右手螺旋定则;Sonar is the coordinate origin Establishing the world coordinate system ; , and The axis satisfies the right-hand screw rule; 设定摄像机坐标系,以摄像机光心作为坐标系的原点,经过光心垂直于成像平面的直线作轴,轴和轴所形成的平面与成像平面平行来建立摄像机坐标系;Set the camera coordinate system , with the camera optical center As the origin of the coordinate system, a straight line passing through the optical center and perpendicular to the imaging plane is drawn axis, Axis and The plane formed by the axes is parallel to the imaging plane to establish the camera coordinate system; 设定图像物理坐标系,图像物理坐标系建立在摄像机二维成像面上,原点为摄像机光轴与成像面的交点,轴分别平行于摄像机坐标系的轴;Set the image physical coordinate system , the image physical coordinate system is established on the two-dimensional imaging surface of the camera, and the origin is the intersection of the camera optical axis and the imaging surface, axis The axes are parallel to the camera coordinate system axis axis; 设定图像像素坐标系;图像像素坐标系以图像左上角为原点,轴为坐标轴,坐标轴的单位为像素pixel,像素的横坐标与纵坐标分别表示图像数组中所在的行数与列数。Set the image pixel coordinate system ; The image pixel coordinate system takes the upper left corner of the image as the origin, axis The axis is the coordinate axis, the unit of the coordinate axis is pixel, and the horizontal coordinate of the pixel is With vertical coordinate Respectively represent the row and column numbers in the image array. 3.如权利要求1所述的一种用于水下声光信息结合的标定方法,其特征在于,所述步骤2的具体过程为:3. A calibration method for combining underwater sound and light information according to claim 1, characterized in that the specific process of step 2 is: 利用一个已知尺寸和每个格子大小的棋盘格标定板作为标准参照物,为保证标定的精度,采集N张不同位置不同角度的棋盘格标定板图像;A checkerboard calibration plate with known dimensions and grid size is used as a standard reference. To ensure the accuracy of calibration, N images of the checkerboard calibration plate at different positions and angles are collected. 使用openCV库中内置的calibrateCamera函数进行标定,标定程序读取角点的像素坐标和世界坐标,所述角点的像素坐标是角点在采集的图像中的像素坐标;所述角点的世界坐标是角点在以棋盘格标定板为z平面,以棋盘格左上角点为原点,以棋盘格长、宽分别为x、y轴建立的世界坐标系中的世界坐标;Use the built-in calibrateCamera function in the openCV library for calibration. The calibration program reads the pixel coordinates and world coordinates of the corner points. The pixel coordinates of the corner points are the pixel coordinates of the corner points in the acquired image; the world coordinates of the corner points are the world coordinates of the corner points in a world coordinate system established with the chessboard calibration plate as the z plane, the upper left corner of the chessboard as the origin, and the length and width of the chessboard as the x and y axes respectively; 摄像机标定的原理为:The principle of camera calibration is: 其中分别表示分别表示水平方向和垂直方向上单位距离内像素的个数,表示焦距,摄像机坐标系的轴与图像交点的像素坐标为in , Respectively and , , Respectively represent the number of pixels per unit distance in the horizontal and vertical directions, Represents the focal length, in the camera coordinate system The pixel coordinates of the intersection of the axis and the image are ; 标定时将世界坐标系的平面定义在标定板平面上,表示在这种世界坐标系下棋盘格角点的世界坐标,是棋盘格角点的像素坐标;的投影矩阵;表示摄像机的外参矩阵;分别表示标定时定义的世界坐标系相对于摄像机坐标系的旋转矩阵和平移矩阵;根据最大似然法计算摄相机的内部矩阵和畸变矩阵。During calibration, the world coordinate system The plane is defined on the calibration plate plane. represents the world coordinates of the corner points of the chessboard in this world coordinate system, are the pixel coordinates of the corner points of the chessboard; for The projection matrix; Represents the extrinsic parameter matrix of the camera; and Respectively represent the rotation matrix and translation matrix of the world coordinate system defined during calibration relative to the camera coordinate system; the internal matrix of the camera is calculated according to the maximum likelihood method and the distortion matrix. 4.如权利要求1所述的一种用于水下声光信息结合的标定方法,其特征在于,所述步骤3的具体过程为:4. A calibration method for combining underwater sound and light information according to claim 1, characterized in that the specific process of step 3 is: 获取以声呐为原点的世界坐标系下目标物特征点的世界坐标;获取目标物特征点的像素坐标;Obtain the world coordinates of the feature points of the target object in the world coordinate system with the sonar as the origin; obtain the pixel coordinates of the feature points of the target object; 用求解出的摄像机内部参数和畸变矩阵以及已知的目标物特征点的世界坐标和目标物特征点在图像中的像素坐标,使用openCV中内置的solvePnP函数求出旋转向量和平移矩阵,并用Rodrigues函数将旋转向量转换为旋转矩阵The camera internal parameters are solved The built-in solvePnP function in openCV is used to find the rotation vector and translation matrix using the distortion matrix, the world coordinates of the known target feature points, and the pixel coordinates of the target feature points in the image. , and use the Rodrigues function to convert the rotation vector into a rotation matrix . 5.如权利要求4所述的一种用于水下声光信息结合的标定方法,其特征在于,所述获取以声呐为原点的世界坐标系下目标物特征点的世界坐标是使用以下三种方法中的任意一种:5. A calibration method for combining underwater sound and light information according to claim 4, characterized in that the world coordinates of the feature points of the target object in the world coordinate system with the sonar as the origin are obtained by using any one of the following three methods: 利用卷尺测量 轴上的坐标表示以声呐为原点的世界坐标系下目标物特征点的世界坐标;Measuring with a tape measure , and The coordinates on the axis represent the world coordinates of the feature points of the target object in the world coordinate system with the sonar as the origin; 或用二维声呐获取影像,测量得到极坐标,用卷尺得到轴上的坐标,将二维声呐得到的极坐标转换为测量 轴上的世界坐标,结合轴上的世界坐标,得到以声呐为原点的世界坐标系下目标物特征点的世界坐标;Or use 2D sonar to obtain images, measure polar coordinates, and use a tape measure to obtain The coordinates on the axis are converted into the polar coordinates obtained by the two-dimensional sonar. , The world coordinates on the axis, combined The world coordinates on the axis are obtained to obtain the world coordinates of the feature points of the target object in the world coordinate system with the sonar as the origin; 或直接用三维声呐测量获得以声呐为原点的世界坐标系下目标物特征点的世界坐标。Or directly use three-dimensional sonar measurement to obtain the world coordinates of the target feature points in the world coordinate system with the sonar as the origin. 6.如权利要求1所述的一种用于水下声光信息结合的标定方法,其特征在于,所述S1的具体过程为:6. A calibration method for combining underwater sound and light information according to claim 1, characterized in that the specific process of S1 is: 将已知的目标物在以声呐为原点的世界坐标系下的坐标转换为齐次坐标并进行转置并将旋转矩阵连接组成新的矩阵,即:Convert the known target's coordinates in the world coordinate system with the sonar as the origin into homogeneous coordinates and transpose them and rotate the matrix and Connect to form a new matrix ,Right now: 其中,分别为以声呐为原点的世界坐标系相对于摄像机坐标系的旋转矩阵和平移矩阵,是3×3的正交单位矩阵,有3个独立变量,为3×1的平移矩阵,是4×4的摄像机外部参数矩阵;in, , They are the rotation matrix and translation matrix of the world coordinate system with the sonar as the origin relative to the camera coordinate system, is a 3×3 orthogonal identity matrix with 3 independent variables, is a 3×1 translation matrix, is a 4×4 camera extrinsic parameter matrix; 根据声呐识别的目标位置的坐标和摄像机坐标系中的坐标之间的关系,将矩阵与已知的目标物在以声呐为原点的世界坐标系下的坐标的齐次坐标相乘得到摄像机坐标系中的齐次坐标;两者之间的关系为:According to the relationship between the coordinates of the target position identified by the sonar and the coordinates in the camera coordinate system, the matrix Multiply the homogeneous coordinates of the known target in the world coordinate system with the sonar as the origin to obtain the homogeneous coordinates in the camera coordinate system ; The relationship between the two is: 其中,是点在以声呐为原点的世界坐标系下的齐次坐标,是点在摄像机坐标系下的齐次坐标。in, Yes The homogeneous coordinates in the world coordinate system with the sonar as the origin are: Yes Homogeneous coordinates in the camera coordinate system.
CN202410832136.2A 2024-06-26 2024-06-26 A calibration method for combining underwater acoustic and optical information Active CN118397108B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410832136.2A CN118397108B (en) 2024-06-26 2024-06-26 A calibration method for combining underwater acoustic and optical information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410832136.2A CN118397108B (en) 2024-06-26 2024-06-26 A calibration method for combining underwater acoustic and optical information

Publications (2)

Publication Number Publication Date
CN118397108A CN118397108A (en) 2024-07-26
CN118397108B true CN118397108B (en) 2024-08-27

Family

ID=91999614

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410832136.2A Active CN118397108B (en) 2024-06-26 2024-06-26 A calibration method for combining underwater acoustic and optical information

Country Status (1)

Country Link
CN (1) CN118397108B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110763152A (en) * 2019-10-09 2020-02-07 哈尔滨工程大学 Underwater active rotation structure light three-dimensional vision measuring device and measuring method
CN115830103A (en) * 2022-11-28 2023-03-21 北京石油化工学院 Monocular color-based transparent object positioning method, device and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111536902B (en) * 2020-04-22 2021-03-09 西安交通大学 Galvanometer scanning system calibration method based on double checkerboards
CN115100298B (en) * 2022-08-25 2022-11-29 青岛杰瑞工控技术有限公司 Light-sound image fusion method for deep and open sea visual culture
CN115797460B (en) * 2022-10-10 2023-07-21 哈尔滨工程大学 A Method for Underwater Two-Target Targeting
CN117452426A (en) * 2023-08-21 2024-01-26 山东科技大学 A target detection method based on water lidar and underwater binocular cameras

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110763152A (en) * 2019-10-09 2020-02-07 哈尔滨工程大学 Underwater active rotation structure light three-dimensional vision measuring device and measuring method
CN115830103A (en) * 2022-11-28 2023-03-21 北京石油化工学院 Monocular color-based transparent object positioning method, device and storage medium

Also Published As

Publication number Publication date
CN118397108A (en) 2024-07-26

Similar Documents

Publication Publication Date Title
CN110197466B (en) A wide-angle fisheye image correction method
CN110689581B (en) Structured light module calibration method, electronic device, and computer-readable storage medium
CN110276808B (en) Method for measuring unevenness of glass plate by combining single camera with two-dimensional code
CN105678783B (en) Refractive and reflective panorama camera merges scaling method with laser radar data
TWI555379B (en) An image calibrating, composing and depth rebuilding method of a panoramic fish-eye camera and a system thereof
CN111369630A (en) A method of multi-line lidar and camera calibration
WO2018228013A1 (en) Front coated plane mirror-based structured light parameter calibration device and method
CN109163657B (en) Round target pose detection method based on binocular vision three-dimensional reconstruction
CN110830781A (en) Automatic projected image correction method and system based on binocular vision
CN112734921B (en) An underwater three-dimensional map construction method based on sonar and visual image stitching
CN106091984A (en) A kind of three dimensional point cloud acquisition methods based on line laser
CN103530880A (en) Camera calibration method based on projected Gaussian grid pattern
CN101354796B (en) Omnidirectional stereo vision three-dimensional rebuilding method based on Taylor series model
CN109859137B (en) Wide-angle camera irregular distortion global correction method
JP2010276433A (en) Imaging device, image processing device, and distance measuring device
CN114998448B (en) A method for multi-constrained binocular fisheye camera calibration and spatial point positioning
CN110874854A (en) Large-distortion wide-angle camera binocular photogrammetry method based on small baseline condition
CN106296825A (en) A kind of bionic three-dimensional information generating system and method
CN110490943B (en) Rapid and accurate calibration method and system of 4D holographic capture system and storage medium
CN112017248A (en) 2D laser radar camera multi-frame single-step calibration method based on dotted line characteristics
CN115100298A (en) Light-sound image fusion method for deep and open sea visual culture
CN110728745B (en) A three-dimensional reconstruction method for underwater binocular stereo vision based on a multi-layer refraction image model
CN114963981B (en) A non-contact measurement method for cylindrical parts docking based on monocular vision
CN111968182A (en) Calibration method for binocular camera nonlinear model parameters
CN113554709A (en) Camera-projector system calibration method based on polarization information

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