CN1290058C - Method for treating scratch of digital image - Google Patents

Method for treating scratch of digital image Download PDF

Info

Publication number
CN1290058C
CN1290058C CN 03148117 CN03148117A CN1290058C CN 1290058 C CN1290058 C CN 1290058C CN 03148117 CN03148117 CN 03148117 CN 03148117 A CN03148117 A CN 03148117A CN 1290058 C CN1290058 C CN 1290058C
Authority
CN
China
Prior art keywords
pixel
cut
difference
special
digital picture
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.)
Expired - Fee Related
Application number
CN 03148117
Other languages
Chinese (zh)
Other versions
CN1567372A (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.)
Primax Electronics Ltd
Destiny Technology Corp
Original Assignee
Primax Electronics 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 Primax Electronics Ltd filed Critical Primax Electronics Ltd
Priority to CN 03148117 priority Critical patent/CN1290058C/en
Publication of CN1567372A publication Critical patent/CN1567372A/en
Application granted granted Critical
Publication of CN1290058C publication Critical patent/CN1290058C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)

Abstract

The present invention discloses a method for treating scratches of digital images, which comprises the following steps: the differences of selected pixels Y (i, j) and adjacent pixels are calculated to identify the number of abnormal pixels of the adjacent pixels; the selected pixels of which the number is bigger than a number reference value are marked as special pixels; the surrounding regions of the special pixels are divided into a plurality of adjacent blocks to calculate the differences between the adjacent blocks; the special pixels are marked with scratch pixels according to the differences of the adjacent blocks; the regions which are encircled by the scratch pixels are in refinement and stuffing. The method can accurately position and repair the scratches without the support of hardware.

Description

The cut disposal route of digital picture
Technical field
The present invention relates to a kind of disposal route of digital picture, particularly relate to a kind of cut disposal route of digital picture.
Background technology
Along with the continuous development and the application of digital technology, Digital image technology is changing the mode that we handle image.Real-life a lot of information can be handled and store with the data of digital form, and Network Transmission.Digital picture is mainly obtained from the external world by equipment such as digital camera, image reading apparatus, utilizes the direct drafting of graphics software also can obtain digital picture certainly.The height of digital picture quality not only depends on the quality of image source itself, more depends primarily on the situation of image Input/Output Device.The height of input equipment performance, meeting directly influence the quality of image.
We know the digital picture that obtains through regular meeting because original image impaired, or the dust of piling up etc. makes to go out the such flaw of phenomenon cut on the photo, these materials are handled, to recover its original looks and to be preserved, be an important job.
At present the processing of cut is mostly carried out at egative film." trace technology automatically disappears " is the up-to-date technological achievement in current international scanning field, and it mainly is at the cut in the egative film.Negative film scanner not only requires manufacturer to have advanced photoelectric technology as high-end electron image product, and the production technology to manufacturer has also proposed strict requirement simultaneously.
Technique known positions the cut in the image and mostly relies on hardware to solve, and not only expense is than higher, and the effect of handling is also not ideal.Softwares such as the Photoshop in the computing machine can be used for the image of impaired egative film is repaired, but it is very complicated to operate.Often in order to repair slight one cut, photographer will take the time of several hrs, and for the such line production unit of photo studio, this work efficiency is intolerable.
In addition, the cut processing to digital picture is divided into two big steps usually, at first the cut that will be removed in the image is positioned, and next be exactly repairing to scored area.To the repairing technique of cut comparative maturity, the current most thorny issue positions cut exactly, and how finding cut accurately is problem demanding prompt solution.
Summary of the invention
In view of this,, the present invention proposes a kind of cut disposal route of digital picture, need not the support of hardware, and can locate cut exactly and cut is repaired for solving above-mentioned prior art problems.
In order to realize that above-mentioned order has, the invention provides a kind of cut disposal route of digital picture, (i j) is adjacent difference between the pixel, to determine the number of abnormal pixel in this neighbor to comprise the steps: to calculate selected pixel Y; With the number of this abnormal pixel selected pixel, be labeled as special pixel greater than a quantity reference value; The peripheral region of special pixel is divided into a plurality of adjacent blocks, and calculates the difference between this adjacent block; According to the difference between this adjacent block, mark cut pixel in special pixel; Reach refinement and fill the zone that this cut pixel surrounds.
The cut disposal route of above-mentioned digital picture, its characteristics are that described abnormal pixel is this neighbor and the pixel of the absolute value that is somebody's turn to do the difference of selecting pixel intensity greater than unusual reference value.
The cut disposal route of above-mentioned digital picture, its characteristics are that described special pixel comprises cut pixel and edge pixel.
The cut disposal route of above-mentioned digital picture, its characteristics are that described peripheral region with special pixel is divided into a plurality of adjacent blocks, are that the peripheral region with this special pixel is divided into 4 adjacent blocks.
The cut disposal route of above-mentioned digital picture, its characteristics are that described peripheral region with special pixel is divided into a plurality of adjacent blocks, are that the peripheral region with this special pixel is divided into 3 adjacent blocks.
The cut disposal route of above-mentioned digital picture, its characteristics are that described peripheral region with special pixel is divided into a plurality of adjacent blocks, for the peripheral region with this special pixel is divided into 8 adjacent blocks.
The cut disposal route of above-mentioned digital picture, its characteristics are that the step of the difference between this adjacent block of described calculating more comprises: the mean square deviation of calculating all pixels of each adjacent block; Reach the relatively difference between this mean square deviation.
The cut disposal route of above-mentioned digital picture, its characteristics are, the described relatively step of difference between this mean square deviation, if the adjacent block number is 4 o'clock, relatively formula is:
Dif=MaxVar-Mid1Var-Mid2Var+MinVar
Wherein, Dif is the difference between the mean square deviation, and MaxVar is the mean square deviation of the adjacent block of exponential quantity maximum, and Mid1Var and Mid2Var are the mean square deviations of exponential quantity two adjacent blocks placed in the middle, and MinVar is the mean square deviation of the adjacent block of exponential quantity minimum.
The cut disposal route of above-mentioned digital picture, its characteristics are, the described relatively step of difference between this mean square deviation, if the adjacent block number is 3 o'clock, relatively formula is:
Dif=MaxVar-2MidVar+MinVar
Wherein, Dif is the difference between the mean square deviation, and MaxVar is the mean square deviation of the adjacent block of exponential quantity maximum, and Mid is the mean square deviation of exponential quantity adjacent block placed in the middle, and MinVar is the mean square deviation of the adjacent block of exponential quantity minimum.
The cut disposal route of above-mentioned digital picture, its characteristics are that described according to the difference between this adjacent block, the step of mark cut pixel in special pixel is if this difference (Dif) then is labeled as the cut pixel less than the difference reference value in special pixel; If this difference then is labeled as edge pixel greater than this difference reference value in special pixel.
The disclosed digital image processing method according to the present invention can be decided to be cut and fill fast and accurately.The processing of cut be need not support on the hardware, saved spending, improved the treatment effect of digital picture simultaneously.
Relevant detailed content of the present invention and technology cooperate graphic being described as follows now:
Description of drawings
Fig. 1 is the overview flow chart of the cut disposal route of digital picture of the present invention;
Fig. 2 is the process flow diagram of embodiment of the cut disposal route of digital picture of the present invention;
Fig. 3 is the synoptic diagram of neighbor of the cut disposal route of digital picture of the present invention; And
Fig. 4 A, 4B, 4C, Fig. 4 D are the synoptic diagram of adjacent block of the cut disposal route of digital picture of the present invention.
Embodiment
According to the cut disposal route of digital picture of the present invention, it is mainly used in by equipment such as digital camera, image reading apparatus, and the digital picture of obtaining from the external world is utilized graphics software directly to draw certainly and obtained digital picture and also be suitable for the present invention.
Cut disposal route according to digital picture provided by the invention sees also Fig. 1, and this figure is the overview flow chart of the cut disposal route of digital picture of the present invention.At first, in step 110, (i j) is adjacent difference between the pixel, to determine the number of abnormal pixel in this neighbor to calculate selected pixel Y, then, in step 120,, be labeled as special pixel with the number of this abnormal pixel selected pixel greater than the quantity reference value, in step 130, peripheral region with special pixel is divided into a plurality of adjacent blocks again, and calculates the difference between this adjacent block, step 140, according to the difference between this adjacent block, mark cut pixel in special pixel,, last, in step 150, refinement is also filled the zone that this cut pixel surrounds.
In order to describe method of the present invention in detail, see also Fig. 2, this figure is the process flow diagram of embodiment of the cut disposal route of digital picture of the present invention.At first, in step 210, image is carried out pre-service, in actual applications, the original image that our system obtains is not perfectly, the original image that obtains for system, owing to reasons such as noise, illumination, emissions, make the of low quality of image, thus need carry out pre-service, to help extracting our Useful Information.The pre-service of image comprises contents such as figure image intensifying, smothing filtering, sharpening.Image is carried out Filtering Processing can eliminate or weaken noises such as stain in the image, water stain, cut, cavity, effectively improve the quality of image.
We know the rgb value that captures image by sensor, the rgb color system is the mode of our the most frequently used expression color, being the color mode of coloured light, is three wave bands of red, green, blue corresponding to the three primary colours of human vision, utilizes R, G, these three components of B three primary colours can characterize color.In the present invention, need RGB color mode view data is converted to the data of YCbCr color format then, i.e. step 220.In YCbCr, wherein Y represents brightness, and Cb and Cr then represent colourity, saturation degree.Here only need obtain the numerical value of Y part.
Being converted to the YCbCr form by rgb format is the most general a kind of conversion, only need know the coefficient from a kind of form map to another kind of form, can finish data-switching by following computing formula:
Y=0.2990R+0.5870G+0.1140B
Cb=-0.1687R-0.3313G+0.5000B+128
Cr=0.5000R-0.4187G-0.0813B+128
Cut is handled, and primary also is exactly cut being positioned of most critical.Cut is positioned the pixel that marks scored area exactly in image, just the cut pixel.All corresponding unique Y value of each pixel in the image, the Y value has been represented the brightness of pixel.Because the brightness of cut pixel should be bigger, therefore to mark the bigger pixel of brightness in the image, i.e. " selected pixel ", so-called " selected pixel " just is meant the pixel that those brightness values are bigger, here the Y value is defined as selected pixel greater than the pixel of " luminance reference value ", it is 80 that the present invention chooses the luminance reference value, and (i, pixel j)>80 is labeled as selected pixel with Y in step 230 in the present invention just.
See also Fig. 3, selected pixel is that (i, j), (i j), has the pixel of eight directions adjacent with it around it to Y, and these eight pixels are " neighbor " for each selected pixel Y in the image.For selected pixel Y (i, j), its corresponding neighbor is as shown in the table:
Y(i-1,j-1) Y(i-1,j) Y(i-1,j+1)
Y(i,j-1) Y(i,j) Y(i,j+1)
Y(i+1,j-1) Y(i+1,j) Y(i+1,j+1)
Its corresponding value is respectively:
Y = Y ( i - 1 , j - 1 ) Y ( i - 1 , j ) Y ( i - 1 , j + 1 ) Y ( i , j - 1 ) Y ( i , j ) Y ( i , j + 1 ) Y ( i + 1 , j - 1 ) Y ( i + 1 , j ) Y ( i + 1 , j + 1 ) =
217.0273 200.8299 122.9947 206.0808 161.8376 108.1474 180.5265 109.3145 88.5259
In neighbor, have a part for " abnormal pixel ", described abnormal pixel is exactly for a certain selected pixel, in its 8 neighbors, the pixel that differs greatly with this selected pixel.We need mark the abnormal pixel of all selected pixels; concrete computing method are; calculate the absolute value of the difference of selected pixel and all neighbors one by one; if this absolute value is greater than one " unusual reference value "; differing greatly of this neighbor pixel selected with it then is described; therefore it is labeled as abnormal pixel; the unusual reference value here is 40; be exactly in neighbor; the present invention will be labeled as abnormal pixel greater than 40 neighbor with the absolute value of the difference of selected pixel, i.e. step 240.
The result of gained calculates the number of the abnormal pixel of each selected pixel then, all is labeled as abnormal pixel adds up, if greater than one " quantity reference value ", should selected pixel be " special pixel " then.Experience shows that the number of the abnormal pixel of elected fixation element was greater than 4 o'clock, and it is a special pixel, just can mark all special pixel, step 250 in image thus.
" special pixel " be meant brightness more greatly, the more selected pixel of the number of abnormal pixel on every side, it may be the cut pixel, also may be edge pixel.Next in special pixel, find out the cut pixel exactly.So-called edge just is meant that image local brightness changes the most significant part.The difference of cut pixel and edge pixel is exactly that cut pixel and the zone around it are more approaching, and the edge pixel then contrast with the peripheral region is bigger.Therefore for each special pixel, we are a plurality of " adjacent blocks " with the area dividing around it, relatively the difference between each adjacent block.During concrete the division, the peripheral region can be divided into 4 pieces, also can all allow for 3 pieces, 8 pieces etc.When the peripheral region being divided into 4 adjacent blocks, see also Fig. 4 A~Fig. 4 D, be the synoptic diagram of the adjacent block of the embodiment of the invention.4 adjacent blocks are respectively adjacent block 401, adjacent block 402, adjacent block 403 and adjacent block 404.Include 9 pixels in each adjacent block, step 260 of the present invention pair 4 adjacent blocks carry out mean square deviation respectively and calculate, and calculate the mean square deviation of 9 pixels in each adjacent block.The difference that compares 4 mean square deviations then.The computing formula of calculating the difference of 4 adjacent block mean square deviations is:
Dif=MaxVar-Mid1Var-Mid2Var+MinVar
Wherein, Dif is the difference between the mean square deviation, and MaxVar is the mean square deviation of the adjacent block of numerical value maximum, and Mid1Var and Mid2Var are the mean square deviations of numerical value two adjacent blocks placed in the middle, and MinVar is the mean square deviation of the adjacent block of numerical value minimum.If the Dif value of gained is less than " difference reference value ", then this special pixel is the cut pixel, on the contrary, if the value of gained greater than this " difference reference value ", then this special pixel is an edge pixel.The scope of described " difference reference value " is 5~8, and the present invention gets 5.5, that is to say, carries out a judgement in step 270:
If MaxVar-Mid1Var-Mid2Var+MinVar<5.5, then in step 280, this special pixel of the present invention is labeled as the cut pixel, otherwise execution in step 281, the present invention is labeled as edge pixel with it.
When image division was 3 adjacent blocks, the computing formula of difference can be Dif=MaxVar-2MidVar+MinVar, and different during with 4 adjacent blocks is that MidVar is the mean square deviation of a numerical value adjacent block placed in the middle.
After finding the cut pixel, just can find cut according to the zone that the cut pixel surrounds.The scored area of mark need be done refinement usually and handle.Morph based on image is a kind of 2 D animation technology commonly used.Interpolation distortion between the image is called Morph, the Morph technology is obtaining application widely aspect the film trick processing, it can be felt just as the film film that becomes the back slowly by the front merging dexterously between two different filmstrips.The present invention utilizes the method for Morph that image is carried out refinement, in step 290, the zone after the refinement is filled.When image is filled.Certain mean value of cut surrounding pixel can be substituted vestige, thereby realize reparation image.
Though the present invention discloses as above with aforesaid preferred embodiment; right its is not in order to limit the present invention; any those of ordinary skills; without departing from the spirit and scope of the present invention; when can doing some corresponding change and retouching, so protection scope of the present invention should be as the criterion with the protection domain of claims.

Claims (7)

1, a kind of cut disposal route of digital picture comprises the steps:
(i j) is adjacent difference between the pixel, to determine the number of abnormal pixel in this neighbor to calculate selected pixel Y;
With the number of this abnormal pixel selected pixel, be labeled as special pixel greater than a quantity reference value;
The peripheral region of special pixel is divided into a plurality of adjacent blocks, and calculates the difference between this adjacent block;
According to the difference between this adjacent block, mark cut pixel in special pixel; And
Refinement is also filled the zone that this cut pixel surrounds.
2, the cut disposal route of digital picture according to claim 1 is characterized in that, described abnormal pixel is this neighbor and the pixel of the absolute value that is somebody's turn to do the difference of selecting pixel intensity greater than unusual reference value.
3, the cut disposal route of digital picture according to claim 1 is characterized in that, described special pixel comprises cut pixel and edge pixel.
4, the cut disposal route of digital picture according to claim 1 is characterized in that, described peripheral region with special pixel is divided into a plurality of adjacent blocks, is that the peripheral region with this special pixel is divided into 4 adjacent blocks.
5, the cut disposal route of digital picture according to claim 1 is characterized in that, the step of the difference between this adjacent block of described calculating more comprises:
Calculate the mean square deviation of all pixels of each adjacent block; And
The difference between this mean square deviation relatively.
6, the cut disposal route of digital picture according to claim 5 is characterized in that, the described relatively step of difference between this mean square deviation, if the adjacent block number is 4 o'clock, relatively formula is:
Dif=MaxVar-Mid1Var-Mid2Var+MinVar
Wherein, Dif is the difference between the mean square deviation, and MaxVar is the mean square deviation of the adjacent block of exponential quantity maximum, and Mid1Var and Mid2Var are the mean square deviations of exponential quantity two adjacent blocks placed in the middle, and MinVar is the mean square deviation of the adjacent block of exponential quantity minimum.
7, the cut disposal route of digital picture according to claim 1, it is characterized in that, described according to the difference between this adjacent block, the step of mark cut pixel in special pixel is if this difference (Dif) then is labeled as the cut pixel less than the difference reference value in special pixel; If this difference then is labeled as edge pixel greater than this difference reference value in special pixel.
CN 03148117 2003-07-02 2003-07-02 Method for treating scratch of digital image Expired - Fee Related CN1290058C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 03148117 CN1290058C (en) 2003-07-02 2003-07-02 Method for treating scratch of digital image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 03148117 CN1290058C (en) 2003-07-02 2003-07-02 Method for treating scratch of digital image

Publications (2)

Publication Number Publication Date
CN1567372A CN1567372A (en) 2005-01-19
CN1290058C true CN1290058C (en) 2006-12-13

Family

ID=34472192

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 03148117 Expired - Fee Related CN1290058C (en) 2003-07-02 2003-07-02 Method for treating scratch of digital image

Country Status (1)

Country Link
CN (1) CN1290058C (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510303B (en) * 2009-03-26 2011-09-14 北京兆维电子(集团)有限责任公司 Method and system for image renovation
CN101674397B (en) * 2009-09-27 2013-01-09 上海大学 Repairing method of scratch in video sequence
CN101692691B (en) * 2009-09-27 2012-07-04 上海大学 Method for detecting bands in video images
JP2011170838A (en) * 2010-01-20 2011-09-01 Sanyo Electric Co Ltd Image processing device and electronic apparatus
CN103175844A (en) * 2012-03-16 2013-06-26 沈阳理工大学 Detection method for scratches and defects on surfaces of metal components
CN104349045B (en) * 2013-08-09 2019-01-15 联想(北京)有限公司 A kind of image-pickup method and electronic equipment
CN104636727A (en) * 2015-02-08 2015-05-20 浙江大学 Face recognition method applicable to multiple expressions and multiple gestures

Also Published As

Publication number Publication date
CN1567372A (en) 2005-01-19

Similar Documents

Publication Publication Date Title
CN109068025B (en) Lens shadow correction method and system and electronic equipment
US20070280529A1 (en) External-Appearance Inspection Apparatus
CN1615029A (en) Method and apparatus for enhancing local luminance of image, and recording medium
CN1633159A (en) A method for removing image noise
CN1290058C (en) Method for treating scratch of digital image
CN106846279B (en) A kind of adapting to image method for repairing and mending and its system based on interpolation by continued-fractions technology
CN103973997A (en) Image processing method and device
CN100382107C (en) Method and system for differentially and regularly modifying a digital image by pixel
CN114878595B (en) Book printing quality detection method
CN105574819A (en) Real-time image defogging method and apparatus
CN101398929B (en) Method and device for restraining night image noise
CN1780358A (en) Photograph image-processing method and device thereof
CN114581339A (en) Metal industrial product surface defect data enhancement method
JP2003143421A (en) Image processing device and method therefor
US7324704B2 (en) Method of repairing scratches in digital images
US7272266B2 (en) Method for restoring faded photographs and film
JP2007049496A (en) Image processing method and apparatus
CN1755708A (en) Method for extracting text filed in digital image
CN1604135A (en) Single color words reinforcing method
CN1581926A (en) Half-tone processing method for automatic detecting image-text
CN1867036A (en) Negative scanning processing method and its device
JP2002320237A (en) Method for detecting chromatic aberration in magnification
CN111970449B (en) Image processing method, device, terminal and computer readable storage medium
JP6160264B2 (en) Image processing apparatus and image processing method
CN101505361B (en) Image processing equipment and image processing method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20061213

Termination date: 20150702

EXPY Termination of patent right or utility model