CN104952049B - Based on the image repair method for facing domain diverging interpolation - Google Patents
Based on the image repair method for facing domain diverging interpolation Download PDFInfo
- Publication number
- CN104952049B CN104952049B CN201510348382.1A CN201510348382A CN104952049B CN 104952049 B CN104952049 B CN 104952049B CN 201510348382 A CN201510348382 A CN 201510348382A CN 104952049 B CN104952049 B CN 104952049B
- Authority
- CN
- China
- Prior art keywords
- points
- point
- repaired
- value
- 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.)
- Active
Links
Landscapes
- Image Processing (AREA)
- Image Generation (AREA)
- Apparatus For Radiation Diagnosis (AREA)
Abstract
Description
技术领域technical field
本发明属于图形图像处理领域,特别涉及一种基于临域发散插值的图像修复方法。The invention belongs to the field of graphics and image processing, in particular to an image restoration method based on neighborhood divergence interpolation.
背景技术Background technique
随着科技的发展,3D技术已越来越成熟。目前主流的3D技术,主要是通过参考图及其深度图信息,结合3D变换方程,从2D转到3D。但这一方法,会存在明显的缺陷,即合成的新视图会存在较小的空洞裂隙。为了解决该缺陷,技术人员们研究了各种空洞修复技术,目前主要的空洞修复算法包括:FMM快速行进算法,Criminisi算法,临域插值算法等等。With the development of science and technology, 3D technology has become more and more mature. The current mainstream 3D technology mainly converts from 2D to 3D through the reference map and its depth map information, combined with the 3D transformation equation. However, this method has obvious defects, that is, the synthesized new view will have smaller holes and cracks. In order to solve this defect, technicians have studied various hole repair technologies. At present, the main hole repair algorithms include: FMM fast marching algorithm, Criminisi algorithm, neighborhood interpolation algorithm and so on.
传统的临域插值算法,主要是通过找到待修复点周围八个方向最近的点,再使该八个点的单通道值两两相减并求绝对值,得到绝对值最小的两个点,再将这两个点三通道RGB值分别求平均值,将得到的平均RGB值分别赋值给待修复点,即完成图像修复。实验表明该方法修复存在严重的不足,只能完美修复裂隙宽度小于两个像素的空洞,而对裂隙宽度大于两个像素的空洞,其修复图像的质量效果非常的低。The traditional neighborhood interpolation algorithm mainly finds the nearest points in eight directions around the point to be repaired, and then subtracts the single-channel values of the eight points and calculates the absolute value to obtain the two points with the smallest absolute values. Then the three-channel RGB values of these two points are respectively averaged, and the obtained average RGB values are respectively assigned to the points to be repaired, and the image restoration is completed. Experiments show that this method has serious shortcomings in repairing. It can only perfectly repair holes with a crack width less than two pixels, but for holes with a crack width greater than two pixels, the quality of the repaired image is very low.
发明内容Contents of the invention
针对现有技术的不足,本发明提出了一种新的基于临域发散插值的图像修复方法。Aiming at the deficiencies of the prior art, the present invention proposes a new image restoration method based on neighborhood divergence interpolation.
本发明解决其技术问题所采用的技术方案如下:The technical solution adopted by the present invention to solve its technical problems is as follows:
首先,确定待修复空洞点,并找到待修复空洞点附近最近的左上、上、右上、左、右、左下、下、右下八个点。分别记为:a、b、c、d、e、f、g、h。然后再进一步确定a、b、c、d、e、f、g、h八个点是否存在空洞点。若存在,则继续向外发散直到找到不为空洞的点。比如:距离待修复空洞点最近的左上方向的点a为空洞点,则继续向左上方向遍历寻找,直到寻找到不为空洞的点,记为a',直到最终八个方向上都得到不为空洞的点,共计八个点,分别为a'、b'、c'、d'、e'、f'、g'和h'。接着将左上和右下,上和下,右上和左下,左和右的点的单通道像素值相减求绝对值操作。即|a'-h'|、|b'-g'|、|c'-f'|和|d'-e'|,并将其值分别记为:diff1,diff2,diff3,diff4。并算出diff1,diff2,diff3,diff4中最小值:First, determine the hole point to be repaired, and find the nearest upper left, upper, upper right, left, right, lower left, lower, and lower right points near the hole point to be repaired. They are respectively recorded as: a, b, c, d, e, f, g, h. Then further determine whether there are empty points at the eight points a, b, c, d, e, f, g, and h. If it exists, continue to diverge outward until finding a point that is not a hole. For example: the point a in the upper left direction closest to the hole point to be repaired is a hole point, then continue to traverse the search in the upper left direction until a point that is not a hole is found, which is recorded as a', until finally all eight directions are obtained. There are eight empty points in total, namely a', b', c', d', e', f', g' and h'. Then subtract the single-channel pixel values of the upper left and lower right, upper and lower, upper right and lower left, left and right points for absolute value operation. That is |a'-h'|, |b'-g'|, |c'-f'| and |d'-e'|, and their values are recorded as: diff1, diff2, diff3, diff4. And calculate the minimum value in diff1, diff2, diff3, diff4:
min=minminsize(diff1,minsize(diff2,minsize(diff3,diff4)))min=minminsize(diff1,minsize(diff2,minsize(diff3,diff4)))
最后根据最小值对应的两个点(例如最小值为diff1,则找到点a和h),得到其三通道图对应的R,G,B值。即Ra、Ga、Ba和Rh、Gh、Bh。然后分别计算出两点三个通道每个通道和的平均值,如R,=(Ra+Rh)/2,G,=(Ga+Gh)/2,B,=(Ba+Bh)/2。再将R,、G,、B,均分别赋值给待修复点的R,G,B三通道,即可完成修复。Finally, according to the two points corresponding to the minimum value (for example, if the minimum value is diff1, find points a and h), get the R, G, and B values corresponding to the three-channel map. Namely Ra, Ga, Ba and Rh, Gh, Bh. Then calculate the average value of each channel and three channels at two points, such as R, = (Ra+Rh)/2, G, = (Ga+Gh)/2, B, = (Ba+Bh)/2 . Then assign R, G, and B to the R, G, and B channels of the point to be repaired respectively, and the repair can be completed.
本发明有益效果:本发明是一种适用于裂隙宽度大于两个像素以上的小空洞,相比传统方法其修复的图像质量更加的高。Beneficial effects of the present invention: the present invention is suitable for small cavities with a crack width greater than two pixels, and the repaired image quality is higher than that of traditional methods.
附图说明Description of drawings
图1为传统临域插值方法;Fig. 1 is traditional neighborhood interpolation method;
图2为本发明的临域发散插值图像修复方法。Fig. 2 is the image restoration method of the present invention with divergent interpolation.
具体实施方式detailed description
以下结合附图对本发明作进一步说明:The present invention will be further described below in conjunction with accompanying drawing:
如图1所示,传统的临域插值方法是找到待修复点最近的八个方向上的点,无论这八个点中是否存在空洞(如果存在空洞,则令其单通道值为零),都将两两的单通道值相减求绝对值,得到值最小的两个点,再将其三通道RGB值求平均值,分别赋值给待修复点,即完成修复。该方法,如果修复空洞的裂隙宽度大于两个像素,会使得待修复点周围的八个点中绝对会存在空洞点,从而造成RGB三通道值得修复误差。而如果在找临域八个点时通过不断向外发散知道找到不为空洞的八个临域点,再进行三通道值得赋值,可以避免出现空洞,降低误差,从而最优化的修复图像。As shown in Figure 1, the traditional neighborhood interpolation method is to find the points in the eight directions closest to the point to be repaired, regardless of whether there are holes in the eight points (if there are holes, let the single-channel value be zero), The two single-channel values are subtracted to obtain the absolute value, and the two points with the smallest values are obtained, and then the three-channel RGB values are averaged, and assigned to the points to be repaired respectively, and the repair is completed. In this method, if the crack width of the repaired hole is greater than two pixels, there will definitely be a hole point in the eight points around the point to be repaired, resulting in an error in the repair of the RGB three-channel value. However, if we continue to diverge outward to find eight adjacent points that are not holes, and then assign values to the three channels, we can avoid holes and reduce errors, thereby optimizing the image restoration.
如图2所示,本发明主要是根据临域插值算法,优化改良,进而提高图像修复质量,本发明的具体实施如下:As shown in Figure 2, the present invention is mainly based on the neighborhood interpolation algorithm, optimizes and improves, and then improves the image repair quality, and the specific implementation of the present invention is as follows:
步骤1.确定待修复空洞点,并找到待修复空洞点附近最近的左上、上、右上、左、右、左下、下、右下八个点。分别记为:a、b、c、d、e、f、g、h。Step 1. Determine the hole point to be repaired, and find the nearest upper left, upper, upper right, left, right, lower left, lower, and lower right points near the hole point to be repaired. They are respectively recorded as: a, b, c, d, e, f, g, h.
步骤2.进一步确定a、b、c、d、e、f、g、h八个点是否存在空洞点。若存在,则继续向外发散直到找到不为空洞的点。比如:距离待修复空洞点最近的左上方向的点a为空洞点,则继续向左上方向遍历寻找,直到寻找到不为空洞的点,记为a'。Step 2. Further determine whether there are empty points at eight points a, b, c, d, e, f, g, and h. If it exists, continue to diverge outward until finding a point that is not a hole. For example: the point a in the upper left direction closest to the hole point to be repaired is a hole point, then continue to search in the upper left direction until a point that is not a hole is found, which is recorded as a'.
步骤3.反复进行步骤2,使得最终八个方向上都得到不为空洞的点,共计八个点,分别为a'、b'、c'、d'、e'、f'、g'和h'。Step 3. Repeat step 2, so that the points that are not empty are obtained in the final eight directions, a total of eight points, respectively a', b', c', d', e', f', g' and h'.
步骤4.将左上和右下,上和下,右上和左下,左和右的点的单通道像素值相减求绝对值操作。即|a'-h'|、|b'-g'|、|c'-f'|和|d'-e'|,并将其值分别记为:diff1,diff2,diff3,diff4。并算出diff1,diff2,diff3,diff4中最小值min=minminsize(diff1,minsize(diff2,minsize(diff3,diff4)))。Step 4. Subtract the single-channel pixel values of the upper left and lower right, upper and lower, upper right and lower left, left and right points for absolute value operation. That is |a'-h'|, |b'-g'|, |c'-f'| and |d'-e'|, and their values are recorded as: diff1, diff2, diff3, diff4. And calculate the minimum value min=minminsize(diff1,minsize(diff2,minsize(diff3,diff4))) among diff1, diff2, diff3, diff4.
步骤5.找的最小值对应的两个点(例如最小值为diff1,则找到点a和h),得到其三通道图对应的R,G,B值。即Ra、Ga、Ba和Rh、Gh、Bh。然后分别计算出两点三个通道每个通道和的平均值,如R,=(Ra+Rh)/2,G,=(Ga+Gh)/2,B,=(Ba+Bh)/2。再将R,、G,、B,均分别赋值给待修复点的R,G,B三通道,即可完成修复。Step 5. Find the two points corresponding to the minimum value (for example, the minimum value is diff1, then find points a and h), and get the R, G, and B values corresponding to the three-channel diagram. Namely Ra, Ga, Ba and Rh, Gh, Bh. Then calculate the average value of each channel and three channels at two points, such as R, = (Ra+Rh)/2, G, = (Ga+Gh)/2, B, = (Ba+Bh)/2 . Then assign R, G, and B to the R, G, and B channels of the point to be repaired respectively, and the repair can be completed.
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510348382.1A CN104952049B (en) | 2015-06-23 | 2015-06-23 | Based on the image repair method for facing domain diverging interpolation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510348382.1A CN104952049B (en) | 2015-06-23 | 2015-06-23 | Based on the image repair method for facing domain diverging interpolation |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104952049A CN104952049A (en) | 2015-09-30 |
CN104952049B true CN104952049B (en) | 2018-02-23 |
Family
ID=54166682
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510348382.1A Active CN104952049B (en) | 2015-06-23 | 2015-06-23 | Based on the image repair method for facing domain diverging interpolation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104952049B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111242871B (en) * | 2020-01-20 | 2023-03-10 | 上海微盟企业发展有限公司 | Image completion method, device, equipment and computer readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7277595B1 (en) * | 2003-01-06 | 2007-10-02 | Apple Inc. | Method and apparatus for digital image manipulation to remove image blemishes |
CN101388967A (en) * | 2008-10-20 | 2009-03-18 | 四川虹微技术有限公司 | A Hole Filling Method for View Synthesis |
CN103248909A (en) * | 2013-05-21 | 2013-08-14 | 清华大学 | Method and system of converting monocular video into stereoscopic video |
CN103259960A (en) * | 2013-04-22 | 2013-08-21 | 重庆金山科技(集团)有限公司 | Data interpolation method and device and image output method and device |
-
2015
- 2015-06-23 CN CN201510348382.1A patent/CN104952049B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7277595B1 (en) * | 2003-01-06 | 2007-10-02 | Apple Inc. | Method and apparatus for digital image manipulation to remove image blemishes |
CN101388967A (en) * | 2008-10-20 | 2009-03-18 | 四川虹微技术有限公司 | A Hole Filling Method for View Synthesis |
CN103259960A (en) * | 2013-04-22 | 2013-08-21 | 重庆金山科技(集团)有限公司 | Data interpolation method and device and image output method and device |
CN103248909A (en) * | 2013-05-21 | 2013-08-14 | 清华大学 | Method and system of converting monocular video into stereoscopic video |
Non-Patent Citations (1)
Title |
---|
基于插值的图像修复算法;王茜艳 等;《汕头大学学报(自然科学版)》;20150531;第30卷(第2期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN104952049A (en) | 2015-09-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105046750B (en) | A kind of method of the full jaw tooth triangle grid model of automatic segmentation | |
CN103517069A (en) | HEVC intra-frame prediction quick mode selection method based on texture analysis | |
CN104484469B (en) | One kind supports more non-stop-machine expansion methods of hash map data base cluster systems | |
CN102359042A (en) | Railway track accurate measurement control network establishing method | |
MX385660B (en) | METHOD AND APPARATUS FOR DETECTING DEFECTS ON THE SURFACE OF TIRES. | |
WO2012161431A3 (en) | Method for generating an image of the view around a vehicle | |
CN104952049B (en) | Based on the image repair method for facing domain diverging interpolation | |
CN105306944A (en) | Chrominance component prediction method in hybrid video coding standard | |
JP2014102202A5 (en) | ||
CN108346135B (en) | An Improved Criminisi Image Inpainting Method | |
CN103916876B (en) | A kind of method, apparatus and communication network for calculating whole network covering | |
CN107038446A (en) | A kind of night double fruits overlapping tomato recognition methods detected under active illumination based on overlapping edge | |
CN105386375A (en) | Area based steel rail grinding method | |
WO2020146416A3 (en) | Deformation reduction in three-dimensional object formation | |
CN101820546A (en) | Intra-frame prediction method | |
CN104837000A (en) | Virtual viewpoint synthesis method using contour perception | |
CN102447925A (en) | Virtual viewpoint image synthesis method and device | |
CN107610092A (en) | Pavement crack dynamic testing method based on video flowing | |
CN103177260A (en) | Color image boundary extraction method | |
CN109087370B (en) | A method for generating images of spongy defects in castings | |
JP2012104099A5 (en) | ||
CN103164847A (en) | Method for eliminating shadow of moving target in video image | |
SA115360319B1 (en) | Method for analyzing the wall thickness distribution of a pipe | |
CN109885899A (en) | Extraction method of multi-layer graphic data for spacecraft thermal control | |
CN107330906A (en) | Improvement thinning algorithm based on curve matching |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |