The content of the invention
The invention provides a kind of China second-generation identity card recognition methodss and device based on Intelligent mobile equipment, the method can
Intelligent mobile equipment and relatively low to image taking requirement is applied to, can be user-friendly to.
To achieve these goals, the present invention adopts following technological means:
A kind of China second-generation identity card recognition methodss based on Intelligent mobile equipment, including:
The China second-generation identity card image comprising name information, certificate address information and citizenship number information is obtained, it is described secondary
ID Card Image shoots for the photographic head of Intelligent mobile equipment;
The ash that gray count obtains each pixel of the China second-generation identity card image is carried out to the China second-generation identity card image
Angle value;
Binary conversion treatment is carried out to the gray value of the China second-generation identity card image each pixel and obtains binary image data;
Floor projection is carried out to the binary image data, each black segment is obtained;
Successively each judges whether the image-region corresponding to black segment meets citizenship number information area feature,
Continue described each black segment of traversal if being unsatisfactory for, citizenship number information area is determined if meeting;
Determine name information region and address letter according to citizenship number information area and default China second-generation identity card template
Breath region;
The citizenship number information area, name information region and certificate address information region are vertically thrown respectively
Shadow, obtains each black segment, intercepts citizenship number information, name information, address letter according to each black segment respectively
Each single character of breath;
Described each single character is sent to OCR engine and is identified, citizenship number information, name are obtained respectively
Information and certificate address information.
Preferably, binary conversion treatment is carried out to the gray value of the China second-generation identity card image each pixel and obtains bianry image
Data include:
Judge the gray value of the China second-generation identity card image each pixel whether more than predetermined threshold value successively;
The gray value that the pixel is arranged if more than the predetermined threshold value is 0, and if less than the predetermined threshold value this is arranged
The gray value of pixel is 255;
Using the gray value of each pixel as the binary image data.
Preferably, floor projection is carried out to the binary image data, obtaining each black segment includes:
Step 1:Horizontal direction projection is carried out to the binary image data, each projection line length is obtained;
Step 2:Interference is carried out to described each projection line length to process, normal projection's line that acquisition is gone after disturbing;
Step 3:The first projection line is obtained in normal projection's line as Current projection line;
Step 4:Judge whether Current projection line is the last item projection line, if Current projection line is not the last item projection
Line, into step 5, if Current projection line is the last item projection line, into step 13;
Step 5:Next projection line is obtained as the second projection line;
Step 6:Whether the distance between the second projection line and Current projection line are judged more than black segment minimum spacing, if
Step 7 is no more than then entered, step 9 is entered if being more than;
Step 7:Judge that start line whether there is, if exist entering step 12, if not existing, into step 8;
Step 8:It is start line to arrange Current projection line, into step 12;
Step 9:Judge whether to find start line;If it was found that into step 10 if start line, entering if start line is not found
Enter step 12;
Step 10:Judge the distance between Current projection line and start line whether more than black segment minimum constructive height;If big
In step 11 is then entered, step 7 is entered if being less than;
Step 11:Increase a black segment, then cancel start line, into step 12;
Step 12:It is Current projection line to arrange the second projection line, into step 4;
Step 13:If Current projection line is the last item projection line, judge whether to find start line;If it was found that starting
Line, into step 14, does not then find that start line then enters step 16;
Step 14:Judge the distance between Current projection line and start line whether more than black segment minimum constructive height;If big
In step 15 is then entered, step 16 is entered if being less than;
Step 15:Increase a black segment, into step 16;
Step 16:Terminate flow process.
Preferably, whether described each image-region for judging corresponding to black segment successively meets citizenship number letter
Breath provincial characteristicss include:
The image-region corresponding to black segment is extracted successively;
Upright projection is carried out to described image region, each horizontal black segment is obtained;
If the quantity of the horizontal black segment is 18, then it represents that the corresponding image-region of black segment meets citizen's body
Part number information provincial characteristicss.
Preferably, according to citizenship number information area and default China second-generation identity card template determine name information region and
Certificate address information region includes:
As origin, the horizontal direction axle of the China second-generation identity card image is X in the upper left corner with the China second-generation identity card image
Axle, vertical direction is Y-axis;
According to position of the citizenship number information area on the China second-generation identity card image, citizenship number is obtained
The top left co-ordinate of information area, lower-left angular coordinate, upper right angular coordinate or bottom right angular coordinate;
Name information region, certificate address information region and citizenship number are provided according to the default China second-generation identity card template
Size relationship between information area, is sat by the top left co-ordinate of citizenship number information area, lower-left angular coordinate, the upper right corner
Mark or bottom right angular coordinate determine name information region top left co-ordinate and bottom right angular coordinate, the top left co-ordinate in certificate address information region
With bottom right angular coordinate;
Citizenship number information is determined according to the top left co-ordinate and bottom right angular coordinate of citizenship number information area
Region;
According to name information region top left co-ordinate and bottom right angular coordinate name information region;
Certificate address information region is determined according to the top left co-ordinate and bottom right angular coordinate in certificate address information region.
Preferably, according to citizenship number information area and default China second-generation identity card template determine name information region and
Certificate address information region includes:
As origin, the horizontal direction axle of the China second-generation identity card image is X in the upper left corner with the China second-generation identity card image
Axle, vertical direction is Y-axis;
According to position of the citizenship number information area on the China second-generation identity card image, citizenship number is obtained
The top left co-ordinate of information area, lower-left angular coordinate, upper right angular coordinate or bottom right angular coordinate;
Name information region, certificate address information region and citizenship number are provided according to the default China second-generation identity card template
Size relationship between information area, is sat by the top left co-ordinate of citizenship number information area, lower-left angular coordinate, the upper right corner
Mark or bottom right angular coordinate determine name information region lower-left angular coordinate and upper right angular coordinate, the lower-left angular coordinate in certificate address information region
With upper right angular coordinate;
Citizenship number information is determined according to the lower-left angular coordinate and upper right angular coordinate of citizenship number information area
Region;
According to name information region lower-left angular coordinate and upper right angular coordinate name information region;
Certificate address information region is determined according to the lower-left angular coordinate and upper right angular coordinate in certificate address information region.
Preferably, also wrap after region in acquisition citizenship number information area, name information region, certificate address information
Include:
Carry out floor projection to citizenship number information area, name information region, certificate address information region respectively and hang down
Shadow is delivered directly, citizenship number information area, name information region, the accurate coordinate in certificate address information region is reacquired;
According to the citizenship number information area, name information region, certificate address information region accurate coordinate again
Positioning citizenship number information area, name information region, certificate address information region.
Preferably, also include:
It is 1280*720 pixels to arrange the specification that the photographic head of the Intelligent mobile equipment takes pictures.
A kind of recognition device for second-generation ID card based on Intelligent mobile equipment, including:
Elementary area is obtained, for obtaining the secondary body comprising name information, certificate address information and citizenship number information
Part card image, the China second-generation identity card image shoots for the photographic head of Intelligent mobile equipment;
Gray proces unit, for carrying out gray count to the China second-generation identity card image China second-generation identity card figure is obtained
The gray value of each pixel of picture;
Two-value processing unit, obtains for carrying out binary conversion treatment to the gray value of the China second-generation identity card image each pixel
Take binary image data;
Floor projection unit, for carrying out floor projection to the binary image data, obtains each black segment;
Identity card identification unit, for successively each judge whether the image-region corresponding to black segment meets citizen's body
Part number information provincial characteristicss, continue described each black segment of traversal if being unsatisfactory for, and citizenship number is determined if meeting
Code information area;
Superscription recognition unit, for determining according to citizenship number information area and default China second-generation identity card template
Name information region and certificate address information region;
Character acquiring unit, for respectively to the citizenship number information area, name information region and address letter
Breath region carries out upright projection, obtains each black segment, respectively according to each black segment intercept citizenship number information,
Each single character of name information, certificate address information;
Information acquisition unit, is identified for described each single character to be sent to OCR engine, and citizen is obtained respectively
Identity code information, name information and certificate address information.
The invention provides a kind of China second-generation identity card recognition methodss based on Intelligent mobile equipment, the method is first by imaging
Head obtains the China second-generation identity card image for including name information, certificate address information and citizenship number information, and to China second-generation identity card
Image carries out gray count and binary conversion treatment obtains binary image data, then carries out floor projection acquisition to binary image data
Each black segment, according to black segment citizenship number information area is obtained first, and according to citizenship number information
Region and default China second-generation identity card module obtain name information region and certificate address information region.
The invention provides a kind of China second-generation identity card recognition methodss based on Intelligent mobile equipment, the method is to secondary identity
Card image is when carrying out image procossing, using gray count, binary conversion treatment, floor projection and upright projection in image procossing and
The rudimentary algorithms such as relative coordinates positioning, these algorithms easily can run in Intelligent mobile equipment, and this method is to taking the photograph
As the China second-generation identity card image that head shoots does not have strict requirements, as long as including identified content is needed, without the need for including
Four edges of ID Card Image, therefore this method is relatively low to the photographing request of image and can be applied to intelligent mobile and sets
It is standby, can be user-friendly to.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than the embodiment of whole.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of protection of the invention.
As shown in figure 1, the invention provides a kind of China second-generation identity card recognition methodss based on Intelligent mobile equipment, including:
Step S101:The China second-generation identity card image comprising name information, certificate address information and citizenship number information is obtained,
The China second-generation identity card image shoots for the photographic head of Intelligent mobile equipment;
China second-generation identity card image in the present invention is that user is shot by Intelligent mobile equipment, and Intelligent mobile equipment is taken the photograph
As the specification that head is taken pictures is shot after China second-generation identity card image for the photographic head of 1280*720 pixel Intelligent mobile equipments, just will be secondary
ID Card Image is sent to the processor of Intelligent mobile equipment, and China second-generation identity card image is carried out further by processor
Reason.
It is illustrated in figure 2 the structural representation of China second-generation identity card of the prior art, the China second-generation identity card figure in the present invention
As at least including name information 101, certificate address information 102 and citizenship number information 103, name information is identity card holder
Name content, for example:Zhang San, Li Si etc., certificate address information handles inhabitation certificate address information during identity card for identity card holder,
Citizenship number information is the number of 18 character contents of identity card holder.
Step S102:The China second-generation identity card image is carried out gray count obtain the China second-generation identity card image each
The gray value of pixel;
The processor of Intelligent mobile equipment is obtained after China second-generation identity card image, the RGB component of each pixel is obtained first, so
Pass through gray value computing formula afterwards:Gray=(R*306+G*601+B*117)>>10 gray values for being calculated each pixel, its
In the precision of gray scale that obtained by the formula of the present embodiment be 10.
Step S103:Binary conversion treatment is carried out to the gray value of the China second-generation identity card image each pixel and obtains binary map
As data;
Carry out binary conversion treatment to China second-generation identity card image to be the gray value of the pixel on China second-generation identity card image
0 or 255 is set to, pixel value 255 is white, pixel value 0 is black, entirely China second-generation identity card image will be presented significantly
Black and white effect.Black is certain objects, i.e., the required content in the present invention in China second-generation identity card image, and white is background objects
Body.
When binary conversion treatment is carried out to China second-generation identity card image, gray value in China second-generation identity card image is more than or equal to
The pixel of threshold value is judged as certain objects, and its gray value is represented with 0, i.e. black pixel point, and China second-generation identity card image is mellow lime
Angle value is excluded outside certain objects less than the pixel of threshold value, and gray value is 255, i.e., white pixel point represent background or its
His object area.
Step S104:Floor projection is carried out to the binary image data, each black segment is obtained;
As shown in figure 3, for the schematic diagram of each black segment.Floor projection is per one-row pixels to binary image data
Transverse projection, counts the number of black pixel point, so as to obtain the projection line of each row pixel.Black figure is constituted by each projection line
Block.
After China second-generation identity card floor projection, the floor projection of name information, certificate address information and citizenship number information
Crest occurs at position.But the pixel comprising identity card picture in the projection of the horizontal direction of name information and certificate address information,
Occurs adhesion between crest, it is not easy to be positioned.Citizenship number information is single crest, without others image-region
Pixel interference, therefore position citizenship number in the present invention first.
Step S105:Successively each judges whether the image-region corresponding to black segment meets citizenship number information
Provincial characteristicss, continue described each black segment of traversal if being unsatisfactory for, and citizenship number information area is determined if meeting;
As shown in figure 4, for the schematic diagram of citizenship number information area, name information region and certificate address information region.
Citizenship number information area 201 is the image-region corresponding to citizenship number information, and name information region 202 is surname
Image-region corresponding to name information, certificate address information region 203 is the image-region corresponding to certificate address information.
As shown in figure 5, the schematic diagram after upright projection is carried out for citizenship number region, as seen from the figure, to citizen's body
Part region is carried out after upright projection, and the quantity of the horizontal black segment for obtaining is to above-mentioned steps in 18, therefore the present embodiment
The image-region that the horizontal black segment of middle acquisition is answered carries out upright projection, and whether the quantity of determined level black segment is
18, citizenship number information area feature is met if the quantity of horizontal black segment is for 18, if the number of horizontal black segment
Amount is not 18 sufficient citizenship number information area features with thumb down.
The present invention can each black segment of Ergodic judgement in any order, because citizenship number region is in identity card
In the bottommost of image, therefore each black segment obtained after floor projection, citizenship number information area part should
In the lower section of each black segment, therefore preferred traversal order is using traversal black segment from bottom to up in the present embodiment
Mode.
Step S106:Determine name information region according to citizenship number information area and default China second-generation identity card template
With certificate address information region;
Be illustrated in figure 6 default China second-generation identity card template, it is illustrated that in digital unit all be mm.China second-generation identity card template
Include the size relationship between name information region, certificate address information region and citizenship number information area.By citizen's body
Each size relationship in part number information region and China second-generation identity card template, you can determine name information region and address letter
Breath region, name region is single file, and certificate address information region is multirow, and citizenship number information area is single file.
Step S107:The citizenship number information area, name information region and certificate address information region are entered respectively
Row upright projection, obtains each black segment, and according to black segment single character is intercepted;
Upright projection is carried out to the citizenship number information area, each black segment is obtained, according to black segment
Intercept the single character of citizenship number information;
Upright projection is carried out to name information region, each black segment is obtained, according to black segment name information is intercepted
Single character;
Upright projection is carried out respectively to the often row region in certificate address information region, each black segment is obtained, according to black figure
Block intercepts the single character of certificate address information;
Step S108:The single character is sent to OCR engine and is identified, citizenship number letter is obtained respectively
Breath, name information and certificate address information.
Each single character of citizenship number information area is sent to OCR engine and is identified, obtain citizen's body
Part number field information;
Each single character in name information region is sent to OCR engine and is identified, obtain name information;
Each single character in the often row region in certificate address information region is sent to OCR engine and is identified, obtain address
Information.
OCR(Optical Character Recognition)Engine is that process can be analyzed to image file, from
Dynamic identification obtains the software of Word message and layout information, and the software is a mature technology, be will not be described here.
When the method carries out image procossing to China second-generation identity card image, gray count, binaryzation in the image procossing for using
The rudimentary algorithm such as process, floor projection and upright projection and relative coordinates positioning, these algorithms can easily in intelligent sliding
Run in dynamic equipment, and this method does not have strict requirements to the China second-generation identity card image that photographic head shoots, as long as including need
Content to be identified, without the need for including four edges of ID Card Image, therefore this method to the photographing request of image compared with
It is low and Intelligent mobile equipment can be applied to, can be user-friendly to.
As shown in fig. 7, the invention provides the second of a kind of China second-generation identity card recognition methodss based on Intelligent mobile equipment
Embodiment, including:
Step S201:Obtain China second-generation identity card image;Obtain and include name information, certificate address information and citizenship number
The China second-generation identity card image of information, the China second-generation identity card image shoots for the photographic head of Intelligent mobile equipment;
Step S202:Gray count is carried out to China second-generation identity card image, i.e., gray scale is carried out to the China second-generation identity card image
It is calculated the gray value of each pixel of the China second-generation identity card image;
Step S203:Binary conversion treatment is carried out to China second-generation identity card image, i.e., to described each picture of China second-generation identity card image
The gray value of element carries out binary conversion treatment and obtains binary image data;
As shown in figure 8, carrying out binary conversion treatment to China second-generation identity card image specifically includes following steps:
Step S301:Judge the gray value of the China second-generation identity card image each pixel whether more than predetermined threshold value successively;
Predetermined threshold value as judges that each pixel of China second-generation identity card image is the boundary of required content or background object,
If the gray value of the pixel of China second-generation identity card image be more than predetermined threshold value, then it represents that the pixel is certain objects information, i.e., this
Information needed in bright, information needed is name information, certificate address information and citizenship number information, otherwise represents the pixel
It is background object.
Step S302:The gray value that the pixel is arranged if more than the predetermined threshold value is 0;
If the gray value of a certain pixel is more than predetermined threshold value, the gray value for resetting the pixel is 0, and pixel value is for 0
Black, represents that the pixel is the required content in the present invention.
Step S303:The gray value that the pixel is arranged if less than the predetermined threshold value is 255;
If the gray value of a certain pixel is less than predetermined threshold value, the gray value for resetting the pixel is 255, and pixel value is
255 are white, represent that the pixel is background information, are not the required contents in the present invention.
Step S304:Using the gray value of each pixel as the binary image data.
After binarization operation, China second-generation identity card image is changed into black white image, the secondary body after resetting
Part card each pixel gray value as binary image data, for being used in subsequent step.
Step S204:Floor projection is carried out to the binary image data, each black segment is obtained;
Comprise the following steps as shown in figure 9, floor projection being carried out to image and obtaining each black segment:
Step 1:Horizontal direction projection is carried out to the binary image data, each projection line length is obtained;
Binary image data is obtained in above-mentioned steps S203, horizontal direction projection has been carried out to binary image data, i.e.,
It is that black pixel point in every row is added up, obtains each projection line.
Step 2:Interference is carried out to described each projection line length to process, normal projection's line that acquisition is gone after disturbing;
Binary conversion treatment is carried out to China second-generation identity card image, some errors are occurred unavoidably, in causing the projection line for obtaining
Have some to be interfering line, in order to eliminate projection line in interfering line, to each projection line length average, by each projection line length
Degree is deleted less than the projection line of meansigma methodss as interfering line, will be greater than the projection line of meansigma methodss as normal projection's line.
Step 3:Obtain Current projection line(C), i.e., the first projection line is obtained in normal projection's line as current throwing
Hachure(C);
Step 4:Judge Current projection line(C)Whether it is the last item projection line, if Current projection line(C)It is not last
Bar projection line, into step 5, if Current projection line is the last item projection line, into step 13;
Step 5:Obtain the second projection line(N), that is, next projection line is obtained as the second projection line(N);
Step 6:Judge(N)-(C)> black segment minimum spacings, that is, judge the second projection line(N)With Current projection line
(C)The distance between whether be more than black segment minimum spacing, step 7 is entered if being not more than, if entering step 9 more than if;
Step 7:Judge start line(B)Whether there is, if exist entering step 12, if not existing, into step 8;
Step 8:Current projection line is set(C)For start line(B), into step 12;
Step 9:Judge whether to find start line(B);If it was found that start line(B)Step 10 is then entered, if not finding starting
Line(B)Then enter step 12;
Step 10:Judge Current projection line(C)With start line(B)The distance between it is whether minimum more than black segment high
Degree;If step 11 is entered more than if, step 7 is entered if being less than;
Step 11:Increase a black segment, cancel start line(B), into step 12;
Step 12:Second projection line is set(N)For Current projection line(C), into step 4;
Step 13:If Current projection line(C)It is the last item projection line, then judges whether to find start line(B);If it was found that
Start line(B), into step 14, then do not find start line(B)Then enter step 16;
Step 14:Judge(C)-(B)>Image-region minimum constructive height, that is, judge Current projection line(C)With start line(B)It
Between distance whether be more than black segment minimum constructive height;If step 15 is entered more than if, step 16 is entered if being less than;
Step 15:Increase a black segment, into step 16.
Step 16:Terminate flow process.
Step S205:Determine citizenship number information area, i.e., successively each judges the image corresponding to black segment
Whether region meets citizenship number information area feature, described each black segment of traversal is continued if being unsatisfactory for, if full
Sufficient then determination citizenship number information area;
As shown in Figure 10, successively each judges whether the image-region corresponding to black segment meets citizenship number letter
Breath provincial characteristicss are comprised the following steps:
Step S501:The image-region corresponding to black segment is extracted successively;
Black segment is the region divided by start line and the second projection line, therefore according to start line and the second projection line
Divide China second-generation identity card image, you can obtain the image-region corresponding to each black segment.
Step S502:Upright projection is carried out to described image region, each horizontal black segment is obtained;
Upright projection is carried out to image-region, its process is similar with floor projection, obtain and obtain each after each upright projection
Individual horizontal black segment.
Step S503:If the quantity of each horizontal black segment is 18, then it represents that the corresponding image of black segment
Region meets citizenship number information area feature.
If the quantity of each horizontal black segment is 18, it is determined that the corresponding image-region of black segment is citizenship
Number information region, because the citizenship number information of citizenship number information area all only has 18 characters, it is logical
The quantity for crossing horizontal black segment determines citizenship number information area.
If the quantity of each horizontal black segment is not 18, the next black segment of traversal, again to black segment institute
Corresponding region is judged, until confirming citizenship number information area.
Step S206:Determine name information region according to citizenship number information area and default China second-generation identity card template
With certificate address information region;
As shown in figure 11, comprise the following steps:
Step S601:Foundation sets up coordinate system, the secondary body by origin of the upper left corner of the China second-generation identity card image
The horizontal direction axle of part card image is X-axis, and vertical direction is Y-axis;
Step S602:According to position of the citizenship number information area on the China second-generation identity card image, obtain public
The top left co-ordinate in people's identity code information region, lower-left angular coordinate, upper right angular coordinate or bottom right angular coordinate;
Step S603:Determine the coordinate in name information region and certificate address information region, i.e., preset secondary identity according to described
Card template provides name information region, the size relationship between certificate address information region and citizenship number information area, by public affairs
The top left co-ordinate in people's identity code information region, lower-left angular coordinate, upper right angular coordinate or bottom right angular coordinate determine name information
Region top left co-ordinate and bottom right angular coordinate, the top left co-ordinate in certificate address information region and bottom right angular coordinate;
Or the coordinate in determination name information region and certificate address information region, i.e., according to the default China second-generation identity card template
Name information region, the size relationship between certificate address information region and citizenship number information area are provided, by citizenship
The top left co-ordinate in number information region, lower-left angular coordinate, upper right angular coordinate or bottom right angular coordinate determine that name information region is left
Lower angular coordinate and upper right angular coordinate, the lower-left angular coordinate in certificate address information region and upper right angular coordinate;
For example:Below equation can be drawn by identity card template:With the coordinate of citizenship number information area
(IDX0, IDY0)It is that, with reference to calculating significant character information area coordinate, significant character information area is:Name, sex, nationality,
Date of birth, 6, address region.The coordinate of significant character information area with(X0, Y0),(X1, Y1)Represent.
X0=IDX0-ID height * 5;
Y0=IDY0-ID height * 13;
X1=IDY0;
Y1=ID length/2;
ID is highly the height of citizenship number information area in formula;
According to(X0, Y0),(X1, Y1)Calculate name information region and certificate address information region substantially coordinate;
Step S604:Citizenship is determined according to the top left co-ordinate and bottom right angular coordinate of citizenship number information area
Number information region;Or citizenship number is determined according to the lower-left angular coordinate and upper right angular coordinate of citizenship number information area
Code information area;
Step S605:According to name information region top left co-ordinate and bottom right angular coordinate name information region;Or according to surname
Name information area lower-left angular coordinate and upper right angular coordinate name information region;
Step S606:Certificate address information region is determined according to the top left co-ordinate and bottom right angular coordinate in certificate address information region, or
Certificate address information region is determined according to the lower-left angular coordinate and upper right angular coordinate in certificate address information region.
After above-mentioned steps, the citizenship number information area of acquisition, name information region, certificate address information region
Position it is inaccurate, in order to more accurately obtain regional, after step S406, also include:
Step S607:Respectively level is carried out to citizenship number information area, name information region, certificate address information region
Projection and upright projection, reacquire citizenship number information area, name information region, the accurate seat in certificate address information region
Mark;
Again floor projection is carried out to citizenship number information area, name information region and certificate address information region and is hung down
Shadow is delivered directly, according to the black segment after China second-generation identity card module and projection, citizenship number information area, surname is obtained respectively
Name information area, the accurate coordinate in certificate address information region.
Step S608:According to the citizenship number information area, name information region, certificate address information region it is accurate
Coordinate repositions citizenship number information area, name information region, certificate address information region.
Step S207:Obtain the single character of each information area, i.e., respectively to the citizenship number information area,
Name information region and certificate address information region carry out upright projection, obtain each black segment, respectively according to each black segment
Intercept citizenship number information, name information, each single character of certificate address information;
Step S208:Each information area carries out character recognition, will described each single character send to OCR engine
Row identification, obtains respectively citizenship number information, name information and certificate address information.
As shown in figure 12, present invention also offers a kind of recognition device for second-generation ID card based on Intelligent mobile equipment, bag
Include:
Elementary area 100 is obtained, it is secondary comprising name information, certificate address information and citizenship number information for obtaining
ID Card Image, the China second-generation identity card image shoots for the photographic head of Intelligent mobile equipment;
Gray proces unit 200, for carrying out gray count to the China second-generation identity card image the secondary identity is obtained
The gray value of each pixel of card image;
Two-value processing unit 300, for carrying out at binaryzation to the gray value of the China second-generation identity card image each pixel
Reason obtains binary image data;
Floor projection unit 400, for carrying out floor projection to the binary image data, obtains each black segment;
Identity card identification unit 500, for successively each judge whether the image-region corresponding to black segment meets public affairs
People's identity code information provincial characteristicss, continue described each black segment of traversal if being unsatisfactory for, and citizen's body is determined if meeting
Part number information region;
Superscription recognition unit 600, for according to citizenship number information area and default China second-generation identity card template
Determine name information region and certificate address information region;
Character acquiring unit 700, for respectively to the citizenship number information area, name information region and address
Information area carries out upright projection, obtains each black segment, intercepts citizenship number letter according to each black segment respectively
Breath, name information, each single character of certificate address information;
Information acquisition unit 800, is identified for described each single character to be sent to OCR engine, obtains respectively
Citizenship number information, name information and certificate address information.
If the function described in the present embodiment method is realized and as independent product pin using in the form of SFU software functional unit
When selling or using, during a computing device read/write memory medium can be stored in.Based on such understanding, the embodiment of the present invention
The part contributed to prior art or the part of the technical scheme can be embodied in the form of software product, and this is soft
Part product is stored in a storage medium, including some instructions are used so that a computing device(Can be personal computer,
Server, mobile computing device or network equipment etc.)Perform all or part of step of each embodiment methods described of the invention
Suddenly.And aforesaid storage medium includes:USB flash disk, portable hard drive, read only memory(ROM, Read-Only Memory), at random deposit
Access to memory(RAM, Random Access Memory), magnetic disc or CD etc. are various can be with the medium of store program codes.
Each embodiment is described by the way of progressive in this specification, and what each embodiment was stressed is and other
The difference of embodiment, between each embodiment same or similar part mutually referring to.
The foregoing description of the disclosed embodiments, enables professional and technical personnel in the field to realize or using the present invention.
Various modifications to these embodiments will be apparent for those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, the present invention
The embodiments shown herein is not intended to be limited to, and is to fit to and principles disclosed herein and features of novelty phase one
The most wide scope for causing.