Periodic image hole filling method and system
By employing multi-scale gradient coupling and nonlinear dynamic attenuation mechanisms, combined with smoothing of grayscale statistical curves, the jagged edge problem in periodic image hole filling is solved, achieving high-precision adaptive hole filling and improving automation and adaptability.
Patent Information
- Application Number
- CN202511555222.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-10-29
AI Technical Summary
Existing technologies tend to produce jagged edges in the transition areas when filling periodic image holes, affecting filling accuracy, and have low automation and poor adaptability.
By employing multi-scale gradient coupling and nonlinear dynamic attenuation mechanisms, and smoothing grayscale statistical curves, filling data is obtained to achieve adaptive hole filling, and high-precision filling is achieved by combining grayscale distribution patterns.
It effectively avoids the influence of image noise on the filling results, improves filling accuracy, solves the jagged edge transition area problem, and achieves adaptive high-precision hole filling.
Smart Images

Figure CN121033035B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of digital image processing, and particularly relates to a periodic image hole filling method and system. BACKGROUND
[0002] Image hole filling is a key technology of digital image processing, and is mainly used for repairing blank areas in binary or grayscale images caused by data loss, noise interference or acquisition restrictions. The image hole filling technology is widely used in medical image repair, industrial detection, remote sensing image processing and other fields, and the core goal is to maintain the continuity of image structure and the integrity of semantic.
[0003] At present, the methods of image hole filling mainly include morphological processing, connected domain analysis, flood fill algorithm and texture synthesis, but the above methods all have defects and deficiencies, for example, in the prior art, the morphological processing method is used for image hole filling, the closed operation is used for filling closed holes, the kernel size is relied on and the universality is poor, the parameters need to be manually adjusted, and it is difficult to balance the filling accuracy and the calculation efficiency; the connected domain analysis method is only suitable for regular holes, and the processing effect is poor for irregular holes (such as texture fracture and multi-scale holes) by interpolation or adjacent pixel filling after marking the holes; the flood fill algorithm is a method of filling holes based on region growing, and the degree of automation is low; the above three methods have a common shortcoming that they are not suitable for filling images with periodic texture. The intelligent filling based on texture synthesis, such as the contour drawing method of OpenCV (open source image processing library), has limited adaptability to complex background, especially in the edge transition area, which is easy to produce sawtooth or fuzzy effect, affecting the filling accuracy.
[0004] Therefore, the prior art needs to be further developed. SUMMARY
[0005] The present application aims to overcome the above technical deficiencies, and provides a periodic image hole filling method and system to solve the technical problem that sawteeth are generated in the edge transition area after the periodic image hole filling in the related art, affecting the filling accuracy.
[0006] To achieve the above technical purpose, the present application adopts the following technical scheme: a periodic image hole filling method is provided, comprising: pre-processing a periodic image based on a preset image processing model to obtain a hole region, a grayscale reference region and a grayscale statistical curve of the periodic image; smoothing the grayscale statistical curve to obtain a period segmentation node; obtaining filling data based on the hole region and the period segmentation node; and filling holes of the periodic image according to the filling data.
[0007] Furthermore, the method for preprocessing the periodic image includes: correcting the periodic image to obtain a standard periodic image; and performing horizontal and vertical projection on the gray values of the standard periodic image to obtain a gray-scale statistical curve, wherein the gray-scale statistical curve includes a gray-scale statistical curve in the horizontal direction and a gray-scale statistical curve in the vertical direction.
[0008] Furthermore, the method for obtaining the periodic segmentation node includes: performing dual-channel gradient detection based on the gray-scale statistical curve to obtain the gradient points of the gray-scale statistical curve; and smoothing the gray-scale statistical curve according to a weight parameter to obtain the periodic segmentation node, wherein the weight parameter is a dynamic weight parameter.
[0009] Furthermore, the dual-channel gradient detection method includes:
[0010] ;
[0011] The formulas above are for calculating gradients. The first formula is the commonly used gradient calculation formula, i.e., the short-time gradient. The second formula is an improved formula, i.e., the long-time gradient. The third formula is a two-channel gradient coupling calculation formula that combines the two. The design idea is to add information about the neighboring segments before and after the calculation point to maintain the gradient trend. i This is the current gray-level gradient calculation point on the statistical curve. j This is the distance from the current grayscale gradient calculation point. grad s (i) These are short-time gradient detection values. (i+j) The point is added to the current calculation point. j point, (i-j) The point is the subtraction from the current calculation point. j point, y i+j For curve points (i+j) grayscale value, y i-j For curve points (i-j) grayscale value, △x for 2*j The value of, i.e. (i+j) Click (i-j) Distance between points W The width of the standard periodic image, grad l (i) These are long-term gradient detection values. W k The normalized weight vector for the kernel. k It is some integer value between -4 and 4. (i+k) The point is added to the current calculation point. k The point of value, grads (i+k) is a short-time gradient detection value of the point (i+k) , grad fusion is a coupled gradient detection value of the point α , is a coupling weight of the short-time gradient detection, (1-α) is a coupling weight of the long-time gradient detection.
[0012] Further, the method for obtaining the filling data comprises: obtaining a gray distribution rule; obtaining a gray reference array based on the gray reference region and the gray distribution rule; and obtaining the filling data based on the period segmentation node and the gray reference array.
[0013] Further, the gray distribution rule comprises a uniform gray value distribution and a gradual gray value distribution.
[0014] Further, the method for obtaining the filling data comprises: when the gray distribution rule is the uniform gray value distribution, a formula for calculating the gray distribution rule is:
[0015] ;
[0016] The above formula is a mean value formula, wherein a sum formula is used to calculate a gray accumulation value first, and then the mean value is obtained by dividing the element number, wherein, p is a pixel point sequence number of an image, g h (p) is a filling value in a horizontal direction, g v (p) is a filling value in a vertical direction, N is an element number contained in a horizontal direction in the gray reference region, M is an element number contained in a vertical direction in the gray reference region, f is a specific value from 0 , N or M , g href (f) is a gray value of the point f in the horizontal direction reference gray array, g verf (f) is a gray value of the point f in the vertical direction reference gray array, f is a coordinate of the point in the hole region.
[0017] Further, the method for obtaining the filling data comprises: when the gray distribution rule is the gradual gray value distribution, a formula for calculating the gray distribution rule is:
[0018] g h (t)=g h0 ·e -μ(t-t0) ;
[0019] g v (t)=g v0 ·e -μ(t-t0) ;
[0020] g fill (t)=θ·g h (t)+ (1-θ)·g v (t);
[0021] The above formula is the derivation formula of the filling gray value, which is fitted by the gray value of the luminance attenuation pixel, and then fused by the horizontal direction and vertical direction weight to obtain the final pixel coordinate point gray filling value, wherein, g h (t) is the filling value of the horizontal direction, g h0 The distance between the horizontal direction prediction point and the first gray point is equal to the gray value at 0 μ is the attenuation coefficient, t is the current filling point coordinate of the image, t 0 is the coordinate of the first gray point, g v (t) is the filling value of the vertical direction, g v0 is the gray value at d 0 g fill (t) is the derived gray filling value at t θ is the current filling point coordinate of the image, g h (t) is the fusion weight of (1-θ) g v (t) is the fusion weight of
[0022] Also provided is a periodic image hole filling system, comprising: a preprocessing unit configured to preprocess a periodic image based on a preset image processing model to obtain a hole region, a gray reference region and a gray statistical curve of the periodic image; an optimization unit configured to perform smoothing processing on the gray statistical curve to obtain a period segmentation node; a calculation unit configured to obtain filling data based on the hole region and the period segmentation node; and a filling unit configured to fill holes of the periodic image according to the filling data.
[0023] Also provided is a computer readable storage medium having computer readable instructions stored thereon, the computer readable instructions being executed by a processor to implement each step of the periodic image hole filling method or the periodic image hole filling system.
[0024] Advantages:
[0025] 1. The periodic image hole filling method of the present application calculates the change period of the periodic image through multi-scale gradient coupling and nonlinear dynamic attenuation mechanism, provides adaptive segmentation endpoint calculation results, avoids the influence of image noise on the period segmentation result, summarizes the gray change rule of the image in the period, combines the gray distribution rule of the context reference region on the hole region, infers the filling gray of the hole region, realizes the high-precision filling demand of the hole region with adaptive periodic distribution, and solves the technical problem that the existing technology produces sawtooth in the edge transition area after filling the periodic image hole, affecting the filling precision.
[0026] 2. The periodic image hole filling method of the present application automatically calculates the change period of the periodic image based on the projection statistical method, skillfully avoids the low universality problem of manual adjustment of kernel size and preset seed point in morphological processing, and makes the filling gray more smooth based on the statistical mean pixel insertion method, avoiding the problem of sawtooth in the transition edge. BRIEF DESCRIPTION OF DRAWINGS
[0027] Fig. 1 is a periodic image hole filling method flowchart adopted by the embodiment of the present application;
[0028] Fig. 2 is a structural schematic diagram of the periodic image hole filling system adopted by the embodiment of the present application;
[0029] Fig. 3 is a periodic image hole filling method flowchart adopted by the fifth embodiment of the present application;
[0030] Fig. 4 is a flowchart of the method for inferring the period segmentation node adopted by the fifth embodiment of the present application;
[0031] Fig. 5 is a structural diagram of a periodic image hole filling system adopted by the sixth embodiment of the present application;
[0032] Fig. 6 is a schematic diagram of a filling data acquisition method adopted by the present application. DETAILED DESCRIPTION
[0033] In order for those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.
[0034] According to the embodiment of the present application, a periodic image hole filling method is provided, please refer to Figs. 1 to 6 , comprising:
[0035] S100, pre-processing the periodic image based on a preset image processing model to obtain a hole region, a gray reference region and a period segmentation node of the periodic image;
[0036] The preset image processing model includes a hole region positioning unit, a gray reference region acquisition unit and a period segmentation node acquisition unit.
[0037] Specifically, the method for positioning the hole region by the hole region positioning unit includes threshold segmentation, blob analysis processing. First, the suspected hole region is obtained by gray threshold segmentation, and then the suspected region is filtered by using gray mean value, size, shape and other blob analysis, and then the hole region is obtained.
[0038] In specific practice, the method for acquiring the gray reference region by the gray reference region acquisition unit includes: collecting the context gray reference region (i.e. the upper and lower regions of the hole) of the hole region. Taking the horizontal direction as an example, taking the hole region as the middle part, a region larger than 5 periods is collected on both sides as the context gray reference region. However, in special cases, it is necessary to judge whether the collected region exceeds the image boundary. If the period of the region collected on one side is less than 1 period, the collection on that side is abandoned.
[0039] It should be noted that the period segmentation node of the hole region and the period segmentation node of the gray reference region are calculated by using the gray statistical curve of the periodic image respectively, and the period segmentation node of the hole region and the period segmentation node of the gray reference region are a set.
[0040] It should be noted that the periodic image is an image with periodic distribution of light and shade in horizontal and vertical directions, so in a single direction, the gray value distribution is similar to a sine curve, the only difference is that the periodic image mentioned in the present application does not have a standard periodicity, and the period length is different in distribution, so the periodic segmentation node method mentioned in the present application is required, and a fixed period segmentation value cannot be used.
[0041] In the periodic image hole filling method of the present embodiment, the method for obtaining the periodic segmentation node by the periodic segmentation node acquisition unit comprises:
[0042] S110 corrects the periodic image to obtain a standard periodic image;
[0043] Embodiment one:
[0044] In the panel detection industry, the product is pre-aligned with the carrier to ensure that the product is a horizontal image in the camera field of view, but due to alignment errors, the image source may be slightly rotated, so that the obtained periodic image is not a standard horizontal image, so it is necessary to extract the edge of the product in the periodic image, fit a straight line, and correct the direction of the periodic image to obtain a standard periodic image, thereby reducing the statistical error in the subsequent process.
[0045] S120 performs horizontal projection and vertical projection on the gray value of the standard periodic image to obtain a gray statistical curve, wherein the gray statistical curve includes a horizontal gray statistical curve and a vertical gray statistical curve;
[0046] In specific practice, the gray value of the product ROI (region of interest, i.e. target area to be processed) image needs to be projected horizontally and vertically, wherein the horizontal projection is to establish a pixel distribution axis in the X direction of the coordinate system with the width of the ROI image, and the Y axis of the coordinate system is used as the statistical axis of the pixel gray value, that is, taking the b point of the X axis as an example, the gray values of all pixels in the b column of the ROI image are superimposed as the Y value of the b point, and then a gray statistical curve y H in the horizontal direction is formed. V
[0047] Specifically, the formula of the gray statistical curve is as follows:
[0048] ;
[0049] wherein Y b is the Y axis statistical value of the b point on the X axis, (b, a) is the pixel coordinate of the image, h is the height of the ROI image, gray(b, a) is the gray value of the (b, a) coordinate point on the ROI image, and y H The statistical curve is in the horizontal direction, y V The statistical curve is a sin(cx+φ) sine function curve in the vertical direction, and it has a certain periodicity. φ(x) These represent amplitude values of varying degrees caused by factors such as noise or grayscale fluctuations.
[0050] S200 smooths the grayscale statistical curve to obtain periodic segmentation nodes;
[0051] In the periodic image hole filling method of this embodiment, the method for obtaining periodic segmentation nodes includes:
[0052] S210 performs dual-channel gradient detection based on grayscale statistical curves to obtain the gradient points of the grayscale statistical curves;
[0053] Specifically, the dual-channel gradient detection method includes:
[0054] ;
[0055] The formulas above are for calculating gradients. The first formula is the commonly used gradient calculation formula, i.e., the short-time gradient; the second formula is an improved formula, i.e., the long-time gradient; and the third formula is a dual-channel gradient coupling calculation formula, designed to incorporate information about the neighboring segments before and after the calculation point to maintain the gradient trend. i This is the current gray-level gradient calculation point on the statistical curve. j This is the distance from the current grayscale gradient calculation point. grad s (i) These are short-time gradient detection values. (i+j) The point is added to the current calculation point. j point, (i-j) The point is the subtraction from the current calculation point. j point, y i+j For curve points (i+j) grayscale value, y i-j For curve points (i-j) grayscale value, △x for 2*j The value of, i.e. (i+j) Click (i-j) Distance between points W The width of the standard periodic image, grad l (i) These are long-term gradient detection values. W k The normalized weight vector for the kernel. k It is some integer value between -4 and 4. (i+k) The point is added to the current calculation point. kthe point of the value, grad s (i+k) the point of the value (i+k) the short-time gradient detection value, grad fusion the coupled gradient detection value, α is a coupling weight of the short-time gradient detection, (1-α) is a coupling weight of the long-time gradient detection.
[0056] It should be noted that in the periodic image hole filling method of the embodiment, a multi-scale gradient coupling mechanism is introduced, wherein the multi-scale gradient coupling refers to using a double-channel gradient detection curve gradient point. Generally, a single gradient detection method needs to set a suitable filter parameter to avoid incomplete removal of image noise or excessive filtering, resulting in loss of too much original real data. The double-channel gradient detection includes short-time gradient detection and long-time gradient detection. The short-time gradient detection is a discrete data derivation, that is, the difference between the values before and after the current point is divided by the distance value between the two points before and after the current point, which is used to capture instantaneous changes, filter image noise, and avoid losing too much original real data. However, it is sensitive to image high-frequency noise and easy to produce pseudo-undulation signals. The long-time gradient detection is a weighted convolution windowed calculation, such as establishing a Gaussian kernel. The Gaussian kernel is used to perform long-time gradient detection on the short-time gradient detection, and the normalized Gaussian kernel is weighted for each short-time gradient detection. This method is sensitive to image high-frequency noise and can remove the influence of image high-frequency noise while retaining the trend characteristics of the data. Finally, the short-time gradient detection and the long-time gradient detection are coupled to realize the complementarity of the double-scale gradient detection, which can filter high-frequency interference and maintain edge sharpness, balances sensitivity and stability, and shows stronger generalization ability in a complex image noise environment.
[0057] S220 smoothing the gray scale statistical curve according to a weight parameter to obtain the periodic segmentation node, wherein the weight parameter is a dynamic weight parameter.
[0058] Specifically, the nonlinear dynamic attenuation mechanism is used to dynamically adjust the weight of the current smoothing according to the gradient information, that is, in the low gradient area, the weight is dynamically adjusted to a larger weight to maintain a larger smoothing force, thereby filtering the influence of image noise; in the high gradient area, the weight is dynamically adjusted to a smaller weight, the smoothing force is small, and the curve trend change characteristics are retained, and the smoothing weight value of each point can be dynamically solved.
[0059] It should be noted that the principle of the nonlinear dynamic attenuation mechanism is as follows:
[0060] ;
[0061] The design idea is to use βThe parameter value varies according to the change of the gradient value of different points, and the value in the formula is set by experience, thereby W i The weight value is dynamically adjusted according to the change of the gradient value. Among them, i and the weight value in S210 in Embodiment I i have the same meaning, which is a certain coordinate point on the statistical curve, W i is i the smoothing weight value of the point, β controls the weight decrease rate, and the greater the value, the more sensitive to the gradient change, |grad fusion | represents the absolute value of the gradient of the first i point, which is used to quantify the change strength of the statistical value, τ is a preset gradient threshold value (the experience value is usually 1.5-2 times of the gradient standard deviation), μ g is the average value of the gradient detection value, N is the number of gradient detection values, σ g is the standard deviation of the gradient detection value.
[0062] Finally, the statistical curve is smoothed in real time according to the dynamic weight parameter, the sawtooth-shaped mutation in the curve is eliminated, the problem of false fluctuation points caused by pixel gray jump or image noise when the curve is derived is solved, and the problem of error in period end point segmentation is solved.
[0063] Specifically, the formula for curve smoothing processing is:
[0064] ;
[0065] Among them, i and the weight value in S210 in Embodiment I i have the same meaning, which is a certain coordinate point on the statistical curve, f is an integer value between -2 and 2, y s (i) is the value of the statistical curve i after point smoothing, C f is a weight coefficient.
[0066] S300 obtains filling data based on the hole region and the period segmentation node;
[0067] In the periodical image hole filling method of the embodiment, the method for obtaining the filling data comprises:
[0068] S310 obtains a gray distribution rule;
[0069] S320 obtains the gray reference array based on the gray reference region and the gray distribution rule in the gray reference region; wherein the gray distribution rule includes uniform distribution of gray values and gradual distribution of gray values.
[0070] It should be noted that the method of obtaining the gray distribution rule includes taking the periodic division nodes of the gray reference region and the periodic division nodes of the hole region as the starting and ending points of the speculation of the gray distribution rule.
[0071] Specifically, if the context gray reference region gray mean values of the collected hole region are similar, it is considered that the overall gray distribution of the image filling region (i.e. the hole region) and the reference region is relatively uniform; if the context gray reference region gray mean values of the collected hole region are not similar, it is considered that the overall gray distribution of the image filling region and the reference region exists gradual change.
[0072] Embodiment two:
[0073] The method of obtaining the gray reference array in this embodiment includes:
[0074] Taking the periodic division node of the gray reference region as the starting point, the gray reference array is formed by respectively obtaining the gray values of the reference points in the context gray reference region corresponding to the filling points in the hole region, and then the gray value to be filled in the hole is speculated, and the filling coordinates of the hole are cycled until the filling is completed.
[0075] S330 obtains the filling data based on the periodic division node and the gray reference array.
[0076] Embodiment three:
[0077] In the periodic image hole filling method of this embodiment, the gray distribution rule is uniform distribution of gray values, and the method of obtaining the filling data includes:
[0078] ;
[0079] The above formula is a mean value formula, the numerator first calculates the gray accumulation value using the summation formula, and then divides the element number to obtain the mean value. Wherein, p is the image pixel point sequence number, g h (p) is the filling value in the horizontal direction, g v (p) is the filling value in the vertical direction, N is the element number contained in the horizontal direction in the gray reference region, M is the element number contained in the vertical direction in the gray reference region, f is from 0, NOr M A specific value, g href (f) The gray value of the point in the horizontal direction reference gray array f The gray value of the point, g verf (f) The gray value of the point in the vertical direction reference gray array f The gray value of the point, f The coordinates of the point are the coordinates of the hole region.
[0080] Embodiment four:
[0081] In the periodic image hole filling method of the present embodiment, the gray value gradually distributes according to the gray distribution rule, wherein the method for obtaining the filling data comprises:
[0082] g h (t)=g h0 ·e -μ(t-t0) ;
[0083] g v (t)=g v0 ·e -μ(t-t0) ;
[0084] g fill (t)=θ·g h (t)+ (1-θ)·g v (t);
[0085] The above formula is the derivation formula of the filling gray value, which is fitted by the gray value of the brightness attenuation pixel, and then fused by the horizontal direction and vertical direction weight to obtain the final pixel coordinate point gray filling value. Wherein, g h (t) The filling value in the horizontal direction is g h0 The gray value at the distance equal to 0 between the horizontal direction prediction point and the first gray point, μ The attenuation coefficient is t The current filling point coordinates of the image are t 0 The coordinates of the first gray point are g v (t) The filling value in the vertical direction is g v0 The vertical directiond the gray value at the position equal to 0, g fill (t) is t the derived gray fill value at the position equal to 0, θ is g h (t) the fusion weight of, (1-θ) is g v (t) the fusion weight of.
[0086] Embodiment Five:
[0087] Referring to Fig. 3 , the embodiment provides a periodic image hole filling method, comprising the following steps:
[0088] ①Receiving image input start.
[0089] ②Image horizontal direction correction and ROI image interception.
[0090] ③Collecting context gray reference area of hole position on ROI image.
[0091] ④Setting the default speculation direction as horizontal direction.
[0092] ⑤Calculating speculation period division node, referring to Fig. 4 , the method of speculation period division node comprises:
[0093] I, setting the projection direction as horizontal direction.
[0094] II, gray projection, generating gray projection curve.
[0095] III, detecting curve gradient point using the method of double-channel multi-scale gradient detection coupling.
[0096] IV, calculating the smoothing weight of curve point based on gradient point using nonlinear adaptive method, which can dynamically adjust the weight coefficient of each point.
[0097] V, smoothing the projection statistical curve based on the smoothing weight, eliminating curve sawtooth and gray noise.
[0098] VI, calculating zero value point by deriving the smoothed curve, and the point with low to high gray statistics value is taken as the period division point of horizontal direction.
[0099] VII, judging the current projection direction, if the projection direction is horizontal direction, returning to step I, setting the projection direction as vertical direction, repeating the above steps to obtain the period division point of vertical direction, otherwise ending.
[0100] VI. Inducing the gray scale distribution law of the context reference region, and judging whether the current distribution law is gray scale uniform or gray scale gradual.
[0101] VII. If the distribution law is gray scale gradual, then using the gray scale value filled based on the gradual fitting prediction, and if the distribution law is gray scale uniform, then using the gray scale value filled based on the statistical mean prediction.
[0102] VIII. Judging the current prediction direction, and if it is the horizontal direction, then returning to step IV, setting the prediction direction to the vertical direction, and otherwise ending.
[0103] IX. Weighted fusion of the prediction gray scale values of the two directions to obtain the final filled gray scale value.
[0104] XI. Judging whether all the pixels in the hole are filled, and if yes, then ending the filling, and otherwise returning to step IV.
[0105] Referring to Fig. 2 The embodiment provides a periodic image hole filling system, which comprises:
[0106] a preprocessing unit, which is used for preprocessing the periodic image based on a preset image processing model to obtain a hole region and an initial periodic segmentation node of the periodic image;
[0107] an optimization unit, which is used for smoothing the initial periodic segmentation node to obtain an optimized periodic segmentation node;
[0108] a calculation unit, which is used for obtaining filling data based on the hole region and the optimized periodic segmentation node;
[0109] a filling unit, which is used for filling the hole of the periodic image based on the filling data.
[0110] Embodiment six:
[0111] Referring to Fig. 5 The embodiment provides a periodic image hole filling system, which comprises:
[0112] extracting an image hole region, collecting a context gray scale reference region of the hole region, automatically obtaining a periodic segmentation point module, predicting a filled gray scale value module, and cyclically filling a hole pixel gray scale.
[0113] Thus, when receiving the image, firstly, the image hole region is extracted, the hole position needing to be filled in the current image is located, the hole region actually filled needs to be extended by a small number of pixels outside the hole contour, then the context gray reference region of the hole region is collected, the normal pixel region around the hole needing to be filled is intercepted, the context is the up, down, left and right of the hole, and the reference region is generally about 5 complete periods, which is relatively suitable, secondly, the period division point is calculated in the context reference region and the hole region respectively by using the method of the automatic period division point acquisition module, and the period division point is shown in the following figure. Fig. 6 Taking a row of pixels in a reference region image as an example, the image in the figure is divided into 5 periods by the period division point, and the pixel points pointed by the red arrows are the first serial number of pixels in each period, thereby forming the gray reference set of the first to-be-filled pixel point in the period in the filling region, then the first to-be-filled gray value in the period in the hole is calculated by using the method of the speculative filling gray value module, and the above steps are used in a loop until all the pixels in the hole are filled, so that the complete image after filling can be acquired.
[0114] The embodiment provides a computer readable storage medium, and computer readable instructions are stored on the computer readable storage medium, and the computer readable instructions are executed by a processor to realize each step of the periodical image hole filling method or the periodical image hole filling system according to any one of the above.
[0115] The embodiment of the application can adopt the form of a computer program product implemented on one or more storage media (including but not limited to disk memory, CD-ROM, optical memory and the like) containing program code. The computer readable storage medium includes permanent and non-permanent, removable and non-removable media, and can be realized by any method or technology. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer readable storage media include, but are not limited to: new memory such as phase change memory / resistive memory / magnetic memory / ferroelectric memory (PRAM / RRAM / MRAM / FeRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0116] It should be noted that the terms "first", "second" and the like in the description and in the claims of the present application are used for distinguishing between similar objects and not necessarily for describing a sequential or chronological order. It is to be understood that the data used herein can be interchanged, in suitable cases, to describe the embodiments of the application described herein in other than the given order. Additionally, the terms "comprises", "comprising", "includes", "including", "having" and their conjugates, as used herein, are intended to be open ended, i.e., to mean including, but not limited to. To the extent any of the foregoing descriptions contain terms or phrases that are not commonly used in the art, such terms and phrases are intended to be interpreted in a functional sense, i.e., to mean that the described device, method, system, product or apparatus can perform the function described by the term or phrase, and not necessarily in a manner which is the same as the term or phrase is commonly used in the art.
[0117] Optionally, the specific examples in the embodiments can refer to the examples described in the above embodiments, and the embodiments will not be described here again.
[0118] The serial numbers of the embodiments of the application described above are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0119] In the above embodiments of the application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0120] The above is only the preferred embodiment of the application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the application, can make a number of improvements and refinements, these improvements and refinements should be considered as the protection scope of the application.
Claims
1. A method of periodic image hole filling, the method comprising: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: , where i is the current gray level gradient calculation point on the statistical curve, j is the distance from the current gray level gradient calculation point, grad s (i) is the short-time gradient detection value, the (i+j) point is the point after adding j to the current calculation point, the (i-j) point is the point after subtracting j from the current calculation point, y i+j is the gray level value of the curve point (i+j), y i-j is the gray level value of the curve point (i-j), Δx is the value of 2*j, i.e. the distance between the (i+j) point and the (i-j) point, W is the width of the standard periodic image, grad1(i) is the long-time gradient detection value, W k is the normalized weight vector of the kernel, k is an integer value between -4 and 4, the (i+k) point is the point after adding k to the current calculation point, grad s (i+k) is the short-time gradient detection value of the point , grad fusion is the coupled gradient detection value, α is the coupling weight of the short-time gradient detection, and (1-α) is the coupling weight of the long-time gradient detection; The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: ; wherein p is the image pixel point serial number, g h (p) is the horizontal direction filling value, g v (p) is the vertical direction filling value, N is the horizontal direction contained element number in the gray reference area, M is the vertical direction contained element number in the gray reference area, f is from 0, N or M specific certain value, g href (f) is the horizontal direction reference gray array f point gray value, g verf (f) is the vertical direction reference gray array f point gray value, f point is the hole area coordinate; The method comprises the following steps: ; wherein g h (t) is the filling value in horizontal direction, g h0 is the gray value at which the distance between the horizontal direction prediction point and the first gray point equals 0, μ is the decay coefficient, t is the current filling point coordinate of the image, t0 is the coordinate of the first gray point, g v (t) is the filling value in vertical direction, g v0 is the gray value at which the vertical direction d equals 0, g fill (t) is the derived gray filling value at t, θ is the fusion weight of g h (t), (1-θ) is the fusion weight of g v (t); The method comprises the following steps:
2. The method of claim 1, wherein, The method comprises the following steps: The method comprises the following steps: The method comprises the following steps:
3. A periodic image hole filling system for carrying out the periodic image hole filling method according to any one of claims 1-2, characterized by, The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps:
4. A computer-readable storage medium having stored thereon computer-readable instructions, wherein, The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the following steps: The method comprises the
Citation Information
Patent Citations
Real-time visual detection and identification method for high speed rail surface defect
CN102854191A
Medical image quality enhancement system based on big data
CN119963548A