Nothing Special   »   [go: up one dir, main page]

CN110889829A - A monocular ranging method based on fisheye lens - Google Patents

A monocular ranging method based on fisheye lens Download PDF

Info

Publication number
CN110889829A
CN110889829A CN201911090732.3A CN201911090732A CN110889829A CN 110889829 A CN110889829 A CN 110889829A CN 201911090732 A CN201911090732 A CN 201911090732A CN 110889829 A CN110889829 A CN 110889829A
Authority
CN
China
Prior art keywords
image
fisheye lens
target object
method based
contour
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.)
Granted
Application number
CN201911090732.3A
Other languages
Chinese (zh)
Other versions
CN110889829B (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.)
Donghua University
Original Assignee
Donghua University
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 Donghua University filed Critical Donghua University
Priority to CN201911090732.3A priority Critical patent/CN110889829B/en
Publication of CN110889829A publication Critical patent/CN110889829A/en
Application granted granted Critical
Publication of CN110889829B publication Critical patent/CN110889829B/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/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/80Geometric correction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Quality & Reliability (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

本发明涉及一种基于单目鱼眼相机的目标物体测距方法,包括以下步骤:1)使用鱼眼镜头拍摄照片,得到畸变图像;2)将畸变图像送入训练好的神经网络,得到目标物体的外接框坐标,并根据得到的框图坐标,在图像中将目标物体框出;3)对框出的图像区域进行图像处理,得到目标物体的轮廓图;4)对轮廓图使用特征点检测算法,得到目标特征点;5)根据畸变图像校正公式,得到校正后的特征点坐标;6)根据已知的与图像中特征点对应的现实中物体特征点间的距离,使用坐标转换公式在图像与世界坐标系间建立数学等式,求解得到鱼眼相机距离目标物体距离。与传统方法相比,本方法具有成本低、识别范围大、检测速度快、准确度高的优点。

Figure 201911090732

The invention relates to a target object ranging method based on a monocular fisheye camera, comprising the following steps: 1) using the fisheye lens to take pictures to obtain a distorted image; 2) sending the distorted image into a trained neural network to obtain the target The bounding frame coordinates of the object, and frame the target object in the image according to the obtained frame frame coordinates; 3) Perform image processing on the framed image area to obtain the contour map of the target object; 4) Use feature point detection on the contour map algorithm to obtain the target feature points; 5) According to the distorted image correction formula, the corrected feature point coordinates are obtained; 6) According to the known distances between the feature points of objects in reality corresponding to the feature points in the image, use the coordinate conversion formula in A mathematical equation is established between the image and the world coordinate system, and the distance between the fisheye camera and the target object is obtained by solving. Compared with the traditional method, the method has the advantages of low cost, large recognition range, fast detection speed and high accuracy.

Figure 201911090732

Description

一种基于鱼眼镜头的单目测距方法A monocular ranging method based on fisheye lens

技术领域technical field

本发明涉及一种基于鱼眼镜头的单目测距方法,属于光学与计算机视觉领域。The invention relates to a monocular ranging method based on a fisheye lens, belonging to the fields of optics and computer vision.

背景技术Background technique

近年来,视觉传感器吸引了广泛的关注,基于视觉传感器的测距方法也已成为研究热点,因为它们能收集广泛的环境信息,并且价格便宜且易于使用。根据所使用的视觉传感器的数量,视觉测距方法主要可分为单目测距,双目测距和多目测距三种。Vision sensors have attracted a lot of attention in recent years, and vision sensor-based ranging methods have also become a research hotspot because they can collect a wide range of environmental information, and are inexpensive and easy to use. According to the number of visual sensors used, visual ranging methods can be mainly divided into three types: monocular ranging, binocular ranging and multi-eye ranging.

目前,从目标获取高精度深度信息通常需要用到激光雷达,但是由于其价格昂贵,它还主要处于技术研究和测试阶段,距大型市场化应用仍有一定距离。另外,随着近年来人工智能的快速发展,视觉已经逐渐成为研究的焦点,但是也发现了一些缺点,如使用双目测距技术受限于基准线,这导致设备的大小与交通平台负载能力之间的协调不足;基于RGB-D的深度估计范围短,很难应用于实际,并且受环境空间变化的影响很大,在室外的性能并不理想;基于普通针孔相机的测距方法,因为相机可视范围小,故不能获得尽可能多的视觉信息,识别效率较低。At present, LiDAR is usually required to obtain high-precision depth information from a target. However, due to its high price, it is still mainly in the stage of technical research and testing, and it is still far from large-scale market applications. In addition, with the rapid development of artificial intelligence in recent years, vision has gradually become the focus of research, but some shortcomings have also been found, such as the use of binocular ranging technology is limited by the baseline, which leads to the size of the equipment and the load capacity of the transportation platform. The coordination between them is insufficient; the depth estimation based on RGB-D has a short range, which is difficult to apply in practice, and is greatly affected by environmental spatial changes, so the outdoor performance is not ideal; the ranging method based on ordinary pinhole cameras, Because the visible range of the camera is small, it cannot obtain as much visual information as possible, and the recognition efficiency is low.

鱼眼相机不仅具有价格低,体积小的优点,而且其拥有能达到甚至超过180度的超大视角,仅需一个就能达到2-3个大小的普通相机拍摄范围,所拍照片信息量丰富,因此可以有效克服上述传感器的诸多缺点。因此,使用单眼鱼眼相机获取深度信息已经逐渐成为计算机视觉领域的研究重点之一。Fisheye camera not only has the advantages of low price and small size, but also has a large viewing angle that can reach or even exceed 180 degrees. Only one can reach the shooting range of 2-3 ordinary cameras, and the photos taken are rich in information. Therefore, many shortcomings of the above sensors can be effectively overcome. Therefore, obtaining depth information using a single-eye fisheye camera has gradually become one of the research focuses in the field of computer vision.

发明内容SUMMARY OF THE INVENTION

本发明要解决的技术问题是提供一种基于鱼眼镜头的单目测距方法。The technical problem to be solved by the present invention is to provide a monocular ranging method based on a fisheye lens.

为了解决上述技术问题,本发明的技术方案是提供了一种基于鱼眼镜头的单目测距方法,所述方法包括下述步骤:In order to solve the above technical problems, the technical solution of the present invention is to provide a monocular ranging method based on a fisheye lens, and the method includes the following steps:

1)使用鱼眼镜头拍摄照片,得到畸变图像;1) Use a fisheye lens to take a photo to obtain a distorted image;

2)将畸变图像送入训练好的神经网络,得到目标物体的外接框坐标,并根据得到的框图坐标,在图像中将目标物体框出;2) Send the distorted image into the trained neural network to obtain the bounding box coordinates of the target object, and frame the target object in the image according to the obtained frame coordinates;

3)对框出的图像区域进行图像处理,得到目标物体的轮廓图;3) Image processing is performed on the framed image area to obtain the contour map of the target object;

4)对轮廓图使用特征点检测算法,得到目标特征点;4) Use the feature point detection algorithm on the contour map to obtain the target feature points;

5)根据畸变图像校正公式,得到校正后的特征点坐标;5) According to the distorted image correction formula, the corrected feature point coordinates are obtained;

6)根据已知的与图像中特征点对应的现实中物体特征点间的距离,使用坐标转换公式在图像与世界坐标系间建立数学等式,求解得到鱼眼相机距离目标物体距离。6) According to the known distances between the feature points of objects in reality corresponding to the feature points in the image, use the coordinate conversion formula to establish a mathematical equation between the image and the world coordinate system, and solve to obtain the distance between the fisheye camera and the target object.

在所述步骤1)中,鱼眼镜头视角为180度,目标物体中心与鱼眼镜头光心在同一水平面。In the step 1), the angle of view of the fisheye lens is 180 degrees, and the center of the target object and the optical center of the fisheye lens are on the same horizontal plane.

在所述步骤2)中,对畸变图像使用的算法是基于深度学习的目标检测算法,该算法包括以下部分:In the step 2), the algorithm used for the distorted image is a target detection algorithm based on deep learning, and the algorithm includes the following parts:

a)采用MobileNet V2中的分通道卷积方法,提取训练数据集中畸变图像的高级特征;a) Using the sub-channel convolution method in MobileNet V2 to extract the high-level features of the distorted images in the training data set;

b)对不同卷积层筛选出的特征使用FPN进行特征融合,将融合后的特征送入分类子网络和定位子网络,得到分类和定位误差;b) Use FPN to perform feature fusion on the features screened by different convolutional layers, and send the fused features into the classification sub-network and the positioning sub-network to obtain the classification and positioning errors;

c)采用损失函数进行深度神经网络学习训练,得到训练后的优化模型,损失函数为:c) Use the loss function to learn and train the deep neural network, and obtain the optimized model after training. The loss function is:

Figure BDA0002266772380000021
Figure BDA0002266772380000021

其中,x为输入图像,θ为模型参数,m为预设框数量,α和β是平衡定位与分类损失的权重,

Figure BDA0002266772380000022
是当预设框为正预设框时值为1,否则为0,li和pi分别为位置偏移和标签;Lreg表示位置损失函数,Lcls表示分类损失函数。where x is the input image, θ is the model parameter, m is the number of preset frames, α and β are the weights that balance the localization and classification losses,
Figure BDA0002266772380000022
is 1 when the preset frame is a positive preset frame, otherwise 0, l i and p i are the position offset and label, respectively; L reg represents the position loss function, and L cls represents the classification loss function.

在所述步骤3)中,对图像进行轮廓识别包含以下步骤:In the step 3), the contour recognition of the image includes the following steps:

a)读取待检测图像,对图像进行灰度处理,即

Figure BDA0002266772380000023
a) Read the image to be detected, and perform grayscale processing on the image, that is,
Figure BDA0002266772380000023

b)设置阈值对灰度图进行二值化处理;b) Set a threshold to binarize the grayscale image;

c)使用Canny算子对灰度图检测轮廓,得到轮廓点后存入数组,对轮廓采用轮廓跟踪,得到连续的轮廓点集P(i);c) use the Canny operator to detect the contour of the grayscale image, obtain the contour points and store them in the array, and use contour tracking to the contour to obtain a continuous contour point set P(i);

d)使用OpenCV将轮廓绘制于原图大小的黑白图中。d) Use OpenCV to draw the outline in the black and white image of the original size.

在所述步骤4)中,基于轮廓的特征点检测方法主要是通过间接法来求解特征点。首先,将目标物体轮廓点集P(i)分解到X、Y坐标轴,得到两条一维离散曲线X(i)和Y(i),然后通过插值法求解曲线X(i)和Y(i)各点凹率:In the step 4), the feature point detection method based on the contour mainly solves the feature point by an indirect method. First, decompose the target object contour point set P(i) into the X and Y coordinate axes to obtain two one-dimensional discrete curves X(i) and Y(i), and then solve the curves X(i) and Y( i) The concave rate of each point:

Figure BDA0002266772380000031
Figure BDA0002266772380000031

其中L为插值步长;得到凹率后在小尺度下利用多尺度提高检测精度和算法对噪声的鲁棒性,同时使用自适应阈值即可得到目标物体特征点。Among them, L is the interpolation step size; after obtaining the concave rate, multi-scale is used to improve the detection accuracy and the robustness of the algorithm to noise at a small scale, and the feature points of the target object can be obtained by using an adaptive threshold.

在所述步骤5)中,畸变图像的校正需要采用由张正友标定法得到的畸变系数矩阵K=[K1,K2,...,K5];In the step 5), the correction of the distorted image needs to adopt the distortion coefficient matrix K=[K 1 , K 2 , . . . , K 5 ] obtained by Zhang Zhengyou’s calibration method;

张正友标定法需要用到一张打印好的棋盘格(黑白间距已知),并贴在一个平板上,然后针对棋盘格拍摄若干张图片(10-20张),之后利用Harris特征在图片中检测特征点,最后通过解析解估算方法可计算出鱼眼镜头的内部参数以及畸变系数。Zhang Zhengyou's calibration method needs to use a printed checkerboard (the black and white spacing is known), and paste it on a flat plate, and then take several pictures (10-20 pictures) of the checkerboard, and then use the Harris feature to detect in the picture Finally, through the analytical solution estimation method, the internal parameters and distortion coefficients of the fisheye lens can be calculated.

在所述步骤6)中,像素坐标系与世界坐标系间的转换表达式为:In the step 6), the conversion expression between the pixel coordinate system and the world coordinate system is:

Figure BDA0002266772380000032
Figure BDA0002266772380000032

其中,(μ,v)为像素坐标系的坐标,dx、dy分别为图像单位像素在水平和垂直方向的大小,(cx,cy)为图像中心点,f为鱼眼镜头焦距,R为旋转矩阵,t为转移向量,

Figure BDA0002266772380000033
为世界坐标系的坐标。Among them, (μ, v) is the coordinates of the pixel coordinate system, dx, dy are the size of the image unit pixel in the horizontal and vertical directions, (c x , cy ) is the image center point, f is the focal length of the fisheye lens, R is the rotation matrix, t is the transfer vector,
Figure BDA0002266772380000033
are the coordinates of the world coordinate system.

本发明相较于传统技术,本发明具有以下优点:Compared with the traditional technology, the present invention has the following advantages:

一、成本低:本发明最低仅需使用一个单目相机以及一个嵌入式设备即可完成测距全部流程;1. Low cost: the present invention only needs to use a monocular camera and an embedded device at least to complete the whole process of ranging;

二、识别范围大:本发明采用大广角鱼眼镜头,与传统算法相比,在镜头相同数目下,检测范围更广,效率更高;Second, the recognition range is large: the present invention adopts a large and wide-angle fisheye lens. Compared with the traditional algorithm, the detection range is wider and the efficiency is higher under the same number of lenses;

三、检测速度快、准确度高:本发明使用轻量型深度神经网络,与传统目标检测算法相比,不仅更加快速,而且更加准确;本发明使用间接法求解目标物体特征点,在保证准确率的情况下能够更加快速地识别特征点。3. Fast detection speed and high accuracy: the present invention uses a lightweight deep neural network, which is not only faster but also more accurate compared with the traditional target detection algorithm; the present invention uses an indirect method to solve the feature points of the target object, which ensures accurate In the case of high rate, feature points can be identified more quickly.

附图说明Description of drawings

图1为本发明基于鱼眼镜头的单目测距方法流程图;Fig. 1 is the flow chart of the monocular ranging method based on fisheye lens of the present invention;

图2为本发明的目标检测网络结构图;Fig. 2 is the target detection network structure diagram of the present invention;

图3为本发明的鱼眼镜头成像原理图;Fig. 3 is the imaging principle diagram of the fisheye lens of the present invention;

图4为本发明中在坐标系间建立数学等式的测距示意图。FIG. 4 is a schematic diagram of distance measurement for establishing mathematical equations between coordinate systems in the present invention.

具体实施方式Detailed ways

为了更清晰的说明本发明的优势以及方案实施过程,下面结合具体实施例和附图,对本发明进行进一步的阐述。应当理解,以下所讲解的实施例并不用于限制本发明实施条件,而仅仅用于解释说明本发明。In order to illustrate the advantages of the present invention and the implementation process of the solution more clearly, the present invention will be further described below with reference to specific embodiments and accompanying drawings. It should be understood that the embodiments explained below are not used to limit the implementation conditions of the present invention, but are only used to explain the present invention.

本发明提供了一种基于单目鱼眼镜头的目标检测与测距方法,其通过单个鱼眼镜头作为检测的传感器采集图像,具体实施流程如图1所示,该方法包括以下步骤:The present invention provides a target detection and ranging method based on a monocular fisheye lens, which uses a single fisheye lens as a detection sensor to collect images. The specific implementation process is shown in Figure 1, and the method includes the following steps:

步骤一、使用鱼眼镜头拍摄照片,得到畸变图像:Step 1. Take a photo with a fisheye lens to get a distorted image:

鱼眼镜头视角为180度,目标物体中心与鱼眼镜头光心在同一水平面。根据不同用处,需要在以下三处使用鱼眼镜头拍摄照片:The angle of view of the fisheye lens is 180 degrees, and the center of the target object is on the same horizontal plane as the optical center of the fisheye lens. Depending on the application, you need to use a fisheye lens to take pictures in three places:

1)使用鱼眼镜头拍摄10-20张间距为20mm的黑白棋盘照片,以便利用张正友标定法进行标定,得到鱼眼镜头畸变系数K=[k1,k2,k3,k4,k5]及内参[dx,dy,cx,cy];1) Take 10-20 black and white chessboard photos with a spacing of 20mm using a fisheye lens, so as to use the Zhang Zhengyou calibration method for calibration, and obtain the fisheye lens distortion coefficient K=[k 1 , k 2 , k 3 , k 4 , k 5 ] and internal parameters [dx, dy, c x , c y ];

2)令鱼眼镜头光心与目标物体中心处于同一高度,然后从不同角度不同距离不同场景拍摄1000张左右照片,用于对图像检测深度网络模型进行训练。该深度网络模型结构图如图2所示:2) Make the optical center of the fisheye lens and the center of the target object at the same height, and then take about 1000 photos from different angles and different distances and different scenes to train the image detection deep network model. The structure of the deep network model is shown in Figure 2:

深度卷积部分采用MobileNet V2中的分通道卷积方法,用于提取训练数据集中畸变图像的高级特征,即特征图。与传统卷积相比,该方法将图像的区域和通道分离,降低参数量,计算速度更快;The deep convolution part adopts the sub-channel convolution method in MobileNet V2 to extract the high-level features of the distorted images in the training dataset, that is, feature maps. Compared with traditional convolution, this method separates the regions and channels of the image, reduces the amount of parameters, and calculates faster;

对不同卷积层筛选出的特征图使用FPN进行特征融合,将融合后的特征送入分类子网络和定位子网络,得到分类和定位误差;Use FPN to perform feature fusion on the feature maps screened by different convolutional layers, and send the fused features into the classification sub-network and the positioning sub-network to obtain the classification and positioning errors;

采用损失函数进行深度神经网络学习训练,损失函数为:The loss function is used for deep neural network learning and training, and the loss function is:

Figure BDA0002266772380000051
Figure BDA0002266772380000051

其中,x为输入图像,θ为模型参数,m为预设框数量,α和β是平衡定位与分类损失的权重,

Figure BDA0002266772380000052
是当预设框为正预设框时值为1,否则为0,li和pi分别为位置偏移和标签;Lreg表示位置损失函数,Lcls表示分类损失函数。where x is the input image, θ is the model parameter, m is the number of preset frames, α and β are the weights that balance the localization and classification losses,
Figure BDA0002266772380000052
is 1 when the preset frame is a positive preset frame, otherwise 0, li and p i are the position offset and label , respectively; L reg represents the position loss function, and L cls represents the classification loss function.

3)直接对目标拍摄一张图片,使用本方法对目标测距。3) Take a picture of the target directly, and use this method to measure the distance of the target.

步骤二、将畸变图像送入训练好的神经网络,得到目标物体的外接框坐标,并根据得到的框图坐标:Step 2: Send the distorted image to the trained neural network to obtain the bounding frame coordinates of the target object, and according to the obtained frame frame coordinates:

框图坐标是以(x,y,w,h)形式表现,其中(x,y)为外接框左上角顶点坐标,(w,h)为外接框宽和高,据此,便可以在图像中将目标物体框出。The frame coordinates are expressed in the form of (x, y, w, h), where (x, y) are the coordinates of the upper left corner of the bounding box, and (w, h) are the width and height of the bounding box. Frame the target object.

步骤三、对框出的图像区域进行图像处理,得到目标物体的轮廓图:Step 3: Perform image processing on the framed image area to obtain the contour map of the target object:

1)读取待检测图像,对图像进行灰度处理,即

Figure BDA0002266772380000053
1) Read the image to be detected, and perform grayscale processing on the image, that is,
Figure BDA0002266772380000053

2)设置阈值对灰度图进行二值化处理;2) Set a threshold to binarize the grayscale image;

3)根据步骤二得到的框图坐标,将框图外区域像素值置0,然后使用Canny算子对灰度图检测轮廓,得到轮廓点后存入数组,对轮廓采用轮廓跟踪,得到连续的轮廓点集P(i);3) According to the coordinates of the frame obtained in step 2, set the pixel value of the area outside the frame to 0, then use the Canny operator to detect the contour of the grayscale image, obtain the contour points and store them in the array, and use contour tracking for the contour to obtain continuous contour points. set P(i);

4)使用OpenCV将轮廓绘制于原图大小的黑白图中。4) Use OpenCV to draw the outline in the black and white image of the original image size.

步骤四、对轮廓图使用特征点检测算法,得到目标特征点:Step 4. Use the feature point detection algorithm on the contour map to obtain the target feature points:

基于轮廓的特征点检测方法主要是通过间接法来求解特征点。首先,将目标物体轮廓点集P(i)分解到X、Y坐标轴,得到两条一维离散曲线X(i)和Y(i),然后通过插值法求解曲线X(i)和Y(i)各点凹率:The feature point detection method based on contour mainly solves the feature point by indirect method. First, decompose the target object contour point set P(i) into the X and Y coordinate axes to obtain two one-dimensional discrete curves X(i) and Y(i), and then solve the curves X(i) and Y( i) The concave rate of each point:

Figure BDA0002266772380000061
Figure BDA0002266772380000061

其中L为插值步长;得到凹率后在小尺度下利用多尺度提高检测精度和算法对噪声的鲁棒性,同时使用自适应阈值即可得到目标物体特征点。Among them, L is the interpolation step size; after obtaining the concave rate, multi-scale is used to improve the detection accuracy and the robustness of the algorithm to noise at a small scale, and the feature points of the target object can be obtained by using an adaptive threshold.

步骤五、根据畸变图像校正公式,得到校正后的特征点坐标:Step 5. Obtain the corrected feature point coordinates according to the distorted image correction formula:

鱼眼镜头成像原理如图3所示。现实中目标P经过鱼眼镜头光心成像于图像平面p′点,设O′p′长度为r′,结合畸变系数K,由:The imaging principle of the fisheye lens is shown in Figure 3. In reality, the target P is imaged at the point p' of the image plane through the optical center of the fisheye lens, and the length of O'p' is set as r', combined with the distortion coefficient K, as follows:

r′(θ)=k1θ+k2θ3+…+k5θ9 r′(θ)=k 1 θ+k 2 θ 3 +…+k 5 θ 9

可得入射角θ,因此Op长度r=ftanθ。又已知p′点坐标(x′,y′),所以能得到

Figure BDA0002266772380000062
大小,进而求得针孔模型下正常点p坐标:The angle of incidence θ can be obtained, so Op length r = ftan θ. The coordinates (x', y') of p' are also known, so we can get
Figure BDA0002266772380000062
size, and then obtain the p-coordinate of the normal point under the pinhole model:

Figure BDA0002266772380000063
Figure BDA0002266772380000063

步骤六、根据已知的与图像中特征点对应的现实中物体特征点间的距离,使用坐标转换公式在图像与世界坐标系间建立数学等式,求解得到鱼眼相机距离目标物体距离:Step 6. According to the known distances between the feature points of objects in reality corresponding to the feature points in the image, use the coordinate conversion formula to establish a mathematical equation between the image and the world coordinate system, and solve to obtain the distance between the fisheye camera and the target object:

已知像素坐标系与世界坐标系间的转换表达式为:The conversion expression between the known pixel coordinate system and the world coordinate system is:

Figure BDA0002266772380000064
Figure BDA0002266772380000064

假设世界坐标系位于如图4所示位置,则R=I,T=[0 0 d]T,则上式可以化为:Assuming that the world coordinate system is located at the position shown in Figure 4, then R=I, T=[0 0 d] T , the above formula can be transformed into:

Figure BDA0002266772380000065
Figure BDA0002266772380000065

综合已知特征点坐标及之间长度可以求得d。d can be obtained by synthesizing the coordinates of the known feature points and the length between them.

选取两特征点中点作为目标质心,则在世界坐标系中质心到原点距离

Figure BDA0002266772380000071
则摄像机光心到目标质心的距离
Figure BDA0002266772380000072
Select the midpoint of the two feature points as the target centroid, then the distance from the centroid to the origin in the world coordinate system
Figure BDA0002266772380000071
Then the distance from the camera optical center to the target mass center
Figure BDA0002266772380000072

Claims (8)

1.一种基于鱼眼镜头的单目测距方法,其特征在于,包括下述步骤:1. a monocular ranging method based on fisheye lens, is characterized in that, comprises the following steps: 步骤一、使用鱼眼镜头拍摄照片,得到畸变图像;Step 1. Use a fisheye lens to take a photo to obtain a distorted image; 步骤二、将畸变图像送入训练好的神经网络,得到目标物体的外界框坐标,并根据得到的框图坐标,在图像中将目标物体框出;Step 2, sending the distorted image into the trained neural network to obtain the outer frame coordinates of the target object, and frame the target object in the image according to the obtained frame frame coordinates; 步骤三、对框出的图像区域进行图像处理,得到目标物体的轮廓图;Step 3: Perform image processing on the framed image area to obtain a contour map of the target object; 步骤四、对轮廓图使用特征点检测算法,得到目标特征点;Step 4: Use a feature point detection algorithm on the contour map to obtain target feature points; 步骤五、根据畸变图像校正公式,得到校正后的特征点坐标;Step 5. Obtain the corrected feature point coordinates according to the distorted image correction formula; 步骤六、根据已知的与图像中特征点对应的现实中物体特征点间的距离,使用坐标转换公式在图像与世界坐标系间建立数学等式,求解得到鱼眼相机距离目标物体距离。Step 6: According to the known distance between the feature points of the real object corresponding to the feature points in the image, use the coordinate conversion formula to establish a mathematical equation between the image and the world coordinate system, and solve to obtain the distance between the fisheye camera and the target object. 2.如权利要求1所述的一种基于鱼眼镜头的单目测距方法,其特征在于,在所述步骤一中,鱼眼镜头视角为180度,目标物体中心与鱼眼镜头光心在同一水平面。2. a kind of monocular ranging method based on fisheye lens as claimed in claim 1, is characterized in that, in described step 1, fisheye lens angle of view is 180 degrees, the center of target object and fisheye lens optical center at the same level. 3.如权利要求1所述的一种基于鱼眼镜头的单目测距方法,其特征在于,在所述步骤二中,对畸变图像使用的算法是基于深度学习的目标检测算法,该算法包括以下部分:3. a kind of monocular ranging method based on fisheye lens as claimed in claim 1 is characterized in that, in described step 2, the algorithm used to distorted image is the target detection algorithm based on deep learning, this algorithm Includes the following parts: 采用MobileNet V2中的分通道卷积方法,提取训练数据集中畸变图像的高级特征;Using the sub-channel convolution method in MobileNet V2 to extract the high-level features of the distorted images in the training dataset; 对不同卷积层筛选出的特征使用FPN进行特征融合,将融合后的特征送入分类子网络和定位子网络,得到分类和定位误差;Use FPN to perform feature fusion on the features screened by different convolutional layers, and send the fused features into the classification sub-network and the positioning sub-network to obtain the classification and positioning errors; 采用损失优化函数进行深度神经网络学习训练,得到训练后的优化模型,其损失函数为:The loss optimization function is used for deep neural network learning and training, and the optimized model after training is obtained. The loss function is:
Figure FDA0002266772370000011
Figure FDA0002266772370000011
其中,x为输入图像,θ为模型参数,m为预设框数量,α和β是平衡定位与分类损失的权重,
Figure FDA0002266772370000012
是当预设框为正预设框时值为1,否则为0,li和pi分别为位置偏移和标签;Lreg表示位置损失函数,Lcls表示分类损失函数。
where x is the input image, θ is the model parameter, m is the number of preset frames, α and β are the weights that balance the localization and classification losses,
Figure FDA0002266772370000012
is 1 when the preset frame is a positive preset frame, otherwise 0, l i and p i are the position offset and label, respectively; L reg represents the position loss function, and L cls represents the classification loss function.
4.如权利要求1所述的一种基于鱼眼镜头的单目测距方法,其特征在于,在所述步骤三中,对图像进行轮廓识别包含以下步骤:4. a kind of monocular ranging method based on fisheye lens as claimed in claim 1, is characterized in that, in described step 3, carries out outline recognition to the image and comprises the following steps: 读取待检测图像,对图像进行灰度处理,即
Figure FDA0002266772370000021
Read the image to be detected, and perform grayscale processing on the image, that is,
Figure FDA0002266772370000021
设置阈值对灰度图进行二值化处理;Set the threshold to binarize the grayscale image; 使用Canny算子对灰度图检测轮廓,得到轮廓点后存入数组,对轮廓采用轮廓跟踪,得到连续的轮廓点集P(i);The Canny operator is used to detect the contour of the grayscale image, and the contour points are obtained and stored in the array, and contour tracking is used for the contour to obtain a continuous contour point set P(i); 使用OpenCV将轮廓绘制于原图大小的黑白图中。Use OpenCV to draw the contours in the original size black and white image.
5.如权利要求1所述的一种基于鱼眼镜头的单目测距方法,其特征在于,在所述步骤四中,基于轮廓的特征点检测方法是通过间接法来求解特征点,其步骤如下:5. a kind of monocular ranging method based on fisheye lens as claimed in claim 1 is characterized in that, in described step 4, the feature point detection method based on contour is to solve feature point by indirect method, its Proceed as follows: 首先,将目标物体轮廓点集P(i)分解到X、Y坐标轴,得到两条一维离散曲线X(i)和Y(i),然后通过插值法求解曲线X(i)和Y(i)各点曲率:First, decompose the target object contour point set P(i) into the X and Y coordinate axes to obtain two one-dimensional discrete curves X(i) and Y(i), and then solve the curves X(i) and Y( i) Curvature of each point:
Figure FDA0002266772370000022
Figure FDA0002266772370000022
其中上为插值步长;得到曲率后在小尺度下利用多尺度提高检测精度和算法对噪声的鲁棒性,同时使用自适应阈值得到目标物体特征点。The upper part is the interpolation step size; after the curvature is obtained, the detection accuracy and the robustness of the algorithm to noise are improved by using multi-scale in a small scale, and the feature points of the target object are obtained by using an adaptive threshold.
6.如权利要求1所述的一种基于鱼眼镜头的单目测距方法,其特征在于,在所述步骤五中,畸变图像的校正采用由张正友标定法得到的畸变系数矩阵K=[K1,K2,...,K5];6. a kind of monocular ranging method based on fisheye lens as claimed in claim 1 is characterized in that, in described step 5, the correction of distorted image adopts the distortion coefficient matrix K=[ K 1 , K 2 , ..., K 5 ]; 张正友标定法:使用一张打印好的棋盘格(黑白间距已知),并贴在一个平板上,然后针对棋盘格拍摄10-20张图片,之后利用Harris特征在图片中检测特征点,最后通过解析解估算方法计算出鱼眼镜头的内部参数以及畸变系数。Zhang Zhengyou calibration method: use a printed checkerboard (the black and white spacing is known), and paste it on a flat plate, then take 10-20 pictures of the checkerboard, and then use the Harris feature to detect feature points in the picture, and finally pass The analytical solution estimation method calculates the internal parameters and distortion coefficients of the fisheye lens. 7.如权利要求1所述的一种基于鱼眼镜头的单目测距方法,其特征在于,在所述步骤六中,像素坐标系与世界坐标系间的转换表达式为:7. a kind of monocular ranging method based on fisheye lens as claimed in claim 1 is characterized in that, in described step 6, the conversion expression between pixel coordinate system and world coordinate system is:
Figure FDA0002266772370000031
Figure FDA0002266772370000031
其中,(μ,v)为像素坐标系的坐标,dx、dy分别为图像单位像素在水平和垂直方向的大小,(cx,cy)为图像中心点,f为鱼眼镜头焦距,R为旋转矩阵,t为转移向量,
Figure FDA0002266772370000032
为世界坐标系的坐标。
Among them, (μ, v) is the coordinates of the pixel coordinate system, dx, dy are the size of the image unit pixel in the horizontal and vertical directions, (c x , cy ) is the image center point, f is the focal length of the fisheye lens, R is the rotation matrix, t is the transfer vector,
Figure FDA0002266772370000032
are the coordinates of the world coordinate system.
8.如权利要求2所述的一种基于鱼眼镜头的单目测距方法,其特征在于,所述的目标物体为立方体。8 . The monocular ranging method based on a fisheye lens according to claim 2 , wherein the target object is a cube. 9 .
CN201911090732.3A 2019-11-09 2019-11-09 A monocular distance measurement method based on fisheye lens Active CN110889829B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911090732.3A CN110889829B (en) 2019-11-09 2019-11-09 A monocular distance measurement method based on fisheye lens

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911090732.3A CN110889829B (en) 2019-11-09 2019-11-09 A monocular distance measurement method based on fisheye lens

Publications (2)

Publication Number Publication Date
CN110889829A true CN110889829A (en) 2020-03-17
CN110889829B CN110889829B (en) 2023-11-03

Family

ID=69747179

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911090732.3A Active CN110889829B (en) 2019-11-09 2019-11-09 A monocular distance measurement method based on fisheye lens

Country Status (1)

Country Link
CN (1) CN110889829B (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109859263A (en) * 2019-01-26 2019-06-07 中北大学 One kind being based on fish-eye wide viewing angle localization method
CN111429533A (en) * 2020-06-15 2020-07-17 上海海栎创微电子有限公司 Camera lens distortion parameter estimation device and method
CN111780673A (en) * 2020-06-17 2020-10-16 杭州海康威视数字技术股份有限公司 Distance measurement method, device and equipment
CN112308927A (en) * 2020-10-26 2021-02-02 南昌智能新能源汽车研究院 Fusion device of panoramic camera and laser radar and calibration method thereof
CN112508975A (en) * 2020-12-21 2021-03-16 上海眼控科技股份有限公司 Image identification method, device, equipment and storage medium
CN113421300A (en) * 2021-06-28 2021-09-21 上海迈外迪网络科技有限公司 Method and device for determining actual position of object in fisheye camera image
CN114092884A (en) * 2021-11-25 2022-02-25 中邮信息科技(北京)有限公司 Camera lens displacement detection method and device, electronic equipment and storage medium
CN114820526A (en) * 2022-04-28 2022-07-29 广东电网有限责任公司 Detection management method, device and system for construction hidden danger of power transmission line
CN114972509A (en) * 2022-05-26 2022-08-30 北京利君成数字科技有限公司 Method for quickly identifying tableware position
CN115086628A (en) * 2021-03-16 2022-09-20 株式会社东芝 Learning method and image processing apparatus
US20240053477A1 (en) * 2021-02-09 2024-02-15 State Grid Jiangsu Taizhou Power Supply Company System and method for measuring image distance of power transmission lines with unmanned aerial vehicle (uav)
CN118757135A (en) * 2024-09-02 2024-10-11 烟台兴业机械股份有限公司 Integrated control method and system for drilling positioning and drilling arm operation of rock drilling rig

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108106627A (en) * 2017-12-20 2018-06-01 清华大学 A kind of monocular vision vehicle positioning method of the online dynamic calibration of distinguished point based
CN109359553A (en) * 2018-09-21 2019-02-19 上海小萌科技有限公司 Commodity detection method, device, computer equipment and the storage medium of fish eye images
CN109446909A (en) * 2018-09-27 2019-03-08 山东省科学院自动化研究所 A kind of monocular ranging auxiliary parking system and method
CN109479082A (en) * 2016-12-21 2019-03-15 华为技术有限公司 Image processing method and device
CN109741241A (en) * 2018-12-26 2019-05-10 斑马网络技术有限公司 Processing method, device, equipment and the storage medium of fish eye images
CN109977952A (en) * 2019-03-27 2019-07-05 深动科技(北京)有限公司 Candidate target detection method based on local maximum
CN110231013A (en) * 2019-05-08 2019-09-13 哈尔滨理工大学 A kind of Chinese herbaceous peony pedestrian detection based on binocular vision and people's vehicle are apart from acquisition methods
CN110414559A (en) * 2019-06-26 2019-11-05 武汉大学 Construction method and product identification method of a unified framework for product target detection in smart retail cabinets

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109479082A (en) * 2016-12-21 2019-03-15 华为技术有限公司 Image processing method and device
CN108106627A (en) * 2017-12-20 2018-06-01 清华大学 A kind of monocular vision vehicle positioning method of the online dynamic calibration of distinguished point based
CN109359553A (en) * 2018-09-21 2019-02-19 上海小萌科技有限公司 Commodity detection method, device, computer equipment and the storage medium of fish eye images
CN109446909A (en) * 2018-09-27 2019-03-08 山东省科学院自动化研究所 A kind of monocular ranging auxiliary parking system and method
CN109741241A (en) * 2018-12-26 2019-05-10 斑马网络技术有限公司 Processing method, device, equipment and the storage medium of fish eye images
CN109977952A (en) * 2019-03-27 2019-07-05 深动科技(北京)有限公司 Candidate target detection method based on local maximum
CN110231013A (en) * 2019-05-08 2019-09-13 哈尔滨理工大学 A kind of Chinese herbaceous peony pedestrian detection based on binocular vision and people's vehicle are apart from acquisition methods
CN110414559A (en) * 2019-06-26 2019-11-05 武汉大学 Construction method and product identification method of a unified framework for product target detection in smart retail cabinets

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
JIANGCHENG ZHU 等: ""Downside hemisphere object detection and localization of MAV by fisheye"" *
JUN ZHU 等: ""Object detection and localization in 3D environment by fusing raw fisheye image and attitude data"" *
宋子豪: ""基于双目立体视觉的汽车测距避障和目标识别研究"" *

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109859263A (en) * 2019-01-26 2019-06-07 中北大学 One kind being based on fish-eye wide viewing angle localization method
CN111429533A (en) * 2020-06-15 2020-07-17 上海海栎创微电子有限公司 Camera lens distortion parameter estimation device and method
CN111429533B (en) * 2020-06-15 2020-11-13 上海海栎创微电子有限公司 Camera lens distortion parameter estimation device and method
CN111780673A (en) * 2020-06-17 2020-10-16 杭州海康威视数字技术股份有限公司 Distance measurement method, device and equipment
CN112308927A (en) * 2020-10-26 2021-02-02 南昌智能新能源汽车研究院 Fusion device of panoramic camera and laser radar and calibration method thereof
CN112308927B (en) * 2020-10-26 2024-05-17 南昌智能新能源汽车研究院 Fusion device of panoramic camera and laser radar and calibration method thereof
CN112508975A (en) * 2020-12-21 2021-03-16 上海眼控科技股份有限公司 Image identification method, device, equipment and storage medium
US12105199B2 (en) * 2021-02-09 2024-10-01 State Grid Jiangsu Taizhou Power Supply Company System and method for measuring image distance of power transmission lines with unmanned aerial vehicle (UAV)
US20240053477A1 (en) * 2021-02-09 2024-02-15 State Grid Jiangsu Taizhou Power Supply Company System and method for measuring image distance of power transmission lines with unmanned aerial vehicle (uav)
CN115086628A (en) * 2021-03-16 2022-09-20 株式会社东芝 Learning method and image processing apparatus
CN113421300B (en) * 2021-06-28 2023-05-12 上海迈外迪网络科技有限公司 Method and device for determining actual position of object in fisheye camera image
CN113421300A (en) * 2021-06-28 2021-09-21 上海迈外迪网络科技有限公司 Method and device for determining actual position of object in fisheye camera image
CN114092884A (en) * 2021-11-25 2022-02-25 中邮信息科技(北京)有限公司 Camera lens displacement detection method and device, electronic equipment and storage medium
CN114820526A (en) * 2022-04-28 2022-07-29 广东电网有限责任公司 Detection management method, device and system for construction hidden danger of power transmission line
CN114972509B (en) * 2022-05-26 2023-09-29 北京利君成数字科技有限公司 Method for quickly identifying tableware position
CN114972509A (en) * 2022-05-26 2022-08-30 北京利君成数字科技有限公司 Method for quickly identifying tableware position
CN118757135A (en) * 2024-09-02 2024-10-11 烟台兴业机械股份有限公司 Integrated control method and system for drilling positioning and drilling arm operation of rock drilling rig

Also Published As

Publication number Publication date
CN110889829B (en) 2023-11-03

Similar Documents

Publication Publication Date Title
CN110889829B (en) A monocular distance measurement method based on fisheye lens
CN109035320B (en) Monocular vision-based depth extraction method
CN110689581B (en) Structured light module calibration method, electronic device, and computer-readable storage medium
CN108122191B (en) Method and device for splicing fisheye images into panoramic image and panoramic video
CN109269430B (en) Passive measurement method of diameter at breast height of multiple standing trees based on depth extraction model
CN111429533B (en) Camera lens distortion parameter estimation device and method
CN109003311B (en) Calibration method of fisheye lens
KR101666959B1 (en) Image processing apparatus having a function for automatically correcting image acquired from the camera and method therefor
CN110146030A (en) Slope Surface Deformation Monitoring System and Method Based on Checkerboard Marking Method
CN106878687A (en) A multi-sensor based vehicle environment recognition system and omnidirectional vision module
CN105654547B (en) Three-dimensional rebuilding method
CN107103056B (en) Local identification-based binocular vision indoor positioning database establishing method and positioning method
CN102903101B (en) Method for carrying out water-surface data acquisition and reconstruction by using multiple cameras
CN109859137B (en) Wide-angle camera irregular distortion global correction method
CN107301665A (en) Depth camera and its control method with varifocal optical camera
CN111709985A (en) A method of underwater target ranging based on binocular vision
CN206611521U (en) A kind of vehicle environment identifying system and omni-directional visual module based on multisensor
CN108446596A (en) Iris 3D 4 D datas acquisition system based on Visible Light Camera matrix and method
CN111260539A (en) Fisheye pattern target identification method and system
CN103824303A (en) Image perspective distortion adjusting method and device based on position and direction of photographed object
CN105352482B (en) 332 dimension object detection methods and system based on bionic compound eyes micro lens technology
CN113963065A (en) Lens internal reference calibration method and device based on external reference known and electronic equipment
CN107680035B (en) Parameter calibration method and device, server and readable storage medium
CN105335959B (en) Imaging device quick focusing method and its equipment
CN114963981B (en) A non-contact measurement method for cylindrical parts docking based on monocular vision

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