-
长波红外(8~12 μm)成像技术已被广泛地应用于红外精确制导、预警、视频检测和跟踪等多种军事及民用领域[1-3]。长波红外成像的本质是将物体红外辐射的强度信号转换成人类视觉分辨的图像,温度越高,长波红外辐射强度越强,成像时的灰度值越大。基于长波红外成像技术检测运动目标的本质是利用目标与周围环境的温度差检测目标,适用于夜晚运动目标的检测。如果目标与周围环境的温度差小,长波红外图像中的目标与背景的差异小,目标检测难度大。夏季周围环境温度全年中最高,在长波红外视频图像中的运动目标与背景的对比度[4]最低,本文特选择拍摄于夏季城市夜晚道路的长波红外视频图像,展开针对性的研究以实时精确检测道路上运动的车辆。夏季城市夜晚道路的状况复杂,造成红外视频图像背景复杂。固定安装的摄像机无法有效持续检测跟踪道路上的运动车辆,利用运动平台使摄像机平移和旋转以持续检测跟踪运动[5]的车辆,造成红外视频图像背景旋转[6]。城市夜晚道路上的运动车辆体积小,各种车辆运动速度不同,造成红外视频图像中待检测的运动目标是多种速度的小目标。运动车辆的长波红外辐射区域主要集中在发动机的区域。上述情况使得目标检测难度大,本文展开针对性的研究以实时检测旋转复杂背景[7]中红外运动小目标。
通过感兴趣区域增强[8]、区域生长和连续图像特征匹配融合的算法对于简单背景下的运动目标可以有效的检测,但对于复杂背景下的红外目标检测效果不是很理想[9]。文献[10]提出了基于形态学和高斯函数模型的目标检测算法,能够很好地去除云雾等复杂气象条件干扰,提取高亮度点作为空中目标,局限在仅限于检测空中目标,无法应用在有高亮度干扰的地面上。文献[11]提出了基于图像匹配差分的红外运动目标检测算法,可以有效去除背景中树木等干扰,只适用于检测速度较大的运动目标,不适用于慢速小目标的检测。文献[12]提出了图像分块重建的红外运动目标检测算法,算法简单,运算速度快,抗噪声强,但是算法建立在目标灰度值大于背景灰度值假设基础上,不能适用于复杂背景下的目标检测。本文针对旋转复杂背景中红外运动小目标检测误检率高、实时性差等问题,提出了目标检测新算法。
-
长波红外视频图像背景旋转复杂时可以提取的特征点较多,当背景特征点的数量远大于目标特征点的数量时,用图像总的特征点数量替代背景特征点数量来估算背景光流是简单高效的。从2 642帧拍摄于夏季城市夜晚道路的长波红外视频图像中随机抽取10帧图像,实验验证估算背景光流方法的有效性。特征点检测采用Shi和Tomasi提出的角点检测方法,对每帧图像检测背景特征点和目标特征点,其数量关系如表 1所示。
表 1 Shi-Tomasi Harris特征点检测结果
图像帧序号 背景特征点数/个 目标特征点数/个 特征点总数/个 背景特征点数占特征点总数的百分比/% 566 552 18 570 96.84 908 425 28 453 93.82 1 015 548 9 557 98.38 1 212 444 20 464 95.69 1 379 190 11 201 94.53 1 590 201 13 214 93.93 1 992 443 4 447 99.11 2 031 480 8 488 98.36 2 312 520 10 530 98.11 2 485 276 9 285 96.84 平均 408 13 421 96.91 实验结果表明:不同场景中检测的背景特征点数占特征点总数的93.82%以上,平均为96.91%。因此,用全部检测出的特征点代替背景特征点来估算图像背景光流是简单高效的。
-
文献[14]中Lucas-Kanade稀疏光流算法应用在输入图像中的一组点上,基于如下3个假设:
1) 像素亮度恒定:连续视频图像前后两帧极短时间内,跟踪像素的灰度f(x, y, t)不随时间变化。
2) 时间连续或者运动是缓慢运动:时间变化相对图像中运动的比例要足够小。
3) 运动一致性:视频图像上在一块k×k小区域内的像素运动是近似一致的。
可以得到光流矢量为:
$$ \left[ \begin{matrix} {{\mathit{\boldsymbol{v}}}_{x}} \\ {{\mathit{\boldsymbol{v}}}_{y}} \\ \end{matrix} \right]={{\left[ \begin{matrix} \sum\limits_{k\times k}{\frac{\partial f}{\partial x}\frac{\partial f}{\partial x}} & \sum\limits_{k\times k}{\frac{\partial f}{\partial x}\frac{\partial f}{\partial y}} \\ \sum\limits_{k\times k}{\frac{\partial f}{\partial x}\frac{\partial f}{\partial y}} & \sum\limits_{k\times k}{\frac{\partial f}{\partial y}\frac{\partial f}{\partial y}} \\ \end{matrix} \right]}^{-1}}\left[ \begin{matrix} -\sum\limits_{k\times k}{\frac{\partial f}{\partial x}\frac{\partial f}{\partial t}} \\ -\sum\limits_{k\times k}{\frac{\partial f}{\partial y}\frac{\partial f}{\partial t}} \\ \end{matrix} \right] $$ (1) 式中, ${{\mathit{\boldsymbol{v}}}_{x}}$ 和 ${{\mathit{\boldsymbol{v}}}_{y}}$ 是特征点在x和y方向上的光流矢量。
-
利用金字塔Lucas-Kanade稀疏光流法估算图像背景光流,计算目标光流,得到目标备选特征点集合。由于夏季城市夜晚道路的长波红外视频图像含有大量的噪声、干扰,所以在目标备选特征点集合中含有大量背景特征点。利用特征点光流矢量角度、目标灰度值区间、目标特征点区域边缘检测的方法,排除其中的背景特征点,实现目标特征点的准确提取,从而检测出红外运动小目标。
-
利用光流矢量把运动目标特征点从红外图像的背景中提取出来。在连续两帧图像中检测出N对匹配特征点,特征点光流矢量为:
$$ {{\mathit{\boldsymbol{v}}}_{k}}={{[{{\mathit{\boldsymbol{v}}}_{x,k}},{{\mathit{\boldsymbol{v}}}_{y,k}}]}^{{\rm{T}}}},\;\;k=1,2,\cdots ,N $$ (2) 背景光流矢量 ${{\mathit{\boldsymbol{v}}}_{B}}$ 可用平均光流矢量近似为:
$$ \left\{ \begin{align} & {{\mathit{\boldsymbol{v}}}_{Bx}}=\frac{1}{N}\sum\limits_{k=0}^{N}{{{\mathit{\boldsymbol{v}}}_{xk}}} \\ & {{\mathit{\boldsymbol{v}}}_{By}}=\frac{1}{N}\sum\limits_{k=0}^{N}{{{\mathit{\boldsymbol{v}}}_{yk}}} \\ \end{align} \right. $$ (3) 目标特征点光流矢量 ${{\mathit{\boldsymbol{v}}}_{Tk}}$ 为:
$$ {{\mathit{\boldsymbol{v}}}_{Tk}}={{\mathit{\boldsymbol{v}}}_{k}}-{{\mathit{\boldsymbol{v}}}_{B}},\;\;k=1,2,\cdots ,N $$ (4) 设定阈值T,根据式(4) 逐一判定N个特征点是否为运动目标特征点。
$$ \left| {{\mathit{\boldsymbol{v}}}_{Tk}} \right|=\left\{ \begin{align} & 1\left( \left| {{\mathit{\boldsymbol{v}}}_{Tk}} \right|>T \right),\ \ \ \ k点是运动目标特征点\\ & 0\left( \left| {{\mathit{\boldsymbol{v}}}_{Tk}} \right|<T \right),\ \ \ \ k点是背景特征点 \\ \end{align} \right. $$ $$ k=1,2,\cdots ,N $$ (5) 阈值T的设定非常关键,T值越小,运动目标检测的漏检率越低。因此排除背景点的误检尤为关键。为了检测出旋转复杂背景中红外运动小目标,需要将阈值T设置尽可能小,使初步得到的备选目标特征点集合包含所有的运动目标的特征点和部分背景特征点。从该集合中排除背景特征点,剩下的就是运动目标特征点,进而把所有运动目标检测出来。
-
当摄像机平移和旋转以持续检测跟踪运动目标时,造成红外视频图像背景旋转。利用特征点光流矢量角度的方法,排除背景特征点。
如图 1所示,当摄像机位置固定时,某一背景点p距离摄像机的位置是不变的;当摄像机旋转时,p点的轨迹是一条圆心在O点的圆弧。在前后两帧连续图像0.04 s的极短时间内,背景点p的光流矢量 ${{\mathit{\boldsymbol{v}}}_{B}}$ 方向可近似认为是沿着弧线的切线方向。当目标在道路上运动时,目标特征点k的光流矢量方向 ${\mathit{\boldsymbol{v}}_{Tk}}$ 是背景点p的光流矢量方向和目标自身运动方向的矢量合成。 ${\mathit{\boldsymbol{v}}_{Tk}}$ 与 ${\mathit{\boldsymbol{v}}_B}$ 之间会存在一个夹角,因此,当备选目标特征点的光流矢量与背景点光流矢量的夹角小于角度阈值时,则判断其为背景特征点,予以排除。
$$ {\rm{|}}T' - {T_B}{\rm{|}} < {T_\alpha } $$ (6) 式中, $T'$ 为备选目标特征点光流矢量角度; ${T_B}$ 为背景点光流失量的角度; ${T_\alpha }$ 为设定的角度阈值。
-
长波红外图像受环境热源、空气流动、天气状况、季节温度的影响,背景像素灰度值分布范围很大,运动目标的像素灰度值一般较大,其分布在一定的范围内。利用一种适应环境的动态目标灰度值区间[15]确定方法,可以确定目标像素灰度值的分布区间,从而排除部分背景特征点。本文提出一种改进的确定目标灰度值区间的方法,从图像直方图峰值向两侧搜索灰度值区间,可以有效避免因某一灰度值统计量较小而中断,从而获取足够大的目标灰度值区间。
目标灰度值区间为 $[{h_{\max }} -{h_{l1}}, {h_{\max }} + {h_{l2}}]$ ,其中:
$$ {h_{\max }} = {\rm{\{ }}h|{\rm{hist}}(h) = \max ({\rm{hist}}(h))\} \,h \in [0,255] $$ (7) $$ \begin{array}{l} {h_{l1}} = {\rm{min}}\{ {h_{l1}}|{\mathop{\rm g}\nolimits} ({h_{\max }} - {h_{l1}}) > 0,\\ \quad \quad \quad \quad \quad \;\;{\mathop{\rm g}\nolimits} ({h_{\max }} - {h_{l1}} - 1) < 0,\\ \quad \quad \quad \quad \quad \;\;{\mathop{\rm g}\nolimits} ({h_{\max }} - {h_{l1}} - 2) < 0\} \end{array} $$ (8) $$ \begin{array}{l} {h_{l2}} = {\rm{min}}\{ {h_{l2}}|{\mathop{\rm g}\nolimits} ({h_{\max }} + {h_{l2}} - 1) < 0,\\ \quad \quad \quad \quad \quad \;\;{\mathop{\rm g}\nolimits} ({h_{\max }} + {h_{l2}}) > 0,\\ \quad \quad \quad \quad \quad \;\;{\mathop{\rm g}\nolimits} ({h_{\max }} + {h_{l2}} + 1) > 0\} \end{array} $$ (9) $$ g(h) = {\rm{hist}}(h + 1) - {\rm{hist}}(h)\quad h \in [0,255) $$ (10) 式中, ${\rm{hist}}(h)$ 为图像直方图。
根据式(7)~式(10) 可以确定目标的灰度值区间,避免因为个别灰度值数量太低而导致灰度区间较窄的情况,如图 2所示。
根据确定的直方图区间,如图 3所示(箭头指示的区间),可以去除部分背景特征点。原始图像经过灰度值区间滤除后的图像仍然包含所有运动目标,并去除部分背景,如图 4所示。
-
夏季城市夜晚道路上由于路灯、广告屏、道路旁各种建筑、桥梁、湖面等的干扰,导致红外视频图像背景复杂,因此在目标备选特征点集合中含有大量背景特征点。本文提出一种目标特征点区域边缘检测的方法对目标备选特征点逐一进行甄别,以排除背景特征点。
首先对原始图像进行线性拉伸[16],增强目标与背景的对比度:
$$ w(x,y) = \frac{{f(x,y)}}{{\max (f(x,y))}} \times 255 $$ (11) 式中, ${f(x, y)}$ 为原始图像灰度值; $w(x, y)$ 为拉伸后图像灰度值。
再对拉伸后的红外图像 $w(x, y)$ 利用canny算子进行边缘检测,得到二值图像 $s(x, y)$ 。
最后,目标特征点在边缘上,如图 5所示。
所以在二值图像 $s(x, y)$ 中,用一个以特征点为中心的m×m的模板算子从中取值,计算模板内所有像素值之和sumM,将其与判断阈值Te比较。如果sumM > Te,该特征点为目标特征点;否则,该特征点为背景特征点。
m值的选取与运动目标的大小有关,m×m的区域应能包含目标,可以有选择地检测不同尺寸的运动目标,如大客车、小汽车、摩托车等。
-
本文所用的实验视频图像是用长波红外摄像机拍摄的夏季城市夜晚道路的长波红外视频图像(帧率为25帧/s,尺寸为352×288),拍摄时利用运动平台使摄像机可以平移和旋转,从而能够持续检测跟踪运动的车辆。视频图像背景中有路灯、高架桥、各式各样的建筑,造成背景复杂、干扰较多;视频图像中运动车辆较多,车辆大小不尽相同,运动速度各异,需要检测出多种速度的运动目标。实验平台为Windows XP操作系统的PC机,使用VC6.0进行编程实现。
图 7为长波红外视频图像中选取的4帧图像,图 8为背景的旋转情况,图中圆点表示同一位置,箭头标示背景旋转的方向(背景的旋转中心位于图像右下方,旋转方向为逆时针),由图 8可以看出图像伴随有上下抖动的现象。图 9是上述4帧图像中的特征点光流减去背景光流后产生的备选目标特征点光流。图 10是利用特征点光流矢量角度、目标灰度值区间、目标特征点区域边缘检测的方法,排除备选目标特征点集合中的背景特征点,实现目标特征点的准确提取。
实验中,获取备选特征点集合的判定阈值T=0.75像素,该阈值的意义是检测目标的帧间最小速度为0.75像素/帧,帧间光流矢量角度阈值 ${T_\alpha }$ =0.1 rad,4帧图像的灰度判断区间分别为[90, 153]、[100, 149]、[99, 158]、[95, 175],检测出最小为5个像素的红外运动小目标。其中,剔除背景特征点过程数据如表 2所示。
表 2 剔除背景特征点
帧数 备选特征点数量/个 光流矢量角度剔除背景点后特征点数量/个 灰度区间剔除背景点后特征点数量/个 边缘检测剔除背景点后目标特征点数量/个 第951 29 25 18 12 第1 184 37 26 19 12 第1 595 35 25 22 20 第1 763 38 28 20 15 视频(2 642帧)中出现的5 890个运动目标,检测目标5 524个,准确检测率为93.8%,出现虚警目标334次,平均虚警率0.126次/帧。虚警率与环境的复杂程度直接相关。目标检测总耗时为41 023 ms,平均耗时15.53 ms/帧,每帧图像处理的最大时间为20.45 ms。本文算法检测时间小于40 ms,完全能够满足对路面运动目标检测实时性的要求。该算法针对长波红外场景下的运动目标检测,因此要求目标与背景的灰度值存在一定差异,进而有效提取特征点,这是该算法进行目标检测前提和基础。但是该算法仍有尚需改进之处,如对于极其慢速的运动目标(即将靠近红灯前将要停止的运动车辆),难以检测出来。
Real-Time Detection for Infrared Motion Small Targets in Rotation and Complex Background
-
摘要: 针对旋转复杂背景中红外运动小目标检测误检率高、实时性差等问题,提出了目标检测新算法。首先对图像进行中值滤波预处理,计算图像光流场,提取特征点,估算背景光流;然后设置阈值,判断提取备选目标特征点集合;最后通过特征点光流矢量角度、目标灰度值区间、目标特征点区域边缘检测的方法,排除备选目标特征点集合中的背景特征点,实时准确检测旋转复杂背景中红外运动小目标。实验结果表明,该算法能够准确地检测出红外多个运动小目标,检测率93.8%,平均虚警率0.126次/帧,平均每帧耗时15.53 ms,每帧图像处理的最大时间为20.45 ms,能够满足运动目标检测对实时性的要求。Abstract: A new algorithm of real-time detection for infrared motion small targets in rotational and complex background is proposed for solving the problems of high error rate of detection and poor real-time performance. The algorithm, at the first, processes the original infrared image with median filter, calculates the optical flows field, extracts the image's feature points, estimates the background optical flows field, and then extracts the assemblage of the target feature points by setting the threshold. Finally, according to the optical flow vector angle of feature points, target gray interval and the area of feature points of edge detection, the background features points are removed from the assemblage, and thus the infrared motion small targets in rotational and complex background are detected accurately and timely. The experimental results show that the rate of detection of infrared motion small targets reaches 93.8%, the rate of average false alarm is 0.126 times per frame, the average time of target detection per frame is 15.53 milliseconds, and the maximum processing time for each frame is 20.45 milliseconds. It is concluded that the proposed algorithm meets the requirements of real-time moving target detection.
-
表 1 Shi-Tomasi Harris特征点检测结果
图像帧序号 背景特征点数/个 目标特征点数/个 特征点总数/个 背景特征点数占特征点总数的百分比/% 566 552 18 570 96.84 908 425 28 453 93.82 1 015 548 9 557 98.38 1 212 444 20 464 95.69 1 379 190 11 201 94.53 1 590 201 13 214 93.93 1 992 443 4 447 99.11 2 031 480 8 488 98.36 2 312 520 10 530 98.11 2 485 276 9 285 96.84 平均 408 13 421 96.91 表 2 剔除背景特征点
帧数 备选特征点数量/个 光流矢量角度剔除背景点后特征点数量/个 灰度区间剔除背景点后特征点数量/个 边缘检测剔除背景点后目标特征点数量/个 第951 29 25 18 12 第1 184 37 26 19 12 第1 595 35 25 22 20 第1 763 38 28 20 15 -
[1] YANG L, YANG J, YANG K. Adaptive detection for infrared small target under sea-sky complex background[J]. Electronics Letters, 2004, 40(17):1083-1085. doi: 10.1049/el:20045204 [2] WANG X, LV G, XU L. Infrared dim target detection based on visual attention[J]. Infrared Physics & Technology, 2012, 55(6):513-521. https://www.researchgate.net/publication/257519425_Infrared_dim_target_detection_based_on_visual_attention [3] WEIHUA W, YAN H, ZHIJUN L, et al. A real-time target detection algorithm for Infrared Search and track system based on ROI extraction[C]//Signal Processing, Communication and Computing (ICSPCC), 2012 IEEE International Conference on.[S.l.]:IEEE, 2012:774-778. [4] 张肃, 王文生, 徐春云.低对比度环境下运动目标光学相关检测技术[J].仪器仪表学报, 2013, 34(2):319-325. http://www.cnki.com.cn/Article/CJFDTOTAL-YQXB201302011.htm ZHANG Su, WANG Wen-sheng, XU Chun-yun. Optical correlation detection technology of moving target under low contrast environment[J]. Chinese Journal of Scientific Instrument, 2013, 34(2):319-325. http://www.cnki.com.cn/Article/CJFDTOTAL-YQXB201302011.htm [5] 蒋建国, 安红新, 齐美彬, 等.复杂场景下的快速目标检测算法[J].电子测量与仪器学报, 2012, 26(3):261-266. http://youxian.cnki.com.cn/yxdetail.aspx?filename=JSYJ20170123008&dbname=CAPJ2015 JIANG Jian-guo, AN Hong-xin, QI Mei-bin, et al. Rapid target detection algorithm in complex scene[J]. Journal of Electronic Measurement and Instrument, 2012, 26(3):261-266. http://youxian.cnki.com.cn/yxdetail.aspx?filename=JSYJ20170123008&dbname=CAPJ2015 [6] 蒋建国, 蔡志祥, 齐美彬, 等.旋转摄像机下的快速目标检测算法[J].电子测量与仪器学报, 2012, 26(7):624-628. http://www.cnki.com.cn/Article/CJFDTOTAL-DZIY201207011.htm JIANG Jian-guo, CAI Zhi-xiang, QI Mei-bin, et al. The method of rapid moving object detection in rotating camera[J]. Journal of Electronic Measurement and Instrument, 2012, 26(7):624-628. http://www.cnki.com.cn/Article/CJFDTOTAL-DZIY201207011.htm [7] 李劲菊, 朱青, 王耀南.一种复杂背景下运动目标检测与跟踪方法[J].仪器仪表学报, 2010, 31(10):2242-2247. http://youxian.cnki.com.cn/yxdetail.aspx?filename=WXJY201718005&dbname=CJFDPREP LI Jing-ju, ZHU Qing, WANG Yao-nan. Detecting and track ingmethod ofmoving target in complex environment Chinese[J]. Journal of Scientific Instrument, 2010, 31(10):2242-2247. http://youxian.cnki.com.cn/yxdetail.aspx?filename=WXJY201718005&dbname=CJFDPREP [8] DONG X, HUANG X, ZHENG Y, et al. Infrared dim and small target detecting and tracking method inspired by Human Visual System[J]. Infrared Physics & Technology, 2014, 62:100-109. doi: 10.1016/j.infrared.2013.11.007 [9] CHEN Y, LIU X, HUANG Q. Real-time detection of rapid moving infrared target on variation background[J]. Infrared Physics & Technology, 2008, 51(3):146-151. doi: 10.1016/j.infrared.2007.09.005 [10] KIM J H, PARK J J, AHN S H, et al. A small target detection system based on morphology and modified gaussian distance function[M]. Berlin, Germany:Springer Berlin Heidelberg, 2014. [11] 李建成, 刘兴淼, 潘伟全, 等.动态背景下的红外运动目标检测[J].光电工程, 2013, 40(3):1-6. http://www.cnki.com.cn/Article/CJFDTOTAL-GDGC201303004.htm LI Jian-cheng, LIU Xing-miao, PAN Wei-quan, et al. A method of infrared image moving object detection on dynamic background[J]. Opto-Electronic Engineering, 2013, 40(3):1-6. http://www.cnki.com.cn/Article/CJFDTOTAL-GDGC201303004.htm [12] 刘兴淼, 王仕成, 赵静.图像分块重建的红外运动目标检测算法[J].红外与激光工程, 2011, 40(1):176-180. http://www.cnki.com.cn/Article/CJFDTOTAL-HWYJ201101042.htm LIU Xing-miao, WANG Shi-cheng, ZHAO Jing. Infrared image moving object detection based on image block reconstruction[J]. Infrared and Laser Engineering, 2011, 40(1):176-180. http://www.cnki.com.cn/Article/CJFDTOTAL-HWYJ201101042.htm [13] LUCAS B D, KANADE T. An iterative image registration technique with an application to stereo vision[C]//IJCAI'81 Proceedings of the 7th International Joint Conference on Artificial Intelligence. Vancouver, BC, Canada:Morgan Kaufmann Publishers Inc, 1981. [14] BRADSKI G, KAEHLER A. Learning openCV:Computer vision with the openCV library[M].[S.l.]:O'Reilly Media Inc, 2008. [15] LIU Z, ZHOU F, CHEN X, et al. Iterative infrared ship target segmentation based on multiple features[J]. Pattern Recognition, 2014, 47(9):2839-2852. doi: 10.1016/j.patcog.2014.03.005 [16] TAN D, CUI L, ZHANG A. Object Detection Based on Cluttered Infrared Image Background Suppression[C]//Proceedings of the 9th International Symposium on Linear Drives for Industry Applications, Volume 2. Berlin, Germany:Springer, 2014:787-795.