[go: up one dir, main page]

CN104867110A - Lattice Boltzmann model-based video image defect repairing method - Google Patents

Lattice Boltzmann model-based video image defect repairing method Download PDF

Info

Publication number
CN104867110A
CN104867110A CN201410733849.XA CN201410733849A CN104867110A CN 104867110 A CN104867110 A CN 104867110A CN 201410733849 A CN201410733849 A CN 201410733849A CN 104867110 A CN104867110 A CN 104867110A
Authority
CN
China
Prior art keywords
video
image
model
lattice boltzmann
repair
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.)
Pending
Application number
CN201410733849.XA
Other languages
Chinese (zh)
Inventor
严壮志
吴冰晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Shanghai for Science and Technology
Original Assignee
University of Shanghai for Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by University of Shanghai for Science and Technology filed Critical University of Shanghai for Science and Technology
Priority to CN201410733849.XA priority Critical patent/CN104867110A/en
Publication of CN104867110A publication Critical patent/CN104867110A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

本发明公开了一种基于格子波尔兹曼模型的视频图像瑕疵修复方法。该方法的操作步骤为:1)输入待修复对象;2)判断修复对象的格式,若是图像则转入步骤5)进行修复,否则进入步骤3);3)判断输入的视频信号格式,若是模拟视频则先通过视频采集卡转化为数字视频,再进入步骤4),否则直接转入步骤4);4)将视频分解成帧;5)、对分解的每帧图像使用提出的格子波尔兹曼方法修复;6)、判断所需输出格式,若有需要合成视频,否则直接输出图像。格子波尔兹曼修复方法通过碰撞和迁移过程对模型中各节点粒子密度进行更新,若达到迭代次数或满足阈值条件则输出。该修复方法实现简单且并行性好,在保持较好修复质量的同时能够提高修复效率。

The invention discloses a video image defect repair method based on a lattice Boltzmann model. The operation steps of this method are: 1) input the object to be repaired; 2) judge the format of the repaired object, if it is an image, go to step 5) to repair, otherwise go to step 3); 3) judge the format of the input video signal, if it is an analog The video is first converted into digital video through the video capture card, and then enter step 4), otherwise directly transfer to step 4); 4) decompose the video into frames; 5), use the proposed lattice Boltz for each frame of the decomposed image Repair by Mann method; 6) Determine the required output format, if necessary, synthesize video, otherwise output image directly. The lattice Boltzmann repair method updates the particle density of each node in the model through the collision and migration process, and outputs if the number of iterations is reached or the threshold condition is met. The restoration method is simple to implement and has good parallelism, and can improve restoration efficiency while maintaining good restoration quality.

Description

基于格子波尔兹曼模型的视频图像瑕疵修复方法Video Image Defect Repair Method Based on Lattice Boltzmann Model

技术领域 technical field

本发明属于视频图像处理领域,提出一种基于格子波模型的视频图像瑕疵修复方法。 The invention belongs to the field of video image processing, and proposes a method for repairing video image defects based on a lattice wave model.

背景技术 Background technique

随着数字化技术的发展,数字视频的保存和修复已成为老档案,老照片,旧影视资料等保存和修复的重要手段。数字视频的修复即利用视频帧的空间结构信息或视频各帧之间的连续性来实现视频内指定破损区域的修复和填充,使视频具有空间平滑性和时间连续性,提高视频的可观赏性,被广泛应用于多种情况,如在场景中去除多余的目标、旧影视资料中斑点或划痕的修复,以及解决老胶片在播放过程中产生闪烁的问题等。 With the development of digital technology, the preservation and restoration of digital video has become an important means of preservation and restoration of old archives, old photos, and old film and television materials. The restoration of digital video is to use the spatial structure information of the video frame or the continuity between the video frames to repair and fill the specified damaged area in the video, so that the video has spatial smoothness and temporal continuity, and improves the viewing quality of the video. , is widely used in many situations, such as removing redundant objects in the scene, repairing spots or scratches in old film and television materials, and solving the flickering problem of old film during playback, etc.

视频修复技术是对数字图像修复技术的延展,目前主要的视频修复技术与图像修复技术类似,而针对图像修复问题国内外主要采用基于偏微分方程(Partial Differential Equation, PDE)的方法和基于纹理合成的方法。 Video inpainting technology is an extension of digital image inpainting technology. At present, the main video inpainting technology is similar to image inpainting technology. However, for image inpainting problems at home and abroad, the partial differential equation (Partial Differential Equation) is mainly used. Equation, PDE) method and method based on texture synthesis.

基于偏微分方程的修复方法最早是仿照人工修复的原理,利用图像破损区域的周围信息沿着等照度线方向逐渐向破损区域扩散的方式达到平滑修复的效果,该方法针对较小尺度以及不具有复杂纹理结构的破损图像,能够得到较好的修复效果。Chan和Shen提出全变分模型(TV模型)用于修复,(Chan T,Shen J.2002.Mathematical models for local non-texture inpainting[J].SIAM Journal on Applied Mathematics,62(3):1019-1043.)TV修复方法通过对能量泛函求最小值得。 The restoration method based on partial differential equations was originally based on the principle of manual restoration, using the surrounding information of the damaged area of the image to gradually spread to the damaged area along the direction of the isoluminance line to achieve the effect of smooth repair. Damaged images with complex texture structures can be better repaired. Chan and Shen proposed a total variational model (TV model) for inpainting, (Chan T, Shen J.2002.Mathematical models for local non-texture inpainting[J].SIAM Journal on Applied Mathematics, 62(3):1019-1043.) The TV repair method finds the minimum value of the energy functional.

TV模型在修复较大区域时会出现不连续的问题,破坏了视觉连通性原则,曲率驱动扩散模型(Curvature Driven Diffusion,CDD)用于修复时(T. Chan, J. Shen. Non-Texture Inpaintings by Curvature-Driven Diffusions [C].JVCIR,2001, 12(4):436-449)不会出现不连续的问题,将曲率嵌入到扩散系数中。CDD模型能够实现较大破损区域的修复,当修复区域处于边缘部分时,能够得到较好的修复效果。TV模型和CDD模型均能够实现较好的修复效果,但从计算效率来看,对于偏微分方程的求解需要数值的计算,算法实现较复杂,所花费时间较长,实现效率低。 The TV model will have discontinuity problems when repairing large areas, destroying the principle of visual connectivity, and the Curvature Driven Diffusion (CDD) model is used for repair (T. Chan, J. Shen. Non-Texture Inpaintings by Curvature-Driven Diffusions [C]. JVCIR, 2001, 12(4):436-449) do not suffer from discontinuities, embedding curvature into the diffusion coefficient. The CDD model can realize the repair of larger damaged areas, and when the repaired area is at the edge, a better repair effect can be obtained. Both the TV model and the CDD model can achieve better repair effects, but from the perspective of computational efficiency, the solution of partial differential equations requires numerical calculations, and the algorithm implementation is more complicated, takes a long time, and has low implementation efficiency.

基于纹理合成的图像修复方式即图像补全技术是利用待修边界以外的信息,对破损区域边界利用搜索匹配块的方式来逐渐复制填充破损区域边界(张红英,彭启琮.数字图像修复技术综述[J].中国图像图形学报,2007,12(1): 1-10)。 The image repair method based on texture synthesis, that is, the image completion technology, uses information other than the boundary to be repaired, and uses the method of searching for matching blocks to gradually copy and fill the boundary of the damaged area (Zhang Hongying, Peng Qicong. A review of digital image restoration technology [J ]. Chinese Journal of Image and Graphics, 2007, 12(1): 1-10).

这种修复方法能够实现较大区域破损的修复,以及通过匹配填充能够得到较好的纹理特性。但这类方法在修复区域内部易产生明显的颜色与结构的不一致性,修复效果不够理想,并且其本身的计算比较耗时,导致图像修复的效率低下。 This repair method can realize the repair of large area damage, and can get better texture characteristics through matching filling. However, this kind of method tends to produce obvious color and structure inconsistency inside the repaired area, the repairing effect is not ideal, and its own calculation is time-consuming, resulting in low efficiency of image repairing.

而格子波尔兹曼模型具有清晰的物理思想,简单边界处理和快速并行计算的优点,并且它是离散的空间模型,特别适合于数字图像处理。从格子波尔兹曼模型的微观模型,设计格子波尔兹曼模型演化方程,最后可以得到满足图像处理要求的宏观偏微分方程。因此格子波尔兹曼模型方法为实现图像处理的快速高效和准确性提供了实现途径。 The lattice Boltzmann model has the advantages of clear physical thought, simple boundary processing and fast parallel calculation, and it is a discrete space model, which is especially suitable for digital image processing. From the microscopic model of the lattice Boltzmann model, the evolution equation of the lattice Boltzmann model is designed, and finally the macroscopic partial differential equation that meets the requirements of image processing can be obtained. Therefore, the lattice Boltzmann model method provides a way to achieve fast, efficient and accurate image processing.

发明内容 Contents of the invention

本发明的目的在于针对影像中存在的有瑕疵而失真的问题而提出一种新颖快速跨平台的基于格子波尔兹曼模型的修复实现方案,以解决现有技术中修复区域不连续,图像修复效率不高的问题,该方法旨在于保持较好修复效果的同时能得到较好的修复效率,可用于修复影像中的各种瑕疵,如斑点、划痕和目标物的去除等等。并且以该修复方法为核心,开发了可在多种软硬平台上运行的修复系统,使得该方法得到更为广泛的应用。 The purpose of the present invention is to propose a novel and fast cross-platform restoration implementation scheme based on Lattice Boltzmann model to solve the problem of discontinuous repair area and image restoration in the prior art. The problem of low efficiency, this method aims to obtain better repair efficiency while maintaining a better repair effect, and can be used to repair various defects in the image, such as spots, scratches, and target removal. And with this repair method as the core, a repair system that can run on a variety of software and hardware platforms has been developed, making this method more widely used.

为了实现上述目的,本发明采用如下技术方案: In order to achieve the above object, the present invention adopts the following technical solutions:

本发明提出一种基于格子波尔兹曼模型的修复实现方案,可在包括PC和服务器的硬件计算平台,和包括Android、Linux、Mac、Windows在内的多种软件操作系统上运行。其主要步骤如下: The invention proposes a restoration implementation scheme based on the lattice Boltzmann model, which can run on hardware computing platforms including PCs and servers, and various software operating systems including Android, Linux, Mac, and Windows. Its main steps are as follows:

1)、输入含有瑕疵的图像 1), input images containing defects ;

2)、判断修复对象的格式,若是图像修复则转至步骤5)进行修复,否则进入步骤3); 2) Determine the format of the repaired object, if it is an image repair, go to step 5) to repair, otherwise go to step 3);

3)、判断输入的是数字视频还是模拟视频,若是模拟视频则先通过视频采集卡转换为数字视频,再进入步骤4),否则,直接进入步骤4); 3), determine whether the input is digital video or analog video, if it is analog video, first convert it to digital video through the video capture card, and then enter step 4); otherwise, directly enter step 4);

4)、将视频分解成帧如25帧/秒; 4) Decompose the video into frames such as 25 frames per second;

5)、对分解的每帧图像使用提出的格子波尔兹曼模型进行修复; 5) Use the proposed Lattice Boltzmann model to repair each decomposed image;

6)、判断所需输出格式,若所需输出为视频,则合成视频,否则直接输出图像6) Determine the required output format, if the required output is video, synthesize the video, otherwise directly output the image .

针对上文提到的格子波尔兹曼模型修复,本发明提出一种各向异性扩散格子波尔兹曼模型(D2Q9模型),并利用该模型实现瑕疵修复是利用待修复区域以及周围信息的梯度或曲率等几何信息来设计扩散系数,根据图像本身的几何特性来控制粒子的扩散演化速度从而实现平滑修复的过程。由于各类视频均可分解成图像,不失一般性,本发明以修复bmp格式的斑点和划痕图像为例,在装有Windows操作系统的PC机上进行实验,修复结果见 9,10,数据记录见 12、 13。修复的主要流程图如图 3所示,本发明是结合TV模型和CDD模型宏观方程中的扩散系数特点,针对图像和视频中出现的斑点和划痕瑕疵设计应用于格子波尔兹曼模型中的扩散系数,从而在保持较好修复效果的同时提高修复效率。对于已经读入的含有瑕疵的图像,其主要步骤如下: For the repair of the lattice Boltzmann model mentioned above, the present invention proposes an anisotropic diffusion lattice Boltzmann model (D2Q9 model), and using this model to realize defect repair is to use the area to be repaired and the surrounding information Geometric information such as gradient or curvature is used to design the diffusion coefficient, and the diffusion evolution speed of particles is controlled according to the geometric characteristics of the image itself to achieve a smooth repair process. Because all kinds of videos can be decomposed into images, without loss of generality, the present invention takes the spot and scratch image of repairing bmp format as an example, and experiments are carried out on a PC equipped with Windows operating system, and the repair results are shown in Fig. 9 , 10, Data records are shown in Figure 1 2 and Figure 1 3. The main flow chart of the repair is shown in Figure 3. The present invention combines the characteristics of the diffusion coefficient in the TV model and the CDD model macroscopic equation, and is designed to apply to the lattice Boltzmann model for the spots and scratches that appear in images and videos. Diffusion coefficient, so as to improve the repair efficiency while maintaining a good repair effect. For images with artifacts that have been read in , its main steps are as follows:

1)、判断检测破损区域,并对检测到的区域进行膨胀得到,预处理得图像1) Judging and detecting the damaged area , and dilate the detected area to get , the preprocessed image ;

2)、建立格子波尔兹曼模型,设置初始平衡态分布函数2) Establish a lattice Boltzmann model and set the initial equilibrium distribution function ;

3)、确立格子波尔兹曼模型演化方程的迭代次数,以及迭代终止条件和迭代终止阈值3) Establish the iteration times of the lattice Boltzmann model evolution equation , and the iteration termination condition and iteration termination threshold ;

4)、设计格子波尔兹曼模型演化方程的扩散系数4), Design the diffusion coefficient of the lattice Boltzmann model evolution equation ;

5)、根据格子波尔兹曼模型中的D2Q9模型,更新格子波尔兹曼模型演化方程中的平衡态分布函数5), according to the D2Q9 model in the lattice Boltzmann model, update the equilibrium state distribution function in the evolution equation of the lattice Boltzmann model ;

6)、计算格子波尔兹曼模型中的迁移过程: 6), calculate the migration process in the lattice Boltzmann model: ;

7)、计算格子波尔兹曼模型中的碰撞过程: 7) Calculate the collision process in the lattice Boltzmann model:

8)、更新模型各节点处粒子密度,及待修复区域的外围信息; 8) Update the particle density at each node of the model , and peripheral information of the area to be repaired;

9)、判断是否满足迭代终止条件,如果不满足迭代停止条件则进入步骤10),否则修复结束; 9) Judging whether the iteration termination condition is satisfied, if not, proceed to step 10), otherwise the repair ends;

10)、判断迭代次数是否达到N,如果没有达到迭代次数N则转至步骤4),并重复步骤4)-9),直到达到迭代次数N后结束修复; 10), judge whether the number of iterations reaches N, if it does not reach the number of iterations N, go to step 4), and repeat steps 4)-9), until the number of iterations N is reached, the repair is completed;

上述步骤3)中,提出利用迭代终止条件来判断是否停止格子波尔兹曼模型演化方程的迭代,常用的迭代终止条件为: In the above step 3), it is proposed to use the iteration termination condition to judge whether to stop the iteration of the evolution equation of the lattice Boltzmann model. The commonly used iteration termination condition is:

其中,为预先设定的阈值,而为输入图像的破损区域像素个数。本发明对上述迭代终止条件进行了优化,将每次迭代前后待修复区域像素差值的绝对值分为5段,并为每一段分配一个权重,这里称作差值权重,如图 5所示。 in, is a preset threshold, and is the number of pixels in the damaged area of the input image. The present invention optimizes the above-mentioned iteration termination condition, divides the absolute value of the pixel difference in the area to be repaired before and after each iteration into five segments, and assigns a weight to each segment, which is called the difference weight here, as shown in Figure 5 .

在每次迭代前后,像素差值越大所需要继续迭代的机会越大,所以差值权重示了在演化过程中像素差值处像素点演化的重要性。这里差值权重设为,而本发明提出的迭代终止条件为: Before and after each iteration, the greater the pixel difference value, the greater the chance of continuous iteration, so the difference weight represents the importance of the evolution of the pixel point at the pixel difference value during the evolution process. Here the difference weight is set to , and the iteration termination condition proposed by the present invention is:

其中,会根据不同的待修复图像以及对修复质量的要求进行预先设置。 in, It will be pre-set according to different images to be repaired and the requirements for repair quality.

上述步骤4)中,提出对格子波尔兹曼模型演化方程的扩散系数进行设计。在TV模型和CDD模型中,其扩散系数分别为: In the above step 4), it is proposed to design the diffusion coefficient of the evolution equation of the lattice Boltzmann model. In TV model and CDD model, the diffusion coefficients are:

and

其中,为待修复图像的梯度,为曲率函数。在斑点失真图像中,斑点较多为近似圆形或椭圆形,且斑点面积较小,在划痕失真图像中,划痕多为长条状,两者都不会造成大部分纹理的丢失。同时,为了提高修复效率,扩散系数的设计仅包含梯度信息。扩散系数为,其中为非负单调递减,且in, is the gradient of the image to be repaired, is a curvature function. In the speckle distortion image, most of the spots are approximately circular or oval, and the spot area is small. In the scratch distortion image, the scratches are mostly long strips, neither of which will cause the loss of most textures. Meanwhile, in order to improve repair efficiency, the design of diffusion coefficient only includes gradient information. The diffusion coefficient is ,in is non-negative monotonically decreasing, and and .

本发明提出三种不同的扩散系数模型及它们组合,扩散系数如下: The present invention proposes three different diffusion coefficient models and their combinations, and the diffusion coefficients are as follows:

, ,

其中,为待修复图像的梯度,为预先设定的阈值,为正值。将上述三种扩散系数的曲线进行分析,如图 6所示,并对三种扩散系数进行组合可得到不同的扩散系数: in, is the gradient of the image to be repaired, is a preset threshold, is a positive value. Analyze the curves of the above three diffusion coefficients, as shown in Figure 6 , and combine the three diffusion coefficients to obtain different diffusion coefficients:

其中,分别取不同的值将对应不同的扩散系数,对图像的修复会产生不同的影响。 in, Taking different values will correspond to different diffusion coefficients, which will have different effects on image restoration.

本发明与现有技术相比较,具有如下显而易见的突出实质性特点和显著技术进步:由于格子波尔兹曼模型具有并行性结构,易于实现并行运算,相比于纹理合成法,提高了斑点修复的效率,能更好的应用到旧影视资料中斑点失真的修复。而与经典PDE修复模型相比较,具有较好的修复效果,克服了修复区域的不连续性,同时也能提高修复的效率。 Compared with the prior art, the present invention has the following obvious outstanding substantive features and significant technical progress: because the lattice Boltzmann model has a parallel structure, it is easy to realize parallel computing, and compared with the texture synthesis method, the spot repair method is improved. The efficiency can be better applied to the restoration of speckle distortion in old film and television materials. Compared with the classic PDE repair model, it has a better repair effect, overcomes the discontinuity of the repair area, and can also improve the repair efficiency.

附图说明 Description of drawings

1:基于D2Q9的格子波尔兹曼模型的各矢量方向; Figure 1 : The vector directions of the lattice Boltzmann model based on D2Q9;

2:基于格子波尔兹曼模型的视频图像下次修复操作流程 Figure 2 : The next repair operation flow chart of the video image based on the Lattice Boltzmann model;

3:针对图像或视频中的瑕疵,格子波尔兹曼模型修复方法的流程 Figure 3 : A flowchart of the Lattice Boltzmann model inpainting method for defects in images or videos;

4:离散化网络构成的二维格子波尔兹曼模型D2Q9模型结构示意 Figure 4 : Schematic diagram of the structure of the two-dimensional lattice Boltzmann model D2Q9 model composed of discretized networks;

5:待修复区域像素差值的分段,以及各段的差值权重分布; Figure 5 : Segmentation of the pixel difference in the area to be repaired, and the weight distribution of the difference in each segment;

6:该发明提出的三种扩散系数及其组合的曲线,其中值均设为10,组合曲线中设为 Fig. 6 : the graph of three kinds of diffusion coefficients and combination thereof that this invention proposes, wherein middle The values are all set to 10, in the combination curve set to ;

7:斑点失真灰度图像,图中的黑点为斑点; Figure 7 : Speckle distortion grayscale image, the black dots in the figure are speckles;

8:老照片划痕失真的图像,白色条状为划痕; Figure 8 : Old photos with scratches and distorted images, the white stripes are scratches;

9:斑点失真灰度图像的修复结果,其中 依次对应于扩散系数为的格子波尔兹曼模型修复结果; Figure 9 : Inpainting results of speckle-distorted grayscale images, where Fig. which in turn corresponds to a diffusion coefficient of Lattice Boltzmann model inpainting results;

10:老照片划痕的修复结果,其中 依次对应于扩散系数为的格子波尔兹曼模型修复结果; Fig. 10 : Repair results of old photo scratches, where Fig. which in turn corresponds to a diffusion coefficient of Lattice Boltzmann model inpainting results;

11:修复软件运行展示 Figure 1 1: Repair software running display diagram ;

12为 1:针对灰度图像的斑点失真,不同扩散系数的格子波尔兹曼模型修复所需迭代次数和修复时间; Fig. 1 2 is Table 1 : for the speckle distortion of the grayscale image, the number of iterations and repair time required for repairing the lattice Boltzmann model with different diffusion coefficients;

13为 2:针对老照片的划痕失真,不同扩散系数的格子波尔兹曼模型修复所需迭代次数和修复时间。 Figures 1 and 3 are Table 2 : For the scratch distortion of old photos, the number of iterations and repair time required for the repair of the lattice Boltzmann model with different diffusion coefficients.

具体实施方式 Detailed ways

下面将参考附图并结合实施例对本发明进行详细说明: The present invention will be described in detail below with reference to accompanying drawing and in conjunction with embodiment:

实施例一:参见 1 2,本基于格子波尔兹曼方法操作步骤:1)、输入含有瑕疵的图像;2)、判断修复对象的格式,若是图像修复则转入步骤5)进行修复,否则进入步骤3);3)、判断输入的是数字视频还是模拟视频,若是模拟视频则先通过视频采集卡转化为数字视频,再转入步骤4),否则,直接进入步骤4);4)、将视频分解成帧;5)、对分解的每帧图像使用提出的格子波尔兹曼方法进行修复;6)、判断所需输出格式,若所需输出为视频,则合成视频,否则直接输出图像Embodiment 1: See Fig. 1 and Fig. 2 , this operation steps based on Lattice Boltzmann method: 1), input an image containing defects ;2), determine the format of the repair object, if it is an image repair, go to step 5) to repair, otherwise go to step 3); 3), judge whether the input is digital video or analog video, if it is an analog video, first pass through the video capture card Convert to digital video, and then go to step 4), otherwise, go directly to step 4); 4), decompose the video into frames; 5), use the proposed lattice Boltzmann method to repair each decomposed image; 6) Determine the required output format, if the required output is video, synthesize the video, otherwise directly output the image .

所述的视频包含MPEG-1、MPEG-4、AVI、RM、ASF、WMV、MOV或MKV格式的数字或模拟视频;所述的图像包括各类遥感成像、或者医学仪器成像得到的模拟或数字图像,其格式包括bmp、jpg、gif、或png;所述的瑕疵来源包括成像设备故障造成的色彩失真,老照片的褪色、折痕,胶片的老化造成的播放闪烁,旧影视资料的斑点、划痕。所述格子波尔兹曼模型:通过把图像的边缘截止函数嵌入到格子波尔兹曼模型的松弛因子中求解扩散方程得以实现,常用的二维格子波尔兹曼模型包括D2Q5——二维5个方向扩散,D2Q9,三维的格子波尔兹曼模型包括D3Q7,D3Q15。所述的基于格子波尔兹曼模型的视频图像瑕疵修复可在包括PC或服务器在内的硬件计算平台,和包括Android、iOS、Linux或Windows在内的软件操作系统中运行。 The video includes digital or analog video in MPEG-1, MPEG-4, AVI, RM, ASF, WMV, MOV or MKV formats; the image includes analog or digital images obtained from various remote sensing imaging or medical instrument imaging Image, the format of which includes bmp, jpg, gif, or png; the sources of defects include color distortion caused by imaging equipment failure, fading and creases of old photos, playback flicker caused by film aging, spots on old video materials, scratches. The lattice Boltzmann model: it is realized by embedding the edge cutoff function of the image into the relaxation factor of the lattice Boltzmann model to solve the diffusion equation. The commonly used two-dimensional lattice Boltzmann model includes D2Q5—two-dimensional Diffusion in 5 directions, D2Q9, three-dimensional lattice Boltzmann model including D3Q7, D3Q15. The video image defect repair based on the lattice Boltzmann model can run on a hardware computing platform including a PC or a server, and a software operating system including Android, iOS, Linux or Windows.

格子波尔兹曼修复方法的具体操作步骤如下: The specific operation steps of the lattice Boltzmann repair method are as follows:

1)、判断检测破损区域,并对检测到的区域进行膨胀得到,预处理得图像 1) Judging and detecting the damaged area , and dilate the detected area to get , the preprocessed image

2)、建立LB模型,设置初始平衡态分布函数2) Establish the LB model and set the initial equilibrium distribution function ;

3)、确立LB演化方程的迭代次数,以及迭代终止条件和迭代终止阈值3) Establish the number of iterations of the LB evolution equation , and the iteration termination condition and iteration termination threshold ;

4)、设计LB演化方程的扩散系数4) Design the diffusion coefficient of the LB evolution equation ;

5)、根据LB模型中的D2Q9模型,更新LB演化方程中的平衡态分布函数5), according to the D2Q9 model in the LB model, update the equilibrium state distribution function in the LB evolution equation ;

6)、计算LB模型中的迁移过程:6) Calculate the migration process in the LB model: ;

7)、计算LB模型中的作用过程: 7) Calculate the action process in the LB model:

;

8)、更新模型各节点处粒子密度,及待修复区域的外围信息; 8) Update the particle density at each node of the model , and peripheral information of the area to be repaired;

9)、 判断是否满足迭代终止条件,如果不满足迭代停止条件则进入步骤10),否则修复结束; 9), judging whether the iteration termination condition is met, if not, proceed to step 10), otherwise the repair ends;

10)、判断迭代次数是否达到N,如果没有达到迭代次数N则转至步骤4),并重复步骤4)-9),直到达到迭代次数N后结束修复; 10), judge whether the number of iterations reaches N, if it does not reach the number of iterations N, go to step 4), and repeat steps 4)-9), until the number of iterations N is reached, the repair is completed;

所述的边缘截止函数为非负单调递减函数,可利用图像梯度信息和曲率信息,在边界处扩散速度减慢,在平滑处扩散速度加快,使得图像扩散过程中对扩散速度和边缘保持能力都具有较好的性能。所述松弛因子控制扩散速率,实现非线性扩散,以达到保护图像边缘特性,抑制噪声的目的;平衡态分布函数的设计实现各向异性扩散或者各向同性扩散。 The edge cut-off function is a non-negative monotonically decreasing function, which can use image gradient information and curvature information to slow down the diffusion speed at the boundary and accelerate the diffusion speed at the smooth place, so that the diffusion speed and edge retention ability are both improved during the image diffusion process. Has better performance. The relaxation factor controls the diffusion rate to realize nonlinear diffusion, so as to protect image edge characteristics and suppress noise; the design of equilibrium distribution function realizes anisotropic diffusion or isotropic diffusion.

实施例二:本实施例以本发明的技术方案为前提进行实施,并分别对斑点失真图像和老照片划痕失真图像实施修复,如图 7、8所示。以下给出了详细的实施方案。 Embodiment 2: This embodiment is implemented on the premise of the technical solution of the present invention, and repairs the spot distorted image and the old photo scratch distorted image respectively, as shown in FIGS. 7 and 8 . Detailed embodiments are given below.

所述格子波尔兹曼模型D2Q9模型是由均匀网格组成,其中网格的节点被看作一个元胞,对应于图像中的像素点。而像素点处的灰度值即对应于元胞中的粒子密度。同时,描述了在矢量方向上的粒子密度分布函数,其中节点处的矢量方向如图 1所示: The lattice Boltzmann model D2Q9 model is composed of a uniform grid, where the nodes of the grid are regarded as a cell, corresponding to the pixel points in the image . The gray value at the pixel corresponds to the particle density in the cell . at the same time, described in the vector direction The particle density distribution function on , where the vector direction representation at the node is shown in Figure 1 :

D2Q9模型拥有9个离散速度,模型中微观粒子扩散演化方程为: The D2Q9 model has 9 discrete velocities, and the diffusion evolution equation of microscopic particles in the model is:

其中, 示在节点处的粒子扩散系数,与格子波尔兹曼模型中的松弛因子之间的关系为: in, represented at the node The particle diffusion coefficient at , and the relaxation factor in the lattice Boltzmann model The relationship between is:

为平衡态分布函数,这里平衡态分布函数与各节点处粒子的密度之间关系为: is the equilibrium distribution function, where the relationship between the equilibrium distribution function and the particle density at each node is:

实施例1:修复有斑点瑕疵的灰度图像 Example 1: Repairing a grayscale image with speckle defects

针对存在失真的视频或图像的格子波尔兹曼模型修复,对于事先已得到待修复图像,由于选取的实施对象是图像,所以本发明直接采用如图 3所示的修复流程,该方法主要包括如下步骤: Lattice Boltzmann model restoration for distorted videos or images, for images to be repaired that have been obtained in advance , because the selected implementation object is an image, so the present invention directly adopts the restoration process as shown in Figure 3 , and the method mainly includes the following steps:

1)、对输入图像进行破损区域检测得到待修复区域,并对检测到的区域进行膨胀得到,预处理得图像1) Perform damaged area detection on the input image to obtain the area to be repaired , and dilate the detected area to get , the preprocessed image ;

其中,为输入图像的全部区域; in, is the entire area of the input image;

2)、建立格子波尔兹曼模型,设置初始平衡态分布函数2) Establish a lattice Boltzmann model and set the initial equilibrium distribution function ;

3)、预设L模型演化方程的迭代次数=500和迭代终止阈值=0.03; 3) Preset the number of iterations of the evolution equation of the L model =500 and iteration termination threshold =0.03;

4)、设计格子波尔兹曼模型演化方程的扩散系数,,其中。当时,计算三种扩散系数的组合,分别将上述四种扩散系数应用到格子波尔兹曼模型演化方程,并对修复效果进行比较; 4) Design the diffusion coefficient of the evolution equation of the lattice Boltzmann model, and ,in . when When , calculate the combination of the three diffusion coefficients , respectively apply the above four diffusion coefficients to the evolution equation of the lattice Boltzmann model, and compare the restoration effect;

5)、根据格子波尔兹曼模型中的D2Q9模型,如图 4所示,来更新格子波尔兹曼模型演化方程中的平衡态分布函数5) According to the D2Q9 model in the lattice Boltzmann model, as shown in Figure 4 , update the equilibrium state distribution function in the evolution equation of the lattice Boltzmann model ;

6)、计算格子波尔兹曼模型中的迁移过程: 6) Calculate the migration process in the lattice Boltzmann model: ;

7)、计算格子波尔兹曼模型中的碰撞过程: 7) Calculate the collision process in the lattice Boltzmann model:

8)、更新模型各节点处粒子密度,并更新待修复区域的外围信息,得到更新后的图像为: 8) Update the particle density at each node of the model , and update the peripheral information of the area to be repaired, the updated image is:

9)、判断是否满足迭代阈值条件,如果不满足迭代终止条件则进入步骤10),否则修复结束; 9) Judging whether the iteration threshold condition is met, if the iteration termination condition is not met, go to step 10), otherwise the repair ends;

10)、判断迭代次数是否达到500,如果没有达到则转至步骤4),并重复步骤4)-9),直到达到迭代次数500后结束修复; 10), judge whether the number of iterations reaches 500, if not, go to step 4), and repeat steps 4)-9), until the number of iterations reaches 500, the repair is completed;

待修复完成后,输出修复效果,如图 9所示。上述实施的硬件条件为处理器Intel® Core™i5-2450M,主频2.50GHz,内存4G;软件配置为Window7系统和matlab2012b;对于灰度图像的斑点失真的实验,四种不同扩散系数所需迭代次数和迭代时间如图 12所示。 After the repair is completed, the repair effect is output, as shown in Figure 9 . The hardware conditions for the above implementation are processor Intel® Core™ i5-2450M, main frequency 2.50GHz, memory 4G; software configuration is Window7 system and matlab2012b; for the experiment of speckle distortion of grayscale images, four different diffusion coefficients need to be iterated The times and iteration time are shown in Fig . 12.

实施例2:修复有划痕瑕疵的老照片 Example 2: Restoring old photos with scratches

8为划痕失真的图像,实施步骤与上述一致,利用上述四种扩散系数进行格子波尔兹曼模型修复得到的修复结果如图 10所示, 13将不同扩散系数完成修复所需的迭代次数和修复时间进行比较。 Figure 8 shows the image of scratch distortion, and the implementation steps are the same as above. The restoration results obtained by using the above four diffusion coefficients to repair the lattice Boltzmann model are shown in Fig . The number of iterations required and the repair time are compared.

实验显示,针对图像和视频瑕疵的修复,采用基于格子波尔兹曼模型的修复方案能够得到较好的修复效果,以及提高了修复效率,该方法能更好的应用到工程应用中。 Experiments show that, for the restoration of image and video defects, the restoration scheme based on the Lattice Boltzmann model can obtain better restoration results and improve the restoration efficiency. This method can be better applied to engineering applications.

Claims (7)

1. A quick and novel cross-platform video image flaw repairing method based on a lattice Boltzmann model is characterized in that the video image flaw repairing operation steps are as follows:
1) inputting the image containing the flaw
2) Judging the format of the repaired object, if the image is repaired, turning to the step 5) to repair, and if not, entering the step 3);
3) judging whether the input video is digital video or analog video, if the input video is analog video, converting the input video into digital video by a video capture card, and then turning to the step 4), otherwise, directly entering the step 4);
4) decomposing the video into frames;
5) repairing each decomposed frame of image by using a proposed lattice Boltzmann method;
6) judging the required output format, if the required output is video, synthesizing the video, otherwise, directly outputting the image
2. The method for repairing the defects of the video image based on the lattice Boltzmann model is as follows:
the video comprises digital or analog video in MPEG-1, MPEG-4, AVI, RM, ASF, WMV, MOV or MKV format; the images comprise various remote sensing imaging or analog or digital images obtained by imaging of a medical instrument, and the formats of the images comprise bmp, jpg, gif or png; the sources of defects include color distortion caused by failure of imaging equipment, fading and creasing of old photos, play flicker caused by aging of films, spots and scratches of old video data.
3. The method for repairing the defects of the video image based on the lattice Boltzmann model as claimed in claim 1, wherein:
the lattice boltzmann model: solving the diffusion equation is realized by embedding the edge cut function of the image into the relaxation factors of a lattice Boltzmann model, wherein the commonly used two-dimensional lattice Boltzmann model comprises D2Q5, two-dimensional 5-direction diffusion, D2Q9, and the three-dimensional lattice Boltzmann model comprises D3Q7 and D3Q 15.
4. The method for repairing the defects of the video image based on the lattice Boltzmann model as claimed in claim 1, wherein:
the video image flaw repairing based on the lattice Boltzmann model can be operated in a hardware computing platform comprising a PC or a server and a software operating system comprising Android, iOS, Linux or Windows.
5. The method for repairing video and image based on lattice Boltzmann model according to claim 1, wherein the specific operation steps of the step 5) are as follows:
1) determining and detecting the damaged areaAnd expanding the detected region to obtainPre-processing to obtain an image
2) Establishing an LB model and setting an initial equilibrium state distribution function
3) Establishing the iteration number of the LB evolution equationAnd an iteration end condition and an iteration end threshold
4) Designing diffusion coefficient of LB evolution equation
5) Updating the equilibrium state distribution function in the LB evolution equation according to the D2Q9 model in the LB model
6) Calculating the migration process in the LB model:
7) calculating the action process in the LB model:
8) updating the particle density at each node of the modelAnd peripheral information of the area to be repaired;
9) judging whether an iteration termination condition is met, if the iteration termination condition is not met, entering a step 10), and if not, finishing the repair;
10) judging whether the iteration number reaches N, if not, turning to the step 4), and repeating the steps 4) -9) until the iteration number N is reached, and finishing the repair.
6. The method for repairing video image based on lattice Boltzmann model as recited in claim 3, wherein:
the edge cut-off function is a non-negative monotone decreasing function, and can utilize image gradient information and curvature information to reduce the diffusion speed at the boundary and accelerate the diffusion speed at the smooth part, so that the diffusion speed and the edge retention capacity have better performance in the image diffusion process.
7. The method for repairing video image based on lattice Boltzmann model as recited in claim 3, wherein:
the relaxation factor controls the diffusion rate and realizes the nonlinear diffusion so as to achieve the purposes of protecting the edge characteristic of the image and inhibiting noise; the design of the equilibrium state distribution function realizes anisotropic diffusion or isotropic diffusion.
CN201410733849.XA 2014-12-08 2014-12-08 Lattice Boltzmann model-based video image defect repairing method Pending CN104867110A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410733849.XA CN104867110A (en) 2014-12-08 2014-12-08 Lattice Boltzmann model-based video image defect repairing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410733849.XA CN104867110A (en) 2014-12-08 2014-12-08 Lattice Boltzmann model-based video image defect repairing method

Publications (1)

Publication Number Publication Date
CN104867110A true CN104867110A (en) 2015-08-26

Family

ID=53912927

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410733849.XA Pending CN104867110A (en) 2014-12-08 2014-12-08 Lattice Boltzmann model-based video image defect repairing method

Country Status (1)

Country Link
CN (1) CN104867110A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106251312A (en) * 2016-08-09 2016-12-21 央视国际网络无锡有限公司 Incomplete automatically benefit of a kind of picture paints method
CN106469441A (en) * 2016-09-11 2017-03-01 江苏师范大学 A kind of image synchronization noise reduction Enhancement Method based on LBM
CN111524077A (en) * 2020-04-17 2020-08-11 三维六度(北京)文化有限公司 Method and system for repairing image data
CN114187245A (en) * 2021-11-25 2022-03-15 深兰工业智能创新研究院(宁波)有限公司 Video contamination detection method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101673393A (en) * 2009-09-25 2010-03-17 上海大学 Image de-noising method based on lattice Boltzmann model
KR20110046904A (en) * 2009-10-29 2011-05-06 삼성전자주식회사 Image restoration apparatus and method with limited search area
CN102163321A (en) * 2011-06-15 2011-08-24 上海大学 Image segmentation method based on lattice Boltzman model
US20120224781A1 (en) * 2011-03-02 2012-09-06 Xue-Cheng Tai Methods and systems for generating enhanced images using euler's elastica model

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101673393A (en) * 2009-09-25 2010-03-17 上海大学 Image de-noising method based on lattice Boltzmann model
KR20110046904A (en) * 2009-10-29 2011-05-06 삼성전자주식회사 Image restoration apparatus and method with limited search area
US20120224781A1 (en) * 2011-03-02 2012-09-06 Xue-Cheng Tai Methods and systems for generating enhanced images using euler's elastica model
CN102163321A (en) * 2011-06-15 2011-08-24 上海大学 Image segmentation method based on lattice Boltzman model

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张蕊 等: "图像修复的格子波尔兹曼方法", 《信息技术及图像处理》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106251312A (en) * 2016-08-09 2016-12-21 央视国际网络无锡有限公司 Incomplete automatically benefit of a kind of picture paints method
CN106251312B (en) * 2016-08-09 2019-04-23 央视国际网络无锡有限公司 A kind of incomplete mend automatically of picture draws method
CN106469441A (en) * 2016-09-11 2017-03-01 江苏师范大学 A kind of image synchronization noise reduction Enhancement Method based on LBM
CN111524077A (en) * 2020-04-17 2020-08-11 三维六度(北京)文化有限公司 Method and system for repairing image data
CN111524077B (en) * 2020-04-17 2023-11-17 三维六度(北京)文化有限公司 Method and system for repairing image data
CN114187245A (en) * 2021-11-25 2022-03-15 深兰工业智能创新研究院(宁波)有限公司 Video contamination detection method and device, electronic equipment and storage medium
CN114187245B (en) * 2021-11-25 2025-07-04 深兰工业智能创新研究院(宁波)有限公司 Video corruption detection method, device, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN107833270B (en) Real-time object three-dimensional reconstruction method based on depth camera
CN103020897B (en) Device, system and method for super-resolution reconstruction of single-frame image based on multiple blocks
CN101765022B (en) A Depth Representation Method Based on Optical Flow and Image Segmentation
WO2017201751A1 (en) Hole filling method and device for virtual viewpoint video or image, and terminal
CN110033475A (en) A kind of take photo by plane figure moving object segmentation and removing method that high-resolution texture generates
CN103024421B (en) Method for synthesizing virtual viewpoints in free viewpoint television
CN100448271C (en) Video Editing Method Based on Panorama Stitching
CN101980285B (en) Method for restoring non-local images by combining GMRF priori
CN102411774A (en) Processing method, device and system based on single image defogging
CN114550021A (en) Surface defect detection method and device based on feature fusion
CN102819837B (en) Method and device for depth map processing based on feedback control
CN105719250A (en) Image inpainting method based on simple background, system and shooting camera
CN104408757A (en) Method and system for adding haze effect to driving scene video
CN104867110A (en) Lattice Boltzmann model-based video image defect repairing method
CN107301674B (en) A 3D Reconstruction Texture Restoration Method Based on Window Interpolation
CN116091588A (en) Three-dimensional object detection method, apparatus, and computer-readable storage medium
CN110298809B (en) A kind of image defogging method and device
CN112734914A (en) Image stereo reconstruction method and device for augmented reality vision
CN102800078A (en) Non-local mean image detail restoration method
CN113971669A (en) 3D Inspection System Applied to Pipeline Damage Recognition
CN103106663B (en) Realize the method for SIM card defects detection based on image procossing in computer system
CN104166992A (en) Content perception binocular image zooming method based on grid deformation
CN104966269A (en) Multi-frame super-resolution imaging device and method
CN115115691A (en) Monocular three-dimensional plane recovery method, equipment and storage medium
Musialski et al. Symmetry-Based Façade Repair.

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150826

WD01 Invention patent application deemed withdrawn after publication