CN108345881A - A kind of document quality detection method based on computer vision - Google Patents
A kind of document quality detection method based on computer vision Download PDFInfo
- Publication number
- CN108345881A CN108345881A CN201810101325.7A CN201810101325A CN108345881A CN 108345881 A CN108345881 A CN 108345881A CN 201810101325 A CN201810101325 A CN 201810101325A CN 108345881 A CN108345881 A CN 108345881A
- Authority
- CN
- China
- Prior art keywords
- image
- point
- picture
- file
- document
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/22—Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/40—Document-oriented image-based pattern recognition
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/24—Aligning, centring, orientation detection or correction of the image
- G06V10/243—Aligning, centring, orientation detection or correction of the image by compensating for image skew or non-uniform image deformations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/34—Smoothing or thinning of the pattern; Morphological operations; Skeletonisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/44—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/48—Extraction of image or video features by mapping characteristic values of the pattern into a parameter space, e.g. Hough transformation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/98—Detection or correction of errors, e.g. by rescanning the pattern or by human intervention; Evaluation of the quality of the acquired patterns
- G06V10/993—Evaluation of the quality of the acquired pattern
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Artificial Intelligence (AREA)
- Image Analysis (AREA)
Abstract
The present invention relates to a kind of document quality detection methods based on computer vision.Difficult for traditional visual inspection, efficiency is low, poor reliability, and the problem of being affected by subjectivity proposes document quality detection method based on computer vision.Accurately to detect document quality, this method obtains first prints video progress frozen frozen mass extraction by rational method to High Speed Document;Secondly, preprocess method based on computer vision carries out suitable image preprocessing to file and picture;Again, good that file and picture carries out accurate contour detecting and extraction to pre-processing;And then, Slant Rectify is carried out to the document profile image extracted so that lopsided image becomes the document image to be detected normally to tile;Finally, PSNR and MSE quality evaluations are carried out to image to be detected, is compared with template, obtains the testing result of document quality.This method possesses the features such as high efficiency, reliability, continuity, flexibility etc., has stronger practical application.
Description
Technical field
The present invention relates to computer visions and digital image arts, and are applied in document quality detection, especially
A kind of document quality detection method based on computer vision.
Background technology
Fast-developing with the society of 21st century, the fast development and progress of industry and service trade are printed in modernization
Brush has industrially carried out supermatic production, since the competition between each enterprise is more and more fierce in service trade,
So the requirement for the appearance printing quality of document is higher and higher, and it is more and more for the demand of document, it needs to huge
The document of quantity carry out taxonomic revision also at headache the problem of.In Modern Press enterprise by the pressure shadow of time and cost
Under sound, traditional visually observing can only qualitatively describe print quality, and cannot it is a large amount of, rapidly print quality is quantified
Description can not accurately classify quickly and according to certain tagsorts document.Promote people in these cases
Urgently seek the document detection of efficiently and accurately and the intelligence system of classification.
And in recent years, computer vision technique is fast-developing, and various detection techniques based on computer vision are in many realities
It has been widely used and has developed in the application system on border.Computer vision is to replace the mankind with industrial camera and computer,
In the case of no human intervention by computer computer come target is identified, tracing detection.Generally speaking, it exactly uses
Machine replaces human eye to handle and analyze image.The features such as possessing high efficiency, reliability, continuity, flexibility etc..In modern chemical industry
In Masses of Document printing in industry and service trade, probably due to not reach requirement, printing material inadequate for printing press precision, with
And the complicated technology in printing technology also has environment etc. factor.The document printed may have various quality and lack
Fall into, for example insurance policy exists as an example, printing defects have that ink stain, pin hole, corrugation, word be fuzzy, skip printing of characters, the flaw
Defect, scratch, ghost image, cut, dislocation, register trouble, chromatography error etc..These mass defects can become the development bottle of industrial enterprise
Neck, for service trade, the case where causing to be less competitive than others.Meanwhile because manual quality's detection efficiency well below machine
The efficiency of computer, these situations force document quickly to detect with classification as inevitable development trend.
Invention content
The purpose of the present invention is to provide a kind of document quality detection methods based on computer vision, to overcome existing people
The existing defect of work detection, and solve to be directed to document quality detection method based on computer vision.
To achieve the above object, the technical scheme is that:A kind of document quality detection side based on computer vision
Method is realized in accordance with the following steps:
Step S1:Frozen frozen mass is extracted to the high-speed image video sequence of input and is detected processing to get to needs
File and picture;
Step S2:The frozen frozen mass extracted is pre-processed, noise reduction and Edge Enhancement are carried out, excludes environmental disturbances item;
Step S3:Image after being pre-processed to step S2 carries out document profile detection, then presses contours extract file and picture
Part;
Step S4:Slant Rectify is carried out to file and picture on spatial alternation, makes the vertical vertical view document of tiling
Image;
Step S5:The file and picture that step S4 identifications navigate to is compared by quality evaluation algorithm with template, is examined
Measure the quality level of document.
In an embodiment of the present invention, in the step S1, file and picture to be detected is extracted as follows:
Step S11:Frame number I is taken to the high-speed video under printer of input, image is extracted every I frame numbers, chooses
The video streaming of input is image stream by predetermined interval frame number;
Step S12:Frozen frozen mass processing is carried out to image stream, two images before and after in image stream are subjected to image algorithm phases
Subtract, it is pixel 255 to make same section, and it is 0 to differ part;
Step S13:The image after phase reducing, 0 pixel number N are counted, if N is less than the threshold value Y preset, when
Previous frame is frozen frozen mass, otherwise, abandons this frame, continues step S12.
In an embodiment of the present invention, in the step S2, frozen frozen mass is pre-processed as follows:
Step S21:Image to be detected is subjected to picture smooth treatment, Mean by Mean Shift mean shift algorithms
Shift algorithm steps are:
S211:First a pixel centered on point is randomly selected in picture;
S212:The offset mean value M (x) of central point is calculated,Wherein, x indicates that central point is horizontal
Coordinate y indicates the ordinate of central point, ShIt is the higher-dimension ball region that a radius is h:K expressions have k in this n sample point
Fall into ball ShIn;
S213:The mobile point deviates mean value, X to itt+1=Mt+xt, MtFor the offset mean value acquired under t states;xtFor t shapes
Center under state, Xt+1For xtCenter under next state;Then it as new starting point, continues to move to, until meeting one
Fixed condition terminates;
Step S22:Image to be detected is subjected to morphological operation opening operation, i.e., first corrodes the process expanded afterwards to image,
Its mathematic(al) representation is as follows:
Dst=open (src, element)=dilate (erode (src, element))
Wherein, src is input picture, and element is the core of definition, and erode is etching operation, and dilate is expansion behaviour
Make;
Step S23:Image to be detected is subjected to binary conversion treatment, a threshold value is chosen and image is switched into gray level image.
In an embodiment of the present invention, in the step S3, the image after being pre-processed to step S2 carries out document wheel
Steps are as follows for the specific implementation of exterior feature detection:
Step S31:Contour detecting is carried out to image to be detected using Canny operators, the convolution operator of Canny isX and y is reference axis X and the variable of Y-axis, SxIt is that its x Directional partial derivative calculates masterplate,
SyIts y Directional partial derivative calculates masterplate, x-axis direction, y-axis direction first-order partial derivative matrix, gradient magnitude and gradient side
To mathematic(al) representation be:
P [i, j]=(f [i, j+1]-f [i, j]+f [i+1, j+1]-f [i+1, j])/2
Q [i, j]=(f [i, j]-f [i+1, j]+f [i, j+1]-f [i+1, j+1])/2
θ[i:J]=arCtan (Q [i:j]P[i:j])
Wherein, i and j is array index, and wherein f is gray value of image, and P represents X-direction gradient magnitude, and Q represents Y-axis side
To gradient magnitude, M is the amplitude, and θ is gradient direction, that is, angle;
Non-maxima suppression is carried out further according to calculated gradient magnitude, dual threashold value-based algorithm is and then used to detect and connect side
Edge;
Step S32:Function is searched by profile, and all contour edges are extracted from binary map again by writing a deletion
Algorithm:The area of all connected domains is calculated, the connected domain that those areas are less than predetermined threshold value is then deleted, leaves behind the wheel of document
Exterior feature figure;
Step S33:The straightway in profile diagram is detected, using accumulated probability Hough transformation, steps are as follows:
S331:Image coordinate is mapped on image polar coordinates, straight line expression formula is
Wherein, r is distance of the origin to straight line,It is X axis coordinate, β is Y axis coordinate, and λ is the inclination angle of straight line and X-axis;
S332:A characteristic point in image, i.e. marginal point are randomly selected, if the point has been demarcated as being a certain item
Point on straight line then continues to randomly select a marginal point in remaining marginal point, be over until all marginal points all extract
Until;
S333:Hough transformation is carried out to the point, and is added up and is calculated;
S334:It is chosen at the maximum point of value in hough space and carries out step S335 if the point is more than threshold value, it is no
Then return to step S332;
S335:The maximum value obtained according to Hough transformation, from this point, along the direction displacement of straight line, to find
Two endpoints of straight line;
S336:The length of straight line is calculated, if it is greater than some threshold value, then the edge line segment record for being considered as gets off to put
In Lines arrays, step S332 is returned to.
In an embodiment of the present invention, in the step S4, Slant Rectify is carried out to file and picture on spatial alternation
Specific implementation steps are as follows:
Step S51:File and picture edge is a quadrangle, is divided into four sides, respectively A, B, C, D up and down;One
Vertical element is determined by two endpoints;All straightways in Lines arrays are substantially pressed into A, B, C, D by the two point coordinates
Four side classification, file and picture upper left corner a points take the point near the upper left corner in the left end point of A and the upper extreme point of C;Document map
As upper right corner b points, the point near the upper right corner in the right endpoint of A and the upper extreme point of D is taken;File and picture lower left corner c points, take C's
Near the point in the lower left corner in the left end point of lower extreme point and B;File and picture lower right corner d points, take the lower extreme point of D and the right endpoint of B
In near the lower right corner point, take out a, b, c, d file and picture four angle points;
Step S52:Then, it is converted using perspective space and Slant Rectify, first root is carried out to the lopsided image of file and picture
Lopsided figure is obtained by perspective transformation matrix algorithmic function according to four angle points found in step S51 and changes to rectangular perspective change
Matrix is changed, then converting algorithmic function by perspective space carries out spatial alternation completion Slant Rectify.
In an embodiment of the present invention, steps are as follows for the specific implementation of the step S5:
Step S61:The quality level of file and picture is weighed using PSNR Y-PSNRs;PSNR is applied into text to be detected
Shelves image and template image, PSNR values are bigger between 2 images, then more similar;A threshold value ps is pre-set as measurement base
It is accurate;PSNR formula are as follows:
Wherein, MAX indicates that the greatest measure of color of image, 8 sampled points are expressed as 255, therefore MAX2=255*255;
MSE indicates present image P1With reference picture P2Mean square error, MSE formula are:
Wherein, m and n indicates that the height and width of picture frame, I indicate currently in I row, and J indicates currently to arrange in J, K (I, J)
Indicate present image P1I row J row pixel, L (I, J) indicates reference picture P2I row J row pixel;
Step S62:It is substituted into image to be detected array as K (I, J), template image array is substituted into as L (I, J);Meter
The PSNR value pr for obtaining file and picture to be detected are calculated, if pr is more than threshold value ps, document quality level to be detected is eligible, no
Then document quality level to be detected is unqualified.
Compared to the prior art, the invention has the advantages that:Caused by the present invention has considered environmental factor
Interference deletes the small connected domain of area to improve the accuracy and reliability of document positioning by preprocessing noise reduction and algorithm.Together
When, function pair document profile is searched by Canny operators and profile and is detected and extracts.Furthermore pass through accumulated probability Hough
Transformation carries out line segment extraction, using the algorithm of design, four angular coordinates of locating documents.Then, by perspective space
Slant correction is converted, lopsided file and picture is drawn into normal file and picture.Finally, with PSNR and MSE appraisal procedures pair
Document quality is detected.This patent uses and optimizes the algorithm in computer vision, and identification document can be precisely located
And quality testing is carried out to document.This method is simple, realizes that flexibly practicability is stronger.
Description of the drawings
Fig. 1 is that the present invention is based on the flow charts of the document quality detection method of computer vision.
Specific implementation mode
Below in conjunction with the accompanying drawings, technical scheme of the present invention is specifically described.
As shown in Figure 1, the present invention provides a kind of document quality detection method based on computer vision.To traditional artificial
Naked eyes detection difficult, efficiency is low, poor reliability, and the problem of being affected by subjectivity proposes text based on computer vision
Shelves quality determining method.Accurately to detect document quality, this method obtains first regards High Speed Document printing by rational method
Frequency carries out frozen frozen mass extraction;Secondly, preprocess method based on computer vision locates the suitable image of file and picture progress in advance
Reason;Again, good that file and picture carries out accurate contour detecting and extraction to pre-processing;And then, the document wheel to extracting
Wide image carries out Slant Rectify so that lopsided image becomes the document image to be detected normally to tile;Finally, to image to be detected
PSNR and MSE quality evaluations are carried out, is compared with template, obtains the testing result of document quality.It is as follows:
Step S1:Frozen frozen mass is extracted to the high-speed image video sequence of input and is detected processing to get to needs
File and picture;
Step S2:The frozen frozen mass extracted is pre-processed, noise reduction and Edge Enhancement are carried out, excludes environmental disturbances item;
Step S3:Image after being pre-processed to step S2 carries out document profile detection, then presses contours extract file and picture
Part;
Step S4:Slant Rectify is carried out to file and picture on spatial alternation, makes the vertical vertical view document of tiling
Image;
Step S5:The file and picture that step S4 identifications navigate to is compared by quality evaluation algorithm with template, is examined
Measure the quality level of document.
In the step S1, file and picture to be detected is extracted as follows:
Step S11:Suitable frame number I is taken to the high-speed video under printer of input, extracts and schemes every I frame numbers
Picture, it is image stream to choose predetermined interval frame number by the video streaming of input;
Step S12:Frozen frozen mass processing is carried out to image stream, two images before and after in image stream are subjected to image algorithm phases
Subtract, it is pixel 255 (white pixel) to make same section, and it is 0 (black picture element) to differ part;
Step S13:The image after phase reducing, 0 (black) pixel number N are counted, if N is less than the threshold value Y preset,
Then present frame is frozen frozen mass, otherwise, abandons this frame, continues step S12.
In the step S2, frozen frozen mass is pre-processed as follows:
Step S21:Image to be detected is subjected to picture smooth treatment, Mean by Mean Shift mean shift algorithms
Shift algorithm steps are:
S211:First a pixel centered on point is randomly selected in picture;
S212:The offset mean value M (x) of central point is calculated,Wherein, x indicates that central point is horizontal
Coordinate, y indicate the ordinate of central point, ShIt is the higher-dimension ball region that a radius is h:K expressions have k in this n sample point
It is a to fall into ball ShIn;
S213:The mobile point deviates mean value, X to itt+1=Mt+xt, MtFor the offset mean value acquired under t states;xtFor t shapes
Center under state, Xt+1For xtCenter under next state;Then it as new starting point, continues to move to, until meeting one
Fixed condition terminates;
Step S22:Image to be detected is subjected to morphological operation opening operation, i.e., first corrodes the process expanded afterwards to image,
Its mathematic(al) representation is as follows:
Dst=open (src, element)=dilate (erode (src, element))
Wherein, src is input picture, and element is the core of definition, and erode is etching operation, and dilate is expansion behaviour
Make;
Step S23:Image to be detected is subjected to binary conversion treatment, a threshold value is chosen and image is switched into gray level image.
In the step S3, the image after being pre-processed to step S2 carries out the specific implementation step of document profile detection
It is as follows:
Step S31:Contour detecting is carried out to image to be detected using Canny operators, the convolution operator of Canny isX and y is reference axis X and the variable of Y-axis, SxIt is that its x Directional partial derivative calculates masterplate,
SyIts y Directional partial derivative calculates masterplate, x-axis direction, y-axis direction first-order partial derivative matrix, gradient magnitude and gradient side
To mathematic(al) representation be:
P [i, j]=(f [i, j+1]-f [i, j]+f [i+1, j+1]-f [i+1, j])/2
Q [i, j]=(f [i, j]-f [i+1, j]+f [i, j+1]-f [i+1, j+1])/2
θ [i, j]=arctan (Q [i, j] P [i:j])
Wherein, i and j is array index, and wherein f is gray value of image, and P represents X-direction gradient magnitude, and Q represents Y-axis side
To gradient magnitude, M is the amplitude, and θ is gradient direction, that is, angle;
Non-maxima suppression is carried out further according to calculated gradient magnitude, dual threashold value-based algorithm is and then used to detect and connect side
Edge;
Step S32:Function is searched by profile, and all contour edges are extracted from binary map again by writing a deletion
Algorithm:The area of all connected domains is calculated, the connected domain that those areas are less than predetermined threshold value is then deleted, leaves behind the wheel of document
Exterior feature figure;
Step S33:The straightway in profile diagram is detected, using accumulated probability Hough transformation, steps are as follows:
S331:Image coordinate is mapped on image polar coordinates, straight line expression formula is
Wherein, r is distance of the origin to straight line,It is X axis coordinate, β is Y axis coordinate, and λ is the inclination angle of straight line and X-axis;
S332:A characteristic point in image, i.e. marginal point are randomly selected, if the point has been demarcated as being a certain item
Point on straight line then continues to randomly select a marginal point in remaining marginal point, be over until all marginal points all extract
Until;
S333:Hough transformation is carried out to the point, and is added up and is calculated;
S334:It is chosen at the maximum point of value in hough space and carries out step S335 if the point is more than threshold value, it is no
Then return to step S332;
S335:The maximum value obtained according to Hough transformation, from this point, along the direction displacement of straight line, to find
Two endpoints of straight line;
S336:The length of straight line is calculated, if it is greater than some threshold value, then the edge line segment record for being considered as gets off to put
In Lines arrays, step S332 is returned to.
In the step S4, to the specific implementation of file and picture progress Slant Rectify, steps are as follows on spatial alternation:
Step S51:File and picture edge is a quadrangle, is divided into four sides, respectively A, B, C, D up and down;One
Vertical element is determined by two endpoints;All straightways in Lines arrays are substantially pressed into A, B, C, D by the two point coordinates
Four side classification, file and picture upper left corner a points take the point near the upper left corner in the left end point of A and the upper extreme point of C;Document map
As upper right corner b points, the point near the upper right corner in the right endpoint of A and the upper extreme point of D is taken;File and picture lower left corner c points, take C's
Near the point in the lower left corner in the left end point of lower extreme point and B;File and picture lower right corner d points, take the lower extreme point of D and the right endpoint of B
In near the lower right corner point, take out a, b, c, d file and picture four angle points;
Step S52:Then, it is converted using perspective space and Slant Rectify, first root is carried out to the lopsided image of file and picture
Lopsided figure is obtained by perspective transformation matrix algorithmic function according to four angle points found in step S51 and changes to rectangular perspective change
Matrix is changed, then converting algorithmic function by perspective space carries out spatial alternation completion Slant Rectify.
Steps are as follows for the specific implementation of the step S5:
Step S61:The quality level of file and picture is weighed using PSNR Y-PSNRs;PSNR is applied into text to be detected
Shelves image and template image, PSNR values are bigger between 2 images, then more similar;A threshold value ps is pre-set as measurement base
It is accurate;PSNR formula are as follows:
Wherein, MAX indicates that the greatest measure of color of image, 8 sampled points are expressed as 255, therefore MAX2=255*255;
Wherein, m and n indicates that the height and width of picture frame, I indicate currently in I row, and J indicates currently to arrange in J, K (I, J)
Indicate present image P1I row J row pixel, L (I, J) indicates reference picture P2I row J row pixel;
Step S62:It is substituted into image to be detected array as K (I, J), template image array is substituted into as L (I, J);Meter
The PSNR value pr for obtaining file and picture to be detected are calculated, if pr is more than threshold value ps, document quality level to be detected is eligible, no
Then document quality level to be detected is unqualified.
The above are preferred embodiments of the present invention, all any changes made according to the technical solution of the present invention, and generated function is made
When with range without departing from technical solution of the present invention, all belong to the scope of protection of the present invention.
Claims (6)
1. a kind of document quality detection method based on computer vision, which is characterized in that realize in accordance with the following steps:
Step S1:Frozen frozen mass is extracted to get to the text for needing to be detected processing to the high-speed image video sequence of input
Shelves image;
Step S2:The frozen frozen mass extracted is pre-processed, noise reduction and Edge Enhancement are carried out, excludes environmental disturbances item;
Step S3:Image after being pre-processed to step S2 carries out document profile detection, then presses contours extract file and picture part;
Step S4:Slant Rectify is carried out to file and picture on spatial alternation, makes the vertical vertical view file and picture of tiling;
Step S5:The file and picture that step S4 identifications navigate to is compared by quality evaluation algorithm with template, is detected
The quality level of document.
2. a kind of document quality detection method based on computer vision according to claim 1, which is characterized in that in institute
It states in step S1, extracts file and picture to be detected as follows:
Step S11:Frame number I is taken to the high-speed video under printer of input, image is extracted every I frame numbers, is chosen default
The video streaming of input is image stream by interval frame number;
Step S12:Frozen frozen mass processing is carried out to image stream, two images before and after in image stream, which are carried out image algorithms, to be subtracted each other,
It is pixel 255 to make same section, and it is 0 to differ part;
Step S13:The image after phase reducing, 0 pixel number N are counted, if N is less than the threshold value Y preset, present frame
This frame otherwise is abandoned for frozen frozen mass, continues step S12.
3. a kind of document quality detection method based on computer vision according to claim 1, which is characterized in that in institute
It states in step S2, frozen frozen mass is pre-processed as follows:
Step S21:Image to be detected is subjected to picture smooth treatment, Mean Shift by Mean Shift mean shift algorithms
Algorithm steps are:
S211:First a pixel centered on point is randomly selected in picture;
S212:The offset mean value M (x) of central point is calculated,Wherein, x indicates central point abscissa,
Y indicates the ordinate of central point, ShIt is the higher-dimension ball region that a radius is h:K expressions have k to fall into this n sample point
Ball ShIn;
S213:The mobile point deviates mean value, X to itt+1=Mt+xt, MtFor the offset mean value acquired under t states;xtFor under t states
Center, Xt+1For xtCenter under next state;Then it as new starting point, continues to move to, until meeting centainly
Condition terminates;
Step S22:Image to be detected is subjected to morphological operation opening operation, i.e., first corrodes the process expanded afterwards to image, is counted
It is as follows to learn expression formula:
Dst=open (src, element)=dilate (erode (src, element))
Wherein, src is input picture, and element is the core of definition, and erode is etching operation, and dilate is expansive working;
Step S23:Image to be detected is subjected to binary conversion treatment, a threshold value is chosen and image is switched into gray level image.
4. a kind of document quality detection method based on computer vision according to claim 1, which is characterized in that in institute
It states in step S3, steps are as follows for the specific implementation of the image progress document profile detection after being pre-processed to step S2:
Step S31:Contour detecting is carried out to image to be detected using Canny operators, the convolution operator of Canny isX and y is reference axis X and the variable of Y-axis, SxIt is that its x Directional partial derivative calculates masterplate,
SyIts y Directional partial derivative calculates masterplate, x-axis direction, y-axis direction first-order partial derivative matrix, gradient magnitude and gradient side
To mathematic(al) representation be:
P [i, j]=(f [i, j+1]-f [i, j]+f [i+1, j+1]-f [i+1, j])/2
Q [i, j]=(f [i, j]-f [i+1, j]+f [i, j+1]-f [i+1, j+1])/2
θ [i, j]=arctan (Q [i, j]/P [i, j])
Wherein, i and j is array index, and wherein f is gray value of image, and P represents X-direction gradient magnitude, and Q represents Y direction ladder
Amplitude is spent, M is the amplitude, and θ is gradient direction, that is, angle;
Non-maxima suppression is carried out further according to calculated gradient magnitude, dual threashold value-based algorithm is and then used to detect and connect edge;
Step S32:Function is searched by profile, and all contour edges are extracted from binary map again by writing a deletion algorithm:
The area of all connected domains is calculated, the connected domain that those areas are less than predetermined threshold value is then deleted, leaves behind the profile diagram of document;
Step S33:The straightway in profile diagram is detected, using accumulated probability Hough transformation, steps are as follows:
S331:Image coordinate is mapped on image polar coordinates, straight line expression formula is
Wherein, r is distance of the origin to straight line,It is X axis coordinate, β is Y axis coordinate, and λ is the inclination angle of straight line and X-axis;
S332:A characteristic point in image, i.e. marginal point are randomly selected, if the point has been demarcated as being certain straight line
On point, then continue a marginal point is randomly selected in remaining marginal point, until all marginal points, which all extract, to be over;
S333:Hough transformation is carried out to the point, and is added up and is calculated;
S334:The maximum point of value in hough space is chosen to carry out step S335 if the point is more than threshold value, otherwise return
To step S332;
S335:The maximum value obtained according to Hough transformation, from this point, along the direction displacement of straight line, to find straight line
Two endpoints;
S336:The length of straight line is calculated, if it is greater than some threshold value, then the edge line segment record for being considered as gets off to be placed on
In Lines arrays, step S332 is returned to.
5. a kind of document quality detection method based on computer vision according to claim 1, which is characterized in that in institute
It states in step S4, to the specific implementation of file and picture progress Slant Rectify, steps are as follows on spatial alternation:
Step S51:File and picture edge is a quadrangle, is divided into four sides, respectively A, B, C, D up and down;One straight
Lines are determined by two endpoints;All straightways in Lines arrays are substantially pressed into A, B, C, D tetra- by the two point coordinates
Side is classified, and file and picture upper left corner a points take the point near the upper left corner in the left end point of A and the upper extreme point of C;File and picture is right
Upper angle b points take the point near the upper right corner in the right endpoint of A and the upper extreme point of D;File and picture lower left corner c points, take the lower end of C
Near the point in the lower left corner in the left end point of point and B;File and picture lower right corner d points, take in the lower extreme point of D and the right endpoint of B most
Point close to the lower right corner takes out four angle points of a, b, c, d file and picture;
Step S52:Then, it is converted using perspective space and Slant Rectify is carried out to the lopsided image of file and picture, first according to step
Four angle points found in rapid S51 obtain lopsided figure by perspective transformation matrix algorithmic function and change to rectangular perspective transform square
Then battle array converts algorithmic function by perspective space and carries out spatial alternation completion Slant Rectify.
6. a kind of document quality detection method based on computer vision according to claim 1, which is characterized in that described
Steps are as follows for the specific implementation of step S5:
Step S61:The quality level of file and picture is weighed using PSNR Y-PSNRs;PSNR is applied into document map to be detected
As and template image, PSNR values are bigger between 2 images, then more similar;A threshold value ps is pre-set as benchmark;
PSNR formula are as follows:
Wherein, MAX indicates that the greatest measure of color of image, 8 sampled points are expressed as 255, therefore MAX2=255*255;
MSE indicates present image P1With reference picture P2Mean square error, MSE formula are:
Wherein, m and n indicates that the height and width of picture frame, I indicate currently in I row, and J indicates currently to arrange in J, and K (I, J) is indicated
Present image P1I row J row pixel, L (I, J) indicates reference picture P2I row J row pixel;
Step S62:It is substituted into image to be detected array as K (I, J), template image array is substituted into as L (I, J);It calculates
Go out the PSNR value pr of file and picture to be detected, if pr is more than threshold value ps, document quality level to be detected is eligible, otherwise waits for
It is unqualified to detect document quality level.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810101325.7A CN108345881B (en) | 2018-02-01 | 2018-02-01 | Document quality detection method based on computer vision |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810101325.7A CN108345881B (en) | 2018-02-01 | 2018-02-01 | Document quality detection method based on computer vision |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108345881A true CN108345881A (en) | 2018-07-31 |
CN108345881B CN108345881B (en) | 2021-12-21 |
Family
ID=62958831
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810101325.7A Active CN108345881B (en) | 2018-02-01 | 2018-02-01 | Document quality detection method based on computer vision |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108345881B (en) |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109242787A (en) * | 2018-08-15 | 2019-01-18 | 南京光辉互动网络科技股份有限公司 | It paints in a kind of assessment of middle and primary schools' art input method |
CN109389121A (en) * | 2018-10-30 | 2019-02-26 | 金现代信息产业股份有限公司 | A kind of nameplate recognition methods and system based on deep learning |
CN109785367A (en) * | 2019-01-21 | 2019-05-21 | 视辰信息科技(上海)有限公司 | Exterior point filtering method and device in threedimensional model tracking |
CN109871844A (en) * | 2019-01-09 | 2019-06-11 | 东南大学 | A kind of correction of shooting receipt image text and extracting method |
CN110033471A (en) * | 2019-04-19 | 2019-07-19 | 福州大学 | A kind of wire detection method based on connected domain analysis and morphological operation |
CN110032989A (en) * | 2019-04-23 | 2019-07-19 | 福州大学 | A kind of form document image classification method based on wire feature and pixel distribution |
CN111108515A (en) * | 2019-12-27 | 2020-05-05 | 威创集团股份有限公司 | Picture target point correcting method, device and equipment and storage medium |
CN111435531A (en) * | 2018-12-25 | 2020-07-21 | Tcl集团股份有限公司 | Image deflection angle detection method, intelligent device and storage medium |
CN111488931A (en) * | 2020-04-10 | 2020-08-04 | 腾讯科技(深圳)有限公司 | Article quality evaluation method, article recommendation method and corresponding devices |
CN112131841A (en) * | 2020-08-27 | 2020-12-25 | 北京云动智效网络科技有限公司 | Document quality evaluation method and system |
CN112200789A (en) * | 2020-10-16 | 2021-01-08 | 中国铁道科学研究院集团有限公司 | Image identification method and device, electronic equipment and storage medium |
CN112435218A (en) * | 2020-11-04 | 2021-03-02 | 南京火眼锐视信息科技有限公司 | Method and device for evaluating and screening deformability of document image |
WO2021105902A1 (en) * | 2019-11-27 | 2021-06-03 | Cimpress Schweiz Gmbh | Technologies for detecting crop marks in electronic documents |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2004109586A1 (en) * | 2003-06-05 | 2004-12-16 | Aware, Inc. | Image quality control techniques |
JP2011239066A (en) * | 2010-05-07 | 2011-11-24 | Sony Corp | Device and method of processing image |
CN102496018A (en) * | 2011-12-08 | 2012-06-13 | 方正国际软件有限公司 | Document skew detection method and system |
CN103839058A (en) * | 2012-11-21 | 2014-06-04 | 方正国际软件(北京)有限公司 | Information locating method for document image based on standard template |
-
2018
- 2018-02-01 CN CN201810101325.7A patent/CN108345881B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2004109586A1 (en) * | 2003-06-05 | 2004-12-16 | Aware, Inc. | Image quality control techniques |
JP2011239066A (en) * | 2010-05-07 | 2011-11-24 | Sony Corp | Device and method of processing image |
CN102496018A (en) * | 2011-12-08 | 2012-06-13 | 方正国际软件有限公司 | Document skew detection method and system |
CN103839058A (en) * | 2012-11-21 | 2014-06-04 | 方正国际软件(北京)有限公司 | Information locating method for document image based on standard template |
Non-Patent Citations (5)
Title |
---|
LINHUI LI ET AL.: "Vehicle detection method based on mean shift clustering", 《JOURNAL OF INTELLIGENT & FUZZY SYSTEMS》 * |
ZHOU WANG ET AL.: "Mean Squared Error: Love It or Leave It?", 《IEEE SIGNAL PROCESSING MAGAZINE》 * |
商萌萌: "运动物体相对位置的视觉检测算法的研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
王景丹等: "基于智能检测车位信息的车辆识别算法", 《计算机科学与应用》 * |
高晓波等: "基于边缘检测的OMR图像倾斜矫正", 《长春理工大学学报(自然科学版)》 * |
Cited By (22)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109242787A (en) * | 2018-08-15 | 2019-01-18 | 南京光辉互动网络科技股份有限公司 | It paints in a kind of assessment of middle and primary schools' art input method |
CN109389121B (en) * | 2018-10-30 | 2021-11-09 | 金现代信息产业股份有限公司 | Nameplate identification method and system based on deep learning |
CN109389121A (en) * | 2018-10-30 | 2019-02-26 | 金现代信息产业股份有限公司 | A kind of nameplate recognition methods and system based on deep learning |
CN111435531B (en) * | 2018-12-25 | 2023-08-08 | Tcl科技集团股份有限公司 | Image deflection angle detection method, intelligent device and storage medium |
CN111435531A (en) * | 2018-12-25 | 2020-07-21 | Tcl集团股份有限公司 | Image deflection angle detection method, intelligent device and storage medium |
CN109871844A (en) * | 2019-01-09 | 2019-06-11 | 东南大学 | A kind of correction of shooting receipt image text and extracting method |
CN109785367A (en) * | 2019-01-21 | 2019-05-21 | 视辰信息科技(上海)有限公司 | Exterior point filtering method and device in threedimensional model tracking |
CN109785367B (en) * | 2019-01-21 | 2019-12-20 | 视辰信息科技(上海)有限公司 | Method and device for filtering foreign points in three-dimensional model tracking |
CN110033471A (en) * | 2019-04-19 | 2019-07-19 | 福州大学 | A kind of wire detection method based on connected domain analysis and morphological operation |
CN110033471B (en) * | 2019-04-19 | 2022-09-13 | 福州大学 | Frame line detection method based on connected domain analysis and morphological operation |
CN110032989A (en) * | 2019-04-23 | 2019-07-19 | 福州大学 | A kind of form document image classification method based on wire feature and pixel distribution |
CN110032989B (en) * | 2019-04-23 | 2022-07-08 | 福州大学 | Table document image classification method based on frame line characteristics and pixel distribution |
WO2021105902A1 (en) * | 2019-11-27 | 2021-06-03 | Cimpress Schweiz Gmbh | Technologies for detecting crop marks in electronic documents |
US11145064B2 (en) | 2019-11-27 | 2021-10-12 | Cimpress Schweiz Gmbh | Technologies for detecting crop marks in electronic documents |
CN111108515B (en) * | 2019-12-27 | 2021-11-12 | 威创集团股份有限公司 | Picture target point correcting method, device and equipment and storage medium |
CN111108515A (en) * | 2019-12-27 | 2020-05-05 | 威创集团股份有限公司 | Picture target point correcting method, device and equipment and storage medium |
CN111488931A (en) * | 2020-04-10 | 2020-08-04 | 腾讯科技(深圳)有限公司 | Article quality evaluation method, article recommendation method and corresponding devices |
CN111488931B (en) * | 2020-04-10 | 2023-04-07 | 腾讯科技(深圳)有限公司 | Article quality evaluation method, article recommendation method and corresponding devices |
CN112131841A (en) * | 2020-08-27 | 2020-12-25 | 北京云动智效网络科技有限公司 | Document quality evaluation method and system |
CN112200789A (en) * | 2020-10-16 | 2021-01-08 | 中国铁道科学研究院集团有限公司 | Image identification method and device, electronic equipment and storage medium |
CN112200789B (en) * | 2020-10-16 | 2023-11-21 | 中国铁道科学研究院集团有限公司 | Image recognition method and device, electronic equipment and storage medium |
CN112435218A (en) * | 2020-11-04 | 2021-03-02 | 南京火眼锐视信息科技有限公司 | Method and device for evaluating and screening deformability of document image |
Also Published As
Publication number | Publication date |
---|---|
CN108345881B (en) | 2021-12-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108345881A (en) | A kind of document quality detection method based on computer vision | |
CN112508826B (en) | Printed matter defect detection method | |
CN106683075B (en) | Method for detecting bolt defects at cross arm of power transmission line tower | |
CN114943739B (en) | Aluminum pipe quality detection method | |
CN108355987A (en) | A kind of screen printing of battery quality determining method based on piecemeal template matches | |
CN110264445A (en) | The screen printing of battery quality determining method of piecemeal template matching combining form processing | |
CN111127417B (en) | Printing defect detection method based on SIFT feature matching and SSD algorithm improvement | |
CN112991305A (en) | Visual inspection method for surface defects of paint spraying panel | |
CN112926563B (en) | Fault diagnosis system for steel coil spray printing mark | |
CN107085850A (en) | Masking gathers the marked body of foreign matter in image, recognizes the method and book scanning method of foreign matter marked body in image | |
CN110047063B (en) | Material drop detection method, device, equipment and storage medium | |
CN115100206B (en) | Printing defect identification method for textile with periodic pattern | |
CN111369516A (en) | Transformer bushing heating defect detection method based on infrared image recognition | |
CN112419260A (en) | PCB character area defect detection method | |
CN109993154A (en) | The lithium sulfur type instrument intelligent identification Method of substation's simple pointer formula | |
CN114022439B (en) | Flexible circuit board defect detection method based on morphological image processing | |
CN111753794A (en) | Fruit quality classification method and device, electronic equipment and readable storage medium | |
CN111563896A (en) | Image processing method for catenary anomaly detection | |
CN115619845A (en) | Self-adaptive scanning document image inclination angle detection method | |
CN113723494A (en) | Laser visual stripe classification and weld joint feature extraction method under uncertain interference source | |
CN115760696A (en) | Surface scratch detection method | |
CN106530273B (en) | High-precision FPC (Flexible printed Circuit) linear line detection and defect positioning method | |
CN113902894B (en) | Automatic reading identification method for strip level based on image processing | |
CN109685791B (en) | Corrugated board robust detection method based on multi-window autocorrelation texture detection | |
CN112418210B (en) | Intelligent classification method for tower inspection information |
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 |