CN109711404A - Recognition methods, device and the computer readable storage medium of seal ballot paper full-filling - Google Patents
Recognition methods, device and the computer readable storage medium of seal ballot paper full-filling Download PDFInfo
- Publication number
- CN109711404A CN109711404A CN201811562812.XA CN201811562812A CN109711404A CN 109711404 A CN109711404 A CN 109711404A CN 201811562812 A CN201811562812 A CN 201811562812A CN 109711404 A CN109711404 A CN 109711404A
- Authority
- CN
- China
- Prior art keywords
- closed contour
- seal
- image
- ballot paper
- filling
- 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
Landscapes
- Image Analysis (AREA)
Abstract
The present invention relates to image identification technical field, embodiment specifically discloses recognition methods, device and the computer readable storage medium of a kind of seal ballot paper full-filling.The recognition methods of seal ballot paper full-filling provided by the present application includes receiving seal ballot paper image;The position of each closed contour and size in seal ballot paper image are successively obtained according to default identification parameter list;The internal image for intercepting each closed contour respectively carries out seal identification;The step of generating the recognition result of seal ballot paper full-filling, by using full-filling frame as closed contour, position and the size of each closed contour are successively obtained according to pre-prepd identification parameter list, the internal image for intercepting closed contour again carries out seal image identification, the full-filling of each full-filling frame can fast and accurately be obtained as a result, being suitable for being widely popularized.
Description
Technical field
The present invention relates to image identification technical fields, and in particular to a kind of recognition methods of seal ballot paper full-filling, device and
Computer readable storage medium.
Background technique
The ballot paper filling method of domestic Continental Area election uses black signature pen by rectangle, ellipse, diamond shape full-filling mostly
Block blacking is hooked in predetermined region Freehandhand-drawing, the mode of the symbols such as circle, fork, and a kind of ballot paper use scope is mostly several hundred, several
Thousand, in tens of thousands of electorates, and elect a kind of ballot paper use scope may be million, ten million domestic Hong Kong and Macao, foreign countries
More even more than one hundred million electorates, therefore the mode of filling in of ballot paper provides relatively simpler, more standard.Band outline border is used on ballot paper
Character carry out the differentiation of ballot paper type, use table line to distinguish each candidate or candidate group, the blank circle of table cell
Circle is the position that voter fills in ballot paper using seal.
Mode that the ballot paper is filled in simplifies, when select it is elected select corresponding candidate or candidate group when, use dedicated seal
Tool covers unique " √ " number in corresponding candidate's underlying empty circle, and it is all nothing that other any symbols are done in empty circles
Ballot paper is imitated, if while except the text, the figure external memory that print also are made in vain in anyone witness marking for being in ballot paper other positions
Ballot paper.
The case where there are local deformation or subtle stretchings due to the seal ballot paper image that is acquired by high speed scanner,
Therefore image in closed contour cannot be intercepted simply by fixed pixel coordinate by positioning the seal ballot paper closed contour, it is necessary to
Use image recognition technology.
Summary of the invention
In view of this, the ballot paper that the seal that the application is directed to domestic Hong Kong and Macao, external election uses is filled in, provides
A kind of method and device realized its machine and quickly identify full-filling.
In order to solve the above technical problems, technical solution provided by the invention is a kind of recognition methods of seal ballot paper full-filling,
The seal ballot paper is equipped with several full-filling frames for being used for full-filling seal, and one full-filling frame is a closed contour, institute
The method of stating includes:
S11: seal ballot paper image is received;
S12: the position of each closed contour in the seal ballot paper image is successively obtained according to default identification parameter list
And size;
S13: the internal image for intercepting each closed contour respectively carries out seal identification;
S14: the recognition result of seal ballot paper full-filling is generated.
Preferably, the method for the step S12 includes:
S121: according to the center pixel coordinate and rectangular extent of the 1st closed contour in the default identification parameter list
The wide high region of search for determining starting closed contour in the seal ballot paper image, in the field of search of the starting closed contour
Search positions the practical center pixel coordinate for originating closed contour and size and saves in domain;
S122: according to the call number of positioning closing profile and practical center pixel in the default identification parameter list
The call number of next closed contour to be positioned, opposite center pixel are sat in coordinate and the default identification parameter list
Mark, the wide high and relatively nearest closed contour call number of boundary rectangle successively obtain each closure wheel in the seal ballot paper image
Wide position and size.
Preferably, the method for the step S122 includes:
S1221:m=2;
S1222: it is indexed according to the relatively nearest closed contour of m-th of closed contour in the default identification parameter list
The corresponding relatively nearest closed contour of the relatively nearest closed contour call number number is obtained in the default identification parameter list
Practical center pixel coordinate, wherein the relatively nearest closed contour of m-th of closed contour be m-th of positioning be closed
The call number of a closed contour of positioning is completed before profile;
S1223: according to the practical center pixel coordinate of the relatively nearest closed contour of m-th of closed contour and institute
The opposite center pixel coordinate of m-th of closed contour in default identification parameter list is stated, m-th of closed contour is calculated
Theoretical center pixel coordinate;
S1224: the boundary rectangle of m-th of closed contour in the identification parameter list is k times of height amplification wide, 1 < k < 2, then
According to the theoretical center pixel coordinate of m-th of closed contour, m-th of closed contour in the seal ballot paper image is determined
Region of search;
S1225: described m-th of search positioning in the region of search of m-th of closed contour in the seal ballot paper image
The practical center pixel coordinate and size of closed contour simultaneously save;
S1226: judge whether m-th of closed contour is that the last one in the default identification parameter list is to be positioned and closes
Profile is closed, if so, into next step, if it is not, then m=m+1, returns to S1222.
Preferably, the method for the step S13, comprising:
S131:n=1 or n=2;
S132: it is intercepted according to the practical center pixel coordinate of n-th closed contour in the seal ballot paper image and size
The internal image of n-th of closed contour is simultaneously pre-processed;
S133: judge whether there is density bullet in the internal image of n-th of closed contour, if so, then entering
S134, if it is not, then judging non-full-filling seal in n-th of closed contour;
S134: it whether is identified in the internal image of n-th of closed contour according to default seal template comprising seal figure
Picture, if so, determining that full-filling is effective full-filling in n-th of closed contour, if it is not, then determining n-th of closed contour
Interior full-filling is invalid full-filling;
S135: judge whether n-th of closed contour is that the last one in the identification parameter list is to be identified and closes
Profile is closed, if so, into next step, if it is not, then n=n+1, returns to S132.
Preferably, the internal image of n-th of closed contour is identified in the step S134 according to default seal template
In whether include seal image method, comprising:
S1341: all exterior contours of the density bullet are searched in the internal image of n-th of closed contour;
S1342: polygonal profile is obtained using straight line fitting to the closed contour searched out, intercepts the polygonal wheel
Wide boundary rectangle is density bullet image;
S1343: searching for longest edge line segment in the polygonal profile, is calculated according to the slope of the longest edge line segment
Deflection angle θ, the θ ∈ (- 90 °, 90 °) of the density bullet;
S1344: the density bullet image is rotated by the deflection angle θ of the density bullet, makes the black
The longest edge line segment of label is minimum perpendicular to the mass center of horizontal direction and the density bullet, then intercepts the density bullet
Boundary rectangle is density bullet effective image;
S1345: it is pre- to judge whether the deviation of the density bullet effective picture size and default seal template size meets
If deviation range, if so, the density bullet effective picture size is adjusted to default seal template size, if it is not, then sentencing
It does not include seal image in the internal image of fixed n-th of closed contour;
S1346: the density bullet effective image is subjected to binary conversion treatment, treated that density bullet is effective for judgement
Whether image and the image similarity of default seal template reach default similarity threshold, if so, determining to close for described n-th
Closing includes seal image in the internal image of profile, if it is not, then determining not wrap in the internal image of n-th of closed contour
Containing seal image.
Preferably, further include step S10 before the step S11: generating default identification parameter list;
The method of the step S10, comprising:
S101: any of blank seal ballot paper image closed contour is chosen as starting closed contour, obtains described rise
Center pixel coordinate (the x of beginning closed contour0, y0) and the wide height (w of range rectangle0, h0) be added in identification parameter list;
S102: the center pixel coordinate of each closed contour to be positioned in the blank seal ballot paper image is successively obtained
(xm, ym) and the wide height (w of boundary rectanglem, hm) be added in set A, m > 0;
S103: by the center pixel coordinate (x of the starting closed contour0, y0) and the wide height (w of range rectangle0, h0) addition
Into set B;
S104: in set of computations B the point of each closed contour into set A the point of each closed contour it is European
Distance chooses point Ai and point Bj in two set for meeting most short Euclidean distance, by closed contour where Ai point in set A
Center pixel coordinate (xi, yi) and the wide height (w of boundary rectanglei, hi) move into set B;
S105: the center pixel coordinate (x of closed contour where calculating Ai pointi, yi) relative to closed contour where Bj point
Center pixel coordinate (xj, yj) opposite center pixel coordinate (Δ xi, Δ yi), Δ xi=xi-xj, Δ yi=yi-yj, by Ai
Opposite center pixel coordinate (the Δ x of closed contour where pointi, Δ yi), the wide height of boundary rectangle of closed contour where Ai point
(wi, hi) and Bj point where closed contour be added in the identification parameter list in the index j in set B, i, j to be greater than or
Person is equal to 0 integer;
S106 judges whether there are also closed contours to be processed in set A, if so, S104 is then returned to, if it is not, then terminating
Process.
The present invention also provides a kind of identification device of seal ballot paper full-filling, the seal ballot paper is used for equipped with several
The full-filling frame of full-filling seal, one full-filling frame are a closed contour, and described device includes:
Receiving module, for receiving seal ballot paper image;
Locating module, for successively obtaining each closure in the seal ballot paper image according to default identification parameter list
The position of profile and size;
Identification module, the internal image for intercepting each closed contour respectively carry out seal identification;
Output module, for generating the recognition result of seal ballot paper full-filling.
Preferably, the locating module includes:
Closed contour positioning unit is originated, for according in the default identification parameter list in the 1st closed contour
Heart pixel coordinate and the wide high region of search for determining starting closed contour in the seal ballot paper image of rectangular extent, described
It originates the practical center pixel coordinate of the search positioning starting closed contour and size in the region of search of closed contour and protects
It deposits;
Other closed contour positioning units, for according to positioning closing profile in the default identification parameter list
The rope of next closed contour to be positioned in call number and practical center pixel coordinate and the default identification parameter list
Quotation marks, opposite center pixel coordinate, the wide high and relatively nearest closed contour call number of boundary rectangle, successively obtain the seal
The position of each closed contour and size in ballot paper image.
Preferably, the working method of other closed contour positioning units includes:
S1221:m=2;
S1222: it is indexed according to the relatively nearest closed contour of m-th of closed contour in the default identification parameter list
The corresponding relatively nearest closed contour of the relatively nearest closed contour call number number is obtained in the default identification parameter list
Practical center pixel coordinate, wherein the relatively nearest closed contour of m-th of closed contour be m-th of positioning be closed
The call number of a closed contour of positioning is completed before profile;
S1223: according to the practical center pixel coordinate of the relatively nearest closed contour of m-th of closed contour and institute
The opposite center pixel coordinate of m-th of closed contour in default identification parameter list is stated, m-th of closed contour is calculated
Theoretical center pixel coordinate;
S1224: the boundary rectangle of m-th of closed contour in the identification parameter list is k times of height amplification wide, 1 < k < 2,
Further according to the theoretical center pixel coordinate of m-th of closed contour, m-th of closure wheel in the seal ballot paper image is determined
Wide region of search;
S1225: described m-th of search positioning in the region of search of m-th of closed contour in the seal ballot paper image
The practical center pixel coordinate and size of closed contour simultaneously save;
S1226: judge whether m-th of closed contour is that the last one in the default identification parameter list is to be positioned and closes
Profile is closed, if so, into next step, if it is not, then m=m+1, returns to S1222.
Preferably, the working method of the identification module, comprising:
S131:n=1 or n=2;
S132: it is intercepted according to the practical center pixel coordinate of n-th closed contour in the seal ballot paper image and size
The internal image of n-th of closed contour is simultaneously pre-processed;
S133: judge whether there is density bullet in the internal image of n-th of closed contour, if so, then entering
S134 determines non-full-filling seal in n-th of closed contour if not having;
S134: it whether is identified in the internal image of n-th of closed contour according to default seal template comprising seal figure
Picture, if so, determining that full-filling is effective full-filling in n-th of closed contour, if it is not, then determining n-th of closed contour
Interior full-filling is invalid full-filling;
S135: judge whether n-th of closed contour is the closure wheel to be identified of the last one in the identification parameter list
Exterior feature, if so, into next step, if it is not, then n=n+1, returns to S132.
Preferably, the internal image of n-th of closed contour is identified in the step S134 according to default seal template
In whether include seal image method, comprising:
S1341: all exterior contours of the density bullet are searched in the internal image of n-th of closed contour;
S1342: polygonal profile is obtained using straight line fitting to the closed contour searched out, intercepts the polygonal wheel
Wide boundary rectangle is density bullet image;
S1343: searching for longest edge line segment in the polygonal profile, is calculated according to the slope of the longest edge line segment
Deflection angle θ, the θ ∈ (- 90 °, 90 °) of the density bullet;
S1344: the density bullet image is rotated by the deflection angle θ of the density bullet, makes the black
The longest edge line segment of label is minimum perpendicular to the mass center of horizontal direction and the density bullet, then intercepts the density bullet
Boundary rectangle is density bullet effective image;
S1345: it is pre- to judge whether the deviation of the density bullet effective picture size and default seal template size meets
If deviation range, if so, the density bullet effective picture size is adjusted to default seal template size, if it is not, then sentencing
It does not include seal image in the internal image of fixed n-th of closed contour;
S1346: the density bullet effective image is subjected to binary conversion treatment, treated that density bullet is effective for judgement
Whether image and the image similarity of default seal template reach default similarity threshold, if so, determining to close for described n-th
Closing includes seal image in the internal image of profile, if it is not, then determining not wrap in the internal image of n-th of closed contour
Containing seal image.
Preferably, described device further includes preparation module, for generating default identification parameter list;
The working method of the preparation module, comprising:
S101: any of blank seal ballot paper image closed contour is chosen as starting closed contour, obtains described rise
Center pixel coordinate (the x of beginning closed contour0, y0) and the wide height (w of range rectangle0, h0) be added in identification parameter list;
S102: the center pixel coordinate of each closed contour to be positioned in the blank seal ballot paper image is successively obtained
(xm, ym) and the wide height (w of boundary rectanglem, hm) be added in set A, m > 0;
S103: by the center pixel coordinate (x of the starting closed contour0, y0) and the wide height (w of range rectangle0, h0) addition
Into set B;
S104: in set of computations B the point of each closed contour into set A the point of each closed contour it is European
Distance chooses point Ai and point Bj in two set for meeting most short Euclidean distance, by closed contour where Ai point in set A
Center pixel coordinate (xi, yi) and the wide height (w of boundary rectanglei, hi) move into set B;
S105: the center pixel coordinate (x of closed contour where calculating Ai pointi, yi) relative to closed contour where Bj point
Center pixel coordinate (xj, yj) opposite center pixel coordinate (Δ xi, Δ yi), Δ xi=xi-xj, Δ yi=yi-yj, by Ai
Opposite center pixel coordinate (the Δ x of closed contour where pointi, Δ yi), the wide height of boundary rectangle of closed contour where Ai point
(wi, hi) and Bj point where closed contour be added in the identification parameter list in the index j in set B, i, j to be greater than or
Person is equal to 0 integer;
S106 judges whether there are also closed contours to be processed in set A, if so, S104 is then returned to, if it is not, then terminating
Process.
The present invention also provides a kind of identification devices of seal ballot paper full-filling, comprising:
Memory, for storing computer program;
Processor, for executing the computer program, to realize, seal ballot paper is filled out as described in any one of claim
The step of recognition methods of painting.
The present invention also provides a kind of computer readable storage medium, the computer-readable recording medium storage has calculating
Machine program, realizing the seal ballot paper full-filling as described in any one of claim when the computer program is executed by processor
The step of recognition methods.
Compared with prior art, detailed description are as follows for its advantages by the application: seal ballot paper full-filling provided by the present application
Recognition methods include receive seal ballot paper image;It is successively obtained according to default identification parameter list each in seal ballot paper image
The position of a closed contour and size;The internal image for intercepting each closed contour respectively carries out seal identification;Generate seal choosing
The step of recognition result of ticket full-filling, by using full-filling frame as closed contour, according to pre-prepd identification parameter list according to
The secondary position for obtaining each closed contour and size, then the internal image progress seal image identification of closed contour is intercepted, it can
The full-filling of each full-filling frame is fast and accurately obtained as a result, being suitable for being widely popularized.
Detailed description of the invention
In order to illustrate the embodiments of the present invention more clearly, attached drawing needed in the embodiment will be done simply below
Introduction, it should be apparent that, drawings in the following description are only some embodiments of the invention, skill common for this field
For art personnel, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of recognition methods flow diagram for seal ballot paper full-filling that the embodiment of the present invention 1 provides;
Fig. 2 is a kind of schematic diagram for seal ballot paper that the embodiment of the present invention 1 provides;
Fig. 3 is the recognition methods flow diagram for another seal ballot paper full-filling that the embodiment of the present invention 2 provides;
Fig. 4 is a kind of identification device structural schematic diagram for seal ballot paper full-filling that the embodiment of the present invention 3 provides;
Fig. 5 is a kind of identification device structural schematic diagram for seal ballot paper full-filling that the embodiment of the present invention 4 provides.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, rather than whole embodiments.Based on this
Embodiment in invention, those of ordinary skill in the art are without making creative work, obtained every other
Embodiment belongs to the scope of the present invention.
In order to make those skilled in the art more fully understand technical solution of the present invention, with reference to the accompanying drawing and specifically
The present invention is described in further detail for embodiment.
The case where there are local deformation or subtle stretchings due to the seal ballot paper image that is acquired by high speed scanner,
Therefore the full-filling frame for positioning the seal ballot paper cannot intercept full-filling frame internal image simply by fixed pixel coordinate, it is necessary to
Use image recognition technology.
The full-filling identification of the ballot paper can be rapidly completed by the method that neighbour's closed contour positions by the application, this method
Chosen when basic principle is to position the position of next closed contour relative position it is nearest searched for closing of orienting
Profile is closed as reference, is determined with the opposite center pixel coordinate being previously stored and the nearest closed contour center pixel coordinate
The basis of the substantially search orientation range of this closed contour, this method needs a starting closed contour used for positioning.It realizes
This method needs to prepare identification parameter list in advance, further according to identification parameter list identifying stamp ballot paper image.
As shown in Figure 1, the embodiment of the present invention 1 provides a kind of recognition methods of seal ballot paper full-filling, wherein on seal ballot paper
The full-filling frame of full-filling seal is used for equipped with several, a full-filling frame is a closed contour, this method comprises:
S11: seal ballot paper image is received;
S12: the position of each closed contour in the seal ballot paper image is successively obtained according to default identification parameter list
And size;
S13: the internal image for intercepting each closed contour respectively carries out seal identification;
S14: the recognition result of seal ballot paper full-filling is generated.
Specifically, the method for step S12 includes:
S121: according to the center pixel coordinate and the wide height of rectangular extent of the 1st closed contour in default identification parameter list
It determines the region of search for originating closed contour in seal ballot paper image, positioning is searched in the region of search of starting closed contour
The practical center pixel coordinate and size of starting closed contour simultaneously save;
S122: according to the call number of positioning closing profile and practical center pixel in the default identification parameter list
The call number of next closed contour to be positioned, opposite center pixel are sat in coordinate and the default identification parameter list
Mark, the wide high and relatively nearest closed contour call number of boundary rectangle successively obtain each closure wheel in the seal ballot paper image
Wide position and size.
It should be noted that the method for step S121 includes: according to the 1st closed contour center in identification parameter list
Pixel coordinate (x0, y0) and the wide height (w of approximate range0, h0) determine starting closed contour region of search;Using searching for closed contour
Suo Fangfa determines the practical center pixel coordinate of starting closed contour.
As shown in Fig. 2, starting closed contour can be a full-filling frame on seal ballot paper, or seal ballot paper
Other apparent closed figures of upper non-full-filling frame.For example, by using including the box of " DS " letter to originate closed contour, then
Exact position center (the x ' of " DS " alphabetical outline border is determined after step S1210, y '0) and " DS " alphabetical outline border size.
It should be noted that the method for step S122 includes:
S1221:m=2;
S1222: it is indexed according to the relatively nearest closed contour of m-th of closed contour in the default identification parameter list
The corresponding relatively nearest closed contour of the relatively nearest closed contour call number number is obtained in the default identification parameter list
Practical center pixel coordinate, wherein the relatively nearest closed contour of m-th of closed contour be m-th of positioning be closed
The call number of a closed contour of positioning is completed before profile;
S1223: according to the practical center pixel coordinate of the relatively nearest closed contour of m-th of closed contour and institute
The opposite center pixel coordinate of m-th of closed contour in default identification parameter list is stated, m-th of closed contour is calculated
Theoretical center pixel coordinate;
S1224: the boundary rectangle of m-th of closed contour in the identification parameter list is k times of height amplification wide, 1 < k < 2,
Further according to the theoretical center pixel coordinate of m-th of closed contour, m-th of closure wheel in the seal ballot paper image is determined
Wide region of search;
S1225: described m-th of search positioning in the region of search of m-th of closed contour in the seal ballot paper image
The practical center pixel coordinate and size of closed contour simultaneously save;
S1226: judge whether m-th of closed contour is that the last one in the default identification parameter list is to be positioned and closes
Profile is closed, if so, into next step, if it is not, then m=m+1, returns to S1222.
Specifically, according to opposite center pixel coordinate (the Δ x of closed contour next in identification parameter listi, Δ yi)、
The relatively nearest closed contour call number j of next closed contour and the reality for having searched for the determining relatively nearest closed contour
Border position (x 'j, y 'j), determine the theoretical center position of next closed contour region of search, then take turns with next closure
K times (k value is arranged according to closed contour size, such as 1.2,1.5 etc.) of the wide high size of practical width determines next closure
The region of search size of profile;Wherein, in identification parameter list the 2nd closed contour relatively nearest closed contour call number
It is 0, the call number of the 1st closed contour as in identification parameter list.
Next the closure figure in next closed contour region of search is determined using the searching method of closed contour
Shape, and determine its center pixel coordinate;Above method is all made of for each next closed contour and first determines the field of search
Domain, then searched in region of search and determine the actual center pixel coordinate of closed figures and size, until in identification parameter list
All closed contour positions, which determine, completes, and after the completion of all closed contour positions determine, intercepts the internal image of closed contour
Carry out seal judgement.
Seal ballot paper full-filling frame localization method based on neighbour's closed contour can effectively avoid print caused by linear array scanning
Position and the size of each full-filling frame can be accurately positioned in the influence of chapter ballot paper image longitudinal stretching.
It should be noted that the method for step S13, comprising:
S131:n=1 or n=2;
Here, n=1 indicates that first closure profile is full-filling frame, and n=2 indicates that first closure profile is not full-filling
Frame.
S132: it is intercepted according to the practical center pixel coordinate of n-th closed contour in the seal ballot paper image and size
The internal image of n-th of closed contour is simultaneously pre-processed;Wherein, pretreatment includes including noise reduction, enhancing and binaryzation
Processing.
S133: judge whether there is density bullet in the internal image of n-th of closed contour, if so, then entering
S134 determines non-full-filling seal in n-th of closed contour if not having.
S134: it whether is identified in the internal image of n-th of closed contour according to default seal template comprising seal figure
Picture, if so, determining that full-filling is effective full-filling in n-th of closed contour, if it is not, then determining n-th of closed contour
Interior full-filling is invalid full-filling;Wherein, symbol guide can be chosen for black and white by presetting seal template.
S135: judge whether n-th of closed contour is the closure wheel to be identified of the last one in the identification parameter list
Exterior feature, if so, into next step, if it is not, then n=n+1, returns to S132.
Specifically, being according to presetting seal template and identify in the internal image of n-th of closed contour in step S134
The no method comprising seal image, comprising:
S1341: all exterior contours of the density bullet are searched in the internal image of n-th of closed contour;
Wherein, " the digitlization bianry image Analysis of Topological Structure based on frontier tracing method " algorithm is used to obtain black
All exterior contour coordinates of label, such as findcontours function in opencv.
S1342: polygonal profile is obtained using straight line fitting to the closed contour searched out, intercepts the polygonal wheel
Wide boundary rectangle is density bullet image;
Wherein, including distance threshold is given, fits a plurality of line segment using least square method and is spliced into polygonal wheel
It is wide.
S1343: searching for longest edge line segment in the polygonal profile, is calculated according to the slope of the longest edge line segment
Deflection angle θ, the θ ∈ (- 90 °, 90 °) of the density bullet;
Wherein, according in polygonal profile it is all while beginning and end two o'clock coordinate calculate polygon in it is all while
Length finds the longest side of length.Straight line is oblique where being calculated according to the beginning and end coordinate of longest edge in polygonal profile
Rate finds out the angle excursion of corresponding relatively horizontal orientation by arctan function.
S1344: the density bullet image is rotated by the deflection angle θ of the density bullet, makes the black
The longest edge line segment of label is minimum perpendicular to the mass center of horizontal direction and the density bullet, then intercepts the density bullet
Boundary rectangle is density bullet effective image;
Wherein, it to make longest edge line segment perpendicular to horizontal direction, then needs by center to rotate density bullet image counterclockwise
θ+90 is spent.Assuming that density bullet picture traverse is W0, it is highly H0, rotating coordinate system origin is located at the upper left corner, to the right just for X-axis
Direction is Y-axis positive direction downwards, then the density bullet picture centre coordinate isRotated image size is wide
High D=MAX (W0, H0).The white image Src for creating width Gao Douwei D, copies the density bullet image into white image
The heart, creation transformation matrix are
Postrotational image Des is obtained to the application radiation transformation of Src image using transformation matrix.
S1345: it is pre- to judge whether the deviation of the density bullet effective picture size and default seal template size meets
If deviation range, if so, the density bullet effective picture size is adjusted to default seal template size, if it is not, then sentencing
It does not include seal image in the internal image of fixed n-th of closed contour;
Wherein, determine that the width of the density bullet effective picture size intercepted out is high and choose symbol guide ruler with default black and white
Very little wide height difference is away from if within the allowable range, the density bullet effective image intercepted out is zoomed to identical as template size
Size.
S1346: the density bullet effective image is subjected to binary conversion treatment, treated that density bullet is effective for judgement
Whether image and the image similarity of default seal template reach default similarity threshold, if so, determining to close for described n-th
Closing includes seal image in the internal image of profile, if it is not, then determining not wrap in the internal image of n-th of closed contour
Containing seal image.
Wherein, from left to right, density bullet effective image and default black and white after traversing binaryzation from top to bottom choose symbol
Number template, whether the pixel value for comparing each same position is consistent, and all identical pixel value coordinates are counted after the completion of traversal
It counts, then chooses the area of template divided by default black and white, obtain similarity value.
Specifically, being identified to the internal image of the closed contour of interception based on the seal symbol " √ " of template matching.
Internal image is intercepted in the full-filling circle that positioning searches out first, confirming in the circle after binaryzation by black points is
It is no to have density bullet;Density bullet if it exists then searches for density bullet exterior contour, uses to the closed contour of maximum area
Straight line fitting;The each angle point angle of polygonal profile that following digital simulation goes out, removes angle greater than 170 degree, i.e., close to
The angle point of the straight angle;Longest sideline section is searched in remaining polygonal profile, and density bullet is determined with the longest edge line segment
Deflection angle;Density bullet is rotated by deflection angle, makes its longest edge perpendicular to horizontal direction;Detect density bullet
Size it is whether close with standard form " √ ", density bullet is zoomed into standard size if close;Finally by density bullet
It is compared with equal big " √ " symbol, calculates its image similarity, think that voter fills in if similarity is met the requirements is
" √ " is otherwise determined as invalid full-filling.Seal symbol " √ " recognition accuracy based on template matching is high, and processing method is simple,
Speed is fast.
As shown in figure 3, the embodiment of the present invention 2 provides the recognition methods of another seal ballot paper full-filling, in embodiment 1
On the basis of, further include step S10 before step S11: generating default identification parameter list;
Specifically, the method for step S10, comprising:
S101: any of blank seal ballot paper image closed contour is chosen as starting closed contour, obtains described rise
Center pixel coordinate (the x of beginning closed contour0, y0) and the wide height (w of range rectangle0, h0) be added in identification parameter list;
S102: the center pixel coordinate of each closed contour to be positioned in the blank seal ballot paper image is successively obtained
(xm, ym) and the wide height (w of boundary rectanglem, hm) be added in set A, m > 0;
S103: by the center pixel coordinate (x of the starting closed contour0, y0) and the wide height (w of range rectangle0, h0) addition
Into set B;
S104: in set of computations B the point of each closed contour into set A the point of each closed contour it is European
Distance chooses point Ai and point Bj in two set for meeting most short Euclidean distance, by closed contour where Ai point in set A
Center pixel coordinate (xi, yi) and the wide height (w of boundary rectanglei, hi) move into set B;
S105: the center pixel coordinate (x of closed contour where calculating Ai pointi, yi) relative to closed contour where Bj point
Center pixel coordinate (xj, yj) opposite center pixel coordinate (Δ xi, Δ yi), Δ xi=xi-xj, Δ yi=yi-yj, by Ai
Opposite center pixel coordinate (the Δ x of closed contour where pointi, Δ yi), the wide height of boundary rectangle of closed contour where Ai point
(wi, hi) and Bj point where closed contour be added in the identification parameter list in the index j in set B, i, j to be greater than or
Person is equal to 0 integer;
S106 judges whether there are also closed contours to be processed in set A, if so, S104 is then returned to, if it is not, then terminating
Process.
Specifically, the preparation process of identification parameter list includes: 1) to choose any one closure figure on blank seal ballot paper
Starting closed contour of the shape as positioning, such as the outline border containing " DS " letter in the ballot paper upper right corner, obtain its center pixel coordinate
(x0, y0) and the wide height (w of the closed contour approximate range rectangle0,h0), the region of search as the closed contour is added to identification
In parameter list, the wherein wide height (w of the closed contour approximate range rectangle0,h0) it is more than the closed contour actual profile range
Big range facilitates the search for;2) remaining m closed contour center pixel coordinate (x for needing to position is obtained1, y1)……(xm,
ym) and the wide height (w of its boundary rectangle0, h0)…… (wm, hm) form set A;3) center pixel for originating closed contour is sat
Mark (x0, y0) and the wide height (w of the closed contour approximate range rectangle0,h0) be added in set B, if the element number in set B is
N, 4) calculate in set A Euclidean distance A0B0, A1B0, A2B0 ... A0B1 at any point in any point and set B,
A1B1, A2B1 ... AmBn choose the point A in two set of most short Euclidean distanceiWith point Bj, by point AiCenter pixel sit
Mark (xi, yi) and the wide height (w of boundary rectanglei, hi) move into set B, it calculates and the closed contour for saving needs positioning is opposite
In the centre coordinate deviation delta x of point Bji=xi-xj, Δ yi=yi-yj, and relatively nearest closed contour call number j to identification
In parameter list;5) repeat step 4 in until set A in institute positioning in need closed contour processing completion, formed final
Identification parameter list.
As shown in figure 4, the embodiment of the present invention 3 provides a kind of identification device of seal ballot paper full-filling, wherein on seal ballot paper
The full-filling frame of full-filling seal is used for equipped with several, a full-filling frame to be a closed contour, which includes:
Receiving module 21, for receiving seal ballot paper image;
Locating module 22, for successively obtaining each in the seal ballot paper image close according to default identification parameter list
Close position and the size of profile;
Identification module 23, the internal image for intercepting each closed contour respectively carry out seal identification;
Output module 24, for generating the recognition result of seal ballot paper full-filling.
It should be noted that locating module includes:
Closed contour positioning unit is originated, for according in the default identification parameter list in the 1st closed contour
Heart pixel coordinate and the wide high region of search for determining starting closed contour in the seal ballot paper image of rectangular extent, described
It originates the practical center pixel coordinate of the search positioning starting closed contour and size in the region of search of closed contour and protects
It deposits;
Other closed contour positioning units, for according to positioning closing profile in the default identification parameter list
The rope of next closed contour to be positioned in call number and practical center pixel coordinate and the default identification parameter list
Quotation marks, opposite center pixel coordinate, the wide high and relatively nearest closed contour call number of boundary rectangle, successively obtain the seal
The position of each closed contour and size in ballot paper image.
It should be noted that the working method of other closed contour positioning units includes:
S1221:m=2;
S1222: it is indexed according to the relatively nearest closed contour of m-th of closed contour in the default identification parameter list
The corresponding relatively nearest closed contour of the relatively nearest closed contour call number number is obtained in the default identification parameter list
Practical center pixel coordinate, wherein the relatively nearest closed contour of m-th of closed contour be m-th of positioning be closed
The call number of a closed contour of positioning is completed before profile;
S1223: according to the practical center pixel coordinate of the relatively nearest closed contour of m-th of closed contour and institute
The opposite center pixel coordinate of m-th of closed contour in default identification parameter list is stated, m-th of closed contour is calculated
Theoretical center pixel coordinate;
S1224: the boundary rectangle of m-th of closed contour in the identification parameter list is k times of height amplification wide, 1 < k < 2,
Further according to the theoretical center pixel coordinate of m-th of closed contour, m-th of closure wheel in the seal ballot paper image is determined
Wide region of search;
S1225: described m-th of search positioning in the region of search of m-th of closed contour in the seal ballot paper image
The practical center pixel coordinate and size of closed contour simultaneously save;
S1226: judge whether m-th of closed contour is that the last one in the default identification parameter list is to be positioned and closes
Profile is closed, if so, into next step, if it is not, then m=m+1, returns to S1222.
It should be noted that the working method of identification module, comprising:
S131:n=1 or n=2;
S132: it is intercepted according to the practical center pixel coordinate of n-th closed contour in the seal ballot paper image and size
The internal image of n-th of closed contour is simultaneously pre-processed;
S133: judge whether there is density bullet in the internal image of n-th of closed contour, if so, then entering
S134, if it is not, then judging non-full-filling seal in n-th of closed contour;
S134: it whether is identified in the internal image of n-th of closed contour according to default seal template comprising seal figure
Picture, if so, determining that full-filling is effective full-filling in n-th of closed contour, if it is not, then determining n-th of closed contour
Interior full-filling is invalid full-filling;
S135: judge whether n-th of closed contour is the closure wheel to be identified of the last one in the identification parameter list
Exterior feature, if so, into next step, if it is not, then n=n+1, returns to S132.
Specifically, being according to presetting seal template and identify in the internal image of n-th of closed contour in step S134
The no method comprising seal image, comprising:
S1341: all exterior contours of the density bullet are searched in the internal image of n-th of closed contour;
Wherein, " the digitlization bianry image Analysis of Topological Structure based on frontier tracing method " algorithm is used to obtain black
All exterior contour coordinates of label, such as findcontours function in opencv.
S1342: polygonal profile is obtained using straight line fitting to the closed contour searched out, intercepts the polygonal wheel
Wide boundary rectangle is density bullet image;
Wherein, including distance threshold is given, fits a plurality of line segment using least square method and is spliced into polygonal wheel
It is wide.
S1343: searching for longest edge line segment in the polygonal profile, is calculated according to the slope of the longest edge line segment
Deflection angle θ, the θ ∈ (- 90 °, 90 °) of the density bullet;
Wherein, according in polygonal profile it is all while beginning and end two o'clock coordinate calculate polygon in it is all while
Length finds the longest side of length.Straight line is oblique where being calculated according to the beginning and end coordinate of longest edge in polygonal profile
Rate finds out the angle excursion of corresponding relatively horizontal orientation by arctan function.
S1344: the density bullet image is rotated by the deflection angle θ of the density bullet, makes the black
The longest edge line segment of label is minimum perpendicular to the mass center of horizontal direction and the density bullet, then intercepts the density bullet
Boundary rectangle is density bullet effective image;
Wherein, it to make longest edge line segment perpendicular to horizontal direction, then needs by center to rotate density bullet image counterclockwise
θ+90 is spent.Assuming that density bullet picture traverse is W0, it is highly H0, rotating coordinate system origin is located at the upper left corner, to the right just for X-axis
Direction is Y-axis positive direction downwards, then the density bullet picture centre coordinate isRotated image size is wide
High D=MAX (W0, H0).The white image Src for creating width Gao Douwei D, copies the density bullet image into white image
The heart, creation transformation matrix are
Postrotational image Des is obtained to the application radiation transformation of Src image using transformation matrix.
S1345: it is pre- to judge whether the deviation of the density bullet effective picture size and default seal template size meets
If deviation range, if so, the density bullet effective picture size is adjusted to default seal template size, if it is not, then sentencing
It does not include seal image in the internal image of fixed n-th of closed contour;
Wherein, determine that the width of the density bullet effective picture size intercepted out is high and choose symbol guide ruler with default black and white
Very little wide height difference is away from if within the allowable range, the density bullet effective image intercepted out is zoomed to identical as template size
Size.
S1346: the density bullet effective image is subjected to binary conversion treatment, treated that density bullet is effective for judgement
Whether image and the image similarity of default seal template reach default similarity threshold, if so, determining to close for described n-th
Closing includes seal image in the internal image of profile, if it is not, then determining not wrap in the internal image of n-th of closed contour
Containing seal image.
Wherein, from left to right, density bullet effective image and default black and white after traversing binaryzation from top to bottom choose symbol
Number template, whether the pixel value for comparing each same position is consistent, and all identical pixel value coordinates are counted after the completion of traversal
It counts, then chooses the area of template divided by default black and white, obtain similarity value.
As shown in figure 5, the embodiment of the present invention 4 also provides a kind of identification device of seal ballot paper full-filling, in embodiment 3
On the basis of, which further includes preparation module, for generating default identification parameter list;
It should be noted that the working method of preparation module, comprising:
S101: any of blank seal ballot paper image closed contour is chosen as starting closed contour, obtains described rise
Center pixel coordinate (the x of beginning closed contour0, y0) and the wide height (w of range rectangle0, h0) be added in identification parameter list;
S102: the center pixel coordinate of each closed contour to be positioned in the blank seal ballot paper image is successively obtained
(xm, ym) and the wide height (w of boundary rectanglem, hm) be added in set A, m > 0;
S103: by the center pixel coordinate (x of the starting closed contour0, y0) and the wide height (w of range rectangle0, h0) addition
Into set B;
S104: in set of computations B the point of each closed contour into set A the point of each closed contour it is European
Distance chooses point Ai and point Bj in two set for meeting most short Euclidean distance, by closed contour where Ai point in set A
Center pixel coordinate (xi, yi) and the wide height (w of boundary rectanglei, hi) move into set B;
S105: the center pixel coordinate (x of closed contour where calculating Ai pointi, yi) relative to closed contour where Bj point
Center pixel coordinate (xj, yj) opposite center pixel coordinate (Δ xi, Δ yi), Δ xi=xi-xj, Δ yi=yi-yj, by Ai
Opposite center pixel coordinate (the Δ x of closed contour where pointi, Δ yi), the wide height of boundary rectangle of closed contour where Ai point
(wi, hi) and Bj point where closed contour be added in the identification parameter list in the index j in set B, i, j to be greater than or
Person is equal to 0 integer;
S106 judges whether there are also closed contours to be processed in set A, if so, S104 is then returned to, if it is not, then terminating
Process.
The explanation of feature may refer to mutually speaking on somebody's behalf for embodiment corresponding to Fig. 1, Fig. 3 in embodiment corresponding to Fig. 4, Fig. 5
It is bright, it no longer repeats one by one here.
The embodiment of the present invention 5 also provides a kind of identification device of seal ballot paper full-filling, comprising: memory, based on storing
Calculation machine program;Processor, the step of for executing computer program to realize the recognition methods such as above-mentioned seal ballot paper full-filling.
The embodiment of the present invention 6 also provides a kind of computer readable storage medium, which has
Computer program, when which is executed by processor the step of the realization such as recognition methods of above-mentioned seal ballot paper full-filling.
Recognition methods, device and the computer for being provided for the embodiments of the invention a kind of seal ballot paper full-filling above can
Storage medium is read to be described in detail.Each embodiment is described in a progressive manner in specification, each embodiment emphasis
What is illustrated is the difference from other embodiments, and the same or similar parts in each embodiment may refer to each other.For
For device disclosed in embodiment, since it is corresponded to the methods disclosed in the examples, so be described relatively simple, it is related
Place is referring to method part illustration.It should be pointed out that for those skilled in the art, not departing from
, can be with several improvements and modifications are made to the present invention under the premise of the principle of the invention, these improvement and modification also fall into this hair
In bright scope of protection of the claims.
Professional further appreciates that, list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, hard in order to clearly demonstrate
The interchangeability of part and software generally describes each exemplary composition and step according to function in the above description.
These functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution.
Professional technician can use different methods to achieve the described function each specific application, but this reality
Now it should not be considered as beyond the scope of the present invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly use hardware, processor
The combination of the software module or the two of execution is implemented.Software module can be placed in random access memory (RAM), memory, only
Read memory (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or
In any other form of storage medium well known in technical field.
Claims (14)
1. a kind of recognition methods of seal ballot paper full-filling, the seal ballot paper is equipped with several full-fillings for being used for full-filling seal
Frame, one full-filling frame are a closed contour, which is characterized in that the described method includes:
S11: seal ballot paper image is received;
S12: the position of each closed contour and big is successively obtained in the seal ballot paper image according to default identification parameter list
It is small;
S13: the internal image for intercepting each closed contour respectively carries out seal identification;
S14: the recognition result of seal ballot paper full-filling is generated.
2. the recognition methods of seal ballot paper full-filling according to claim 1, which is characterized in that the method for the step S12
Include:
S121: according to the center pixel coordinate and the wide height of rectangular extent of the 1st closed contour in the default identification parameter list
It determines the region of search for originating closed contour in the seal ballot paper image, is searched in the region of search of the starting closed contour
The practical center pixel coordinate of starting closed contour and size described in Suo Dingwei simultaneously save;
S122: according to the call number of positioning closing profile and practical center pixel coordinate in the default identification parameter list,
And it is the call number of next closed contour to be positioned in the default identification parameter list, opposite center pixel coordinate, external
The wide high and relatively nearest closed contour call number of rectangle, successively obtains the position of each closed contour in the seal ballot paper image
And size.
3. the recognition methods of seal ballot paper full-filling according to claim 2, which is characterized in that the method for the step S122
Include:
S1221:m=2;
S1222: according to the relatively nearest closed contour call number of m-th of closed contour in the default identification parameter list in institute
State the reality that the corresponding relatively nearest closed contour of the relatively nearest closed contour call number is obtained in default identification parameter list
Center pixel coordinate, wherein the relatively nearest closed contour of m-th of closed contour is before positioning m-th of closed contour
The call number of a closed contour of positioning is completed;
S1223: according to the practical center pixel coordinate of the relatively nearest closed contour of m-th of closed contour and described default
The opposite center pixel coordinate of m-th of closed contour in identification parameter list calculates the theoretical center of m-th of closed contour
Pixel coordinate;
S1224: the boundary rectangle of m-th of closed contour in the identification parameter list is k times of height amplification wide, 1 < k < 2, further according to
The theoretical center pixel coordinate of m-th of closed contour determines the search of m-th of closed contour in the seal ballot paper image
Region;
S1225: search positioning m-th of closure in the region of search of m-th of closed contour in the seal ballot paper image
The practical center pixel coordinate and size of profile simultaneously save;
S1226: judge whether m-th of closed contour is the closure wheel to be positioned of the last one in the default identification parameter list
Exterior feature, if so, into next step, if it is not, then m=m+1, returns to S1222.
4. the recognition methods of seal ballot paper full-filling according to claim 1, which is characterized in that the method for the step S13,
Include:
S131:n=1 or n=2;
S132: according to the practical center pixel coordinate of n-th closed contour in the seal ballot paper image and size interception
The internal image of n-th of closed contour is simultaneously pre-processed;
S133: judging whether there is density bullet in the internal image of n-th of closed contour, if so, then enter S134, if
It is no, then judge non-full-filling seal in n-th of closed contour;
Whether S134: identifying according to default seal template comprising seal image in the internal image of n-th of closed contour, if
It is then to determine that full-filling is effective full-filling in n-th of closed contour, if it is not, then determining full-filling in n-th of closed contour
For invalid full-filling;
S135: judge whether n-th of closed contour is the closure wheel to be identified of the last one in the identification parameter list
Exterior feature, if so, into next step, if it is not, then n=n+1, returns to S132.
5. the recognition methods of seal ballot paper full-filling according to claim 4, which is characterized in that basis in the step S134
Default seal template identify in the internal image of n-th of closed contour whether include seal image method, comprising:
S1341: all exterior contours of the density bullet are searched in the internal image of n-th of closed contour;
S1342: polygonal profile is obtained using straight line fitting to the closed contour searched out, intercepts the outer of the polygonal profile
Connecing rectangle is density bullet image;
S1343: searching for longest edge line segment in the polygonal profile, is calculated according to the slope of the longest edge line segment described black
Deflection angle θ, the θ ∈ (- 90 °, 90 °) of color marker;
S1344: the density bullet image is rotated by the deflection angle θ of the density bullet, makes the density bullet
Longest edge line segment it is minimum perpendicular to the mass center of horizontal direction and the density bullet, then intercept the external square of the density bullet
Shape is density bullet effective image;
S1345: it is default inclined to judge whether the deviation of the density bullet effective picture size and default seal template size meets
Poor range, if so, the density bullet effective picture size is adjusted to default seal template size, if it is not, then determining institute
It states in the internal image of n-th of closed contour not comprising seal image;
S1346: carrying out binary conversion treatment for the density bullet effective image, judgement treated density bullet effective image with
Whether the image similarity of default seal template reaches default similarity threshold, if so, determining n-th of closed contour
It include seal image in internal image, if it is not, then determining in the internal image of n-th of closed contour not comprising seal figure
Picture.
6. the recognition methods of seal ballot paper full-filling according to claim 1, which is characterized in that also wrapped before the step S11
It includes step S10: generating default identification parameter list;
The method of the step S10, comprising:
S101: any of blank seal ballot paper image closed contour is chosen as starting closed contour, the starting is obtained and closes
Close the center pixel coordinate (x of profile0, y0) and the wide height (w of range rectangle0, h0) be added in identification parameter list;
S102: the center pixel coordinate (x of each closed contour to be positioned in the blank seal ballot paper image is successively obtainedm, ym)
With the wide height (w of boundary rectanglem, hm) be added in set A, m > 0;
S103: by the center pixel coordinate (x of the starting closed contour0, y0) and the wide height (w of range rectangle0, h0) it is added to set
In B;
S104: the Euclidean distance of the point of each closed contour point of each closed contour into set A in set of computations B,
The point Ai and point Bj in two set for meeting most short Euclidean distance are chosen, by the center of closed contour where Ai point in set A
Pixel coordinate (xi, yi) and the wide height (w of boundary rectanglei, hi) move into set B;
S105: the center pixel coordinate (x of closed contour where calculating Ai pointi, yi) center relative to closed contour where Bj point
Pixel coordinate (xj, yj) opposite center pixel coordinate (Δ xi, Δ yi), Δ xi=xi-xj, Δ yi=yi-yj, will be where Ai point
Opposite center pixel coordinate (the Δ x of closed contouri, Δ yi), the wide height (w of boundary rectangle of closed contour where Ai pointi, hi) and
Closed contour where Bj point is added in the identification parameter list in the index j in set B, and i, j are more than or equal to 0
Integer;
S106 judges whether there are also closed contours to be processed in set A, if so, S104 is then returned to, if it is not, then terminating process.
7. a kind of identification device of seal ballot paper full-filling, the seal ballot paper is equipped with several full-fillings for being used for full-filling seal
Frame, one full-filling frame are a closed contour, which is characterized in that described device includes:
Receiving module, for receiving seal ballot paper image;
Locating module, for successively obtaining each closed contour in the seal ballot paper image according to default identification parameter list
Position and size;
Identification module, the internal image for intercepting each closed contour respectively carry out seal identification;
Output module, for generating the recognition result of seal ballot paper full-filling.
8. the identification device of seal ballot paper full-filling according to claim 7, which is characterized in that the locating module includes:
Closed contour positioning unit is originated, for the middle imago according to the 1st closed contour in the default identification parameter list
Plain coordinate and the wide high region of search for determining starting closed contour in the seal ballot paper image of rectangular extent, are closed in the starting
It closes the practical center pixel coordinate of the search positioning starting closed contour and size in the region of search of profile and saves;
Other closed contour positioning units, for according to the call number of positioning closing profile in the default identification parameter list
With call number, the phase of next closed contour to be positioned in practical center pixel coordinate and the default identification parameter list
To center pixel coordinate, the wide high and relatively nearest closed contour call number of boundary rectangle, the seal ballot paper image is successively obtained
In each closed contour position and size.
9. the identification device of seal ballot paper full-filling according to claim 7, which is characterized in that other described closed contours are fixed
The working method of bit location includes:
S1221:m=2;
S1222: according to the relatively nearest closed contour call number of m-th of closed contour in the default identification parameter list in institute
State the reality that the corresponding relatively nearest closed contour of the relatively nearest closed contour call number is obtained in default identification parameter list
Center pixel coordinate, wherein the relatively nearest closed contour of m-th of closed contour is before positioning m-th of closed contour
The call number of a closed contour of positioning is completed;
S1223: according to the practical center pixel coordinate of the relatively nearest closed contour of m-th of closed contour and described default
The opposite center pixel coordinate of m-th of closed contour in identification parameter list calculates the theoretical center of m-th of closed contour
Pixel coordinate;
S1224: the boundary rectangle of m-th of closed contour in the identification parameter list is k times of height amplification wide, 1 < k < 2, further according to
The theoretical center pixel coordinate of m-th of closed contour determines the search of m-th of closed contour in the seal ballot paper image
Region;
S1225: search positioning m-th of closure in the region of search of m-th of closed contour in the seal ballot paper image
The practical center pixel coordinate and size of profile simultaneously save;
S1226: judge whether m-th of closed contour is the closure wheel to be positioned of the last one in the default identification parameter list
Exterior feature, if so, into next step, if it is not, then m=m+1, returns to S1222.
10. the identification device of seal ballot paper full-filling according to claim 7, which is characterized in that the work of the identification module
Make method, comprising:
S131:n=1 or n=2;
S132: according to the practical center pixel coordinate of n-th closed contour in the seal ballot paper image and size interception
The internal image of n-th of closed contour is simultaneously pre-processed;
S133: judging whether there is density bullet in the internal image of n-th of closed contour, if so, then entering S134, if not having
Have, then determines non-full-filling seal in n-th of closed contour;
Whether S134: identifying according to default seal template comprising seal image in the internal image of n-th of closed contour, if
It is then to determine that full-filling is effective full-filling in n-th of closed contour, if it is not, then determining full-filling in n-th of closed contour
For invalid full-filling;
S135: judging whether n-th of closed contour is the last one closed contour to be identified in the identification parameter list, if
It is then to enter next step, if it is not, then n=n+1, returns to S132.
11. the identification device of seal ballot paper full-filling according to claim 10, which is characterized in that root in the step S134
According to default seal template identify in the internal image of n-th of closed contour whether include seal image method, comprising:
S1341: all exterior contours of the density bullet are searched in the internal image of n-th of closed contour;
S1342: polygonal profile is obtained using straight line fitting to the closed contour searched out, intercepts the outer of the polygonal profile
Connecing rectangle is density bullet image;
S1343: searching for longest edge line segment in the polygonal profile, is calculated according to the slope of the longest edge line segment described black
Deflection angle θ, the θ ∈ (- 90 °, 90 °) of color marker;
S1344: the density bullet image is rotated by the deflection angle θ of the density bullet, makes the density bullet
Longest edge line segment it is minimum perpendicular to the mass center of horizontal direction and the density bullet, then intercept the external square of the density bullet
Shape is density bullet effective image;
S1345: it is default inclined to judge whether the deviation of the density bullet effective picture size and default seal template size meets
Poor range, if so, the density bullet effective picture size is adjusted to default seal template size, if it is not, then determining institute
It states in the internal image of n-th of closed contour not comprising seal image;
S1346: carrying out binary conversion treatment for the density bullet effective image, judgement treated density bullet effective image with
Whether the image similarity of default seal template reaches default similarity threshold, if so, determining n-th of closed contour
It include seal image in internal image, if it is not, then determining in the internal image of n-th of closed contour not comprising seal figure
Picture.
12. the identification device of seal ballot paper full-filling according to claim 7, which is characterized in that described device further includes standard
Standby module, for generating default identification parameter list;
The working method of the preparation module, comprising:
S101: any of blank seal ballot paper image closed contour is chosen as starting closed contour, the starting is obtained and closes
Close the center pixel coordinate (x of profile0, y0) and the wide height (w of range rectangle0, h0) be added in identification parameter list;
S102: the center pixel coordinate (x of each closed contour to be positioned in the blank seal ballot paper image is successively obtainedm, ym)
With the wide height (w of boundary rectanglem, hm) be added in set A, m > 0;
S103: by the center pixel coordinate (x of the starting closed contour0, y0) and the wide height (w of range rectangle0, h0) it is added to set
In B;
S104: the Euclidean distance of the point of each closed contour point of each closed contour into set A in set of computations B,
The point Ai and point Bj in two set for meeting most short Euclidean distance are chosen, by the center of closed contour where Ai point in set A
Pixel coordinate (xi, yi) and the wide height (w of boundary rectanglei, hi) move into set B;
S105: the center pixel coordinate (x of closed contour where calculating Ai pointi, yi) center relative to closed contour where Bj point
Pixel coordinate (xj, yj) opposite center pixel coordinate (Δ xi, Δ yi), Δ xi=xi-xj, Δ yi=yi-yj, will be where Ai point
Opposite center pixel coordinate (the Δ x of closed contouri, Δ yi), the wide height (w of boundary rectangle of closed contour where Ai pointi, hi) and
Closed contour where Bj point is added in the identification parameter list in the index j in set B, and i, j are more than or equal to 0
Integer;
S106 judges whether there are also closed contours to be processed in set A, if so, S104 is then returned to, if it is not, then terminating process.
13. a kind of identification device of seal ballot paper full-filling characterized by comprising
Memory, for storing computer program;
Processor, for executing the computer program to realize the seal ballot paper full-filling as described in any one of claims 1 to 6
Recognition methods the step of.
14. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has computer journey
Sequence realizes the knowledge of the seal ballot paper full-filling as described in any one of claims 1 to 6 when the computer program is executed by processor
The step of other method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811562812.XA CN109711404B (en) | 2018-12-20 | 2018-12-20 | Seal ballot filling identification method and device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811562812.XA CN109711404B (en) | 2018-12-20 | 2018-12-20 | Seal ballot filling identification method and device and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109711404A true CN109711404A (en) | 2019-05-03 |
CN109711404B CN109711404B (en) | 2019-12-24 |
Family
ID=66256176
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811562812.XA Active CN109711404B (en) | 2018-12-20 | 2018-12-20 | Seal ballot filling identification method and device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109711404B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110490141A (en) * | 2019-08-21 | 2019-11-22 | 南京怀宇科技有限公司 | A kind of recognition methods, device, terminal and the storage medium of full-filling information |
CN112132783A (en) * | 2020-08-21 | 2020-12-25 | 成都飞机工业(集团)有限责任公司 | Part identification method based on digital image processing technology |
CN112200117A (en) * | 2020-10-22 | 2021-01-08 | 长城计算机软件与系统有限公司 | Form identification method and device |
CN112560729A (en) * | 2020-12-22 | 2021-03-26 | 成都中科信息技术有限公司 | Vote processing method and system |
CN112837196A (en) * | 2021-01-18 | 2021-05-25 | 中科院成都信息技术股份有限公司 | Voter verification and vote distribution method, device, system and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1804905A (en) * | 2006-01-12 | 2006-07-19 | 北京飞利信电子技术有限公司 | Voting paper recognition method for electronic voting boxes |
CN101436321A (en) * | 2008-12-12 | 2009-05-20 | 中科院成都信息技术有限公司 | Method for processing ballot information |
CN101447017A (en) * | 2008-11-27 | 2009-06-03 | 浙江工业大学 | Method and system for quickly identifying and counting votes on the basis of layout analysis |
CN105389836A (en) * | 2014-09-04 | 2016-03-09 | 陕西鸥玛信息科技有限责任公司 | Image smear point aggregation coding recognition card |
CN105426844A (en) * | 2015-11-20 | 2016-03-23 | 广州未名中智教育科技有限公司 | Method for identifying answer sheet |
CN107194391A (en) * | 2017-04-21 | 2017-09-22 | 广东清华文通科技有限公司 | A kind of method for the intellectual analysis positioning electronic ballot paper for resisting image stretch skew |
-
2018
- 2018-12-20 CN CN201811562812.XA patent/CN109711404B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1804905A (en) * | 2006-01-12 | 2006-07-19 | 北京飞利信电子技术有限公司 | Voting paper recognition method for electronic voting boxes |
CN101447017A (en) * | 2008-11-27 | 2009-06-03 | 浙江工业大学 | Method and system for quickly identifying and counting votes on the basis of layout analysis |
CN101436321A (en) * | 2008-12-12 | 2009-05-20 | 中科院成都信息技术有限公司 | Method for processing ballot information |
CN105389836A (en) * | 2014-09-04 | 2016-03-09 | 陕西鸥玛信息科技有限责任公司 | Image smear point aggregation coding recognition card |
CN105426844A (en) * | 2015-11-20 | 2016-03-23 | 广州未名中智教育科技有限公司 | Method for identifying answer sheet |
CN105426844B (en) * | 2015-11-20 | 2018-09-18 | 广州未名中智教育科技有限公司 | A kind of answer card identification method |
CN107194391A (en) * | 2017-04-21 | 2017-09-22 | 广东清华文通科技有限公司 | A kind of method for the intellectual analysis positioning electronic ballot paper for resisting image stretch skew |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110490141A (en) * | 2019-08-21 | 2019-11-22 | 南京怀宇科技有限公司 | A kind of recognition methods, device, terminal and the storage medium of full-filling information |
CN112132783A (en) * | 2020-08-21 | 2020-12-25 | 成都飞机工业(集团)有限责任公司 | Part identification method based on digital image processing technology |
CN112200117A (en) * | 2020-10-22 | 2021-01-08 | 长城计算机软件与系统有限公司 | Form identification method and device |
CN112200117B (en) * | 2020-10-22 | 2023-10-13 | 长城计算机软件与系统有限公司 | Form identification method and device |
CN112560729A (en) * | 2020-12-22 | 2021-03-26 | 成都中科信息技术有限公司 | Vote processing method and system |
CN112560729B (en) * | 2020-12-22 | 2023-12-26 | 成都中科信息技术有限公司 | Vote processing method and system |
CN112837196A (en) * | 2021-01-18 | 2021-05-25 | 中科院成都信息技术股份有限公司 | Voter verification and vote distribution method, device, system and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109711404B (en) | 2019-12-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109711404A (en) | Recognition methods, device and the computer readable storage medium of seal ballot paper full-filling | |
CN101303768B (en) | Method for correcting circle center error of circular index point when translating camera perspective projection | |
CN107958458B (en) | Image segmentation method, image segmentation system and equipment comprising image segmentation system | |
CN103679702B (en) | A kind of matching process based on image border vector | |
WO1993007580A1 (en) | Method of determining direction in local region of profile segment and method of determining lines and angles | |
CN109426814B (en) | Method, system and equipment for positioning and identifying specific plate of invoice picture | |
CN113052911B (en) | Calibration plate, camera calibration method and device | |
CN109934180B (en) | Fingerprint identification method and related device | |
CN101311963A (en) | Round mark point center picture projection point position acquiring method for positioning video camera | |
CN112396643A (en) | Multi-mode high-resolution image registration method with scale-invariant features and geometric features fused | |
CN105184225B (en) | A kind of multinational banknote image recognition methods and device | |
CN109325381B (en) | QR code positioning and correcting method | |
Kwag et al. | Efficient skew estimation and correction algorithm for document images | |
CN110738216A (en) | Medicine identification method based on improved SURF algorithm | |
CN106815830B (en) | Image defect detection method | |
CN109670447B (en) | Recognition methods, device and the readable storage medium storing program for executing of seal ballot paper full-filling block diagram picture | |
CN106204542B (en) | Visual identity method and system | |
CN117911668A (en) | Drug information identification method and device | |
CN104036494A (en) | Fast matching computation method used for fruit picture | |
Dori et al. | Stepwise recovery of arc segmentation in complex line environments | |
Ni et al. | A fully automatic registration approach based on contour and SIFT for HJ-1 images | |
CN115375576A (en) | Image correction method for biological characteristic photoelectric scanning device | |
CN112183596B (en) | Linear segment matching method and system combining local grid constraint and geometric constraint | |
CN107229935A (en) | A kind of binary system of triangle character describes method | |
CN107909563B (en) | Template-based rapid Hough transformation straight line detection method |
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 | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40003796 Country of ref document: HK |