CN101567080B - An infrared focal plane array image enhancement method - Google Patents
An infrared focal plane array image enhancement method Download PDFInfo
- Publication number
- CN101567080B CN101567080B CN2009100621082A CN200910062108A CN101567080B CN 101567080 B CN101567080 B CN 101567080B CN 2009100621082 A CN2009100621082 A CN 2009100621082A CN 200910062108 A CN200910062108 A CN 200910062108A CN 101567080 B CN101567080 B CN 101567080B
- Authority
- CN
- China
- Prior art keywords
- max
- image
- gray
- focal plane
- value
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000001914 filtration Methods 0.000 claims abstract description 24
- 238000005728 strengthening Methods 0.000 claims abstract 4
- 230000011218 segmentation Effects 0.000 claims description 18
- 230000008569 process Effects 0.000 claims description 5
- 238000003860 storage Methods 0.000 abstract description 11
- 238000012545 processing Methods 0.000 abstract description 7
- 150000003839 salts Chemical class 0.000 abstract description 4
- 238000004364 calculation method Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 8
- 230000000694 effects Effects 0.000 description 7
- 238000003331 infrared imaging Methods 0.000 description 7
- 230000009466 transformation Effects 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 5
- 230000008901 benefit Effects 0.000 description 4
- 230000007704 transition Effects 0.000 description 4
- 235000002566 Capsicum Nutrition 0.000 description 3
- 239000006002 Pepper Substances 0.000 description 3
- 241000722363 Piper Species 0.000 description 3
- 235000016761 Piper aduncum Nutrition 0.000 description 3
- 235000017804 Piper guineense Nutrition 0.000 description 3
- 235000008184 Piper nigrum Nutrition 0.000 description 3
- 230000001186 cumulative effect Effects 0.000 description 3
- 238000001514 detection method Methods 0.000 description 3
- 238000009826 distribution Methods 0.000 description 3
- 238000004519 manufacturing process Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 230000018109 developmental process Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005315 distribution function Methods 0.000 description 2
- 238000003384 imaging method Methods 0.000 description 2
- 230000010354 integration Effects 0.000 description 2
- 102000020897 Formins Human genes 0.000 description 1
- 108091022623 Formins Proteins 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000001816 cooling Methods 0.000 description 1
- 239000003814 drug Substances 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000013178 mathematical model Methods 0.000 description 1
- 230000004297 night vision Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
Abstract
Description
技术领域technical field
本发明属于红外焦平面探测器领域,具体涉及一种红外焦平面阵列图像增强方法。The invention belongs to the field of infrared focal plane detectors, in particular to an infrared focal plane array image enhancement method.
背景技术Background technique
红外成像系统随着红外探测器的发展而发展。在第一代红外成像系统中,采用线列探测器,通过一维光机扫描实现成像。随着CCD(ChargeCoupled Device,电耦合器件)相关技术的成熟,到了20世纪70年代中期,IRFPA(Infrared Focal Plane Array,红外焦平面阵列)探测器的出现标志着第二代红外成像系统——凝视红外成像系统的诞生。与线列探测器相比,焦平面探测器成像具有空间分辨率高、探测能力强、帧频高等优点,正迅速成为红外成像技术的主流器件。目前凝视红外成像系统已开始广泛应用于夜视、海上营救搜索、天文、工业热探测和医学等民用领域,是红外成像系统的发展方向。然而由于制造材料、工艺以及工作环境等方面的原因,红外焦平面阵列输出的图像普遍存在目标对比度较弱,背景细节模糊等缺点。如某种红外焦平面阵列的标称输出数据宽度是16位,然而实际的使用中,不管场景是怎样的,大部分像素值集中在0x7EC0到0x82C0的范围上,显示效果不言而喻。所以对红外焦平面阵列输出的图像进行图像增强的预处理,使之适合特定应用,则十分必要。图像增强的方法分为空域法和频域法两类,空域法主要是对图像中的各个像素点进行操作;而频域法是在图像的某个变换域内,对图像进行操作,修改变换后的系数,然后再进行反变换得到处理后的图像。Infrared imaging systems have evolved with the development of infrared detectors. In the first-generation infrared imaging system, linear detectors are used to realize imaging through one-dimensional optical-mechanical scanning. With the maturity of CCD (Charge Coupled Device, electrically coupled device) related technologies, in the mid-1970s, the appearance of IRFPA (Infrared Focal Plane Array, infrared focal plane array) detector marked the second generation of infrared imaging system - staring The birth of the infrared imaging system. Compared with linear detectors, focal plane detector imaging has the advantages of high spatial resolution, strong detection capability, and high frame rate, and is rapidly becoming the mainstream device of infrared imaging technology. At present, the staring infrared imaging system has begun to be widely used in civilian fields such as night vision, maritime rescue search, astronomy, industrial heat detection and medicine, and is the development direction of infrared imaging systems. However, due to the reasons of manufacturing materials, technology and working environment, the images output by infrared focal plane array generally have disadvantages such as weak target contrast and blurred background details. For example, the nominal output data width of a certain infrared focal plane array is 16 bits. However, in actual use, no matter what the scene is, most of the pixel values are concentrated in the range from 0x7EC0 to 0x82C0, and the display effect is self-evident. Therefore, it is very necessary to preprocess the image output from the infrared focal plane array to make it suitable for specific applications. The method of image enhancement is divided into two types: air domain method and frequency domain method. The space domain method mainly operates on each pixel in the image; while the frequency domain method operates on the image in a certain transformation domain of the image, and modifies the image after transformation. The coefficients, and then inverse transform to get the processed image.
频域法将图像看成一种二维信号,对其进行时域到频域的变换。采用低通滤波(即只让低频信号通过)法,可去掉图中的噪声;采用高通滤波法,则可增强边缘等高频信号,使模糊的图片变得清晰。但是用DSP处理器对一幅图像进行频域的正反变换,计算量大,很难适合实时性要求高的场合。频域法在频域对图像进行增强,无论高通滤波或是低通滤波,都会很大程度的破坏原始图像,很多有效的信息都有可能被滤除。频域法计算复杂,很难由FPGA实现,所以频域法应用于高实时性场合有其局限性。The frequency domain method regards the image as a two-dimensional signal and transforms it from the time domain to the frequency domain. Using low-pass filtering (that is, only allowing low-frequency signals to pass) can remove the noise in the picture; using high-pass filtering can enhance high-frequency signals such as edges and make blurred pictures clear. However, using a DSP processor to perform forward and reverse transformation of an image in the frequency domain requires a large amount of calculation, and it is difficult to be suitable for occasions with high real-time requirements. The frequency domain method enhances the image in the frequency domain, regardless of high-pass filtering or low-pass filtering, will destroy the original image to a large extent, and a lot of effective information may be filtered out. The calculation of the frequency domain method is complex, and it is difficult to realize it by FPGA, so the frequency domain method has its limitations when applied to high real-time occasions.
直方图均衡是一种典型的空间域的图像增强方法,直方图均衡化处理的中心思想是把原始图像的灰度直方图从比较集中的某个灰度区间变成在全部灰度范围内的均匀分布。原始图像灰度值r归一化在0~1之间,p(r)为原始图像灰度分布的概率密度函数。直方图均衡化处理实际上就是寻找一个灰度变换函数T,使得变化后的灰度值s=T(r),其中,s归一化为0~1,即建立r与s之间的映射关系,要求处理后图像灰度分布的概率密度函数p(s)=1,期望所有灰度级出现概率相同。Histogram equalization is a typical image enhancement method in the spatial domain. The central idea of histogram equalization processing is to change the gray histogram of the original image from a relatively concentrated gray-scale interval to a gray-scale range. Evenly distributed. The gray value r of the original image is normalized between 0 and 1, and p(r) is the probability density function of the gray distribution of the original image. Histogram equalization processing is actually to find a grayscale transformation function T, so that the changed grayscale value s=T(r), where s is normalized to 0~1, that is, the mapping between r and s is established The relationship requires that the probability density function p(s)=1 of the gray distribution of the processed image, and it is expected that all gray levels have the same probability of occurrence.
对于数字图像离散情况,其直方图均衡化处理的计算步骤如下:For the case of discrete digital images, the calculation steps of histogram equalization processing are as follows:
(1)统计原始图像的直方图(1) Statistical histogram of the original image
式中,rk是归一化的输入图像灰度,nk是输入图像中归一化灰度等于rk的像素个数,n是输入图像的像素总数。where r k is the normalized grayscale of the input image, nk is the number of pixels in the input image whose normalized grayscale is equal to r k , and n is the total number of pixels in the input image.
(2)计算直方图累积分布曲线(2) Calculate the histogram cumulative distribution curve
(3)用累积分布函数作变换函数进行图像灰度变换(3) Use the cumulative distribution function as the transformation function to perform image grayscale transformation
根据计算得到的累积分布函数,建立输入图像与输出图像灰度之间的对应关系,最后要将变换后的灰度恢复成原先范围。According to the calculated cumulative distribution function, the corresponding relationship between the input image and the output image gray level is established, and finally the transformed gray level is restored to the original range.
直方图均衡作为一种基础的图像处理方法在很多领域得到应用,但大多是通过DSP或者CPU编程实现,其优点是灵活性比较高,调试方便,最大的缺点是很难做到实时或者准实时处理,这在某些领域是不可接受的。而使用FPGA实现可以很好地解决实时处理的难题。但是做直方图统计通常需要大小约为一整幅图的存储空间,如《电子技术应用》2006年第11期的“视频图像灰度信号直方图均衡的FPGA实现”一文,优点是直方图均衡可以很好地起到图像增强的效果,不足之处在于其并未解决直方图统计需要耗费大量存储资源的问题,只是简单地在FPGA外部扩展了一片SDRAM做直方图统计,增加了成本,降低了系统的集成度。As a basic image processing method, histogram equalization has been applied in many fields, but most of them are realized by DSP or CPU programming. Its advantages are high flexibility and convenient debugging. The biggest disadvantage is that it is difficult to achieve real-time or quasi-real-time processing, which is unacceptable in some areas. The use of FPGA can solve the problem of real-time processing very well. However, histogram statistics usually require a storage space of about a whole image, such as the article "FPGA Realization of Histogram Equalization of Video Image Gray Signal Signal" in "Application of Electronic Technology" No. 11, 2006. The advantage is that histogram equalization It can play a good role in image enhancement. The disadvantage is that it does not solve the problem that histogram statistics need to consume a lot of storage resources. It simply expands a piece of SDRAM outside the FPGA for histogram statistics, which increases the cost and reduces the cost. system integration.
《微计算机信息》2007年第63卷第6-2期“基于FPGA的实时红外图像线性增强算法”一文中,利用5帧图像,进行帧间迭代的方法,获取图像中的最大值与最小值,进行一段线性拉伸。其优点在于无须缓存整幅图像,对存储资源要求低,但是其帧间迭代的算法效率较低,只能获取图像中的最大值与最小值,拉伸灵活性很低。"Microcomputer Information", Volume 63, Issue 6-2, 2007 "FPGA-based Real-time Infrared Image Linear Enhancement Algorithm", uses 5 frames of images to iterate between frames to obtain the maximum and minimum values in the image , perform a linear stretch. Its advantage is that it does not need to cache the entire image and has low requirements for storage resources. However, its inter-frame iteration algorithm is inefficient and can only obtain the maximum and minimum values in the image, and the stretching flexibility is very low.
发明内容Contents of the invention
本发明的目的在于提供一种红外焦平面阵列图像增强方法,该方法可以在有限的FPGA资源条件下,有效地增强图像暗区域的细节部分,提高了运算速度。The purpose of the present invention is to provide an infrared focal plane array image enhancement method, which can effectively enhance the details of the dark area of the image under the condition of limited FPGA resources, and improve the operation speed.
本发明提供的红外焦平面阵列图像增强方法,其步骤包括:Infrared focal plane array image enhancement method provided by the present invention, its steps include:
第1步 中值滤波Step 1 Median filtering
对第n帧图像进行中值滤波,n为待处理图像的帧序号;Perform median filtering on the image of the nth frame, where n is the frame number of the image to be processed;
第2步 分段点获取Step 2 Segmentation point acquisition
分别利用下式(I)、(II)和式(III)计算经过中值滤波的第n帧图像的最小灰度值Xmin n,最大灰度值Xmax n和分段点的灰度值Xb n;Use the following formulas (I), (II) and formula (III) to calculate the minimum gray value X min n , the maximum gray value X max n and the gray value of the segmentation point of the nth frame image after median filtering X b n ;
Xmin n-1、Xmax n-1和Xb n-1分别为第n-1帧图像的最小灰度值、最大灰度值和分段点的灰度值,M*N为第n帧图像的分辨率,min%、max%和b%分别表示用户设定比例值,分别表示实际图像中小于拉伸算法中的最小灰度值,最大灰度值和分段点的灰度值的像素占总像素的比例;min_countern、max_countern和b_countern分别为第n帧图像中灰度值小于Xmin n-1、Xmax n-1和Xb n-1的像素个数,ΔX为迭代权值;X min n-1 , X max n-1 and X b n-1 are the minimum gray value, the maximum gray value and the gray value of the segmentation point of the n-1th frame image respectively, and M*N is the nth The resolution of the frame image, min%, max%, and b% respectively represent the user-set ratio values, which represent the minimum gray value, maximum gray value, and gray value of the segmentation point in the actual image that are smaller than those in the stretching algorithm The proportion of pixels in the total pixels; min_counter n , max_counter n and b_counter n are the number of pixels whose gray value is less than X min n-1 , X max n-1 and X b n-1 in the nth frame image respectively, ΔX is the iteration weight;
第3步 分段拉伸Step 3 segmented stretch
利用第2步迭代得到的Xmin n,Xmax n和Xb n拉伸第n+1帧图像,分段拉伸第n+1帧图像后输出的灰度值Xout n+1:Use the X min n , X max n and X b n obtained in the second iteration to stretch the image of the n+1th frame, and the output gray value X out n+1 after stretching the n+1th frame of the image in sections:
其中Xin n+1为第n+1帧输入图像的原始灰度,S1为分配给[Xmin n,Xb n]的灰度级,S2为分配给[Xb n,Xmax n]的灰度级,S1,S2由用户设定,S1+S2为用户需要拉伸到的灰度级。Among them, X in n+1 is the original gray level of the input image of frame n+1, S1 is the gray level assigned to [X min n , X b n ], and S2 is the gray level assigned to [X b n , X max n ] The gray level, S1 and S2 are set by the user, and S1+S2 is the gray level that the user needs to stretch to.
上述中值滤波过程优选快速中值滤波算法,该算法首先对一个3*3窗口的三列元素排序;然后对于列排序后的窗口的三行元素排序;最后求对角线上三个元素的中值,所得中值就是9个元素的中值。The above-mentioned median filtering process is preferably a fast median filtering algorithm. The algorithm first sorts the three-column elements of a 3*3 window; then sorts the three-row elements of the column-sorted window; and finally calculates the three elements on the diagonal. The median value, the resulting median value is the median value of the 9 elements.
本发明在背景技术的基础上,将图像分成亮物体和暗区域两段,分别进行拉伸,有效地增强了图像大面积暗区域的细节部分,抑制了小面积亮物体对拉伸算法效果的影响。开发出基于负反馈思想的帧间迭代算法,迅速稳定地获取每段的分段点。将红外焦平面阵列输出的为w位数字图像量化到k位,使之易于处理。通常情况下w=16或14,k值由用户选定,通常为8位。本算法可以完全由FPGA独立实现,无须外部存储器和DSP的协作。具体而言,本发明方法具有以下技术特点:On the basis of the background technology, the present invention divides the image into bright objects and dark areas, and stretches them separately, which effectively enhances the details of the large-area dark areas of the image, and suppresses the effect of small-area bright objects on the effect of the stretching algorithm. Influence. A frame-to-frame iterative algorithm based on the idea of negative feedback was developed to quickly and stably obtain the segmentation points of each segment. The w-bit digital image output by the infrared focal plane array is quantized to k-bit to make it easy to process. Usually w=16 or 14, and the value of k is selected by the user, usually 8 bits. This algorithm can be completely implemented independently by FPGA without the cooperation of external memory and DSP. Specifically, the inventive method has the following technical characteristics:
(1)本发明方法的所有步骤中都无需缓存整幅图像,这样本发明大大降低了算法对存储资源的要求。因为IC制造工艺的原因,芯片中内置大容量存储资源会提高芯片的制造成本。本发明的低存储消耗特点使其可以作为一个IP核以较低的成本集成于一个SOC系统。若是在FPGA中实现本发明,资源消耗低,极大地降低了实现成本,提高了系统的集成度。(1) There is no need to cache the entire image in all steps of the method of the present invention, so the present invention greatly reduces the requirement of the algorithm for storage resources. Because of the IC manufacturing process, the built-in large-capacity storage resources in the chip will increase the manufacturing cost of the chip. The low memory consumption feature of the present invention makes it possible to be integrated in a SOC system as an IP core at a lower cost. If the present invention is realized in FPGA, the resource consumption is low, the realization cost is greatly reduced, and the integration degree of the system is improved.
(2)分段点获取步骤中,无须缓存图像,在图像输入的同时,即可完成迭代操作。以Xmin n获取为例,迭代步长Vn的选取基于负反馈思想,步长可变,迭代开始时步长较大,当Xmin n逐渐接近真实值后,步长逐渐变小,从而达到较高的迭代精度,一般10帧图像以后,Xmin n,Xmax n,Xb n即可趋于稳定。Xmin n,Xmax n,Xb n的迭代操作充分利用FPGA并行运算的特点,同时执行,大大提高了算法运行的效率。(2) In the step of segment point acquisition, there is no need to cache the image, and the iterative operation can be completed while the image is input. Taking the acquisition of X min n as an example, the selection of the iterative step size V n is based on the idea of negative feedback, the step size is variable , and the step size is large at the beginning of the iteration. To achieve high iteration accuracy, generally after 10 frames of images, X min n , X max n , and X b n can tend to be stable. The iterative operations of X min n , X max n , and X b n make full use of the characteristics of FPGA parallel operation and execute them simultaneously, which greatly improves the efficiency of algorithm operation.
(3)分段拉伸可以将图像拉伸到任意灰度级。目前红外焦平面阵列图像输出多为16位,而对于大多数目标检测跟踪算法,仅需要8位精度的灰度图即可。(3) Segmented stretching can stretch the image to any gray level. At present, the output of infrared focal plane array images is mostly 16 bits, but for most target detection and tracking algorithms, only 8-bit grayscale images are required.
(4)分段拉伸步骤中,考虑到红外焦平面椒盐噪声情况较为恶劣的情况下,中值滤波可能没有将所有的椒盐噪声滤除,分段拉伸选取直方图两端min%和max%处的灰度值作为图像的灰度最大值Xmax和灰度最小值Xmin,这样即可获取稳定的图像的最大值和最小值,为图像增强算法提供了稳定的参数。一般min取1~3,max取97~99。(4) In the segmental stretching step, considering that the salt and pepper noise of the infrared focal plane is relatively bad, the median filter may not filter out all the salt and pepper noise, and the segmental stretching selects min% and max at both ends of the histogram The gray value at % is used as the maximum gray value X max and the minimum gray value X min of the image, so that the maximum and minimum values of the stable image can be obtained, which provides stable parameters for the image enhancement algorithm. Generally, min takes 1~3, and max takes 97~99.
(5)分段拉伸步骤中,采用分两段拉伸的方法,将图像分成亮物体和暗区域两段,分别进行拉伸,有效地增强了图像大面积暗区域的细节部分,抑制了小面积亮物体对拉伸算法效果的影响。(5) In the segmented stretching step, the image is divided into bright objects and dark areas by using the method of stretching in two segments, and stretched separately, which effectively enhances the details of the large dark area of the image and suppresses the The influence of small area bright objects on the effect of stretching algorithm.
本发明优选的快速中值滤波算法仅仅需要三个时钟周期就能求得中值,在速度上有了非常大的提高。该算法并没有降低排序次数,前两个时钟周期,3个三输入排序器都要进行三次的排序,最终取得中值需要21次排序。但是前两个时钟周期3个三输入排序器的比较是同时进行的。该算法采用面积换速度的方法,最大限度的挖掘了FPGA的并行能力,因此其在速度方面的提升也是最大的。The preferred fast median filtering algorithm of the present invention only needs three clock cycles to obtain the median value, which greatly improves the speed. This algorithm does not reduce the number of sorting times. In the first two clock cycles, the three three-input sorters need to sort three times, and finally obtain the median value and need 21 sorting times. But the comparison of the three three-input sequencers is performed simultaneously in the first two clock cycles. This algorithm adopts the method of exchanging area for speed, and maximizes the parallel capability of FPGA, so its speed improvement is also the largest.
附图说明Description of drawings
图1是本发明方法的流程图;Fig. 1 is a flow chart of the inventive method;
图2是方形窗和中值滤波算法流程图;Fig. 2 is a square window and median filtering algorithm flow chart;
图3是分段点获取步骤状态变迁图;Fig. 3 is a state transition diagram of the segmentation point acquisition step;
图4是热像仪输出数字图像时序;Fig. 4 is the timing sequence of digital image output by thermal imager;
图5是原始图;Figure 5 is the original picture;
图6是增强处理后的图像。Figure 6 is the enhanced image.
具体实施方式Detailed ways
本发明将图像分成亮物体和暗区域两段,分别进行拉伸,有效地增强了图像大面积暗区域的细节部分,抑制了小面积亮物体对拉伸算法效果的影响。The invention divides the image into bright objects and dark areas, and stretches them separately, effectively enhancing the details of the large-area dark areas of the image, and suppressing the influence of small-area bright objects on the effect of the stretching algorithm.
本发明的关键是获取第n帧图像的三个灰度值,即该帧图像的最小灰度值Xmin n,最大灰度值Xmax n和分段点的灰度值Xb n,用于拉伸第n+1帧图像,n为图像的帧序号,设图像分辨率大小为M*N。The key of the present invention is to obtain the three grayscale values of the nth frame image, i.e. the minimum grayscale value X min n of the frame image, the maximum grayscale value X max n and the grayscale value X b n of the segmentation point, using For stretching the n+1th frame image, n is the frame number of the image, and the image resolution size is M*N.
灰度值小于Xmin n的像素个数占图像像素总数的min%,即M*N*min%个;The number of pixels whose gray value is less than X min n accounts for min% of the total number of image pixels, that is, M*N*min%;
灰度值小于Xmax n的像素个数占图像像素总数的max%,即M*N*max%个;The number of pixels whose grayscale value is less than X max n accounts for max% of the total number of image pixels, that is, M*N*max%;
灰度值小于Xb n的像素个数占图像像素总数的b%,即M*N*b%个;The number of pixels whose gray value is less than X b n accounts for b% of the total number of image pixels, that is, M*N*b%;
min和max及b的值由用户预先设定,一般而言,min的取值范围为1~3,max为97~99,b根据亮物体占图像面积的估算比例进行设定。这样灰度值小于Xb n的像素即认为是大面积的暗区域,分配较多的灰度级;灰度值大于Xb n的像素即认为是小面积的亮物体,分配较少的灰度级。The values of min, max and b are preset by the user. Generally speaking, the range of min is 1-3, max is 97-99, and b is set according to the estimated ratio of bright objects to the image area. In this way, pixels with a gray value smaller than X b n are considered to be large-area dark areas, and more gray levels are allocated; pixels with gray values greater than X b n are considered to be small-area bright objects, and less gray is allocated. degree level.
下面详细说明本发明的步骤:The steps of the present invention are described in detail below:
本发明提供的红外焦平面阵列图像增强方法,包括中值滤波,分段点获取,分段拉伸。The infrared focal plane array image enhancement method provided by the present invention includes median filtering, segmental point acquisition, and segmental stretching.
(1)中值滤波(1) Median filtering
中值滤波可以优选下述方式进行:3*3方形窗如图2所示,用mid{I1,I2,I3,I4,I5,I6,I7,I8,I9}来取代原方形窗中间位置的原始像素值。之后,每当一个像素及其邻域像素经过中值滤波处理完毕后,3*3方形窗将不断右移或换行,直到将一幅灰度图像的数据阵列中的所有像素全部处理完。Median filtering can preferably be performed in the following manner: 3*3 square window as shown in Figure 2, use mid{I1, I2, I3, I4, I5, I6, I7, I8, I9} to replace the middle position of the original square window raw pixel value. Afterwards, whenever a pixel and its neighboring pixels are processed by the median filter, the 3*3 square window will continuously move to the right or wrap until all the pixels in the data array of a grayscale image are processed.
方形窗内的中值滤波算法:首先对一个3*3窗口的三列元素排序;然后对于列排序后的窗口的三行元素排序;最后求对角线上三个元素的中值,所得中值就是9个元素的中值。Median filtering algorithm in a square window: first sort the elements of the three columns of a 3*3 window; then sort the elements of the three rows of the window after the columns are sorted; finally find the median of the three elements on the diagonal, and obtain the median The value is the median of the 9 elements.
(2)分段点获取(2) Segment point acquisition
Xmin n,Xmax n和Xb n(分段点)的获取采用逐帧迭代的方法。以Xmin n的获取为例,Xmin 0为Xmin n的初始值,红外焦平面阵列的标称输出数据宽度是16位,然而实际的使用中,不管场景是怎样的,大部分像素值集中在0x7EC0到0x82C0的范围上,所以令
寄存器min_countern中记录第n帧图像中,灰度值小于Xmin n-1的像素个数,ΔX为迭代权值,ΔX越大迭代速度越高,但精度变低,权衡迭代精度与迭代效率,一般可设为1。Register min_counter n records the number of pixels whose gray value is less than X min n-1 in the nth frame of the image, and ΔX is the iteration weight. The larger ΔX is, the higher the iteration speed is, but the accuracy becomes lower. It is a trade-off between iteration accuracy and iteration efficiency. , generally can be set to 1.
利用如下公式循环迭代,Use the following formula to loop and iterate,
寄存器max_countern中记录第n帧图像中,灰度值小于Xmax n-1的像素个数,Register max_counter n records the number of pixels whose gray value is less than X max n-1 in the nth frame image,
寄存器b_countern中记录第n帧图像中,灰度值小于Xb n-1的像素个数,Register b_counter n records the number of pixels whose gray value is less than X b n-1 in the nth frame image,
Xmax n和Xb n用相同的方法获取。一般10帧图像以后,Xmin n,Xmax n和Xb n即趋于稳定。X max n and X b n are obtained in the same way. Generally, after 10 frames of images, X min n , X max n and X b n tend to be stable.
(3)分段拉伸(3) Sectional stretching
两段拉伸方法,设其中Xin n+1为第n+1帧输入图像的原始灰度,Xout n+1为分段拉伸第n+1帧图像后输出的灰度,S1为分配给[Xmin n,Xb n]的灰度级,S2为分配给[Xb n,Xmax n]的灰度级。本实施方式中是将16位的图像拉伸到8位灰度级,所以S1+S2=255;取S1=200,S2=55;Two-stage stretching method, where X in n+1 is the original grayscale of the input image of frame n+1, X out n+1 is the grayscale output after stretching the image of frame n+1 in segments, and S1 is The gray level assigned to [X min n , X b n ], S2 is the gray level assigned to [X b n , X max n ]. In this embodiment, the 16-bit image is stretched to 8-bit grayscale, so S1+S2=255; S1=200, S2=55;
利用之前n帧迭代得到的Xmin n,Xmax n和Xb n拉伸第n+1帧图像。变换公式为:Use the X min n , X max n and X b n obtained from the previous n frame iterations to stretch the image of the n+1th frame. The transformation formula is:
下面通过借助实施例更加详细地说明本发明,但以下实施例仅是说明性的,本发明的保护范围并不受这些实施例的限制。The present invention is described in more detail below by means of examples, but the following examples are only illustrative, and the protection scope of the present invention is not limited by these examples.
本发明处理某型号制冷型焦平面实时输出的图像,图像幅面大小为:320*256,帧频为50帧/秒,像素数据位宽为16位,场景为室外建筑物,焦平面输出图像时序如图4所示。The invention processes the real-time output image of a cooling type focal plane, the image format size is: 320*256, the frame frequency is 50 frames per second, the pixel data bit width is 16 bits, the scene is an outdoor building, and the focal plane output image sequence As shown in Figure 4.
下面详细说明本发明的步骤:The steps of the present invention are described in detail below:
(1)中值滤波(1) Median filtering
在FPGA中生成两个双口RAM,DPRAM0与DPRAM1。每个双口RAM用来缓存3行数据,其大小刚好可以缓存3行数据即可,采用乒乓操作的方法,一个双口RAM做中值滤波的同时,另一个双口RAM存储焦平面输出的图像数据。中值滤波算法的流程如图2所示,首先对一个3*3窗口的三列元素排序;然后对于列排序后的窗口的三行元素排序;最后求对角线上三个元素的中值,所得中值就是9个元素的中值。图像进入本模块后,经过320+3个像素时钟后开始输出中值滤波结果。将帧有效信号延时320+3个像素时钟周期,中值滤波模块即可以焦平面时序输出中值滤波结果图。Generate two dual-port RAMs, DPRAM0 and DPRAM1, in the FPGA. Each dual-port RAM is used to cache 3 lines of data, and its size is just enough to cache 3 lines of data. Using the method of ping-pong operation, one dual-port RAM performs median filtering, and the other dual-port RAM stores the focal plane output. image data. The process of the median filtering algorithm is shown in Figure 2. First, sort the three-column elements of a 3*3 window; then sort the three-row elements of the column-sorted window; and finally find the median of the three elements on the diagonal , the resulting median is the median of the 9 elements. After the image enters this module, the median filter result will be output after 320+3 pixel clocks. By delaying the effective frame signal by 320+3 pixel clock cycles, the median filter module can output the median filter result map in the focal plane sequence.
(2)分段点获取(2) Segment point acquisition
Xmin n,Xmax n和Xb n(分段点)的获取采用逐帧迭代的方法。以Xmin n的获取为例,Xmin 0为Xmin n的初始值,寄存器min_countern中记录第n帧图像中,灰度值小于Xmin n-1的像素个数,ΔX为迭代权值。本实例取min=1,max=99,b=80,ΔX=1;The acquisition of X min n , X max n and X b n (segmentation points) adopts an iterative method frame by frame. Take the acquisition of X min n as an example, X min 0 is the initial value of X min n , the register min_counter n records the number of pixels whose gray value is less than X min n-1 in the image of the nth frame, and ΔX is the iteration weight . In this example, min=1, max=99, b=80, ΔX=1;
利用如下公式循环迭代,Use the following formula to loop and iterate,
寄存器max_countern中记录第n帧图像中,灰度值小于Xmax n-1的像素个数,Register max_counter n records the number of pixels whose gray value is less than X max n-1 in the nth frame image,
寄存器b_countern中记录第n帧图像中,灰度值小于Xb n-1的像素个数,Register b_counter n records the number of pixels whose gray value is less than X b n-1 in the nth frame image,
Xmax n和Xb n用相同的方法获取。一般10帧图像以后,Xmin n,Xmax n和Xb n即趋于稳定。X max n and X b n are obtained in the same way. Generally, after 10 frames of images, X min n , X max n and X b n tend to be stable.
帧信号有效时,每收到一个像素即进行判断,When the frame signal is valid, a judgment is made every time a pixel is received.
若像素灰度值小于Xmin n-1,min_countern加一;If the gray value of the pixel is less than X min n-1 , add one to min_counter n ;
若像素灰度值小于Xmax n-1,max_countern加一;If the pixel gray value is less than X max n-1 , add one to max_counter n ;
若像素灰度值小于Xb n-1,b_countern加一;If the gray value of the pixel is less than X b n-1 , add one to b_counter n ;
当一帧图像传输完后,min_countern,max_countern,b_countern记录了第n帧图像中灰度值小于Xmin n-1,Xmax n-1,Xb n-1的像素个数。After a frame of image is transmitted, min_counter n , max_counter n , b_counter n record the number of pixels whose gray value is less than X min n-1 , X max n-1 , and X b n-1 in the nth frame of image.
然后以状态机的方式完成迭代操作。Then complete the iterative operation in a state machine way.
有限状态机(FSM)是一个简单的数学模式,具有离散式输入的有限集合。与通过一个根据被接受到输入的次序所决定的有限状态集合,有限状态机可以具有一个有限集合的输出。如果是这样,状态机将会产生一连串的输出以反映出一连串的输入。A finite state machine (FSM) is a simple mathematical model with a finite set of discrete inputs. Instead of having a finite set of states determined by the order in which inputs are received, a finite state machine can have a finite set of outputs. If so, the state machine will produce a sequence of outputs reflecting the sequence of inputs.
将有限状态机(FSM)定义成一个五元组:M={I,O,S,δ,λ},I是输入的有限非空集合(输入可以是矢量);O是输出的有限非空集合(输出可以是矢量);S是状态的有限非空集合;δ:S×I→S是状态变迁函数(State TransitionFunction);λ:S×I→O是输出函数(Output Fuction)。在任何时刻,状态机总是处于某一状态中,当输入进入时,状态机则由状态变迁函数作用,转换到另一状态中。Define a finite state machine (FSM) as a five-tuple: M={I, O, S, δ, λ}, I is a finite non-empty set of inputs (input can be a vector); O is a finite non-empty output Set (the output can be a vector); S is a finite non-empty set of states; δ: S×I→S is a state transition function (State TransitionFunction); λ: S×I→O is an output function (Output Fuction). At any moment, the state machine is always in a certain state. When the input enters, the state machine is converted to another state by the state transition function.
对照一个状态机的五元组,本发明用确定五元组的办法设计一个模板参数编程状态机,其状态变迁图如图3,其中:Contrasting the quintuple of a state machine, the present invention designs a template parameter programming state machine with the way of determining quintuple, and its state transition diagram is as Figure 3, wherein:
TS0为初始态,TS1为统计图像态,TS2为计算步长系数(Kmin n Kmax n Kb n)态,TS3为计算步长(Stepmin n Stepmax n Stepb n)态,TS4为计算分段点(Xmin n Xmax n Xb n)态。初始状态为TS0,此状态机TS 0 is the initial state, TS 1 is the statistical image state, TS 2 is the calculation step coefficient (K min n K max n K b n ) state, and TS 3 is the calculation step size (Step min n Step max n Step b n ) state, and TS 4 is the state of calculating the segmentation point (X min n X max n X b n ). The initial state is TS 0 , this state machine
输入为:复位信号、帧有效信号、min_countern、max_countern、b_countern;The input is: reset signal, frame valid signal, min_counter n , max_counter n , b_counter n ;
输出为:Xmin n,Xmax n,Xb n分段点的值;The output is: X min n , X max n , the values of X b n segmentation points;
输出函数为:计算并输出分段点的值;The output function is: calculate and output the value of the segmentation point;
TS0态:系统逻辑复位后,状态为TS0,Xmin 0,Xmax 0取较接近期望值的初始值,Xb 0取(Xmin 0+Xmax 0)/2;复位结束且帧信号有效后跳转到TS1态;TS 0 state: After the system logic is reset, the state is TS 0 , X min 0 , X max 0 take the initial value closer to the expected value, X b 0 takes (X min 0 +X max 0 )/2; the reset ends and the frame signal Jump to TS 1 state after valid;
TS1态:统计第n帧图像中灰度值小于Xmin n-1,Xmax n-1,Xb n-1的像素个数,并分别记录于min_countern、max_countern、b_countern中。帧信号无效时,跳转至TS2态;TS 1 state: Count the number of pixels whose gray value is less than X min n-1 , X max n-1 , and X b n-1 in the image of the nth frame, and record them in min_counter n , max_counter n , and b_counter n respectively. When the frame signal is invalid, jump to TS 2 state;
TS2态:计算步长系数(Kmin n Kmax n Kb n),计算完成后跳转至TS3态;TS 2 state: Calculate the step size coefficient (K min n K max n K b n ), and jump to TS 3 state after the calculation is completed;
TS3态:计算步长(Stepmin n Stepmax n Stepb n),计算完成后跳转至TS4态;TS 3 state: Calculate the step size (Step min n Step max n Step b n ), jump to TS 4 state after the calculation is completed;
TS4态:迭代分段点(Xmin n Xmax n Xb n),计算完成后跳转至TS5态;TS 4 state: iteration segmentation point (X min n X max n X b n ), jump to TS 5 state after the calculation is completed;
TS5态:空闲态,输出分段点(Xmin n Xmax n Xb n)的值,当帧信号有效时,跳转至TS1态;TS 5 state: idle state, output the value of segment point (X min n X max n X b n ), when the frame signal is valid, jump to TS 1 state;
如此以来,分段点获取步骤将在内部状态机的控制下稳定的进行。帧信号有效时在TS1态统计图像特性;帧信号无效时:在TS2态、TS3态、TS4态迭代分段点,完成迭代。在TS5态输出分段点(Xmin n Xmax n Xb n)的值并等待下一轮迭代。In this way, the segment point acquisition step will be carried out stably under the control of the internal state machine. When the frame signal is valid, count the image characteristics in TS 1 state; when the frame signal is invalid: iterate the segmentation points in TS 2 state, TS 3 state, and TS 4 state to complete the iteration. In the TS 5 state, output the value of the segmentation point (X min n X max n X b n ) and wait for the next iteration.
(3)分段拉伸(3) Sectional stretching
两段拉伸方法,设其中Xin n+1为第n+1帧输入图像的原始灰度,Xout n+1为分段拉伸第n+1帧图像后输出的灰度,S1为分配给[Xmin n,Xb n]的灰度级,S2为分配给[Xb n,Xmax n]的灰度级。令S1=200,S2=55。将16位的原始图像量化到8位。Two-stage stretching method, where X in n+1 is the original grayscale of the input image of frame n+1, X out n+1 is the grayscale output after stretching the image of frame n+1 in segments, and S1 is The gray level assigned to [X min n , X b n ], S2 is the gray level assigned to [X b n , X max n ]. Let S1=200, S2=55. Quantize the 16-bit raw image to 8-bit.
利用之前n帧迭代得到的Xmin n,Xmax n和Xb n拉伸第n+1帧图像。变换公式为:Use the X min n , X max n and X b n obtained from the previous n frame iterations to stretch the image of the n+1th frame. The conversion formula is:
表1表示直方图均衡法、一段线性拉伸法、本发明方法的综合性能比较。设图像大小为320*256,像素位宽为16bits;Table 1 shows the comprehensive performance comparison of the histogram equalization method, the linear stretching method and the method of the present invention. Set the image size to 320*256, and the pixel bit width to 16bits;
表1三种算法的综合比较Table 1 Comprehensive comparison of three algorithms
综合考虑三种在FPGA中实现的拉伸算法,直方图均衡虽可以达到很好的拉伸效果,但是耗费的存储资源过高,一段线性拉伸很好地解决了存储资源耗费过大的问题,但是由于其迭代算法效率较低,只能获取图像的最大值与最小值,进行一段线性拉伸。本发明方法继承了一段线性拉伸低存储资源消耗的特点,进行分段拉伸,开发出基于负反馈思想的帧间迭代算法,迅速稳定地获取每段的分段点,达到了较好的图像增强效果。Considering the three stretching algorithms implemented in the FPGA, histogram equalization can achieve a good stretching effect, but the storage resources consumed are too high, and a linear stretching solves the problem of excessive storage resource consumption. , but due to the low efficiency of its iterative algorithm, it can only obtain the maximum and minimum values of the image and perform a linear stretch. The method of the present invention inherits the characteristics of a section of linear stretching and low storage resource consumption, performs segmented stretching, and develops an inter-frame iterative algorithm based on the idea of negative feedback, quickly and stably obtains the segmentation points of each segment, and achieves better results. Image enhancement effect.
Claims (2)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009100621082A CN101567080B (en) | 2009-05-19 | 2009-05-19 | An infrared focal plane array image enhancement method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009100621082A CN101567080B (en) | 2009-05-19 | 2009-05-19 | An infrared focal plane array image enhancement method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101567080A CN101567080A (en) | 2009-10-28 |
CN101567080B true CN101567080B (en) | 2011-01-26 |
Family
ID=41283224
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2009100621082A Expired - Fee Related CN101567080B (en) | 2009-05-19 | 2009-05-19 | An infrared focal plane array image enhancement method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101567080B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101950412B (en) * | 2010-07-23 | 2012-01-25 | 北京理工大学 | Method for enhancing details and compressing dynamic range of infrared image |
CN101980282B (en) * | 2010-10-21 | 2012-05-30 | 电子科技大学 | Infrared image dynamic detail enhancement method |
CN102208101A (en) * | 2011-04-29 | 2011-10-05 | 中国航空工业集团公司洛阳电光设备研究所 | Self-adaptive linearity transformation enhancing method of infrared image |
CN102306380B (en) * | 2011-09-14 | 2013-03-27 | 山东省科学院海洋仪器仪表研究所 | Histogram debugging method of colored image and debugging system thereof |
CN102855614B (en) * | 2012-07-24 | 2015-10-28 | 电子科技大学 | Adapting to image drawing process and device in a kind of REAL TIME INFRARED THERMAL IMAGE imaging system |
CN102932661A (en) * | 2012-11-29 | 2013-02-13 | 重庆大学 | Median filtering matching error correction method for disparity map, and circuit for implementing method |
CN103236045B (en) * | 2013-05-02 | 2015-07-22 | 北京理工大学 | Micro scanning image reconstruction method based on focal plane detector MTF (Modulation Transfer Function) |
CN105488774A (en) * | 2015-12-05 | 2016-04-13 | 中国航空工业集团公司洛阳电光设备研究所 | Gray transformation method and device for image display |
CN109561239B (en) * | 2018-08-20 | 2019-08-16 | 上海久页信息科技有限公司 | Piece caudal flexure intelligent selection platform |
CN111077533A (en) * | 2019-12-27 | 2020-04-28 | 湖南傲英创视信息科技有限公司 | Multispectral wide-area panoramic photoelectric radar system and detection method thereof |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1443459A3 (en) * | 2003-02-03 | 2004-09-29 | Noritsu Koki Co., Ltd. | Image processing method and apparatus for correcting photographic images |
CN1696975A (en) * | 2004-05-14 | 2005-11-16 | 蒲恬 | Method for enhancing digital image |
CN1996384A (en) * | 2006-12-25 | 2007-07-11 | 华中科技大学 | Infrared image multistage mean contrast enhancement method |
EP1865726A1 (en) * | 2006-06-06 | 2007-12-12 | Samsung Electronics Co., Ltd. | A Method and Device for Measuring MPEG Noise Strength of Compressed Digital Image |
-
2009
- 2009-05-19 CN CN2009100621082A patent/CN101567080B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1443459A3 (en) * | 2003-02-03 | 2004-09-29 | Noritsu Koki Co., Ltd. | Image processing method and apparatus for correcting photographic images |
CN1696975A (en) * | 2004-05-14 | 2005-11-16 | 蒲恬 | Method for enhancing digital image |
EP1865726A1 (en) * | 2006-06-06 | 2007-12-12 | Samsung Electronics Co., Ltd. | A Method and Device for Measuring MPEG Noise Strength of Compressed Digital Image |
CN1996384A (en) * | 2006-12-25 | 2007-07-11 | 华中科技大学 | Infrared image multistage mean contrast enhancement method |
Non-Patent Citations (9)
Title |
---|
Bai Lianfa et al..The hardware Design of Real-Time Infrared Image Enhancement System.《IEEE Int. Conf.Neural Networks & Singal Processing》.2003,1009-1012. |
Bai Lianfa et al..The hardware Design of Real-Time Infrared Image Enhancement System.《IEEE Int. Conf.Neural Networks & * |
JP特开2006-311378A 2006.11.09 |
Singal Processing》.2003,1009-1012. * |
technology》.2005,第46卷329-337. * |
Yan Shi et al..A feasible approach for nonuniformity correction in IRFPA with nonlinear response.《infrared physics & technology》.2005,第46卷329-337. |
Yan Shi et al..A feasible approach for nonuniformity correction in IRFPA with nonlinear response.《infrared physics & * |
尹立敏等.一种可控的直方图均衡算法.《微计算机信息》.2005,第21卷(第3期),147-148,100. * |
张振军等.红外图像小目标实时检测系统的设计与实现.《计算机应用研究》.2008,第25卷(第3期),789-790、794. * |
Also Published As
Publication number | Publication date |
---|---|
CN101567080A (en) | 2009-10-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101567080B (en) | An infrared focal plane array image enhancement method | |
Bilal et al. | A low-complexity pedestrian detection framework for smart video surveillance systems | |
CN105469373B (en) | A kind of Retinex image enchancing methods and system | |
CN104978728B (en) | A kind of image matching system of optical flow method | |
US20160267111A1 (en) | Two-stage vector reduction using two-dimensional and one-dimensional systolic arrays | |
CN101281650A (en) | A Fast Global Motion Estimation Method for Video Stabilization | |
CN1996384A (en) | Infrared image multistage mean contrast enhancement method | |
CN104751484A (en) | Moving target detection method and detection system for achieving same | |
CN108765282A (en) | Real-time super-resolution method and system based on FPGA | |
Li et al. | High throughput hardware architecture for accurate semi-global matching | |
Zhang et al. | A raw image-based end-to-end object detection accelerator using HOG features | |
Licciardo et al. | Stream processor for real-time inverse Tone Mapping of Full-HD images | |
CN107341772A (en) | A kind of gray level image medium filtering optimization method and its system based on FPGA | |
CN101604449A (en) | A method and device for image target tracking based on parallel particle filter | |
Ma et al. | MS-RNN: A flexible multi-scale framework for spatiotemporal predictive learning | |
CN109215001B (en) | High temperature difference self-adaptive platform histogram equalization implementation method based on FPGA | |
George | Hardware-efficient DWT architecture for image processing in visual sensors networks | |
Mukherjee et al. | Fast hardware architecture for fixed-point 2D Gaussian filter | |
Garg et al. | A low-cost energy efficient image scaling processor for multimedia applications | |
CN104376546A (en) | Method for achieving three-path image pyramid fusion algorithm based on DM642 | |
CN118333862B (en) | Satellite precipitation remote sensing image space-time super-resolution reconstruction method and system | |
Tang et al. | Energy-efficient pedestrian detection system: Exploiting statistical error compensation for lossy memory data compression | |
Ali et al. | Comparametric hdr (high dynamic range) imaging for digital eye glass, wearable cameras, and sousveillance | |
Tan et al. | A simple gray-edge automatic white balance method with FPGA implementation | |
CN107154060A (en) | A kind of openness detecting system of frame of video based on DSP and data processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20110126 Termination date: 20180519 |
|
CF01 | Termination of patent right due to non-payment of annual fee |