CN107292840A - Image recovery method and device, computer-readable recording medium, terminal - Google Patents

Image recovery method and device, computer-readable recording medium, terminal Download PDF

Info

Publication number
CN107292840A
CN107292840A CN201710424945.XA CN201710424945A CN107292840A CN 107292840 A CN107292840 A CN 107292840A CN 201710424945 A CN201710424945 A CN 201710424945A CN 107292840 A CN107292840 A CN 107292840A
Authority
CN
China
Prior art keywords
pixel
image
span
pixel value
value
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
CN201710424945.XA
Other languages
Chinese (zh)
Other versions
CN107292840B (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.)
Shanghai Zhizhen Intelligent Network Technology Co Ltd
Original Assignee
Shanghai Zhizhen Intelligent Network Technology 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 Shanghai Zhizhen Intelligent Network Technology Co Ltd filed Critical Shanghai Zhizhen Intelligent Network Technology Co Ltd
Priority to CN201710424945.XA priority Critical patent/CN107292840B/en
Publication of CN107292840A publication Critical patent/CN107292840A/en
Application granted granted Critical
Publication of CN107292840B publication Critical patent/CN107292840B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering

Landscapes

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

Abstract

A kind of image recovery method and device, computer-readable recording medium, terminal, described image restored method include:Obtain pending image;To each pixel in described image, fuzzy clustering processing is carried out using the pixel value of its neighborhood territory pixel, to determine the corresponding classification pixel value of classification and each classification belonging to each pixel;The pixel value of all pixels in same category is entered as the corresponding classification pixel value of the category, with the image after being restored.The effect of image repair can be improved by technical solution of the present invention.

Description

Image recovery method and device, computer-readable recording medium, terminal
Technical field
The present invention relates to technical field of image processing, more particularly to it is a kind of image recovery method and device, computer-readable Storage medium, terminal.
Background technology
At present, in image processing field, when handling the original image collected, the defect of target in original image Or it is unnecessary will cause difficulty to image recognition, influence image procossing output result.For example in text identification and Car license recognition In scene, there is the situation of defect in Chinese character and numeral, and text identification or Car license recognition may be caused mistake occur.
In the prior art, the method for image repair has many kinds, and the model more first proposed is based on partial differential equation Model, be mainly used in the reparation of smaller area.Later stage, domestic and foreign scholars propose a kind of image repair based on texture structure Technology, is mainly used to the information of big lost block in blank map picture.
But, prior art is poor to the effect of image repair, and the effect of image repair still needs to improve.
The content of the invention
Present invention solves the technical problem that being how to improve the effect of image repair.
In order to solve the above technical problems, the embodiment of the present invention provides a kind of image recovery method, image recovery method includes: Obtain pending image;To each pixel in described image, fuzzy clustering processing is carried out using the pixel value of its neighborhood territory pixel, To determine the corresponding classification pixel value of classification and each classification belonging to each pixel;By all pixels in same category Pixel value is entered as the corresponding classification pixel value of the category, with the image after being restored.
Optionally, it is described to each pixel in described image, carried out using the pixel value of its neighborhood territory pixel at fuzzy clustering Reason includes:The pixel value of the pixel is updated using the neighborhood information of each pixel, the neighborhood information includes neighborhood half-tone information With neighborhood range information;Fuzzy clustering processing is carried out using the pixel value after renewal.
Optionally, it is described to each pixel in described image, carried out using the pixel value of its neighborhood territory pixel at fuzzy clustering Also include before reason:Described image is pre-processed according to the classification of predetermined described image, the classification is selected from scarce Damage classification and unnecessary classification.
Optionally, it is described to each pixel in described image, carried out using the pixel value of its neighborhood territory pixel at fuzzy clustering Also include before reason:Determine described image is categorized as defect classification, first carries out expansive working to described image, then corroded Operation.
Optionally, it is described to each pixel in described image, carried out using the pixel value of its neighborhood territory pixel at fuzzy clustering Also include before reason:Determine described image is categorized as unnecessary classification, first carries out etching operation to described image, then expanded Operation.
Optionally, it is described to each pixel in described image, carried out using the pixel value of its neighborhood territory pixel at fuzzy clustering Reason includes:Determine the initial degree of membership of each pixel in described image relative to each classification, and each classification is initial poly- Class center;Using the pixel value of each pixel neighborhood territory pixel in its neighborhood window, based on current cluster centre and current The new degree of membership of the new cluster centre of degree of membership iterative calculation and each pixel, until iterations reaches greatest iteration time Number, or, the maximum of the new degree of membership of all pixels and current degree of membership difference is less than given threshold;According to last The new degree of membership for each pixel that secondary iteration is determined determines the classification belonging to the pixel, according to the every of last time iteration determination The new cluster centre of one classification determines the corresponding classification pixel value of the category.
Optionally, the new degree of membership of each pixel is calculated using below equation: Wherein, UiterPixel i is new relative to cluster centre k when (i, k) is i-th ter times iteration Degree of membership, xiFor pixel i pixel value, vkFor cluster centre k pixel value, m is default Fuzzy Exponential, and c is cluster centre Quantity, W1 and W2 are the Pixel Information of pixel i neighborhood territory pixel, and the Pixel Information of the neighborhood territory pixel is according to the neighborhood picture The pixel value of element and position are determined.
Optionally, the new cluster centre is calculated using below equation:Its In, viterNew the cluster centre k, N are the sum of all pixels in described image, U during for i-th ter times iterationiter(i, k) is the New degrees of membership of the pixel i relative to cluster centre k, x during iter iterationiFor pixel i pixel value, W1 is pixel i neighbour The Pixel Information of domain pixel, the Pixel Information of the neighborhood territory pixel is determined according to the pixel value of the neighborhood territory pixel and position.
Optionally, described image is the pixel value of the pixel of target part in gray level image, described image in the first pixel In span, the pixel value of the pixel of background parts is in the second pixel span, wherein the first pixel value model It is adjacent domains to enclose with the second pixel span;The defect that is categorized as determining described image is classified, to described image First carry out expansive working, then carry out etching operation including:Transversal scanning described image, determines that pixel value is taken by first pixel Value scope is changed into the first position of the second pixel span, determines that pixel value is changed into from the second pixel span The second place of the first pixel span;Centre position from the first position and the second place is longitudinally two-way Scanning, determines that pixel value is changed into the 3rd position and the 4th of the first pixel span from the second pixel span Position;If the distance of the first position and the second place is more than minimum lateral threshold value and less than maximum transversal threshold value, The distance of 3rd position and the 4th position is more than minimum longitudinal threshold value and is less than maximum longitudinal threshold value, then Expansive working is first carried out to described image, then carries out etching operation.
Optionally, described image is the pixel value of the pixel of target part in gray level image, described image in the first pixel In span, the pixel value of the pixel of background parts is in the second pixel span;Wherein described first pixel value model It is adjacent domains to enclose with the second pixel span, and the determination described image is categorized as unnecessary classification, to described image First carry out etching operation, then carry out expansive working including:Transversal scanning described image, determines that pixel value is taken by second pixel Value scope is changed into the first position of the first pixel span, determines that pixel value is changed into from the first pixel span The second place of the second pixel span;Centre position from the first position and the second place is longitudinally two-way Scanning, determines that pixel value is changed into the 3rd position and the 4th of the second pixel span from the first pixel span Position;If the distance of the first position and the second place is more than minimum lateral threshold value and less than maximum transversal threshold value, The distance of 3rd position and the 4th position is more than minimum longitudinal threshold value and is less than maximum longitudinal threshold value, then Etching operation is first carried out to described image, then carries out expansive working.
Optionally, the gray level image is bianry image, and the first pixel span is the first pixel value, described the Two pixel spans are the second pixel value.
Optionally, the size of the neighborhood window of the neighborhood territory pixel is determined according to following parameter:The first position and institute State the distance of the second place and the distance of the 3rd position and the 4th position.
Optionally, the pending image of the acquisition includes:Original image is divided into individual character image, the original image Including at least one character, the character is selected from Chinese character, letter and number.
Optionally, also include after the pending image of the acquisition:, will be described if described image is coloured image Image is converted to gray level image.
The embodiment of the invention also discloses a kind of image restoration device, image restoration device includes:Image collection module, is used To obtain pending image;Fuzzy clustering module, to each pixel in described image, to utilize the pixel of its neighborhood territory pixel Value carries out fuzzy clustering processing, to determine the corresponding classification pixel value of classification and each classification belonging to each pixel;Assignment Module, the pixel value of all pixels in same category is entered as into the corresponding classification pixel value of the category, to be answered Image after original.
The embodiment of the invention also discloses a kind of computer-readable recording medium, computer instruction is stored thereon with, it is described The step of described image restored method being performed when computer instruction is run.
The embodiment of the invention also discloses a kind of terminal, including memory and processor, being stored with the memory can The computer instruction run on the processor, the processor performs described image when running the computer instruction and restored The step of method.
Compared with prior art, the technical scheme of the embodiment of the present invention has the advantages that:
Technical solution of the present invention obtains pending image;To each pixel in described image, its neighborhood territory pixel is utilized Pixel value carries out fuzzy clustering processing, to determine the corresponding classification pixel value of classification and each classification belonging to each pixel; The pixel value of all pixels in same category is entered as the corresponding classification pixel value of the category, with the figure after being restored Picture.Technical solution of the present invention utilizes the pixel value of each neighborhood of pixels pixel in pending image, and each pixel is carried out Fuzzy clustering is handled;Fuzzy clustering is carried out by using each neighborhood of pixels pixel, can be accurately by pending image Defect or the pixel of redundance are classified;Then the pixel value of all pixels in same category is entered as the category pair The classification pixel value answered, namely the original pixel value of all pixels in pending image is accurately determined, complete to pending Image reparation, the accuracy to the recovery of pending image is realized, so as to improve the effect of image repair.
Further, it is described to each pixel in described image, carried out using the pixel value of its neighborhood territory pixel at fuzzy clustering Reason includes:The pixel value of the pixel is updated using the neighborhood information of each pixel, the neighborhood information includes neighborhood half-tone information With neighborhood range information;Fuzzy clustering processing is carried out using the pixel value after renewal.Technical solution of the present invention is utilizing each picture When plain neighborhood territory pixel carries out fuzzy clustering, the pixel value of the pixel is updated using the neighborhood information of neighborhood territory pixel, is then utilized Pixel value after renewal carries out fuzzy clustering;It is real so as in fuzzy clustering, the neighborhood information of the pixel be taken into account Show the accuracy to the pixel classifications, and then the original pixel value of the pixel can be accurately determined, further improve figure As the effect repaired.
Brief description of the drawings
Fig. 1 is a kind of flow chart of image recovery method of the embodiment of the present invention;
Fig. 2 is the flow chart of the specific implementation of step S102 shown in Fig. 1;
Fig. 3 is a kind of structural representation of image restoration device of the embodiment of the present invention.
Embodiment
As described in the background art, prior art still needs to improve to the effect of image repair.
Technical solution of the present invention utilizes the pixel value of each neighborhood of pixels pixel in pending image, to each pixel Carry out fuzzy clustering processing;Fuzzy clustering is carried out by using each neighborhood of pixels pixel, can be accurately by pending figure Defect or the pixel of redundance are classified as in, namely accurately determine the original pixels of the pixel;Then by same class The pixel value of all pixels in not is entered as the corresponding classification pixel value of the category, completes the reparation to pending image, The accuracy of the recovery to pending image is realized, so as to improve the effect of image repair.
It is understandable to enable the above objects, features and advantages of the present invention to become apparent, below in conjunction with the accompanying drawings to the present invention Specific embodiment be described in detail.
Fig. 1 is a kind of flow chart of image recovery method of the embodiment of the present invention.
Image recovery method shown in Fig. 1 may comprise steps of:
Step S101:Obtain pending image;
Step S102:To each pixel in described image, fuzzy clustering processing is carried out using the pixel value of its neighborhood territory pixel, To determine the corresponding classification pixel value of classification and each classification belonging to each pixel;
Step S103:The pixel value of all pixels in same category is entered as the corresponding classification pixel value of the category, With the image after being restored.
In specific implementation, in step S101, pending image is obtained, specifically, pending image can be The image or the pretreated image of process directly collected using imaging sensor or other appropriate ways. The target that pending image refers in image has the image of defect or redundance.For example, target in pending image Can be numeral, numeral has defect, or with unnecessary point, horizontal or perpendicular.Further, to the recovery of pending image The recovery of pixel value is namely carried out to pixel shared by defect or redundance, to fill up defect part or remove redundance.
In specific implementation, in order to realize the recovery to pending image, it is necessary to recover defect or redundance exactly The pixel value of shared pixel, can determine the pixel pixel value to be recovered by the pixel value of the neighborhood territory pixel of each pixel. Therefore in step s 102, to each pixel in described image, fuzzy clustering processing is carried out using the pixel value of its neighborhood territory pixel, with Determine the corresponding classification pixel value of classification and each classification belonging to each pixel.Specifically, all pictures in image When element carries out clustering processing, using the pixel value of the neighborhood territory pixel of each pixel as the factor is considered, influence is produced on cluster result, Namely influence is produced on the classification belonging to each pixel and the corresponding classification pixel value of each classification, so that pixel is divided The accuracy of classification is improved where the pixel value that class entrance to be recovered.
It will be apparent to a skilled person that can realize that fuzzy clustering is handled using any enforceable algorithm, The embodiment of the present invention is without limitation.
And then in step s 103, the pixel value of all pixels in same category is entered as the corresponding classification of the category Pixel value.Specifically, after the cluster result of fuzzy clustering is obtained, cluster result can include classification, classification pixel value with And all pixels in each classification.If pixel belongs to a certain classification, represent that the pixel is under the jurisdiction of the general of category pixel value Rate is maximum, then the corresponding classification pixel value of the category is assigned into the pixel.That is, the corresponding class of classification belonging to pixel Other pixel value is the pixel value of the pixel.So far, the recovery to the pixel value of all pixels in pending image has been realized.
The embodiment of the present invention accurately can be classified defect in pending image or the pixel of redundance, Accurately determine the original pixels of the pixel;Then the pixel value of all pixels in same category is entered as the category pair The classification pixel value answered, completes the reparation to pending image, realizes the accuracy of the recovery to pending image, so that Improve the effect of image repair.
Preferably, step S102 may comprise steps of:The picture of the pixel is updated using the neighborhood information of each pixel Element value, the neighborhood information includes neighborhood half-tone information and neighborhood range information;Carried out using the pixel value after renewal fuzzy poly- Class processing.
In the present embodiment, when carrying out fuzzy clustering to pixel using neighborhood territory pixel, it is possible to use the neighborhood of each pixel The pixel value of the information updating pixel, wherein, neighborhood information can refer to the information of neighborhood territory pixel, then neighborhood half-tone information can be with Refer to the gray value of neighborhood territory pixel, neighborhood range information can refer to distance of the neighborhood territory pixel relative to the pixel.
Specifically, when the pixel value to the pixel is updated, the neighborhood information of each pixel can be regard as power Weight is multiplied with the pixel value of the pixel, and regard obtained product as the pixel value after renewal;Or, can be by each pixel Neighborhood information is added with the pixel value of the pixel, and regard adding for obtaining as the pixel value after renewal with result;Or, can also Using weighting by the way of summation is combined, the embodiment of the present invention is without limitation.
Preferably, it can also comprise the following steps before step S102:According to the classification pair of predetermined described image Described image is pre-processed, and the classification is selected from defect classification and unnecessary classification.
In the present embodiment, it may be predetermined that the classification of image, and pre-processed accordingly according to the classification of image.Its In, defect classification refers to that target has defect in image, imperfect;It is unnecessary that unnecessary classification refers in image that target is present.Due to The image of defect classification and unnecessary classification is different in the pixel value of pixel shared by defect part and redundance, it is therefore desirable to Different preprocessing process are carried out, to improve the accuracy of follow-up cluster process.
Preferably, it can also comprise the following steps before step S102:Determine that the defect that is categorized as of described image is classified, it is right Described image first carries out expansive working, then carries out etching operation.
In the present embodiment, etching operation can refer to use structural element (namely operation matrix number), such as 3 × 3 sizes Each pixel in matrix, scan image, with each pixel in matrix-scanning image, operates each picture in matrix number Element and the pixel of covering do with operation, for example, by taking bianry image as an example, if with operating result all 1, in image The pixel is 1, otherwise is 0;And if expansive working is on the contrary, when all with operating result 0, the pixel in image element is 0, on the contrary it is 1.Etching operation can eliminate the boundary point of target in image, make shrinking of object, so etching operation can eliminate small And insignificant pixel, border is internally shunk.On the contrary, expansive working can increase target, in filling target Tiny cavity, and the border of smooth target, make border be expanded to outside.
In specific implementation, due to the influence of noise, the border of target is often not perfectly flat cunning in image, therefore target area Domain has some noise holes.When being categorized as defect classification of image, expansive working is first carried out to described image, then carry out corrosion behaviour Make, can be with noise hole tiny in target in blank map picture, and smooth object boundary.Specifically, expansive working can make target Border expand outwardly, if target internal has noise hole, by expansive working, these noise holes will be filled, thus no longer It is border.When carrying out etching operation again, target external border will become original appearance again, and these internal noise holes are not deposited then .
Preferably, it can also comprise the following steps before step S102:The unnecessary classification that is categorized as of described image is determined, it is right Described image first carries out etching operation, then carries out expansive working.
In the present embodiment, due to the influence of noise, the border of target is often not perfectly flat cunning in image, therefore in image Background area is studded with some small noise targets.When being categorized as unnecessary classification of image, corrosion behaviour is first carried out to described image Make, then carry out expansive working, noise tiny on image, and the border of smooth target can be eliminated.Specifically, etching operation The marginal point of target can be removed, small noise targets can be considered as marginal point, therefore can be eliminated.When doing expansive working again, The target remained can recover original size, and the small noise targets being eliminated then are not present.
It will be appreciated by persons skilled in the art that continuous etching operation and expansive working, or continuous expansion behaviour Make and etching operation, it is possible to achieve more preferable pretreating effect, therefore etching operation and/or the number of times of expansive working can be once Or repeatedly, the present embodiment is without limitation.
Further, pending image can be the pixel value of the pixel of target part in gray level image, described image In the first pixel span, the pixel value of the pixel of background parts is in the second pixel span, wherein described first Pixel span is adjacent domains with the second pixel span.Expansive working is first carried out to described image, then carries out corruption Erosion operation may comprise steps of:Transversal scanning described image, determines that pixel value is changed into from the first pixel span The first position of the second pixel span, determines that pixel value is changed into first picture from the second pixel span The second place of plain span;The longitudinal bilateral scanning in centre position from the first position and the second place, it is determined that Pixel value is changed into the 3rd position and the 4th position of the first pixel span from the second pixel span;If The distance of the first position and the second place is more than minimum lateral threshold value and (can also included less than maximum transversal threshold value The distance of first position and the second place is equal to minimum lateral threshold value or the situation equal to maximum transversal threshold value), described the The distance of three positions and the 4th position is more than minimum longitudinal threshold value and (can also wrapped less than maximum longitudinal threshold value The distance for including the 3rd position and the 4th position is equal to minimum longitudinal threshold value or the feelings equal to maximum longitudinal threshold value Condition), then expansive working is first carried out to described image, then carry out etching operation.
In the present embodiment, image is classified for defect, and the inside of defect part is background parts, and outside is back of the body target part. By scan image, according to pixel value in the change of the first pixel span and the second pixel span, first is determined Put, the second place, the 3rd position and the 4th position.Namely when image classification is that defect is classified, by first position, second Put, the 3rd position and the 4th position determine defect area in image.Only when defect area reaches and is sized, Ye Ji The distance of one position and the second place is more than minimum lateral threshold value and (can also include first less than maximum transversal threshold value The distance put with the second place is equal to minimum lateral threshold value or the situation equal to maximum transversal threshold value), the 3rd position It is more than minimum longitudinal threshold value with the distance of the 4th position and (the 3rd can also be included less than maximum longitudinal threshold value The distance of position and the 4th position is equal to minimum longitudinal threshold value or the situation equal to maximum longitudinal threshold value), It is target institute defect in image to judge the defect area, with the noise in rejection image or avoids being judged to background parts to lack Damage part.
In a concrete application scene of the invention, pending image is the pixel of target part in bianry image, image Pixel value be 1, the pixel value of the pixel of background parts is 0.Etching operation is then first carried out to described image, then carries out expansion behaviour It may comprise steps of:Transversal scanning described image, determines that pixel value is changed into 0 first position from 1, determine pixel value by 0 is changed into 1 second place;The longitudinal bilateral scanning in centre position from the first position and the second place, determines pixel Value is changed into 1 the 3rd position and the 4th position from 0;If the distance of the first position and the second place is more than minimum horizontal To threshold value and less than maximum transversal threshold value, the distance of the 3rd position and the 4th position is more than minimum longitudinal threshold value And less than maximum longitudinal threshold value, then expansive working is first carried out to described image, then carry out etching operation.It may be appreciated It is that the pixel value of the pixel of target part is 0 in image, advanced to described image when the pixel value of the pixel of background parts is 1 Row etching operation, then carry out expansive working and can refer to foregoing description, here is omitted.
Further, pending image can be the pixel value of the pixel of target part in gray level image, described image In the first pixel span, the pixel value of the pixel of background parts is in the second pixel span, wherein described first Pixel span is adjacent domains with the second pixel span.Etching operation is first carried out to described image, then is carried out swollen Swollen operation may comprise steps of:Transversal scanning described image, determines that pixel value is changed into from the second pixel span The first position of the first pixel span, determines that pixel value is changed into second picture from the first pixel span The second place of plain span;The longitudinal bilateral scanning in centre position from the first position and the second place, it is determined that Pixel value is changed into the 3rd position and the 4th position of the second pixel span from the first pixel span;If The distance of the first position and the second place is more than minimum lateral threshold value and (can also included less than maximum transversal threshold value The distance of first position and the second place is equal to minimum lateral threshold value or the situation equal to maximum transversal threshold value), described the The distance of three positions and the 4th position is more than minimum longitudinal threshold value and (can also wrapped less than maximum longitudinal threshold value The distance for including the 3rd position and the 4th position is equal to minimum longitudinal threshold value or the feelings equal to maximum longitudinal threshold value Condition), then etching operation is first carried out to described image, then carry out expansive working.
From unlike previous embodiment, image in the present embodiment is unnecessary classification, and the inside of redundance is target Part, outside is background parts.Due to target part pixel pixel value in the first pixel span, background parts The pixel value of pixel determines first position, the second place, the 3rd position in the second pixel span, therefore in scan image During with four positions, pixel value is defined as from the position that the second pixel span is changed into the first pixel span First position, the rest may be inferred for other positions.And then judge whether extraneous region reaches and be sized, namely first position and described The distance of the second place is more than minimum lateral threshold value and (can also include first position and described second less than maximum transversal threshold value The distance of position is equal to minimum lateral threshold value or the situation equal to maximum transversal threshold value), the 3rd position and described 4th The distance put (can also include the 3rd position and described when being more than minimum longitudinal threshold value and threshold value longitudinal less than the maximum The distance of 4th position is equal to minimum longitudinal threshold value or the situation equal to maximum longitudinal threshold value), just judge that this is unnecessary Region is unnecessary for target in image, with the noise in rejection image or avoids target part being defined as redundance.
In a concrete application scene of the invention, pending image is the pixel of target part in bianry image, image Pixel value be 1, the pixel value of the pixel of background parts is 0.It is possible to further transversal scanning described image, pixel is determined Value is changed into 1 first position from 0, determines that pixel value is changed into 0 second place from 1;From the first position and the second The longitudinal bilateral scanning in centre position put, determines that pixel value is changed into 0 the 3rd position and the 4th position from 1.It is understood that The pixel value of the pixel of target part is 0 in image, when the pixel value of the pixel of background parts is 1, determines first position, described The concrete mode of the second place, the 3rd position and the 4th position can refer to foregoing description, and here is omitted.
Closer, the gray level image is bianry image, and the first pixel span is the first pixel value, institute The second pixel span is stated for the second pixel value.In the present embodiment, pending image is bianry image, then is judging defect During the boundary position of region or extraneous region, it is only necessary to judge pixel value change whether from the first pixel value changes for the second pixel Value, or whether be the first pixel value from the second pixel value changes, amount of calculation can be reduced.In addition, pending image is two When being worth image, when carrying out fuzzy clustering to pending image, the quantity of classification is two classes, and cluster centre is respectively pixel value 0 With pixel value 1, so as to further reduce amount of calculation during image restoration, the convenience of image recovery method is improved.
Closer, the size of the neighborhood window of the neighborhood territory pixel is determined according to following parameter:The first position With the distance and the distance of the 3rd position and the 4th position of the second place.
, can be by setting neighborhood window to realize in order to determine the neighborhood territory pixel of each pixel in the present embodiment.Work as picture When element is in the center of neighborhood window, the pixel of other positions is the neighborhood territory pixel of the pixel in neighborhood window.For Take into account the accuracy and amount of calculation of fuzzy clustering, it is ensured that choose appropriate number of neighborhood territory pixel, size to neighborhood window is entered Configuration is gone:The size of neighborhood window is determined according to following parameter:The distance of the first position and the second place and The distance of 3rd position and the 4th position.In other words, the distance and institute of first position and the second place Defect area or the size of extraneous region, the size of neighborhood window can be characterized by stating the distance of the 3rd position and the 4th position It can be configured according to the size of defect area or extraneous region.
Fig. 2 is refer to, Fig. 2 is the flow chart of the specific implementation of step S102 shown in Fig. 1, and step S102 can include following step Suddenly:
Step S21:Determine the initial degree of membership of each pixel in described image relative to each classification, and each classification Initial cluster center;
Step S22:Using the pixel value of each pixel neighborhood territory pixel in its neighborhood window, based on current cluster centre The new degree of membership of new cluster centre and each pixel with current degree of membership iterative calculation, until iterations reaches most Big iterations, or, the maximum of the new degree of membership of all pixels and current degree of membership difference is less than given threshold;
Step S23:Class according to belonging to the new degree of membership for each pixel that last time iteration is determined determines the pixel Not, the new cluster centre of each classification determined according to last time iteration determines the corresponding classification pixel value of the category.
In the present embodiment, when carrying out fuzzy clustering, determined first by step S21 in initial degree of membership and initial clustering The heart.Specifically, the total c of classification is predetermined.For example, when image is bianry image, because pixel value is only 0 and 1, Therefore the total c of classification is 2.The c initial degrees of membership for each pixel relative to each classification, it is possible to use between 0 to 1 Random number obtain.Then calculated according to initial degree of membership and obtain initial cluster center.Or, for the initial of c classification Cluster centre, it is possible to use the pixel value of all pixels in image, which is randomly selected, to be obtained, then utilizes initial cluster center meter Calculate initial degree of membership.Wherein, cluster centre can be pixel value.
It is understood that any enforceable formula can be used to calculate initial cluster center according to initial degree of membership, Or initial degree of membership is calculated according to initial cluster center, the embodiment of the present invention is without limitation.
And then in step S22, the neighborhood territory pixel of each pixel can be selected by neighborhood window, that is to say, that in picture When element is in the center of neighborhood window, other pixels in neighborhood window are the neighborhood territory pixel of the pixel.Utilize neighbour The pixel value of domain pixel, current cluster centre and current degree of membership iterate to calculate new cluster centre and each pixel New degree of membership, until reaching iteration stopping condition.Wherein, iteration stopping condition refers to that iterations reaches greatest iteration time Number, or, the maximum of the new degree of membership of all pixels and current degree of membership difference is less than given threshold.Further and Speech, after the completion of each iteration, with multiple new degrees of membership and current degree of membership difference, only judge multiple new degrees of membership and When the maximum of current degree of membership difference is less than given threshold, stops iterative calculation, amount of calculation can be reduced.
And then in step S23, after the completion of last time iteration, each pixel have relative to c classification c newly Degree of membership, chooses classification of the corresponding classification of maximum in c new degrees of membership belonging to the pixel.Last time iteration is complete Cheng Hou, it may be determined that the new cluster centre of each classification, the corresponding pixel value of new cluster centre is the corresponding class of the category Other pixel value.
It is possible to further calculate the new degree of membership of each pixel using below equation: Wherein, UiterPixel i is new relative to cluster centre k when (i, k) is i-th ter times iteration Degree of membership, xiFor pixel i pixel value, vkFor cluster centre k pixel value, m is default Fuzzy Exponential, and c is cluster centre Quantity, W1 and W2 are the Pixel Information of pixel i neighborhood territory pixel, and the Pixel Information of the neighborhood territory pixel is according to the neighborhood picture The pixel value of element and position are determined.
In the present embodiment, when the neighborhood information using each pixel updates the pixel value of the pixel, asked using weighted sum The mode of sum calculates degree of membership.Can also merely with pixel i neighborhood territory pixel Pixel Information W1 or W2.
It is understood that the Pixel Information W1 and W2 of pixel i neighborhood territory pixel can be using any enforceable algorithms Determined according to the pixel value of the neighborhood territory pixel and position.For example,Its In, N is the sum of all pixels in described image, xrFor the pixel value of pixel i neighborhood territory pixel;The Pixel Information W2 of neighborhood territory pixel can To represent pixel i and its neighborhood territory pixel similarity, calculation formula is as follows:Wherein, xrFor The pixel value of pixel i neighborhood territory pixel, σ is predetermined coefficient.
It is possible to further calculate the new cluster centre using below equation: Wherein, viterNew the cluster centre k, N is in described images during for i-th ter times iteration Sum of all pixels, UiterNew degrees of membership of the pixel i relative to cluster centre k, x when (i, k) is i-th ter times iterationiFor pixel i's Pixel value, W1 is the Pixel Information of pixel i neighborhood territory pixel, and the Pixel Information of the neighborhood territory pixel is according to the neighborhood territory pixel Pixel value and position are determined.
In iteration, the present embodiment uses and first calculates new degree of membership, then calculates the mode of new cluster centre. It can use and first calculate new cluster centre, then calculate the mode of new degree of membership.
Preferably, step S101 may comprise steps of:Original image is divided into individual character image, the original image Including at least one character, the character is selected from Chinese character, letter and number.In the present embodiment, the mesh in pending image ,, can be by original in order to ensure the accuracy and agility of image restoration such as Chinese character, numeral, English alphabet when being designated as word Beginning image is divided into individual character image, to avoid other words from impacting the word currently to be recovered.
Preferably, it can also comprise the following steps after step S101:, will be described if described image is coloured image Image is converted to gray level image.
Because coloured image includes multiple Color Channels, such as RGB or YUV, therefore image is entered using the colour of image The complexity that row restores is higher.In the present embodiment, in order to improve the accuracy and rapidity of image restoration, if get Image is coloured image, coloured image can be converted to gray level image, namely be converted to the image for possessing single channel.Closer to One step, coloured image can be converted to bianry image.
Fig. 3 is a kind of structural representation of image restoration device of the embodiment of the present invention.
Image recovery device shown in Fig. 3 30 can include image collection module 301, fuzzy clustering module 302 and assignment mould Block 303.
Wherein, the image pending to obtain of image collection module 301;Fuzzy clustering module 302 is to the figure Each pixel as in, carries out fuzzy clustering processing, to determine the classification belonging to each pixel using the pixel value of its neighborhood territory pixel And the corresponding classification pixel value of each classification;Assignment module 303 is the pixel value of all pixels in same category to be assigned It is worth for the corresponding classification pixel value of the category, with the image after being restored.
Specifically, assignment module 303 can also be exported the image after recovery.
The present embodiment utilizes the pixel value of each neighborhood of pixels pixel in pending image, and mould is carried out to each pixel Paste clustering processing;Fuzzy clustering is carried out by using each neighborhood of pixels pixel, will accurately can be lacked in pending image Damage or the pixel of redundance is classified;Then the pixel value of all pixels in same category is entered as category correspondence Classification pixel value, namely accurately determine the original pixel value of all pixels in pending image, complete to pending The reparation of image, realizes the accuracy of the recovery to pending image, so as to improve the effect of image repair.
Preferably, fuzzy clustering module 302 can include updating block 3021 and clustering processing unit 3022.Updating block 3021 update the pixel value of the pixel to the neighborhood information using each pixel, and the neighborhood information includes neighborhood half-tone information With neighborhood range information;Clustering processing unit 3022 using the pixel value after updating to carry out fuzzy clustering processing.This implementation In example, when carrying out fuzzy clustering to pixel using neighborhood territory pixel, it is possible to use the neighborhood information of each pixel updates the pixel Pixel value, wherein, neighborhood information can refer to neighborhood territory pixel information.Then neighborhood half-tone information can refer to the ash of neighborhood territory pixel Angle value, neighborhood range information can refer to distance of the neighborhood territory pixel relative to the pixel.
Specifically, when the pixel value to the pixel is updated, the neighborhood information of each pixel can be regard as power Weight is multiplied with the pixel value of the pixel, and regard product as the pixel value after renewal;Or, the neighborhood of each pixel can be believed Breath be added with the pixel value of the pixel, and using be used as the pixel value after renewal;Or, it would however also be possible to employ weighting is mutually tied with summation The mode of conjunction, the embodiment of the present invention is without limitation.
Preferably, image recovery device 30 can also include pretreatment module 304, and pretreatment module 304 is used to according to pre- The classification of the described image first determined is pre-processed to described image, and the classification is selected from defect classification and unnecessary classification.This In embodiment, it may be predetermined that the classification of image, and pre-processed accordingly according to the classification of image.Wherein, defect point Class refers to that target has defect in image, imperfect;It is unnecessary that unnecessary classification refers in image that target is present.Due to defect classification and The image of unnecessary classification is different in the pixel value of pixel shared by defect part and redundance, it is therefore desirable to carried out different Preprocessing process, to improve the accuracy of follow-up cluster process.
Preferably, image recovery device 30 can also include first processing module 305, and first processing module 305 is to true That determines described image is categorized as defect classification, expansive working is first carried out to described image, then carry out etching operation.The present embodiment In, first passing through expansive working can expand outwardly the border of target, if there is noise hole in target internal, then by expansive working These noise holes will be filled, thus no longer be border.When carrying out etching operation again, target external border will become again original Appearance, and these internal noise holes are then not present.
Preferably, image recovery device 30 can also include Second processing module 306, and Second processing module 306 is to true That determines described image is categorized as unnecessary classification, etching operation is first carried out to described image, then carry out expansive working.The present embodiment In, the marginal point of target can be removed by first passing through etching operation, and small noise targets can be considered as marginal point, therefore can be disappeared Remove.When doing expansive working again, the target remained can recover original size, and the small noise targets being eliminated are not deposited then .
Preferably, fuzzy clustering module 302 can also include determining unit 3023, iterative calculation unit 3024 and grouping sheet Member 3025.Wherein it is determined that unit 3023 is to determine the initial degree of membership of each pixel in described image relative to each classification, And the initial cluster center of each classification;Unit 3024 is iterated to calculate to utilize each pixel neighborhood in its neighborhood window The pixel value of pixel, new cluster centre and each pixel are iterated to calculate based on current cluster centre and current degree of membership New degree of membership, until iterations reaches maximum iteration, or, the new degree of membership of all pixels and current person in servitude The maximum of category degree difference is less than given threshold;Taxon 3025 is used to each pixel determined according to last time iteration New degree of membership determines the classification belonging to the pixel, and the new cluster centre of each classification determined according to last time iteration is true Determine the corresponding classification pixel value of the category.
Further, iterative calculation unit 3024 calculates the new degree of membership of each pixel using below equation:Wherein, Uiter(i, k) be i-th ter times iteration when pixel i relative to Cluster centre k new degree of membership, xiFor pixel i pixel value, vkFor cluster centre k pixel value, m is default fuzzy finger Number, c is the quantity of cluster centre, and W1 and W2 are the Pixel Information of pixel i neighborhood territory pixel, the Pixel Information of the neighborhood territory pixel Determined according to the pixel value of the neighborhood territory pixel and position.
Further, iterative calculation unit 3024 calculates the new cluster centre using below equation:Wherein, viterNew the cluster centre k, N are described during for i-th ter times iteration Sum of all pixels in image, UiterNew degrees of membership of the pixel i relative to cluster centre k, x when (i, k) is i-th ter times iterationi For pixel i pixel value, W1 is the Pixel Information of pixel i neighborhood territory pixel, and the Pixel Information of the neighborhood territory pixel is according to described The pixel value of neighborhood territory pixel and position are determined.
Preferably, described image is the pixel value of the pixel of target part in gray level image, described image in the first pixel In span, the pixel value of the pixel of background parts is in the second pixel span, wherein the first pixel value model It is adjacent domains to enclose with the second pixel span;First processing module 305 can include first position determining unit 3051, Second place determining unit 3052 and first processing units 3053.Wherein, first position determining unit 3051 is used to transversal scanning Described image, determines that pixel value is changed into the first position of the second pixel span from the first pixel span, Determine that pixel value is changed into the second place of the first pixel span from the second pixel span;The second place is true Order member 3052 is used to from the longitudinal bilateral scanning in the centre position of the first position and the second place, determine pixel value by The second pixel span is changed into the 3rd position and the 4th position of the first pixel span;First processing units If 3053 are used to the distance of the first position and the second place more than minimum lateral threshold value and less than maximum transversal threshold (distance that can also include first position and the second place is equal to minimum lateral threshold value or the feelings equal to maximum transversal threshold value to value Condition), the distance of the 3rd position and the 4th position is more than minimum longitudinal threshold value and less than maximum longitudinal threshold (distance that can also include the 3rd position and the 4th position is equal to minimum longitudinal threshold value or equal to maximum longitudinal threshold to value The situation of value), then expansive working is first carried out to described image, then carry out etching operation.
In the present embodiment, when image classification is that defect is classified, by first position, the second place, the 3rd position and the 4th Position determines defect area in image.And only when defect area reaches and is sized, namely first position and described The distance of two positions is more than minimum lateral threshold value and (can also include first position and the second place less than maximum transversal threshold value Distance is equal to minimum lateral threshold value or the situation equal to maximum transversal threshold value), the 3rd position and the 4th position away from From more than the minimum longitudinal threshold value and less than the maximum longitudinal threshold value (can also include the 3rd position and the 4th position away from From equal to minimum longitudinal threshold value or the situation equal to maximum longitudinal threshold value), just judge the defect area as in image Target institute defect, with the noise in rejection image or avoid background parts being determined as defect part.
Preferably, described image is the pixel value of the pixel of target part in gray level image, described image in the first pixel In span, the pixel value of the pixel of background parts is in the second pixel span;Wherein described first pixel value model It is adjacent domains to enclose with the second pixel span, and the Second processing module 306 can include the 3rd position determination unit 3061st, the 4th position determination unit 3062 and second processing unit 3063.Wherein, the 3rd position determination unit 3061 is to laterally Described image is scanned, determines that pixel value is changed into first of the first pixel span from the second pixel span Put, determine that pixel value is changed into the second place of the second pixel span from the first pixel span;4th Determining unit 3062 is put to the longitudinal bilateral scanning in centre position from the first position and the second place, pixel is determined Value is changed into the 3rd position and the 4th position of the second pixel span from the first pixel span;Second processing If unit 3063 is more than minimum lateral threshold value and horizontal less than maximum to the distance of the first position and the second place To threshold value, (distance that can also include first position and the second place is equal to minimum lateral threshold value or equal to maximum transversal threshold value Situation), the distance of the 3rd position and the 4th position is more than minimum longitudinal threshold value and less than the maximum longitudinal direction (distance that can also include the 3rd position and the 4th position is equal to minimum longitudinal threshold value or equal to the maximum longitudinal direction to threshold value The situation of threshold value), then etching operation is first carried out to described image, then carry out expansive working.
In the present embodiment, when image classification is unnecessary classification, by first position, the second place, the 3rd position and the 4th Position determines extraneous region in image.And then judge whether extraneous region reaches and be sized, namely first position and described The distance of the second place is more than minimum lateral threshold value and (can also include first position and the second place less than maximum transversal threshold value Distance be equal to minimum lateral threshold value or the situation equal to maximum transversal threshold value), the 3rd position and the 4th position Distance is more than minimum longitudinal threshold value and (can also include the 3rd position and the 4th position when being less than maximum longitudinal threshold value Distance be equal to the minimum longitudinal threshold value or the situation equal to maximum longitudinal threshold value), just judge the extraneous region as figure As in target it is unnecessary, with the noise in rejection image or avoid target part being defined as redundance.
Preferably, the gray level image is bianry image, and the first pixel span is the first pixel value, described the Two pixel spans are the second pixel value.Pending image is bianry image, then is judging defect area or extraneous region Boundary position when, it is only necessary to judge pixel value change whether from the first pixel value changes for the second pixel value, or whether from Second pixel value changes are the first pixel value, can reduce amount of calculation.In addition, when pending image is bianry image, treating When the image of processing carries out fuzzy clustering, the quantity of classification is two classes, and cluster centre is respectively pixel value 0 and pixel value 1, so that Further reduce amount of calculation during image restoration, improve the convenience of image recovery method.
Preferably, the size of the neighborhood window of the neighborhood territory pixel is determined according to following parameter:The first position and institute State the distance of the second place and the distance of the 3rd position and the 4th position.It is each in order to determine in the present embodiment The neighborhood territory pixel of pixel, can be by setting neighborhood window to realize.When pixel is in the center of neighborhood window, it is in The pixel of other positions is the neighborhood territory pixel of the pixel in neighborhood window.In order to take into account the accuracy and amount of calculation of fuzzy clustering, Ensure to choose appropriate number of neighborhood territory pixel, the size to neighborhood window is configured:The size of neighborhood window is according to following Parameter is determined:The distance and the 3rd position of the first position and the second place and the 4th position away from From.In other words, the distance of the distance and the 3rd position and the 4th position of first position and the second place Defect area or the size of extraneous region can be characterized, the size of neighborhood window can be according to the size for damaging region or extraneous region Configured.
Preferably, original image is divided into individual character image by described image acquisition module 301, and the original image is included extremely A few character, the character is selected from Chinese character, letter and number.The embodiment of the present invention in order to ensure image restoration accuracy and Original image, can be divided into individual character image by agility, to avoid other words from impacting the word currently to be recovered.
Preferably, image restoration device 30 can also include image conversion module 307, and image conversion module 307 is to such as Fruit described image is coloured image, then described image is converted into gray level image.In the present embodiment, in order to improve image restoration Accuracy and rapidity, if the image got is coloured image, can be converted to coloured image gray level image, Ye Jizhuan It is changed to the image for possessing single channel.Closer, coloured image can be converted to bianry image.
More contents of operation principle, working method on described image restoring means 30, are referred to Fig. 1 to figure 2 associated description, is repeated no more here.
The embodiment of the invention also discloses a kind of readable storage medium storing program for executing, computer instruction, the computer are stored thereon with The step of image recovery method shown in Fig. 1 being performed during instruction operation.The storage medium can include ROM, RAM, magnetic Disk or CD etc..
The embodiment of the invention also discloses a kind of terminal, the terminal can include memory and processor, the storage Be stored with the computer instruction that can be run on the processor on device.The processor can be with when running the computer instruction The step of performing image recovery method shown in Fig. 1.The user equipment includes but is not limited to mobile phone, computer, tablet personal computer Deng terminal device.
Although present disclosure is as above, the present invention is not limited to this.Any those skilled in the art, are not departing from this In the spirit and scope of invention, it can make various changes or modifications, therefore protection scope of the present invention should be with claim institute The scope of restriction is defined.

Claims (30)

1. a kind of image recovery method, it is characterised in that including:
Obtain pending image;
To each pixel in described image, fuzzy clustering processing is carried out using the pixel value of its neighborhood territory pixel, to determine each picture The corresponding classification pixel value of classification and each classification belonging to element;
The pixel value of all pixels in same category is entered as the corresponding classification pixel value of the category, after being restored Image.
2. image recovery method according to claim 1, it is characterised in that described to each pixel in described image, profit Fuzzy clustering processing is carried out with the pixel value of its neighborhood territory pixel to be included:
The pixel value of the pixel is updated using the neighborhood information of each pixel, the neighborhood information includes neighborhood half-tone information and neighbour Domain range information;
Fuzzy clustering processing is carried out using the pixel value after renewal.
3. image recovery method according to claim 1, it is characterised in that described to each pixel in described image, profit Also include before carrying out fuzzy clustering processing with the pixel value of its neighborhood territory pixel:
Described image is pre-processed according to the classification of predetermined described image, the classification is classified and many selected from defect Remaining classification.
4. the image recovery method according to claim 1 or 3, it is characterised in that described to each pixel in described image, Using the pixel value of its neighborhood territory pixel before fuzzy clustering processing also include:
Determine described image is categorized as defect classification, expansive working is first carried out to described image, then carry out etching operation.
5. the image recovery method according to claim 1 or 3, it is characterised in that described to each pixel in described image, Using the pixel value of its neighborhood territory pixel before fuzzy clustering processing also include:
Determine described image is categorized as unnecessary classification, etching operation is first carried out to described image, then carry out expansive working.
6. image recovery method according to claim 1, it is characterised in that described to each pixel in described image, profit Fuzzy clustering processing is carried out with the pixel value of its neighborhood territory pixel to be included:
The initial degree of membership of each pixel in described image relative to each classification is determined, and in the initial clustering of each classification The heart;
Using the pixel value of each pixel neighborhood territory pixel in its neighborhood window, it is subordinate to based on current cluster centre with current The new degree of membership of the new cluster centre of degree iterative calculation and each pixel, until iterations reaches maximum iteration, Or, the maximum of the new degree of membership of all pixels and current degree of membership difference is less than given threshold;
Classification according to belonging to the new degree of membership for each pixel that last time iteration is determined determines the pixel,
The new cluster centre of each classification determined according to last time iteration determines the corresponding classification pixel value of the category.
7. image recovery method according to claim 6, it is characterised in that the new of each pixel is calculated using below equation Degree of membership:Wherein, UiterPicture when (i, k) is i-th ter times iteration New degrees of membership of the plain i relative to cluster centre k, xiFor pixel i pixel value, vkFor cluster centre k pixel value, m is default Fuzzy Exponential, c is the quantity of cluster centre, W1 and W2 for pixel i neighborhood territory pixel Pixel Information, the neighborhood territory pixel Pixel Information is determined according to the pixel value of the neighborhood territory pixel and position.
8. image recovery method according to claim 6, it is characterised in that the new cluster is calculated using below equation Center:Wherein, viterNew the cluster centre k, N are during for i-th ter times iteration Sum of all pixels in described image, Uiter(i, k) be i-th ter time iteration when pixel i relative to cluster centre k newly be subordinate to Degree, xiFor pixel i pixel value, W1 for pixel i neighborhood territory pixel Pixel Information, the Pixel Information of the neighborhood territory pixel according to The pixel value of the neighborhood territory pixel and position are determined.
9. image recovery method according to claim 4, it is characterised in that described image is gray level image, described image The pixel value of the pixel of middle target part is in the first pixel span, and the pixel value of the pixel of background parts is in the second pixel In span, wherein the first pixel span is adjacent domains with the second pixel span;The determination institute That states image is categorized as defect classification, expansive working is first carried out to described image, then carries out etching operation include:
Transversal scanning described image, determines that pixel value is changed into the second pixel span from the first pixel span First position, determine that pixel value is changed into the second of the first pixel span from the second pixel span Put;
The longitudinal bilateral scanning in centre position from the first position and the second place, determines pixel value by second picture Plain span is changed into the 3rd position and the 4th position of the first pixel span;
If the distance of the first position and the second place is more than minimum lateral threshold value and less than maximum transversal threshold value, institute The distance for stating the 3rd position and the 4th position is more than minimum longitudinal threshold value and less than maximum longitudinal threshold value, then right Described image first carries out expansive working, then carries out etching operation.
10. image recovery method according to claim 5, it is characterised in that described image is gray level image,
The pixel value of the pixel of target part is in the first pixel span in described image, the pixel of the pixel of background parts Value is in the second pixel span;Wherein described first pixel span is adjacent with the second pixel span Domain, the determination described image is categorized as unnecessary classification, etching operation is first carried out to described image, then carry out expansive working bag Include:
Transversal scanning described image, determines that pixel value is changed into the first pixel span from the second pixel span First position, determine that pixel value is changed into the second of the second pixel span from the first pixel span Put;
The longitudinal bilateral scanning in centre position from the first position and the second place, determines pixel value by first picture Plain span is changed into the 3rd position and the 4th position of the second pixel span;
If the distance of the first position and the second place is more than minimum lateral threshold value and less than maximum transversal threshold value, institute The distance for stating the 3rd position and the 4th position is more than minimum longitudinal threshold value and less than maximum longitudinal threshold value, then right Described image first carries out etching operation, then carries out expansive working.
11. the image recovery method according to claim 9 or 10, it is characterised in that the gray level image is bianry image, The first pixel span is the first pixel value, and the second pixel span is the second pixel value.
12. the image recovery method according to claim 9 or 10, it is characterised in that the neighborhood window of the neighborhood territory pixel Size determined according to following parameter:The distance and the 3rd position of the first position and the second place and described The distance of 4th position.
13. the image recovery method according to claims 1 to 3,6 to 10 any one, it is characterised in that
The pending image of the acquisition includes:
Original image is divided into individual character image, the original image includes at least one character, and the character is selected from Chinese character, word Female and numeral.
14. the image recovery method according to claims 1 to 3,6 to 10 any one, it is characterised in that
Also include after the pending image of the acquisition:
If described image is coloured image, described image is converted into gray level image.
15. a kind of image restoration device, it is characterised in that including:
Image collection module, the pending image to obtain;
Fuzzy clustering module, to each pixel in described image, fuzzy clustering is carried out using the pixel value of its neighborhood territory pixel Processing, to determine the corresponding classification pixel value of classification and each classification belonging to each pixel;
Assignment module, the pixel value of all pixels in same category is entered as into the corresponding classification pixel value of the category, With the image after being restored.
16. image restoration device according to claim 15, it is characterised in that the fuzzy clustering module includes:
Updating block, the pixel value of the pixel is updated to the neighborhood information using each pixel, and the neighborhood information includes neighbour Domain half-tone information and neighborhood range information;
Clustering processing unit, to carry out fuzzy clustering processing using the pixel value after updating.
17. image restoration device according to claim 15, it is characterised in that also include:
Pretreatment module, to be pre-processed according to the classification of predetermined described image to described image, the classification Selected from defect classification and unnecessary classification.
18. the image restoration device according to claim 15 or 17, it is characterised in that also include:
First processing module, to determine that the defect that is categorized as of described image is classified, expansive working is first carried out to described image, then Carry out etching operation.
19. the image restoration device according to claim 15 or 17, it is characterised in that also include:
Second processing module, is categorized as unnecessary classification to determine described image, etching operation is first carried out to described image, then Carry out expansive working.
20. image restoration device according to claim 15, it is characterised in that the fuzzy clustering module includes:
Determining unit, to determine the initial degree of membership of each pixel in described image relative to each classification,
And the initial cluster center of each classification;
Unit is iterated to calculate, to the pixel value using each pixel neighborhood territory pixel in its neighborhood window, is gathered based on current Class center and the new degree of membership of the new cluster centre of current degree of membership iterative calculation and each pixel, until iterations Maximum iteration is reached, or, the maximum of the new degree of membership of all pixels and current degree of membership difference is less than setting Threshold value;
Taxon, to the class belonging to determining the pixel according to the new degree of membership for each pixel that last time iteration is determined Not, the new cluster centre of each classification determined according to last time iteration determines the corresponding classification pixel value of the category.
21. image restoration device according to claim 20, it is characterised in that the iterative calculation unit uses following public affairs Formula calculates the new degree of membership of each pixel:
Wherein, UiterPixel i phases when (i, k) is i-th ter times iteration For cluster centre k new degree of membership, xiFor pixel i pixel value, vkFor cluster centre k pixel value, m is default mould Index is pasted, c is the quantity of cluster centre, and W1 and W2 are the Pixel Information of pixel i neighborhood territory pixel, the pixel of the neighborhood territory pixel Information is determined according to the pixel value of the neighborhood territory pixel and position.
22. image restoration device according to claim 20, it is characterised in that the iterative calculation unit uses following public affairs Formula calculates the new cluster centre:Wherein, viterFor i-th ter times iteration when institute It is the sum of all pixels in described image, U to state new cluster centre k, Niter(i, k) be i-th ter times iteration when pixel i relative to Cluster centre k new degree of membership, xiFor pixel i pixel value, W1 is the Pixel Information of pixel i neighborhood territory pixel, the neighbour The Pixel Information of domain pixel is determined according to the pixel value of the neighborhood territory pixel and position.
23. image restoration device according to claim 18, it is characterised in that described image is gray level image, the figure The pixel value of the pixel of target part is in the first pixel span as in, and the pixel value of the pixel of background parts is in the second picture In plain span, wherein the first pixel span is adjacent domains with the second pixel span;Described first Processing module includes:
First position determining unit, to transversal scanning described image, determines that pixel value is become by the first pixel span For the first position of the second pixel span, determine that pixel value is changed into described first from the second pixel span The second place of pixel span;
Second place determining unit, to the longitudinal bilateral scanning in centre position from the first position and the second place, Determine that pixel value is changed into the 3rd position and the 4th position of the first pixel span from the second pixel span;
First processing units, if the distance to the first position and the second place is more than minimum lateral threshold value and small In maximum transversal threshold value, the distance of the 3rd position and the 4th position is more than minimum longitudinal threshold value and less than described Maximum longitudinal direction threshold value, then first carry out expansive working, then carry out etching operation to described image.
24. image restoration device according to claim 19, it is characterised in that described image is gray level image, the figure The pixel value of the pixel of target part is in the first pixel span as in, and the pixel value of the pixel of background parts is in the second picture In plain span;Wherein described first pixel span is adjacent domains, described second with the second pixel span Processing module includes:
3rd position determination unit, to transversal scanning described image, determines that pixel value is become by the second pixel span For the first position of the first pixel span, determine that pixel value is changed into described second from the first pixel span The second place of pixel span;
4th position determination unit, to the longitudinal bilateral scanning in centre position from the first position and the second place, Determine that pixel value is changed into the 3rd position and the 4th position of the second pixel span from the first pixel span;
Second processing unit, if the distance to the first position and the second place is more than minimum lateral threshold value and small In maximum transversal threshold value, the distance of the 3rd position and the 4th position is more than minimum longitudinal threshold value and less than described Maximum longitudinal direction threshold value, then first carry out etching operation, then carry out expansive working to described image.
25. the image restoration device according to claim 23 or 24, it is characterised in that the gray level image is binary map Picture, the first pixel span is the first pixel value, and the second pixel span is the second pixel value.
26. the image restoration device according to claim 23 or 24, it is characterised in that the neighborhood window of the neighborhood territory pixel Size determined according to following parameter:The distance and the 3rd position of the first position and the second place and described The distance of 4th position.
27. the image restoration device according to claim 15 to 17,20 to 24 any one, it is characterised in that described image Original image is divided into individual character image by acquisition module, and the original image includes at least one character, and the character is selected from the Chinese Word, letter and number.
28. the image restoration device according to claim 15 to 17,20 to 24 any one, it is characterised in that also include:
Image conversion module, if being coloured image to described image, gray level image is converted to by described image.
29. a kind of computer-readable recording medium, is stored thereon with computer instruction, it is characterised in that the computer instruction During operation any one of perform claim requirement 1 to 14 the step of image recovery method.
30. be stored with the meter that can be run on the processor on a kind of terminal, including memory and processor, the memory Calculation machine is instructed, it is characterised in that perform claim requires any one of 1 to 14 institute when the processor runs the computer instruction The step of stating image recovery method.
CN201710424945.XA 2017-06-07 2017-06-07 Image restoration method and device, computer-readable storage medium and terminal Active CN107292840B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710424945.XA CN107292840B (en) 2017-06-07 2017-06-07 Image restoration method and device, computer-readable storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710424945.XA CN107292840B (en) 2017-06-07 2017-06-07 Image restoration method and device, computer-readable storage medium and terminal

Publications (2)

Publication Number Publication Date
CN107292840A true CN107292840A (en) 2017-10-24
CN107292840B CN107292840B (en) 2020-01-17

Family

ID=60096182

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710424945.XA Active CN107292840B (en) 2017-06-07 2017-06-07 Image restoration method and device, computer-readable storage medium and terminal

Country Status (1)

Country Link
CN (1) CN107292840B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109257647A (en) * 2018-10-31 2019-01-22 南昌努比亚技术有限公司 Video image compensation method, mobile terminal and readable storage medium storing program for executing
CN109543753A (en) * 2018-11-23 2019-03-29 中山大学 Licence plate recognition method based on adaptive fuzzy repair mechanism

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102945368A (en) * 2012-10-17 2013-02-27 西安理工大学 Method for positioning and identifying laser character of beer bottle cap
CN105654453A (en) * 2014-11-10 2016-06-08 华东师范大学 Robust FCM image segmentation method
CN106408569A (en) * 2016-08-29 2017-02-15 北京航空航天大学 Brain MRI (magnetic resonance image) segmentation method based on improved fuzzy C-means clustering algorithm
CN106504260A (en) * 2016-10-31 2017-03-15 上海智臻智能网络科技股份有限公司 A kind of FCM image partition methods and system
CN106600610A (en) * 2016-12-07 2017-04-26 上海智臻智能网络科技股份有限公司 FCM image segmentation method and apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102945368A (en) * 2012-10-17 2013-02-27 西安理工大学 Method for positioning and identifying laser character of beer bottle cap
CN105654453A (en) * 2014-11-10 2016-06-08 华东师范大学 Robust FCM image segmentation method
CN106408569A (en) * 2016-08-29 2017-02-15 北京航空航天大学 Brain MRI (magnetic resonance image) segmentation method based on improved fuzzy C-means clustering algorithm
CN106504260A (en) * 2016-10-31 2017-03-15 上海智臻智能网络科技股份有限公司 A kind of FCM image partition methods and system
CN106600610A (en) * 2016-12-07 2017-04-26 上海智臻智能网络科技股份有限公司 FCM image segmentation method and apparatus

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109257647A (en) * 2018-10-31 2019-01-22 南昌努比亚技术有限公司 Video image compensation method, mobile terminal and readable storage medium storing program for executing
CN109543753A (en) * 2018-11-23 2019-03-29 中山大学 Licence plate recognition method based on adaptive fuzzy repair mechanism
CN109543753B (en) * 2018-11-23 2024-01-05 中山大学 License plate recognition method based on self-adaptive fuzzy repair mechanism

Also Published As

Publication number Publication date
CN107292840B (en) 2020-01-17

Similar Documents

Publication Publication Date Title
CN108510485B (en) Non-reference image quality evaluation method based on convolutional neural network
CN112052886B (en) Intelligent human body action posture estimation method and device based on convolutional neural network
CN110059698B (en) Semantic segmentation method and system based on edge dense reconstruction for street view understanding
CN109978807B (en) Shadow removing method based on generating type countermeasure network
CN110889449A (en) Edge-enhanced multi-scale remote sensing image building semantic feature extraction method
CN111047522B (en) Image restoration method based on edge generation
JP7048225B2 (en) Trained model for building area extraction
CN110070091B (en) Semantic segmentation method and system based on dynamic interpolation reconstruction and used for street view understanding
CN106934780A (en) A kind of automatic watermark minimizing technology based on image repair
CN109558806A (en) The detection method and system of high score Remote Sensing Imagery Change
CN112184585B (en) Image completion method and system based on semantic edge fusion
CN112347861A (en) Human body posture estimation method based on motion characteristic constraint
CN110751195B (en) Fine-grained image classification method based on improved YOLOv3
CN107506792B (en) Semi-supervised salient object detection method
CN111179196B (en) Multi-resolution depth network image highlight removing method based on divide-and-conquer
CN109685772B (en) No-reference stereo image quality evaluation method based on registration distortion representation
CN112884758B (en) Defect insulator sample generation method and system based on style migration method
CN111080591A (en) Medical image segmentation method based on combination of coding and decoding structure and residual error module
CN111898566B (en) Attitude estimation method, attitude estimation device, electronic equipment and storage medium
CN111353956A (en) Image restoration method and device, computer equipment and storage medium
CN111462090B (en) Multi-scale image target detection method
CN116030498A (en) Virtual garment running and showing oriented three-dimensional human body posture estimation method
CN113378812A (en) Digital dial plate identification method based on Mask R-CNN and CRNN
CN107292840A (en) Image recovery method and device, computer-readable recording medium, terminal
CN111199255A (en) Small target detection network model and detection method based on dark net53 network

Legal Events

Date Code Title Description
PB01 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