CN106296605A - A kind of image mending method and device - Google Patents

A kind of image mending method and device Download PDF

Info

Publication number
CN106296605A
CN106296605A CN201610638285.0A CN201610638285A CN106296605A CN 106296605 A CN106296605 A CN 106296605A CN 201610638285 A CN201610638285 A CN 201610638285A CN 106296605 A CN106296605 A CN 106296605A
Authority
CN
China
Prior art keywords
region
repaired
image
subregion
best matching
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.)
Granted
Application number
CN201610638285.0A
Other languages
Chinese (zh)
Other versions
CN106296605B (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610638285.0A priority Critical patent/CN106296605B/en
Publication of CN106296605A publication Critical patent/CN106296605A/en
Application granted granted Critical
Publication of CN106296605B publication Critical patent/CN106296605B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the invention discloses image mending method and device, be applied to technical field of information processing.In the method for the present embodiment, image mending device can calculate the COLOR COMPOSITION THROUGH DISTRIBUTION information in region to be repaired according to color smoothing algorithm, and be adjusted according to the color information of best matching blocks corresponding to the COLOR COMPOSITION THROUGH DISTRIBUTION information subregion to setting according to region to be repaired, the average color allowing to carry out the best matching blocks after adjustment is consistent with the average color of corresponding subregion, then treats the image of repairing area further according to the best matching blocks after adjusting and repairs.The color of the image represented by the COLOR COMPOSITION THROUGH DISTRIBUTION information of above-mentioned calculating is smoother, do not have lofty sensation, if the average color of the best matching blocks after Tiao Zhenging is consistent with the average color of corresponding subregion, then repair the image in region to be repaired according to the best matching blocks after adjusting after, after repairing, the color of image is the most smoother, and texture also has smooth effect simultaneously.

Description

A kind of image mending method and device
Technical field
The present invention relates to technical field of information processing, particularly to a kind of image mending method and device.
Background technology
The application program of the most many image procossing, the most everyday P figure, the application programs such as U.S. figure is elegant, beauty's camera are all There is image beautifying functions.Such as during the eyebrow in beautifying character image, specifically when beautifying first by character image mesophryon The image in territory, hair-fields is scratched, and then utilizes image mending method to paste a new eyebrow image again, to reach new eyebrow type effect. Wherein, when the image of the brow region scratched is repaired, can first repair with the skin texture images around eyebrow The region scratched, pastes a new eyebrow image the most again, so can reach the effect of nature transition.Above-mentioned image is repaiied Compensating method can also be applied to beautifying in mending course other image, such as landscape photograph.
When above-mentioned existing image mending method is for repairing the image with complex texture background, effect is preferable, such as wind Jing Zhao, and when repairing the image of single grain background, it may appear that the problem that repair efficiency continuity is bad.
Summary of the invention
The embodiment of the present invention provides a kind of image mending method and device, it is achieved that enter the color information of best matching blocks After Row sum-equal matrix, repair the image in region to be repaired by the best matching blocks after adjustment.
The embodiment of the present invention provides a kind of image mending method, including:
Color smoothing algorithm according to image calculates the COLOR COMPOSITION THROUGH DISTRIBUTION information in the region to be repaired of image;
Searching the best matching blocks that the subregion according to the setting of described region to be repaired is corresponding, described best matching blocks is corresponding Region outside region to be repaired described in described image, wherein, described subregion includes a certain portion in described region to be repaired Subregion;
According to described COLOR COMPOSITION THROUGH DISTRIBUTION information, the color information of described best matching blocks is adjusted so that carry out described tune The average color of the best matching blocks after whole is consistent with the average color of corresponding subregion;
According to the best matching blocks after described adjustment, the image in described region to be repaired is repaired.
The embodiment of the present invention provides a kind of image mending device, including:
Distribution computing unit, calculates the COLOR COMPOSITION THROUGH DISTRIBUTION in the region to be repaired of image for the color smoothing algorithm according to image Information;
Search unit, for searching the best matching blocks that the subregion according to the setting of described region to be repaired is corresponding, described Region outside region to be repaired described in the corresponding described image of best matching blocks, wherein, described subregion includes described to be repaired Mend a certain subregion in region;
Adjustment unit, for the color information of described best matching blocks being adjusted according to described COLOR COMPOSITION THROUGH DISTRIBUTION information, The average color allowing to carry out the best matching blocks after described adjustment is consistent with the average color of corresponding subregion;
Repair unit, for the image in described region to be repaired being repaiied according to the best matching blocks after described adjustment Mend.
Visible, in the method for the present embodiment, image mending device can calculate region to be repaired according to color smoothing algorithm COLOR COMPOSITION THROUGH DISTRIBUTION information, and according to best matching blocks corresponding to the COLOR COMPOSITION THROUGH DISTRIBUTION information subregion to setting according to region to be repaired Color information be adjusted so that the average color of the average color of the best matching blocks after being adjusted and corresponding subregion Unanimously, then treat the image of repairing area further according to the best matching blocks after adjusting to repair.Color due to above-mentioned calculating The color of color image represented by distributed intelligence is smoother, does not have lofty sensation, if the best matching blocks after Tiao Zhenging Average color with the average color of corresponding subregion consistent, then repair region to be repaired according to the best matching blocks after adjusting After image, after repairing, the color of image is the most smoother, and texture also has smooth effect simultaneously, so that repairing single stricture of vagina When managing the image of background, after repairing, the continuity of image is preferable.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing In having technology to describe, the required accompanying drawing used is briefly described, it should be apparent that, the accompanying drawing in describing below is only this Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, also may be used To obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the method flow diagram of a kind of image mending method that the embodiment of the present invention provides;
Fig. 2 is the method flow diagram of a kind of image mending method provided in Application Example of the present invention;
Fig. 3 is the schematic diagram of the image that image mending device repairs a certain subregion in Application Example of the present invention;
Fig. 4 a is the schematic diagram of character image in the embodiment of the present invention;
Fig. 4 b is to be scratched the schematic diagram of character image after the image of brow region in the embodiment of the present invention;
Fig. 4 c be in the embodiment of the present invention after the COLOR COMPOSITION THROUGH DISTRIBUTION information calculating region to be repaired the schematic diagram of character image;
Fig. 4 d is the schematic diagram after the image mending treating repairing area in the embodiment of the present invention;
Fig. 4 e is the schematic diagram after the image mending treating repairing area in prior art;
Fig. 5 is the structural representation of a kind of image mending device that the embodiment of the present invention provides;
Fig. 6 is the structural representation of the another kind of image mending device that the embodiment of the present invention provides;
Fig. 7 is the structural representation of a kind of terminal unit that the embodiment of the present invention provides.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Describe, it is clear that described embodiment is only a part of embodiment of the present invention rather than whole embodiments wholely.Based on Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under not making creative work premise Embodiment, broadly falls into the scope of protection of the invention.
Term " first " in description and claims of this specification and above-mentioned accompanying drawing, " second ", " the 3rd " " Four " etc. (if present) is for distinguishing similar object, without being used for describing specific order or precedence.Should manage Solve the data so used can exchange in the appropriate case, in order to embodiments of the invention described herein such as can be to remove Order beyond those that here illustrate or describe is implemented.Additionally, term " includes " and " having " and theirs is any Deformation, it is intended that cover comprising not exclusively, such as, contain series of steps or the process of unit, method, system, product Product or equipment are not necessarily limited to those steps or the unit clearly listed, but can include the most clearly listing or for this Other step that a little processes, method, product or equipment are intrinsic or unit.
The embodiment of the present invention provides a kind of image mending method, mainly by the method performed by image mending device, stream Journey figure is as it is shown in figure 1, include:
Step 101, calculates the COLOR COMPOSITION THROUGH DISTRIBUTION information in the region to be repaired of image according to the color smoothing algorithm of image.
It is appreciated that when subregional image in the middle part of needs beautify a certain image, can be first by the figure of this subregion As scratching, then using the region scratched as the region to be repaired of image, and this region to be repaired is performed the step of the present embodiment Rapid 101 to 104.
In the present embodiment, if the color information of each position, color here in COLOR COMPOSITION THROUGH DISTRIBUTION information spinner region to be repaired Information can be pixel value, and generally, each pixel comprises 3 components of RGB and a transparency component, data Form is RGBA, is red respectively, green, blue, alpha, and transparency component typically all 255 need not process, and RGB is each The value of component is the most all between 0~255, and the most each pixel needs to represent by 4 component values.
Image mending device, when calculating COLOR COMPOSITION THROUGH DISTRIBUTION information, can calculate according to color smoothing algorithm, specifically, permissible It is Multi-dimension interpolation method, specifically can be using the color information of multiple positions of zone boundary to be repaired as initial given value;Then According to the color information of other position in this initial given value and preset function step by step calculation region to be repaired, specifically, figure As repair apparatus can calculate the color information of another location, the color of such another location according to initial given value and preset function Multimedia message can serve as a given value thus calculates the color information of other position further according to this given value, with this Analogize the color information that just can calculate all positions, region to be repaired, and the figure that the COLOR COMPOSITION THROUGH DISTRIBUTION information so calculated represents The color of picture smooths, and does not have lofty sensation.
Step 102, searches the best matching blocks that the subregion set according to region to be repaired is corresponding, this best matching blocks pair Answering the region outside region to be repaired in image, wherein, the subregion set according to region to be repaired includes region to be repaired A certain subregion.
Specifically, image mending device, when searching best matching blocks, first can determine from the beginning of the border in region to be repaired One sub regions, this subregion be on zone boundary to be repaired a little centered by a region, then this subregion wraps Having included Part I and Part II, Part I is a certain subregion or Zone Full, the Part II in region to be repaired For the subregion outside region to be repaired;Then image mending device can be searched from other region outside region to be repaired To multiple regions that size is identical with the size of this subregion;Calculate image texture information and this subregion in multiple region respectively The matching degree of image texture information, and by these multiple regions, the image texture information of image texture information and this subregion The maximum region of matching degree as the best matching blocks of this subregion, and for this best matching blocks perform step 103 and 104.The wherein calculating calculating usually Euclidean distance of matching degree.
After having repaired this subregion, this subregion can be labeled as known region, then image mending device again with Same method repairs another subregion, by that analogy, until this region to be repaired has all been repaired.Visible, one In the case of as, the repairing for the image in a region to be repaired needs through repeatedly, then after first repairing during, It is to be repaired that the sub regions that image mending device sets according to region to be repaired is specially with after repairing at least one times Region more borderline centered by a region.
Step 103, is adjusted the color information of best matching blocks according to COLOR COMPOSITION THROUGH DISTRIBUTION information so that after being adjusted The average color of best matching blocks consistent with the average color of corresponding subregion, average color here can be average by pixel Value represents.
Specifically, if the COLOR COMPOSITION THROUGH DISTRIBUTION information that above-mentioned steps 101 calculates includes the picture of each position in region to be repaired Element value, then image mending device is when performing this step, first determines the second pixel average of this best matching blocks, and according to treating In a certain subregion of repairing area, the pixel value of each position determines the first picture of the subregion corresponding with best matching blocks Element meansigma methods;Then in best matching blocks, on the basis of the pixel value of each position, increase pixel value increment respectively be adjusted After best matching blocks in the pixel value of each position, wherein, pixel value increment is that the first pixel average is put down with the second pixel The difference of average.The pixel average of the best matching blocks after so adjusting is above-mentioned first pixel average so that adjust After the average color of best matching blocks consistent with the average color of corresponding subregion.
Especially, for coloured image, some region of pixel average is the identical of each position in this region The meansigma methods of the numerical value of component, the pixel average finally given also includes 4 component values.
Step 104, the image treating repairing area according to the best matching blocks after adjusting is repaired.
After have adjusted a best matching blocks according to above-mentioned steps 103, image mending device can with after adjusting The sub regions that the image completion of good match block is corresponding, the image information of the best matching blocks after will adjusting saves as correspondence The image information of subregion, image information can include COLOR COMPOSITION THROUGH DISTRIBUTION information here, image texture information, image size etc., its Middle COLOR COMPOSITION THROUGH DISTRIBUTION information includes, by the color information after the adjustment that above-mentioned steps 103 obtains, thus can repairing to be repaired The a certain subregion in region or the image of Zone Full.After the same method, image mending device can be according to above-mentioned step Rapid 103 adjust after other best matching blocks repair the other parts image in region to be repaired, until complete by region to be repaired Till portion has all repaired in region.
Visible, in the method for the present embodiment, image mending device can calculate region to be repaired according to color smoothing algorithm COLOR COMPOSITION THROUGH DISTRIBUTION information, and according to best matching blocks corresponding to the COLOR COMPOSITION THROUGH DISTRIBUTION information subregion to setting according to region to be repaired Color information be adjusted so that the average color of the average color of the best matching blocks after being adjusted and corresponding subregion Unanimously, then treat the image of repairing area further according to the best matching blocks after adjusting to repair.Color due to above-mentioned calculating The color of color image represented by distributed intelligence is smoother, does not have lofty sensation, if the best matching blocks after Tiao Zhenging Average color with the average color of corresponding subregion consistent, then repair region to be repaired according to the best matching blocks after adjusting After image, after repairing, the color of image is the most smoother, and texture also has smooth effect simultaneously, so that repairing single stricture of vagina When managing the image of background, after repairing, the continuity of image is preferable.
The method with a concrete application example, the embodiment of the present invention being described below, is image mending in the present embodiment The method for repairing and mending that eyebrow in character image is carried out by device, flow chart is as in figure 2 it is shown, specifically include:
Step 201, scratches the image of brow region in character image, using the region scratched as region to be repaired, then Region outside region to be repaired in this character image is designated as known region.Such as shown in Fig. 3-a, region to be repaired is designated as Ω (region of colourless filling in Fig. 3), is designated as Φ (with yellow and the blue region filled in Fig. 3) by known region.
Step 202, according to the COLOR COMPOSITION THROUGH DISTRIBUTION information in interpolation calculation region to be repaired, in region the most to be repaired each The pixel value of position.Wherein, using the pixel value of the multiple points on zone boundary to be repaired as initial given value, and according to predetermined Function calculate each position, region to be repaired pixel value.
Step 203, determines the sub regions centered by a some p on zone boundary to be repaired, generally n*n picture The square area of element, this subregion includes a part of known region and a part of region to be repaired.As shown in Fig. 3-b, will be with A sub regions centered by some p is designated as ψ.
Step 204, searches the best matching blocks that this subregion is corresponding, such as, shown in Fig. 3-c, image mending device is first searched To respectively by q ' and q " centered by two region ψ 1 and ψ 2, its size is all identical with the size of this subregion ψ, if Liang Ge district In territory, some region of image texture information is relatively big with the matching degree of the image texture information of this subregion, then made in this region Best matching blocks for this subregion.
Then the COLOR COMPOSITION THROUGH DISTRIBUTION information that image mending device calculates according to above-mentioned steps 202 color to this best matching blocks Information is adjusted, and specifically, increases a pixel value on the basis of the pixel value of each position of best matching blocks respectively Increment be adjusted after best matching blocks in the pixel value of each position, this pixel value increment is that the pixel of corresponding subregion is put down The difference of the pixel average of average and this best matching blocks.
Wherein, the pixel average of subregion is the meansigma methods of the pixel value of each position of subregion, due to this subregion Including a part of known region and a part of region to be repaired, then need from image mending device, extract this part known region In the pixel value of each position, and the COLOR COMPOSITION THROUGH DISTRIBUTION information calculated according to above-mentioned steps 202 obtains in this part region to be repaired The pixel value of each position, calculates pixel average the most again.
Step 205, with subregion corresponding to the image completion of the best matching blocks after adjustment, such as, shown in Fig. 3-d, will adjust The image completion of the best matching blocks after whole is to corresponding subregion ψ.
Step 206, it is judged that region to be repaired has the most all been repaired, if it is, terminate flow process, if it is not, then perform Step 207.
Step 207, centered by determining a borderline point in the region to be repaired after repairing at least one times Another subregion, the square area of generally n*n pixel, this subregion includes a part of known region and a part of to be repaired Mend region, and for another subregion, return and perform step 204.
Such as in the character image of Fig. 4 a, the background of eyebrow is single skin texture figure, by the eyebrow district in this image Territory is scratched, and the region scratched is region to be repaired as shown in Figure 4 b.According to the method for the present embodiment, when according to above-mentioned steps 202 COLOR COMPOSITION THROUGH DISTRIBUTION information calculating region to be repaired after storing this COLOR COMPOSITION THROUGH DISTRIBUTION information, image mending device just can show Show the image that color is smoother, as illustrated in fig. 4 c;When according to above-mentioned steps 203 to 207, the image in region to be repaired is all repaired After complete, image mending device just can show that texture is smoother, and the image that color is smoother, as shown in figure 4d;Finally exist again After new eyebrow image is sticked in relevant position, the image beautified just compares nature.If according to image mending in prior art Method is treated after repairing area repairs, and the continuity of the image that image mending device shows is not fine, as shown in fig 4e. Visible, if the method for the present embodiment can well solve the image repairing single grain background in prior art, repair The problem that the continuity of rear image is bad.
The embodiment of the present invention also provides for a kind of image mending device, and its structural representation is as it is shown in figure 5, specifically can wrap Include:
Distribution computing unit 10, the color for the region to be repaired that the color smoothing algorithm according to image calculates image divides Cloth information;Described distribution computing unit 10, specifically for making the color information of multiple positions of described zone boundary to be repaired For initial given value, calculate the color of other position in described region to be repaired according to described initial given value and preset function Information.
Search unit 11, for searching the best matching blocks that the subregion according to the setting of described region to be repaired is corresponding, institute State the region outside region to be repaired described in the corresponding described image of best matching blocks, wherein, described subregion include described in treat The a certain subregion of repairing area.
Adjustment unit 12, the COLOR COMPOSITION THROUGH DISTRIBUTION information according to the calculating of described distribution computing unit 10 that is used for is to described lookup unit The color information of 11 best matching blocks searched is adjusted so that carry out the average color of the best matching blocks after described adjustment Consistent with the average color of corresponding subregion.
Repairing unit 13, the best matching blocks after adjusting according to described adjustment unit 12 is to described region to be repaired Image is repaired.
Visible, in the image mending device of the present embodiment, distribution computing unit 10 can calculate according to color smoothing algorithm The COLOR COMPOSITION THROUGH DISTRIBUTION information in region to be repaired, and adjustment unit 12 is according to the COLOR COMPOSITION THROUGH DISTRIBUTION information son to setting according to region to be repaired The color information of the best matching blocks that region is corresponding is adjusted so that the average color of the best matching blocks after being adjusted with The average color of corresponding subregion is consistent, then repairs unit 13 and treats the figure of repairing area according to the best matching blocks after adjusting As repairing.The color of the image represented by the COLOR COMPOSITION THROUGH DISTRIBUTION information that distribution computing unit 10 calculates is smoother, no Have lofty sensation, if the average color of the best matching blocks after Tiao Zhenging is consistent with the average color of corresponding subregion, then Repair the image in region to be repaired according to the best matching blocks after adjusting after, after repairing, the color of image is the most smoother, simultaneously Texture also has smooth effect, so that when repairing the image of single grain background, after repairing, the continuity of image is preferable.
With reference to shown in Fig. 6, the lookup list in a specific embodiment, in the image mending device shown in above-mentioned Fig. 5 Unit 11 specifically can be by area determination unit 110 with most preferably determine that unit 111 realizes, and adjustment unit 12 specifically can lead to Cross meansigma methods and determine that unit 120 and increase unit 121 realize, specifically:
Area determination unit 110, be used for determining a subregion, a described subregion be with described zone boundary to be repaired or Region described to be repaired after repairing at least one times more borderline centered by a region;Described to be repaired Multiple regions that other regional search size outside region is identical with the size of a described subregion;
Most preferably determining unit 111, in the multiple regions determined by described area determination unit 110, image texture is believed The region of the matching degree maximum of the image texture information of breath and a described subregion is as the best matching blocks of a described subregion;
Then repair unit 13, specifically for the best matching blocks for a described subregion, described with after described adjustment A subregion described in the image completion of the best matching blocks of one subregion.Specifically, unit 13 is repaired for by after described adjustment The image information of best matching blocks save as the image information of a described subregion of correspondence, described image information includes described The color information of the described best matching blocks after adjustment and image texture information.
If the COLOR COMPOSITION THROUGH DISTRIBUTION information that described distribution computing unit 10 calculates includes each position in described region to be repaired Pixel value;Then meansigma methods determines unit 120, for determining the second pixel average of described best matching blocks, according to described In the described a certain subregion in region to be repaired, the pixel value of each position determines the sub-district corresponding with described best matching blocks First pixel average in territory;
Increase unit 121, for increasing picture in described best matching blocks on the basis of the pixel value of each position respectively Element value increment obtains the pixel value of each position in the best matching blocks after described adjustment, and wherein, described pixel value increment is institute State the difference of the first pixel average that meansigma methods determines that unit 120 determines and the second pixel average.
In the present embodiment, search unit 11 and by area determination unit 110 and most preferably determine that unit 111 determines a certain son After the best matching blocks in region, repair the meansigma methods in unit 12 and determine that unit 120 can calculate according to distribution computing unit 10 COLOR COMPOSITION THROUGH DISTRIBUTION information determine the first pixel average and the second pixel average, then increase unit 121 can optimal really After in the best matching blocks that cell 111 determines, on the basis of the pixel value of each position, one pixel value increment of increase is adjusted Best matching blocks in the pixel value of each position;Finally by repair unit 13 according to increasing the adjustment that unit 121 obtains after In best matching blocks, the pixel value of each position repairs the image in region to be repaired.So by searching unit 11, adjustment unit Cooperation between 12 and repairing unit 13, all can repair the image of all subregions in region to be repaired.
The embodiment of the present invention also provides for a kind of terminal unit, and its structural representation is as it is shown in fig. 7, this terminal unit can be because joining Put or performance is different and produce bigger difference, one or more central processing units (central can be included Processing units, CPU) 20 (such as, one or more processors) and memorizeies 21, one or more are deposited Storage application program 221 or the storage medium 22 (such as one or more mass memory units) of data 222.Wherein, storage Device 21 and storage medium 22 can be of short duration storage or persistently store.Be stored in the program of storage medium 22 can include one or More than one module (diagram does not marks), each module can include a series of command operatings in terminal unit.More enter one Step ground, central processing unit 20 could be arranged to communicate with storage medium 22, performs in storage medium 22 on the terminal device Series of instructions operates.
Terminal unit can also include one or more power supplys 23, and one or more wired or wireless networks connect Mouth 24, one or more input/output interfaces 25, and/or, one or more operating systems 223, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM etc..
Described in said method embodiment can be based on the end shown in this Fig. 7 by the step performed by image mending device The structure of end equipment.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment is can Completing instructing relevant hardware by program, this program can be stored in a computer-readable recording medium, storage Medium may include that read only memory (ROM), random access memory ram), disk or CD etc..
The image mending method and device provided the embodiment of the present invention above is described in detail, used herein Principle and the embodiment of the present invention are set forth by specific case, and the explanation of above example is only intended to help to understand The method of the present invention and core concept thereof;Simultaneously for one of ordinary skill in the art, according to the thought of the present invention, at tool All will change on body embodiment and range of application, in sum, this specification content should not be construed as the present invention Restriction.

Claims (10)

1. an image mending method, it is characterised in that including:
Color smoothing algorithm according to image calculates the COLOR COMPOSITION THROUGH DISTRIBUTION information in the region to be repaired of image;
Search the best matching blocks that the subregion according to the setting of described region to be repaired is corresponding, described in described best matching blocks correspondence Region outside region to be repaired described in image, wherein, described subregion includes certain a part of district in described region to be repaired Territory;
According to described COLOR COMPOSITION THROUGH DISTRIBUTION information, the color information of described best matching blocks is adjusted so that after carrying out described adjustment The average color of best matching blocks consistent with the average color of corresponding subregion;
According to the best matching blocks after described adjustment, the image in described region to be repaired is repaired.
2. the method for claim 1, it is characterised in that the described color smoothing algorithm according to image calculates described to be repaired Mend the COLOR COMPOSITION THROUGH DISTRIBUTION information in region, specifically include:
Using the color information of multiple positions of described zone boundary to be repaired as initial given value, according to described initial given value And preset function calculates the color information of other position in described region to be repaired.
3. the method for claim 1, it is characterised in that a certain son that described lookup sets according to described region to be repaired The best matching blocks that region is corresponding, specifically includes:
Determine a subregion, a described subregion with described zone boundary to be repaired or after repairing at least one times described in Region to be repaired more borderline centered by a region;
Multiple regions that other regional search size outside described region to be repaired is identical with the size of a described subregion;
By in the plurality of region, the district that image texture information is maximum with the matching degree of the image texture information of a described subregion Territory is as the best matching blocks of a described subregion;
For the best matching blocks of a described subregion, described according to the best matching blocks after described adjustment to described district to be repaired The image in territory is repaired, and specifically includes: with the image completion institute of the best matching blocks of the described subregion after described adjustment State a subregion.
4. method as claimed in claim 3, it is characterised in that described with optimal of the described subregion after described adjustment Join a subregion described in the image completion of block, specifically include:
The image information of the best matching blocks after described adjustment is saved as the image information of a described subregion of correspondence, described Image information includes color information and the image texture information of the described best matching blocks after described adjustment.
5. the method as described in any one of claims 1 to 3, it is characterised in that described COLOR COMPOSITION THROUGH DISTRIBUTION information includes described to be repaired Mend the pixel value of each position in region;
Described according to described COLOR COMPOSITION THROUGH DISTRIBUTION information, the color information of described best matching blocks is adjusted, specifically includes:
Determine the second pixel average of described best matching blocks, in the described a certain subregion according to described region to be repaired The pixel value of each position determines the first pixel average of the subregion corresponding with described best matching blocks;
In described best matching blocks, on the basis of the pixel value of each position, increase pixel value increment respectively obtain described adjustment After best matching blocks in the pixel value of each position, wherein, described pixel value increment is described first pixel average and the The difference of two pixel average.
6. an image mending device, it is characterised in that including:
Distribution computing unit, calculates the COLOR COMPOSITION THROUGH DISTRIBUTION letter in the region to be repaired of image for the color smoothing algorithm according to image Breath;
Search unit, for searching best matching blocks corresponding to subregion set according to described region to be repaired, described most preferably Region outside region to be repaired described in the corresponding described image of match block, wherein, described subregion includes described district to be repaired The a certain subregion in territory;
Adjustment unit, for being adjusted the color information of described best matching blocks according to described COLOR COMPOSITION THROUGH DISTRIBUTION information so that The average color carrying out the best matching blocks after described adjustment is consistent with the average color of corresponding subregion;
Repair unit, for the image in described region to be repaired being repaired according to the best matching blocks after described adjustment.
7. device as claimed in claim 6, it is characterised in that
Described distribution computing unit, specifically for using the color information of multiple positions of described zone boundary to be repaired as initially Given value, calculates the color information of other position in described region to be repaired according to described initial given value and preset function.
8. device as claimed in claim 6, it is characterised in that described lookup unit specifically includes:
Area determination unit, be used for determining a subregion, a described subregion be with described zone boundary to be repaired or carry out to Few the most once repair after region described to be repaired more borderline centered by a region;In described region to be repaired it Multiple regions that other outer regional search size is identical with the size of a described subregion;
Most preferably determining unit, for by the plurality of region, the image texture of image texture information and a described subregion is believed The region of the matching degree maximum of breath is as the best matching blocks of a described subregion;
Described repairing unit, specifically for the best matching blocks for a described subregion, with the described son after described adjustment A subregion described in the image completion of the best matching blocks in region.
9. device as claimed in claim 8, it is characterised in that
Described repairing unit, specifically for saving as described the one of correspondence by the image information of the best matching blocks after described adjustment The image information of subregion, described image information includes color information and the image stricture of vagina of the described best matching blocks after described adjustment Reason information.
10. the device as described in any one of claim 6 to 9, it is characterised in that the color that described distribution computing unit calculates divides Cloth information includes the pixel value of each position in described region to be repaired;
Described adjustment unit specifically includes:
Meansigma methods determines unit, for determining the second pixel average of described best matching blocks, according to described region to be repaired Described a certain subregion in the pixel value of each position determine the first picture of the subregion corresponding with described best matching blocks Element meansigma methods;
Increase unit, for increasing pixel value increment in described best matching blocks on the basis of the pixel value of each position respectively Obtaining the pixel value of each position in the best matching blocks after described adjustment, wherein, described pixel value increment is described first picture Element meansigma methods and the difference of the second pixel average.
CN201610638285.0A 2016-08-05 2016-08-05 A kind of image mending method and device Active CN106296605B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610638285.0A CN106296605B (en) 2016-08-05 2016-08-05 A kind of image mending method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610638285.0A CN106296605B (en) 2016-08-05 2016-08-05 A kind of image mending method and device

Publications (2)

Publication Number Publication Date
CN106296605A true CN106296605A (en) 2017-01-04
CN106296605B CN106296605B (en) 2019-03-26

Family

ID=57665990

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610638285.0A Active CN106296605B (en) 2016-08-05 2016-08-05 A kind of image mending method and device

Country Status (1)

Country Link
CN (1) CN106296605B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111210491A (en) * 2019-12-31 2020-05-29 维沃移动通信有限公司 Image processing method, electronic device, and storage medium
CN111325699A (en) * 2020-03-20 2020-06-23 腾讯科技(深圳)有限公司 Image restoration method and training method of image restoration model

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1731449A (en) * 2005-07-14 2006-02-08 北京航空航天大学 A method of image restoration
US20070160309A1 (en) * 2005-10-12 2007-07-12 Bertozzi Andrea L Method for inpainting of images
CN103150711A (en) * 2013-03-28 2013-06-12 山东大学 Open computing language (OpenCL)-based image repair method
CN103544685A (en) * 2013-10-22 2014-01-29 华南理工大学 Method and system for beautifying composition of image based on main body adjustment
CN103839223A (en) * 2012-11-21 2014-06-04 华为技术有限公司 Image processing method and image processing device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1731449A (en) * 2005-07-14 2006-02-08 北京航空航天大学 A method of image restoration
US20070160309A1 (en) * 2005-10-12 2007-07-12 Bertozzi Andrea L Method for inpainting of images
CN103839223A (en) * 2012-11-21 2014-06-04 华为技术有限公司 Image processing method and image processing device
CN103150711A (en) * 2013-03-28 2013-06-12 山东大学 Open computing language (OpenCL)-based image repair method
CN103544685A (en) * 2013-10-22 2014-01-29 华南理工大学 Method and system for beautifying composition of image based on main body adjustment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
许文杰 等: "基于颜色信息和阈值的图像修复算法", 《电视技术》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111210491A (en) * 2019-12-31 2020-05-29 维沃移动通信有限公司 Image processing method, electronic device, and storage medium
CN111325699A (en) * 2020-03-20 2020-06-23 腾讯科技(深圳)有限公司 Image restoration method and training method of image restoration model

Also Published As

Publication number Publication date
CN106296605B (en) 2019-03-26

Similar Documents

Publication Publication Date Title
CN104376535B (en) A kind of rapid image restorative procedure based on sample
CN105046658B (en) A kind of low-light (level) image processing method and device
CN103839223A (en) Image processing method and image processing device
WO2021151318A1 (en) Image classification method and apparatus based on deep learning, and computer device
CN103578085B (en) Image cavity region based on variable-block method for repairing and mending
CN107085842A (en) The real-time antidote and system of self study multiway images fusion
CN102780889A (en) Video image processing method, device and equipment
CN102779351A (en) Interactive grayscale image colorizing method based on local linear model optimization
CN106570909A (en) Skin color detection method, device and terminal
CN108463823A (en) A kind of method for reconstructing, device and the terminal of user's Hair model
CN1731449A (en) A method of image restoration
CN108510557A (en) image tone mapping method and device
CN106296605A (en) A kind of image mending method and device
CN108986063A (en) The method, apparatus and computer readable storage medium of gradient fusion
CN106296748B (en) Object image relighting method based on block matching deformation and color migration
CN104239855A (en) Image style transfer synthesis method based on stroke synthesis
CN103778900A (en) Image processing method and system
CN102609909A (en) Method and device for defogging single image
CN104850847A (en) Image optimization system and method with automatic face thinning function
CN107301417A (en) A kind of method and device of the vehicle brand identification of unsupervised multilayer neural network
CN104794726B (en) A kind of underwater picture Parallel segmentation method and device
CN103208107A (en) Terminal and method and device for repairing image
CN107330387A (en) Pedestrian detection method based on view data
CN104836912A (en) Information processing method and mobile terminal
CN102214362A (en) Block-based quick image mixing method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant