Shape Preserving Sampling and Reconstruction of Grayscale Images
- 格式:pdf
- 大小:186.14 KB
- 文档页数:12
ocr识别发票的详细流程English Answer:Step 1: Preprocessing the Invoice Image.Convert the invoice image into a grayscale image.Apply image binarization to convert the image to a black-and-white image.Remove noise from the image using morphological operations like erosion and dilation.Step 2: Identifying Text Regions.Use connected component analysis to identify regions of text in the invoice image.Apply a bounding box around each text region.Crop the text regions from the image.Step 3: Text Line Segmentation.Use Hough transform or projection profiles to identify text lines within each text region.Separate the text into individual lines.Step 4: Character Segmentation.Use connected component analysis or edge detection techniques to identify individual characters within each text line.Extract the characters from the image.Step 5: Feature Extraction.Extract features from each character using techniques like HOG (Histogram of Oriented Gradients) or CNNs (Convolutional Neural Networks).The features help in representing the shape and texture of characters.Step 6: Character Recognition.Use a pre-trained OCR (Optical Character Recognition) model to recognize the characters.The model classifies the extracted features into different character classes.Step 7: Text Reconstruction.Combine the recognized characters to form words and lines of text.Reconstruct the complete text from the invoice image.Step 8: Data Extraction.Identify key fields in the invoice like the invoice number, date, total amount, etc.Use regular expressions or natural language processing techniques to extract the data from the text.中文回答:步骤1,发票图像预处理。
㊀㊀2018年河北大学学报(自然科学版)2018第38卷㊀第3期J o u r n a l o fH e b e iU n i v e r s i t y(N a t u r a l S c i e n c eE d i t i o n)V o l.38N o.3D O I:10 3969/j i s s n 10001565 2018 03 014一种基于a l p h a通道的彩色图像超分辨率方法赵红,魏勇刚,杨刚(河北大学网络空间安全与计算机学院,河北保定㊀071002)摘㊀要:彩色图像的R G B3个通道间具有密切的相关性.若将现有具有边缘保持作用的灰度图像超分辨率方法直接推广到R G B空间中进行,很容易破坏这种相关性,也必会导致色彩伪影.为解决此问题,本文提出了一种基于a l p h a通道的彩色图像超分辨率方法.首先,对图像进行区域分割,并对每个区域进行前景㊁背景及a l p h a通道的提取;然后,将a l p h a通道㊁前景及背景图像分别进行超分辨率;最后,合成得到高分辨率图像.该方法基于图像分割和a l p h am a t t i n g技术,利用a l p h a通道协调3个通道的边缘信息.实验结果表明,该算法在较好地实现超分辨率的同时保持了图像的边缘,避免了色彩失真,具有较好的视觉效果.关键词:彩色图像超分辨率;a l p h a通道;边缘保持;图像分割中图分类号:T P391㊀㊀㊀文献标志码:A㊀㊀㊀文章编号:10001565(2018)03032106Ac o l o r i m a g e s u p e r r e s o l u t i o na p p r o a c hb a s e d o na l p h a c h a n n e lZ H A OH o n g,W E I Y o n g g a n g,Y A N GG a n g(S c h o o l o fC y b e r S e c u r i t y a n dC o m p u t e r,H e b e iU n i v e r s i t y,B a o d i n g071002,C h i n a)A b s t r a c t:T h e r e i s a c l o s e c o r r e l a t i o nb e t w e e n t h e t h r e e c h a n n e l so f a c o l o r i m a g e.T h e e x i s t i n g e d g e p r e s e r v i n g s u p e rGr e s o l u t i o nm e t h o d f o r g r a y s c a l e i m a g e c a nn o t b e e x t e n d e d d i r e c t l y t oR GB s p a c e,b e c a u s e i t i s e a s y t ob r e a kt h e r e l e v a n c ea n dc a u s ec o l o r a r t i f a c t s.A n e w m e t h o do f c o l o r i m a g es u p e r r e s o l u t i o n b a s e do na l p h a c h a n n e l i s p r o p o s e d t o s o l v e t h i s p r o b l e m.F i r s t l y,t h e i m a g e i s s e g m e n t e db y r e g i o n,a n d t h e f o r e g r o u n d,b a c k g r o u n d a n d a l p h a c h a n n e l o f e a c h r e g i o n a r e e x t r a c t e d.T h e n,t h e a l p h a c h a n n e l,f o r eGg r o u n da n d b a c k g r o u n d i m a g e s a r e s u p e rGr e s o l u t e d r e s p e c t i v e l y.F i n a l l y,t h e h i g h r e s o l u t i o n i m a g e i s s y n t h e s i z e d a g a i n.T h e a l p h a c h a n n e l i su s e d t oc o o r d i n a t e t h ee d g e i n f o r m a t i o no f t h r e e c h a n n e l s.T h e e x p e r i m e n t a l r e s u l t s s h o wt h a t t h em e t h o d c a nk e e p t h e c o l o r e d g e o f t h e i m a g e b e t t e r a n dh a s b e t t e r v i s u a l e f f e c t s.K e y w o r d s:c o l o r i m a g e s u p e r r e s o l u t i o n;a l p h a c h a n n e l;e d g e p r e s e r v i n g;i m a g e s e g m e n t a t i o n图像超分辨率的目标是利用1幅或者多幅低分辨率图像重建一幅高分辨率图像,是计算机视觉领域的研究热点.该技术在诸如遥感监测㊁目标识别㊁医学诊断和军事侦察等领域都具有广泛的应用前景.现有的单幅图像的超分辨率算法大致可以被分为3类:基于插值的方法㊁基于重建的方法[1]和基于学习的方法[2G5].杨文峰等[1]提出一种同时对亮度与色度分量进行基于邻域嵌入的彩色图像超分辨率重建算法,但需要使用K 均值聚类和二叉树搜索的方法来提高算法效率.T i m o f t e等[3]提出了基于K近邻搜索的学习方法,其中存在的缺陷包括:1)算法性能受训练样本的质量影响明显;2)缺乏有效的学习方法表达样本的先验知识;3)学习效率低下等.基于稀疏表示的学习方法[4G5]核心是建立输入图像块与样本图像块间的稀疏关联.然而,这类方㊀收稿日期:20170520㊀基金项目:河北省教育厅科学技术研究青年基金项目(Q N2015025);中西部综合实力提升工程㊀第一作者:赵红(1979 ),女,山西盂县人,河北大学副教授,博士,主要从事信息安全研究.EGm a i l:z h a o h o n g@c s.h b u.c n223河北大学学报(自然科学版)第38卷法对彩色图像一般先取其亮度通道数据处理,之后再还原时常常会引起色彩失真,超分辨率效果不尽人意.另一方面,基于插值的方法[6G9]中边导向的图像插值方法是当前图像插值研究的热点问题.C h e n等[6]提出了一种利用人工神经网络和粒子群优化的显著性导向的彩色图像插值方法.首先,利用改进的基于块的视觉注意模型生成彩色图像插值的高质量显著图.然后,基于显著图,分别采用双线性插值和人工神经网络内插方法对非显著性和显著性块进行插值,得到最终的彩色插值结果.周登文等[9]提出了一个新的边导向的双三次卷积彩色图像插值算法.对于待插值的像素,首先在其邻域检测2个正交方向边的强度,如果该像素在一个强边上,则沿着强边的方向执行双三次卷积插值估计该像素;否则,该像素在弱边或纹理区域,通过加权平均2个正交方向的双三次卷积插值估计该像素.虽然这些方法比经典的插值方法有更高的性能,但是多数算法不能较好地保持R G B色彩通道之间的相关性,会导致图像边缘处的细节恢复效果较差.针对此问题,本文提出了一种基于a l p h a通道的彩色图像超分辨率方法,利用a l p h a通道协调彩色通道之间的边缘信息,从而较好地保持图像边缘.1㊀色彩分量间的相关性图像具有空间相关性和时间相关性[10],空间相关性是指一个像素值与周围的某些像素在亮度和色度上存在特定的关系;时间相关性是指一个图像序列中的前后2帧之间也存在特定的关系.在R G B色彩空间中,由于3个色彩分量来源于同一物理模型,所以在每个像素的色彩分量之间也存在密切的相关性[11].设A㊁B为大小均为MˑN的2幅图像,其相关系数ρ的定义如下:,(1)ρ=c o v(A,B)D AˑD B其中,c o v(A,B)是A,B的协方差,D A㊁D B分别为A,B的方差.c o v(A,B)㊁D A㊁D B的计算公式如下:c o v(A,B)=1MˑNðM i=1ðN j=1(A(i,j)-A)(B(i,j)-B),(2)D A=1MˑNðM i=1ðN j=1(A(i,j)-A)2,(3)D B=1MˑNðM i=1ðN j=1(B(i,j)-B)2,(4)上式中A和B分别表示图像A和B的均值.ρ的取值范围是[G1,1],当ρ越接近于1时,说明图像A和B 的相关程度越高.2㊀A l p h am a t t i n g技术A l p h am a t t i n g是指把需要的前景物体从图像中精确地提取出来的技术,而把抽取出来的前景物体和背景图像融合在一起的过程称为图像合成.显然,提取和合成是2个互逆的过程,可以用P o r t e r等提出的合成方程[12G13]描述:I=αF+(1-α)B,(5)其中,I是表示合成的图像.α称为掩像,或者称为透明度信息,代表对应点颜色值中含前景颜色的百分比.F㊁B分别指前景图像和背景图像.提取和合成得到的图像示例如图1所示.在R G B彩色空间中,理想情况下可以利用(6)G(8)式准确计算出α值,方程式如下:I R=αF R+(1-α)B R,(6)I G=αF G+(1-α)B G,(7)I B=αF B+(1-α)B B.(8)由于方程(5)的求解问题是欠约束的.因此,需要做如下假设,前景F和背景B在每一个像素周围的小第3期赵红等:一种基于a l ph a 通道的彩色图像超分辨率方法窗口中是基本不变的.假设前景F 和背景B 是局部平滑的,但并不是假设输入图像I 是局部平滑的.首先将方程(5)改写为一个图像I 的线性函数:αi ʈa I i +b i ,㊀∀i ɪw ,(9)式中,a =1/(F -B ),b =B /(F -B ),w 是一个图像窗口.在前景和背景局部平滑的前提下,给定代价函数:J (α,a ,b )=ðj ɪI ði ɪj(αi -a j I i -b j)2+εa 2j (),(10)其中,w j 是围绕像素j 的一个窗口.当求出使代价函数(10)取得最小值的α时,即可实现图像的前景提取.a .图像I ;b .前景图像F ;c .掩像α;d .背景图像B .图1㊀提取和合成图像示例F i g .1㊀E x a m p l e s o f e x t r a c t e da n d c o m p o s i t e d i m a ge 3㊀基于a l ph a 通道的边缘保持超分辨率图像边缘两侧的区域可以通过a l p h am a t t i n g 方法获得.输入的低分辨率彩色图像可以看做是由前景㊁背景和a l p h a 通道合成得到.那么,对于输入彩色图像的前景图和背景图分别进行超分辨率,然后再通过a l Gph a 通道合成,即可得到高分辨率的彩色图像.本文提出基于a l p h a 通道的边缘保持超分辨率方法,首先利用自适应变换,将输入的低分辨率彩色图像转换为灰度图像,得到的灰度图像能够保持原彩色图像的边缘和色彩的变化.接着利用C a n n y 边缘检测,检图2㊀基于a l ph a 通道的彩色图像超分辨率流程F i g .2㊀F l o wc h a r t o f c o l o r i m a g e s u p e r r e s o l u t i o nb a s e do na l ph a c h a n n e l 测出图像的连续边缘,再使用角点检测算法检测出图像的角点,用得到的角点把连续的边缘曲线分为线段.然后利用标记分水岭算法将图像根据线段的个数进行分割,得到每个线段所在的区域.对于得到的每个线段进行单独处理,将其两侧看作前景和背景,就可将问题转化为a l p h am a t t i n g[14G15]问题.算法的流程如图2所示,详细实现过程如下.S t e p1.输入单幅低分辨率的彩色图像I L .S t e p2.将输入图像进行自适应灰度变换,得到能够体现彩色图像的边缘和色彩变化的灰度图像.S t e p 3.对灰度图像I G L 进行标准Ca n n y 边缘检测和S U S A N 角点检测,得到I G L 的边缘和角点,用得到的角点将得到的连续边缘进行分段,得到n 个线段.S t e p 4.求I G L 的梯度幅度图I g ,并对其求逆,得到I Gg .S t e p 5.将S t e p3中得到的n 条线段作为标记分水岭算法生长的初始点,利用S t e p 4中得到的梯度幅度图,进行分水岭分割,得到分割后的n 个区域.S t e p6.输入原始彩色图像I L ,对每一个分割区域进行如下过程:1)计算本区域中线段两侧梯度的较小值,分别作为自然图像抠图的纯前景及纯背景区,计算出该区域低分辨率图像前景和背景之间的掩像α,前景F ,背景B ;3232)对图像α进行超分辨率,得到高分辨率的αH ,并用双三次插值算法对分割出的前景和背景3个通道进行插值得到H F ㊁H B ,使其与αH 大小相同;3)将αH ㊁H F ㊁H B 中属于该分割区域的值,保存在矩阵H ㊁F ,B 中.S t e p 7.将S t e p6中得到的H ㊁F ㊁B 利用合成公式,融合出高分辨率彩色图像.4㊀实验结果与分析利用本文提出的方法对一些常用图像进行了实验,并与双三次插值(B i c u b i c )和迭代回投影算法(I B P )方法进行了对比.输入的低分辨率图像是通过将高分辨率彩色图像进行下采样㊁模糊得到的.图3㊁图4㊁图5分别是L e n a 图像㊁M o n a r c h 图像㊁G i r l 图像使用不同的超分辨率算法的结果图像对比.其中图3d ㊁图4d ㊁图5d 是采用本文提出的方法得到的结果,而图3b ㊁图4b ㊁图5b ㊁图3c ㊁图4c ㊁图5c 则是分别采用双三次插值算法㊁和迭代回投影算法得到的结果,图3a ㊁图4a ㊁图5a 是原始的高分辨率图像.从视觉效果而言,可以看出本文的方法得到的结果明显比图3c ㊁图4c ㊁图5c ㊁图3b ㊁图4b ㊁图5b 更加的自然㊁逼真.在图3d ㊁图4d ㊁图5d 图中,图像边缘更加的清晰㊁平滑㊁逼真,边缘处没有模糊.相比其他2种方法能够恢复图像中细微的结构,图像的质量从整体上得到了提高.与双三次插值算法㊁迭代回投影算法的实验结果相比,减少了图像边缘处的块状人为痕迹,同时没有造成模糊和环状伪影.尤其在图4L e n a 的实验结果对比中,明显可以看到图3d ㊁图4d ㊁图5d 中,帽子上的边缘清晰度要好于其他2种算法.a .原始图像;b .双三次插值算法;c .B P 算法;d .本文算法.图3㊀L e n a 图像的超分辨率对比实验F i g .3㊀S u p e r r e s o l u t i o n e x p e r i m e n t a l c o m p a r i s o no fL e n a i m a ge a .原始图像;b .双三次插值算法;c .B P 算法;d .本文算法.图4㊀M o n a r c h 图像的超分辨率对比实验F i g .4㊀S u p e r r e s o l u t i o n e x p e r i m e n t a l c o m p a r i s o no fM o n a r c h i m a ge a .原始图像;b .双三次插值算法;c .B P 算法;d .本文算法.图5㊀G i r l 图像的超分辨率对比实验F i g .5㊀S u p e r r e s o l u t i o n e x p e r i m e n t a l c o m p a r i s o no fG i r l i m a ge 423河北大学学报(自然科学版)第38卷523第3期赵红等:一种基于a l p h a通道的彩色图像超分辨率方法㊀㊀表1㊁2㊁3是实验中彩色图像通道间的相关系数对比.结果表明,在M o n a r c h图像双三次插值算法中,通道之间的相关性遭到了削弱,因为该图像边缘很多,在插值的时候边缘处产生颜色混合,颜色失真比较严重.而本文算法则较好地保持了彩色通道之间的相关性.表1㊀L e n a图像彩色分量的相关系数对比T a b.1㊀C o m p a r i s o no f c o r r e l a t i o n c o e f f i c i e n t o fL e n a i m a g e㊀㊀图像RGB RGG BGG原始图像0.78580.92610.9445双三次插值0.78530.92620.9444I B P0.77980.92490.9436本文算法0.77880.91320.9547表2㊀M o n a r c h图像彩色分量的相关系数对比T a b.2㊀C o m p a r i s o no f c o r r e l a t i o n c o e f f i c i e n t o fM o n a r c h i m a g e㊀㊀图像RGB RGG BGG原始图像0.73500.85520.6804双三次插值0.83560.87640.7850I B P0.74310.85820.6872本文算法0.74680.86780.7261表3㊀G i r l图像彩色分量的相关系数T a b.3㊀C o m p a r i s o no f o f c o r r e l a t i o n c o e f f i c i e n t o fG i r l i m a g e㊀㊀图像RGB RGG BGG原始图像0.81400.93090.9540双三次插值0.81300.93040.9537I B P0.81570.93170.9541本文算法0.80480.92280.9569表4是L e n a图像㊁M o n a r c h图像㊁G i r l图像超分辨率算法的误差分析.可以看出本文的算法与双三次插值算法相比,有较高的峰值信噪比(P S N R)和较低的均方根值(R M S);与迭代回投影算法算法相比,在峰值信噪比和均值方根上也较好或接近.但本文迭代回投影算法使用的原始输入低分辨率图像序列具有精确的退化模型,相比实际应用具有更好的结果.实验结果分析充分表明基于a l p h a通道的彩色图像超分辨率方法的有效性及优越性,但需要指出的是,本文的方法在时间复杂度上要较高于其他2种算法.表4㊀图像S R算法的误差分析T a b.4㊀E r r o r a n a l y s i s o f s u p e rGr e s o l u t i o na l g o r i t h m s方法㊀㊀㊀㊀L e n a㊀㊀㊀㊀㊀㊀㊀M o n a r c h㊀㊀㊀㊀㊀㊀㊀G i r lP S N R R M S P S N R R M S P S N R R M S 双三次插值34.3424.89829.4568.58736.2675.181I B P34.8714.60532.7045.90936.5283.807本文方法35.0384.52033.3425.49136.3503.8855㊀结㊀论本文利用图像分割和a l p h am a t t i n g技术,提出一种基于a l p h a通道的彩色图像超分辨率方法,将每条边缘的左右两侧分别看作前景和背景,避免了超分辨率过程中容易出现的边缘两侧不同色彩区域的混合.实623河北大学学报(自然科学版)第38卷验结果表明,该方法对图像边缘处的色彩具有较好的保持效果,图像视觉效果优于经典的双三次插值算法和迭代回投影算法.参㊀考㊀文㊀献:[1]杨文峰,郑洁莹,干宗良,等,基于邻域嵌入的彩色图像超分辨率重建[J].计算机技术与发展,2015,25(6):25G28.D O I:10.3969/j.i s s n.1673G629X.2015.06.006.Y A N G W F,Z H E N GJY,G A NZL,e t a l.As u p e rGr e s o l u t i o n r e c o n s t r u c t i o n a l g o r i t h mf o r c o l o r i m a g e s b a s e d o nn e i g h b o r e mGb e d d i n g[J].C o m p u t e rT e c h n o l o g y a n dD e v e l o p m e n t,2015,25(6):25G28.D O I:10.3969/j.i s s n.1673G629X.2015.06.006.[2]L I JM,Q U Y,L IC H,e t a l.I m a g e s u p e rGr e s o l u t i o nb a s e o nm u l t iGk e r n e l r e g r e s s i o n[J].I n t e r n a t i o n a l J o u r n a l o fM u l t iGm e d i aT o o l s a n dA p p l i c a t i o n s,2016,75:4115G4128.D O I:10.1007/s11042G015G3016G4.[3]T I MO F T ERD V,G O O LL V.A n c h o r e dn e i g h b o r h o o dr e g r e s s i o n f o r f a s t e x a m p l eGb a s e ds u p e r r e s o l u t i o n[Z].I E E EI nGt e r n a t i o n a l C o n f e r e n c e o nC o m p u t e rV i s i o n,S y d n e y,A u s t r a l i a,2013.D O I:10.1109/I C C V.2013.241.[4]S H E N M F,Z HA N GLS,F U HZ.C o l o r i m a g e s u p e rGr e s o l u t i o n r e c o n s t r u c t i o nb a s e d o n s p a r s e r e p r e s e n t a t i o n[J].I n t e rGn a t i o n a l J o u r n a l o fA p p l i e dM e c h a n i c s a n dM a t e r i a l s,2013,278:1221G1227.D O I:10.4028/w w w.s c i e n t i f i c.n e t/AMM.278G280.1221[5]Y E G A N L IF,N A Z Z A L M,U N A L M,e t a l.I m a g e s u p e rGr e s o l u t i o nv i a s p a r s e r e p r e s e n t a t i o no v e rm u l t i p l e l e a r n e dd i cGt i o n a r i e sb a s e d o n e d g e s h a r p n e s s[J].I n t e r n a t i o n a l J o u r n a l o f S i g n a l,I m a g e a n dV i d e oP r o c e s s i n g,2016,10:535G542.D O I:10.1007/s11760G015G0771G7.[6]C H E N H Y,L E O UJ J.S a l i e n c yGd i r e c t e d c o l o r i m a g e i n t e r p o l a t i o nu s i n g a r t i f i c i a l n e u r a l n e t w o r k a n d p a r t i c l e s w a r mo p t iGm i z a t i o n[J].J o u r n a l o fV i s u a lC o mm u n i c a t i o na n dI m a g eR e p r e s e n t a t i o n,2012,23(2):343G358.D O I:10.1016/j.j v c i r.2011.11.006.[7]K I K U D,MO N N O Y,T A N A K A M.M i n i m i z e dGL a p l a c i a nr e s i d u a l i n t e r p o l a t i o nf o rc o l o r i m a g ed e m o s a i c k i n g[J].P r oGc e e d i n g s o f S P I E,2014,9023(1):2304G2308.D O I:10.1117/12.2038425.[8]C H E NX,J E O NG,J E O N GJ.V o t i n gGb a s e d d i r e c t i o n a l i n t e r p o l a t i o nm e t h o d a n d i t s a p p l i c a t i o n t o s t i l l c o l o r i m a g e d e m o s aGi c k i n g[J].I E E ET r a n s a c t i o n s o nC i r c u i t s a n dS y s t e m s f o rV i d e oT e c h n o l o g y,2014,24(2):255G262.D O I:10.1109/T C SGV T.2013.2255421.[9]周登文,申晓留.边导向的双三次彩色图像插值[J].自动化学报,2012,38(4):525G530.D O I10.3724/S P.J.1004.2012.00525.Z HO U D W,S H E N X L.E d g eGd i r e c t e db i c u b i c c o l o r i m a g e i n t e r p o l a t i o n[J].A c t aA u t o m a t i c aS i n i c a,2012,38(4):525G530.D O I10.3724/S P.J.1004.2012.00525.[10]沈红斌,杨杰,刘小军,等.基于模糊信息增益的图像相关性度量[J].上海交通大学学报,2006,40(3):466G470.D O I:10.3321/j.i s s n:1006G2467.2006.03.023.S H E N H B,Y A N GJ,L I U XJ,e t a l.An e wi m a g e c o r r e l a t i o na n a l y s i sb a s e do nf u z z y i n f o r m a t i o n g a i n[J].J o u r n a l o f S h a n g h a i J i a o t o n g U n i v e r s i t y,2006,40(3):466G470.D O I:10.3321/j.i s s n:1006G2467.2006.03.023.[11]曹文伦,彭国华,秦洪元,等.利用色彩分量相关性的彩色图像分形编码方法[J].计算机工程与应用,2004,40(22):51G55.D O I:10.3321/j.i s s n:1002G8331.2004.22.017.C A O W L,P E N GG H,Q I N H Y,e t a l.C o l o r i m a g e f r a c t a l c o m p r e s s i o n c o d i n g u s i n g t h e c o r r e l a t i o n o f c o l o r c o m p o n e n t s[J].C o m p u t e rE n g i n e e r i n g a n dA p p l i c a t i o n s,2004,40(22):51G55.D O I:10.3321/j.i s s n:1002G8331.2004.22.017.[12]P O R T E RT,D U F FT.C o m p o s i t i n g d i g i t a l i m a g e s[Z].T h e11t hA n n u a l C o n f e r e n c e o nC o m p u t e rG r a p h i c s a n d I n t e r a cGt i v eT e c h n i q u e s,N e w Y o r k,U S A:A C M,1984:253G259.D O I:10.1145/964965.808606.[13]A P O S T O L O F FNE,F I T Z G I B B O N A W.B a y e s i a nv i d e om a t t i n g u s i n g l e a r n t i m a g e p r i o r s[Z].2004I E E EC o m p u t e r S o c i e t yC o n f e r e n c e o nC o m p u t e rV i s i o n a n dP a t t e r nR e c o g n i t i o n,W a s h i n g t o n,D C,U S A,2004.D O I:10.1109/C V P R.2004.50.[14]C HU A N G Y,A G A RWA L A A,C U R LE S SB,e t a l.V i d e o m a t t i n g o f c o m p l e xs c e n e s[J].P r o c e e d i n g so fA C M S I GGG R A P H,N e w Y o r k,N Y,U S A:A C M,2002,21(3):243G248.D O I:10.1145/566654.566572.[15]C H U A N GY,C U R L E S SB,S A L E S I ND,e t a l.Ab a y e s i a n a p p r o a c h t od i g i t a lm a t t i n g[Z].T h e2001I E E EC o m p u t e r S o c i e t yC o n f e r e n c e o nC o m p u t e rV i s i o n a n dP a t t e r nR e c o g n i t i o n,K a u a i,H I,U S A,2001.D O I:10.1109/C V P R.2001.990970.(责任编辑:孟素兰)。
江苏大学(机器视觉)大作业报告题目:图像增强专业:测控技术与仪器班级:1202学号:学生姓名:完成时间:2015年6月说明大作业的要求和内容:一、内容要求对机器视觉中所用的某一技术进行综述,必须用英文书写。
二、格式要求参照报告样例格式。
三、评分依据书写内容是否详尽到位50%语言方面是否通顺,有无错误20%对应PPT制作的好坏10%英文演讲的好坏20%四、其他说明大作业务必独立完成,一经发现雷同作“0”分处理。
教师小结:成绩:教师签名:目录1 The introduction (5)2 The research status at home and abroad (7)3 Key technology (method) is introduced (11)4 conclusion (13)参考文献 (15)图像增强技术(江苏大学机械工程学院仪器科学与工程系,江苏,镇江,212013)摘要:图像增强技术是增强图像中的有用信息,它可以是一个失真的过程,其目的是要改善图像的视觉效果,针对给定图像的应用场合,有目的地强调图像的整体或局部特性,将原来不清晰的图像变得清晰或强调某些感兴趣的特征,扩大图像中不同物体特征之间的差别,抑制不感兴趣的特征,使之改善图像质量、丰富信息量,加强图像判读和识别效果,满足某些特殊分析的需要。
本文就图像增强技术的分类、基本方法以及国内外发展状况做一些简单的介绍。
关键词:图像增强;视觉效果;图像质量Image enhancementAbstract: Image enhanced technology,a process of distortion, is the useful information to enhanced image,whose purposes is to improved the Visual effect of the image.According to the given application occasions of the imagine, to stressed the overall or local characteristics of the imagine. It will turn the originally blur image into clear or stressed some features of intrest, expanded the gap in different objects features of the image, inhibit the features that are not interest, to improved the image quality, and rich its information, strengthened image’s effect of interpretation and recognition, to meet some special needs of analysis. This article simply introduced the categories of the image enhancement technologies, the basic methods and the developments at home and abroad.Keywords: Image enhancement; Visual effects; Image quality1 The introductionIn general, the image transmission and conversion, such as imaging, replication, scanning, transmission and display, etc., often cause the image quality decline, that is, image distortion. In photography due to the light illumination is insufficient or excessive, will make the image is too dark or too bright; optical system distortion, relative motion, air flow will make the image fuzzy, transmission will introduce various types of noise. In short, the image of the image in the visual effect and identification of the convenience and other aspects may exist many problems, such problems might as well collectively referred to as quality issues. Image enhancement is based on the specific need to highlight the important information in the image, while weakening or removing the need for information. Images obtained from different ways, through appropriate enhancement, the originally smudgy even unable to distinguish the original image into clear contains a lot of useful information can use the image and effectively remove image noise, enhance image edges or other interested regional and thus easier to image in the target detection and measurement. Whether the image is kept undisturbed or not is irrelevant, and will not be conscious of the image's authenticity because of the ideal form of the image.. The purpose of the image enhancement is to enhance the visual effect of the image, and convert the original image into a form that is more suitable for the observation of human eyes and computer analysis.. It is generally based on the visual characteristics of the human eye, to obtain the visual effect of the visual effect, and seldom involves the objective and uniform evaluation criteria.. The effect of the enhancement is usually related with the concrete images, and it is evaluated by the subjective feeling of the person..At present, the application of image enhancement has been penetrated into the medical diagnosis, aviation, military reconnaissance, fingerprint identification, non-destructive testing, satellite image processing and other fields.. Such as X-ray images, CT and endoscopic mirror image enhancement, allow doctors to more easilyidentify the lesion area, from the details of the image region finding problem, taken at different times on the same area of remote sensing image enhancement processing to detect whether the enemy troop movements or military equipment and building; in coal mine industrial TV system with enhanced processing to improve the clarity of industrial TV image, overcome due to the lack of light, dust and other reasons caused by image fuzzy and deviation, reduce TV system maintenance workload. Image enhancement technology rapid development with its wide application is inseparable, the motive force of the development from the emergence of stable new application, we can expect, in the future society image enhancement technology will play a more important role.2 The research status at home and abroadPictures for the first time in the 1920 s through the cable from London to New York. People at that time through the character simulation to get the middle value method to restore the image. Early image enhancement technology often involves hardware parameters Settings, such as the choice of printing process and the distribution of brightness level. At the end of 1921, this paper proposes a new technology based on optical reduction. During this period due to the introduction of a coded modulation beam images to convey to adjust the degree of photographic film, the grey level grayscale increased from 5 to 15 grey scale, this method obviously improved the effect of image restoration. To the early 1960 s first can perform tasks of large computer digital image processing, it marks the use of computer technology the advent of the era of digital image processing. In 1964, researchers at the jet propulsion laboratory (JPL) in the use of computers and other hardware devices, using geometric correction, gray level transformation, noise, such as Fourier transform and 2-d linear filtering enhancement method for space probe \"prowler 7\" back to thousands of Zhang Yueqiu photo processing, at the same time they also consider the influence of the sun and the moon environment, finally succeeded in mapping out the map on the surface of the moon. Then they for 1965 years \"prowler 8\" tens of thousands of photos in the back to earth more complex digital image processing, further improve the image quality. These achievements not only attract the attention of the world many relevant parties and JPL itself also pay more attention to the digital image processing research and improvement of the equipment, and set up the image processing laboratory IPL. Success in the IPL for the hundreds of thousands of photos to spacecraft to send back the more complicated image processing, finally obtained the topography of the moon, color chart, and panoramic Mosaic. From the digital image enhancement technology into the field of aeronautics and astronautics.In the late 1960 s and early 1970 s some scholars began to image enhancementtechnique for medical image, the earth remote sensing monitoring and astronomy, and other fields. X ray is one of the earliest used in imaging of the electromagnetic radiation sources, X-ray by roentgen discovered in 1895. Mr Godfrey n. 1970 s Hounsfield and Allan m. Cormack invented the computer, a professor at axial tomography (ct) technology: a detector around the patient, and X-ray source rotate around the object. X-rays through the body and by the corresponding detector are collected on the other side of the ring. Its principle is to use the data of perception to slice image reconstruction. When objects along the perpendicular to the direction of the detector will produce a series of slices, the section of the internal representation of the object. In the 1980 s, the development of a variety of hardware that makes people not only can deal with 2 d images, and start dealing with three-dimensional images. Many can obtain three-dimensional images of three-dimensional image processing equipment and analysis of the system has been successfully developed, the image processing technology has been widely used. Into the 1990 s, the image enhancement technology has gradually involved in all aspects of human life and social development.A computer program used to enhance the contrast or brightness coding for color, in order to explain X rays, and used in industrial, medical and biological sciences in areas such as other images. Geography with the same or similar technology research pollution mode from the aviation and satellite images. In the field of archaeology fuzzy images using image processing method has been successfully recovered. In the field of physics and related computer technology can enhance experiment in the field of high energy plasma and electron microscope images. Histogram equalization processing is one of the commonly used methods for image enhancement technology. Kim, 1997, if you want to image enhancement technique used in digital cameras and other electronic products, then the algorithm must maintain the brightness of the image features. In the article, Kim keep brightness characteristics of histogram equalization algorithm was presented (BBHE). Kim, the improved algorithm is raised, caused the attention of many scholars. In 1999, Wan subgraph two-dimensional histogram equalization algorithm is put forward by (DSIHE). Then, Chen and Ramli minimum mean square error (MMBEBHE) double histogram equalization algorithm.In order to keep the image features, many scholars to study local enhancement processing technology, many of the new algorithm is proposed: recursion average stratified balanced treatment (RMSHE), recursive subgraph equalization algorithm (RSIHE), dynamic histogram equalization algorithm (DHE), maintain brightness characteristics dynamic histogram equalization algorithm (BPDHE), multi-layer histogram equalization algorithm (MHE), brightness to keep clusters of histogram equalization processing (BPWCHE) and so on.In relatively mature theoretical system and draw lessons from foreign technology under the conditions of application system, enhancement technique and application of domestic also had the very big development. In general, image enhancement technology in the development of its initial stage, development, popularization and application of four stages. Early-stage began in the 1960 s, when the image in pixels type raster scan display, in the USES mostly, mainframe to deal with it. During this period due to image storage cost is high, the processing equipment cost is high, thus its application is very narrow. The entered the period of 1970 s, is used in great quantities in the mainframe processing, image processing is gradually convert raster scan display mode, especially in the CT and satellite remote sensing image, the image enhancement processing put forward a higher request. In the 1980 s, image enhancement technology into the popularization period, the computer has been able to to undertake the task of image processing. Entered the application period in the 1990 s, people use digital image enhancement technology processing and analysis of remote sensing images, in order to effectively resources and mineral resources exploration, investigation, agricultural and urban land planning, crop yield estimation, weather forecast and disaster monitoring and military targets, etc. In biomedical engineering, and using image enhancement technique of X-ray images, ultrasound images, and biological section microscopic image processing, such as to improve image clarity and resolution. In industrial and engineering, mainly used in nondestructive flaw detection, automatic quality inspection and process control, etc. In public security, portraits, processing and identification of fingerprints and other trace, and traffic monitoring, accident analysis using image enhancement technology in different extent.Image enhancement is an important part of image processing, the traditional image enhancement method plays a very important role to improve image quality. With the deepening of the research of image technology and development, a new image enhancement method appear constantly. For example, some scholars will be introduced to the theory of fuzzy mapping image enhancement algorithms, including fuzzy relaxation, fuzzy entropy is proposed, fuzzy enhancement algorithm to solve the problem of enhancement algorithm of mapping function selection, and with the application of interactive image enhancement technology, can control the subjective image enhancement effect. And image enhancement using histogram equalization technology has many new progress, such as multilayer histogram combined with a balanced of brightness algorithm is proposed, dynamic hierarchical histogram equalization algorithm. These algorithms by image segmentation, and then in the sub-layer do balance in image processing, better solve the contrast through stretching problem in the process of histogram equalization, and it can control sub-layer gray mapping scope, strengthen effect is better.3 Key technology (method) is introducedImage enhancement can be divided into two categories: frequency domain and spatial domain method. The former the image as a two-dimensional signal, based on the two-dimensional Fourier transform to signal enhancement. Using low pass filter (that is, only through low frequency signal) method, can get rid of the noise in the graph; Using the high-pass filtering method, can enhance the high frequency signal, such as the edge, the fuzzy image becomes clear. The latter is the typical algorithms in spatial domain method with local averaging method and median filter (in the middle of the field of local pixels) method and so on, they can be used to remove or less noise. Image enhancement method is to through certain means for additional information or to transform of the image data, particularly interested in the image features or selectively inhibit (hide) the image features, some don't need to match the images and visual response. In the process of image enhancement, not this paper analyzes the reasons of images is qualitative, not necessarily close to the original image after processing. Image enhancement technology based on the enhanced processing in space is different, can be divided into the airspace based algorithm and based on frequency domain algorithm two kinds big. Based on the algorithm of the airspace to handle directly do arithmetic of image grayscale, based on the algorithm of frequency domain is in a transform domain of the image to some correction, image transform coefficient value is a kind of indirect enhancement algorithm.Algorithm based on airspace is divided into the neighborhood denoising arithmetic algorithm and algorithm. Algorithm namely grayscale correction arithmetic, such as gray transform and histogram modification, purpose or for uniform image imaging, or expand the dynamic range image, expand the contrast. Neighborhood enhancement algorithm into image smoothing and sharpening two kinds. Smooth generally used to eliminate image noise, but also easy to cause the edge of the fuzzy. Commonly used algorithm with average filtering and median filtering. Sharpen the purpose is tohighlight the edge contour of the object, is advantageous for the target identification. Commonly used algorithm with gradient method, operator, high-pass filtering, mask matching method, statistical difference method, etc.4 conclusionOf image enhancement technology is introduced, through this homework, made me more solid grasp the related knowledge of machine vision, while in the process of finish this assignment have a few problems, but after thinking again and again, and again and again on the Internet to collect related material and finally to solve all problems.From the beginning a little knowledge of image enhancement technology to the understanding of image enhancement technology now, I paid a lot of effort. Through the consult relevant material in the library and online collection of various learning summary of the material, make me to have a deeper understanding of image enhancement technology, machine vision for this course have a deeper understanding.I think, in the operation, not only cultivate my independent thinking and the ability of collecting data, in a variety of other skills have improved. And, more importantly, in the process of operation, I learned a lot of learning method, which is the most practical in the future, really benefit a lot. To face the challenge of the society, only by constantly learning, practice, learning and practice. It also has a lot of help for our future. Later, no matter how bitter, I think we can become a pain for a pleasure, looking for fun, find it precious things. Problems encountered in the process of homework, have to be difficult, so to speak, but the good news is that eventually solved.This assignment also let I see, have what not understand don't understand to consult or surf the Internet query in time, as long as study earnestly, people think, hands-on practice, can't understand the knowledge, harvest quite abundant.In a word, take every chance to learn seriously, cherish every point inthe process of a second, learn the knowledge and method of most, exercise their power, this is we are in the work the most important thing you have learned, later will also benefit a lot!参考文献[1] ×××.××××××××××××××××××××××××××××××××××[2] ×××.××××××××××××××××××××××××××××××××××。
About the T utorialOpenCV is a cross-platform library using which we can develop real-time computer vision applications. It mainly focuses on image processing, video capture and analysis including features like face detection and object detection. In this tutorial, we explain how you can use OpenCV in your applications.AudienceThis tutorial has been prepared for beginners to make them understand the basics of OpenCV library. We have used the Java programming language in all the examples, therefore you should have a basic exposure to Java in order to benefit from this tutorial. PrerequisitesFor this tutorial, it is assumed that the readers have a prior knowledge of Java programming language. In some of the programs of this tutorial, we have used JavaFX for GUI purpose. So, it is recommended that you go through our JavaFX tutorial before proceeding further - /javafx/.Copyright & Disclaimer© Copyright 2017 by Tutorials Point (I) Pvt. Ltd.All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher.We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or in this tutorial, please notify us at **************************T able of ContentsAbout the Tutorial (1)Audience (1)Prerequisites (1)Copyright & Disclaimer (1)Table of Contents (2)1.OpenCV – Overview (5)Computer Vision (5)Applications of Computer Vision (5)Features of OpenCV Library (6)OpenCV Library Modules (7)A Brief History of OpenCV (8)2.OpenCV – Environment (9)Installing OpenCV (9)Eclipse Installation (11)Setting the Path for Native Libraries (18)3.OpenCV — Storing Images (21)The Mat Class (21)Creating and Displaying the Matrix (23)Loading Image using JavaSE API (25)4.OpenCV – Reading Images (27)5.OpenCV ─ Writing an Image (29)6.OpenCV— GUI (31)Converting Mat to Buffered Image (31)Displaying Image using AWT/Swings (32)Displaying Image using JavaFX (34)TYPES OF IMAGES (38)7.OpenCV — The IMREAD_XXX Flag (39)8.OpenCV ─ Reading an Image as Grayscale (41)9.OpenCV ─ Reading Image as BGR (45)IMAGE CONVERSION (49)10.OpenCV ─ Colored Images to GrayScale (50)11.OpenCV ─ Colored Image to Binary (54)12.OpenCV ─ Grayscale to Binary (58)DRAWING FUNCTIONS (62)13.OpenCV – Drawing a Circle (63)14.OpenCV – Drawing a Line (67)15.OpenCV ─ Drawing a Rectangle (71)16.OpenCV – Drawing an Ellipse (75)17.OpenCV – Drawing Polylines (79)18.OpenCV – Drawing Convex Polylines (84)19.OpenCV—Drawing Arrowed Lines (88)20.OpenCV – Adding Text (92)BLUR OPERATIONS (96)21.OpenCV – Blur (Averaging) (97)22.OpenCV – Gaussian Blur (100)23.OpenCV – Median Blur (103)FILTERING (106)24.OpenCV – Bilateral Filter (107)25.OpenCV – Box Filter (110)26.OpenCV – SQRBox Filter (113)27.OpenCV – Filter2D (116)28.OpenCV—Dilation (119)29.OpenCV – Erosion (122)30.OpenCV ─ Morphological Operations (125)31.OpenCV ─ Image Pyramids (131)Pyramid Up (131)Pyramid Down (133)Mean Shift Filtering (136)THRESHOLDING (139)32.OpenCV – Simple Threshold (140)33.OpenCV – Adaptive Threshold (144)Other Types of Adaptive Thresholding (147)34.OpenCV ─ Adding Borders (148)SOBEL DERIVATIVES (153)35.OpenCV – Sobel Operator (154)36.OpenCV – Scharr Operator (157)More Scharr Derivatives (159)TRANSFORMATION OPERATIONS (160)37.OpenCV – Laplacian Transformation (161)38.OpenCV – Distance Transformation (164)CAMERA & FACE DETECTION (169)39.OpenCV – Using Camera (170)40.OpenCV ─ Face Detection in a Picture (175)41.OpenCV ─ Face Detection using Camera (179)GEOMETRIC TRANSFORMATIONS (184)42.OpenCV ─ Affine Translation (185)43.OpenCV – Rotation (188)44.OpenCV – Scaling (191)45.OpenCV – Color Maps (194)MISCELLANEOUS CONCEPTS (202)46.OpenCV – Canny Edge Detection (203)47.OpenCV – Hough Line Transform (206)48.OpenCV – Histogram Equalization (210)1.OpenCVOpenCV is a cross-platform library using which we can develop real-time computer vision applications. It mainly focuses on image processing, video capture and analysis including features like face detection and object detection.Let’s start the chapter by defining the term "Computer Vision".Computer VisionComputer Vision can be defined as a discipline that explains how to reconstruct, interrupt, and understand a 3D scene from its 2D images, in terms of the properties of the structure present in the scene. It deals with modeling and replicating human vision using computer software and hardware.Computer Vision overlaps significantly with the following fields:∙Image Processing: It focuses on image manipulation.∙Pattern Recognition: It explains various techniques to classify patterns.∙Photogrammetry:It is concerned with obtaining accurate measurements from images.Computer Vision Vs Image ProcessingImage processing deals with image-to-image transformation. The input and output of image processing are both images.Computer vision is the construction of explicit, meaningful descriptions of physical objects from their image. The output of computer vision is a description or an interpretation of structures in 3D scene.Applications of Computer VisionHere we have listed down some of major domains where Computer Vision is heavily used. Robotics Application∙Localization ─ Determine robot location automatically∙Navigation∙Obstacles avoidance∙Assembly (peg-in-hole, welding, painting)∙Manipulation (e.g. PUMA robot manipulator)∙Human Robot Interaction (HRI): Intelligent robotics to interact with and serve peopleMedicine Application∙Classification and detection (e.g. lesion or cells classification and tumor detection)∙2D/3D segmentation∙3D human organ reconstruction (MRI or ultrasound)∙Vision-guided robotics surgeryIndustrial Automation Application∙Industrial inspection (defect detection)∙Assembly∙Barcode and package label reading∙Object sorting∙Document understanding (e.g. OCR)Security Application∙Biometrics (iris, finger print, face recognition)∙Surveillance ─ Detecting certain suspicious activities or behaviorsTransportation Application∙Autonomous vehicle∙Safety, e.g., driver vigilance monitoringFeatures of OpenCV LibraryUsing OpenCV library, you can –∙Read and write images∙Capture and save videos∙Process images (filter, transform)∙Perform feature detection∙Detect specific objects such as faces, eyes, cars, in the videos or images.∙Analyze the video, i.e., estimate the motion in it, subtract the background, and track objects in it.OpenCV was originally developed in C++. In addition to it, Python and Java bindings were provided. OpenCV runs on various Operating Systems such as windows, Linux, OSx, FreeBSD, Net BSD, Open BSD, etc.This tutorial explains the concepts of OpenCV with examples using Java bindings.OpenCV Library ModulesFollowing are the main library modules of the OpenCV library.Core FunctionalityThis module covers the basic data structures such as Scalar, Point, Range, etc., that are used to build OpenCV applications. In addition to these, it also includes the multidimensional array Mat, which is used to store the images. In the Java library of OpenCV, this module is included as a package with the name org.opencv.core.Image ProcessingThis module covers various image processing operations such as image filtering, geometrical image transformations, color space conversion, histograms, etc. In the Java library of OpenCV, this module is included as a package with the name org.opencv.imgproc.VideoThis module covers the video analysis concepts such as motion estimation, background subtraction, and object tracking. In the Java library of OpenCV, this module is included as a package with the name org.opencv.video.Video I/OThis module explains the video capturing and video codecs using OpenCV library. In the Java library of OpenCV, this module is included as a package with the name org.opencv.videoio.calib3dThis module includes algorithms regarding basic multiple-view geometry algorithms, single and stereo camera calibration, object pose estimation, stereo correspondence and elements of 3D reconstruction. In the Java library of OpenCV, this module is included as a package with the name org.opencv.calib3d.features2dThis module includes the concepts of feature detection and description. In the Java library of OpenCV, this module is included as a package with the name org.opencv.features2d. ObjdetectThis module includes the detection of objects and instances of the predefined classes such as faces, eyes, mugs, people, cars, etc. In the Java library of OpenCV, this module is included as a package with the name org.opencv.objdetect.HighguiThis is an easy-to-use interface with simple UI capabilities. In the Java library of OpenCV, the features of this module is included in two different packages namely, org.opencv.imgcodecs and org.opencv.videoio.A Brief History of OpenCVOpenCV was initially an Intel research initiative to advise CPU-intensive applications. It was officially launched in 1999.∙In the year 2006, its first major version, OpenCV 1.0 was released.∙In October 2009, the second major version, OpenCV 2 was released.∙In August 2012, OpenCV was taken by a nonprofit organization .OpenCV In this chapter, you will learn how to install OpenCV and set up its environment in your system.First of all, you need to download OpenCV onto your system. Follow the steps given below. Step 1: Open the homepage of OpenCV by clicking the following link: / On clicking, you will see its homepage as shown below.2.Step 2: Now, click the Downloads link highlighted in the above screenshot. On clicking, you will be directed to the downloads page of OpenCV.Step 3: On clicking the highlighted link in the above screenshot, a file named opencv-3.1.0.exe will be downloaded. Extract this file to generate a folder opencv in your system, as shown in the following screenshot.Step 4:Open the folder OpenCV-> build ->java. Here you will find the jar file of OpenCV named opencv-310.jar. Save this file in a separate folder for further use.Eclipse InstallationAfter downloading the required JAR files, you have to embed these JAR files to your Eclipse environment. You can do this by setting the Build Path to these JAR files and by using pom.xml.Setting Build PathFollowing are the steps to set up OpenCV in Eclipse:Step 1: Ensure that you have installed Eclipse in your system. If not, download and install Eclipse in your system.Step 2: Open Eclipse, click on File, New, and Open a new project as shown in the following screenshot.Step 3: On selecting the project, you will get the New Project wizard. In this wizard, select Java project and proceed by clicking the Next button, as shown in the following screenshot.Step 4: On proceeding forward, you will be directed to the New Java Project wizard. Create a new project and click Next, as shown in the following screenshot.Step 5:After creating a new project, right-click on it. Select Build Path and click Configure Build Path… as shown in the following screenshot.Step 6: On clicking the Build Path option,you will be directed to the Java Build Path wizard.Click the Add External JARs button,as shown in the following screenshot.Step 7: Select the path where you have saved the file opencv-310.jar.Step 8: On clicking the Open button in the above screenshot, those files will be added to your library.Step 9: On clicking OK, you will successfully add the required JAR files to the current project and you can verify these added libraries by expanding the Referenced Libraries.Setting the Path for Native LibrariesIn addition to the JAR files, you need to set path for the native libraries (DLL files) of OpenCV.Location of DLL files: Open the installation folder of OpenCV and go to the sub-folder build -> java. Here you will find the two folders x64 (64 bit) and x86 (32 bit) which contain the dll files of OpenCV.Open the respective folder suitable for your operating system, then you can see the dll file, as shown in the following screenshot.Now, set the path for this file too by following the steps given below—Step 1: Once again, open the JavaBuildPath window. Here you can observe the added JAR file and the JRE System Library.Step 2: On expanding it, you will get the system libraries and Native library location, as highlighted in the following screenshot.OpenCV Step 3:Double-click on the Native library location. Here, you can see the Native Library Folder Configuration window as shown below—Here, click the button External Folder…and select the location of the dll file in your system.3.OpenCVTo capture an image, we use devices like cameras and scanners. These devices record numerical values of the image (Ex: pixel values). OpenCV is a library which processes the digital images, therefore we need to store these images for processing.The Mat class of OpenCV library is used to store the values of an image. It represents an n-dimensional array and is used to store image data of grayscale or color images, voxel volumes, vector fields, point clouds, tensors, histograms, etc.This class comprises of two data parts: the header and a pointer∙Header: Contains information like size, method used for storing, and the address of the matrix (constant in size).∙Pointer: Stores the pixel values of the image (Keeps on varying).The Mat ClassThe OpenCV Java library provides this class with the same name (Mat) within the package org.opencv.core.ConstructorsThe Mat class of OpenCV Java library has various constructors, using which you can construct the Mat object.Note:∙Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.∙The type of the matrices were represented by various fields of the class CvType which belongs to the package org.opencv.core.Methods and DescriptionFollowing are some of the methods provided by the Mat class.In this section, we are going to discuss our first OpenCV example. We will see how to create and display a simple OpenCV matrix.Given below are the steps to be followed to create and display a matrix in OpenCV.Step 1: Load the OpenCV native libraryWhile writing Java code using OpenCV library, the first step you need to do is to load the native library of OpenCV using the loadLibrary(). Load the OpenCV native library as shown below.Step 2: Instantiate the Mat classInstantiate the Mat class using any of the functions mentioned in this chapter earlier.Step 3: Fill the matrix using the methodsYou can retrieve particular rows/columns of a matrix by passing index values to the methods row()/col().And, you can set values to these using any of the variants of the setTo() methods.ExampleYou can use the following program code to create and display a simple matrix in Java using OpenCV library.On executing the above program, you will get the following output.Loading Image using JavaSE APIThe BufferedImage class of the java.awt.image.BufferedImage package is used to store an image and the ImageIO class of the package import javax.imageio provides methods to read and write Images.ExampleYou can use the following program code to load and save images using JavaSE library.On executing the above program, you will get the following output.If you open the specified path, you can observe the saved image as follows—End of ebook previewIf you liked what you saw…Buy it from our store @ https://。
1、SIFT 尺度不变特征变换算法David Lowe关于SIFT算法,2004年发表在Int. Journal ofComputer Vision的经典论文中,对尺度空间(scale space)是这样定义的:It has been shown by Koenderink (1984) and Lindeberg (1994) that under a variety ofreasonable assumptions the only possible scale-space kernel is the Gaussian function.Therefore,the scale space of an image is defined as a function, L(x; y; delta) that is produced from the convolution of a variable-scale Gaussian, G(x; y; delta), with an input image, I(x; y):因此,一个图像的尺度空间,L(x,y,delta) ,定义为原始图像I (x,y)与一个可变尺度的2维高斯函数G(x,y,delta)卷积运算。
关于图象处理中的空间域卷积运算,可以参考经典的图像处理教材(比如美国冈萨雷斯的图象处理,第二版,或者其Matlab版,都有如何在离散空间进行运算的例子和说明)注:原文中delta为希腊字母,这里无法表示,用delta代替。
Sift 算法中,提到了尺度空间,请问什么是尺度和尺度空间呢?在上述理解的基础上,尺度就是受delta这个参数控制的表示。
而不同的L(x,y,delta)就构成了尺度空间(Space,我理解,由于描述图像的时候,一般用连续函数比较好描述公式,所以,采用空间集合,空间的概念正规一些),实际上,具体计算的时候,即使连续的高斯函数,都要被离散为(一般为奇数大小)(2*k+1) *(2*k+1)矩阵,来和数字图像进行卷积运算。
ShapePreservingSamplingandReconstructionofGrayscaleImages
PeerStelldingerCognitiveSystemsGroup,UniversityofHamburg,Vogt-K¨oln-Str.30,D-22527Hamburg,Germany
Abstract.Theexpressivenessofalotofimageanalysisalgorithmsde-pendsonthequestionwhethershapeinformationispreservedduringdigitization.Mostexistingapproachestoanswerthisarerestrictedtobinaryimagesandonlyconsidernearestneighborreconstruction.Thispapergeneralizesthistograyscaleimagesandtoseveralreconstructionmethods.Itisshownthatacertainclassofimagescanbesampledwithregularandevenirregulargridsandreconstructedwithdifferentinter-polationmethodswithoutanychangeinthetopologyofthelevelsetsofinterest.
1IntroductionMuchoftheinformationinananalogimagemaygetlostunderdigitization.Animageanalysisalgorithmcanonlybesuccessful,iftheneededinformationispre-servedduringthedigitizationprocess.Sincealotofimageanalysisalgorithmsarebasedonlevelsets,isosurfacecontours,andtheirshapes,itisimportanttoknowhowtoguaranteethattheshapesoflevelsetsarepreserved.Uptonowtheproblemofshapepreservingdigitizationhasmostlybeendealtwithforbinaryimages.
Itiswellknownthatso-calledr-regularbinaryimages(seedifinition1)canbedigitizedwithsquareorhexagonalgridsofacertaindensitywithoutchangingtheshapeinatopologicalsense[2,11,12].RecentlyK¨otheandtheauthorwereabletoshowthatthisistrueforanygridofacertaindensityandthatthisstillholdsiftheimageisblurredbyadiscshapedpointspreadfunction[7,13].Incaseofsquaregrids,thisisalsoprovedforsquareshapedpointspreadfunctions[8,9].Butallthisworkisnotonlyrestrictedtobinaryimagesbutalsotonearestneigh-borreconstructionincombinationwiththresholding.TheonlyexceptionistheworkofFlorˆencioandSchafer[2],whichallowsothermorphologicalreconstruc-tionmethods,too,butthenonlyguaranteesaboundedHausdorfferrorinsteadoftopologicalequivalence.Ingeneral,reconstructionmeansextendingthedo-mainofadiscreteimagefunctionfromthesetofsamplingpointstothewholeplaneIR2.Inanotherpaper[3]FlorˆencioandSchafershowthatevencertaingrayscaleimagescanbesampledandreconstructedwithaboundedHausdorfferror,whenusingaregulargridandsomemorphologicalreconstructionmethod.Allthementionedapproachesuseseveraldifferentwaystocompareanimagewithitsreconstructeddigitalcounterpart.Thestrongestmentionedsimilaritycriterionisstrongr-similarity[13],whichsubsumestheothersandwhichisusedinthispaper.Thepriorresultsaregeneralizedtograyscaleimagesandtoabroadclassofimportantreconstructionmethods.
2RegularImagesand2DMonotonyInthissectionsomebasicconceptsaredefined,whicharenecessaryforthefollowingwork.Namelyadefinitionofr-regulargraylevelimagesandagener-alizationofmonotonyto2Disgiven.Additionallysomeconnectionsbetweenthesetwoideasareshown,whichareusedintheproofsofthefollowingsections.
Atfirstsomebasicnotationsaregiven:TheComplementofasetAwillbenotedasAc.Theboundary∂AisthesetofallcommonaccumulationpointsofAandAc.TheinteriorA0ofAisdefinedasA\∂AandtheclosureA.Br(c):={x∈IR|(x−c)2≤r2}denotesthecloseddiscandB0r(c):=(Br(c))0denotestheopendiscofradiusrandcenterc.Theε-dilationofasetAisdefinedasthesetofallpointshavingadistanceofatmostεtosomepointinA.Lt(f)shallbethelevelsetwiththresholdvaluetofanimagefunctionf:IR2→IR:Lt(f):={x∈IR2|f(x)≥t}.AsetA⊂IR2iscalledsimple2D(simple1D)ifitishomeomorphictotheunitdiscB1(0)(totheunitinterval).Obviouslycompactsubsetsoftheplanearesimple2DifftheirboundaryisaJordancurve.
Definition1.AcompactsetA⊂IR2iscalledr-regularifforeachboundarypointofAitispossibletofindtwoosculatingopendiscsofradiusr,onelyingentirelyinAandtheotherlyingentirelyinAc.Agrayscaleimagefunctionf:IR2→IRisr-regular,ifeachlevelsetisr-regular.
Note,thatanr-regulargrayscaleimagedoesnotcontainisolatedextremaorsaddlepoints,butplateaus.Eachlocalextremumisaplateauwithr-regularshape.Thepropertythatextremabecomeplateausissimilartotheconceptofone-dimensionallocalmonotonicfunctions,asdefinedin[1].Thesefunctions,whicharemonotonicinanyintervalofsomerestrictedsize,donotchangeundermedianfiltering.Additionallytheyareinvariantundermorphologicalopeningandclosing,whichisalsotrueforr-regularbinaryimagesasalreadystatedbySerra[12].Thissuggeststoaskfortherelationshipbetweentheconceptsofmonotonyandr-regularity.Thereforeasuitablegeneralizationofmonotonyto2Disneeded.
Ourapproachistounderstandlocalmonotonyasatopologicalcriterionoftheneighborhood:Whenapplyinganarbitrarythresholdfunctiontoa1Dlocallymonotonicfunction,theresultingbinarysetcanhaveatmostonecomponentineachintervalofsomerestrictedsize.Thiscaneasilybegeneralizedtohigherdimensions: