CN106778744A - A kind of method and apparatus of the information of ID card - Google Patents

A kind of method and apparatus of the information of ID card Download PDF

Info

Publication number
CN106778744A
CN106778744A CN201611171572.1A CN201611171572A CN106778744A CN 106778744 A CN106778744 A CN 106778744A CN 201611171572 A CN201611171572 A CN 201611171572A CN 106778744 A CN106778744 A CN 106778744A
Authority
CN
China
Prior art keywords
image
connected domain
detection
predeterminable area
band
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.)
Pending
Application number
CN201611171572.1A
Other languages
Chinese (zh)
Inventor
杨松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201611171572.1A priority Critical patent/CN106778744A/en
Publication of CN106778744A publication Critical patent/CN106778744A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/146Aligning or centring of the image pick-up or image-field
    • G06V30/1475Inclination or skew detection or correction of characters or of image to be recognised
    • G06V30/1478Inclination or skew detection or correction of characters or of image to be recognised of characters or characters lines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

The disclosure is directed to a kind of method and apparatus of the information of ID card, belong to field of computer technology.Methods described includes:Obtain the corresponding bianry image of predeterminable area image in the detection image of release;Closing operation of mathematical morphology treatment is carried out to the bianry image, the first treatment image comprising at least one connected domain is obtained, the connected domain is the connected domain of correspondence foreground image;In at least one connected domain, it is determined that the number of the pixel for including meets the first connected domain of preset number condition, and the corresponding fitting a straight line of first connected domain is determined;According to the slope of the fitting a straight line, rotation correction is carried out to the detection image, and in detection image after rotation correction, recognize the information in the clamp of described information card.Using the disclosure, can avoid placing crooked because of release, and lead to not extract the situation of the character information in release.

Description

A kind of method and apparatus of the information of ID card
Technical field
The disclosure is directed to field of computer technology, especially with respect to the method and dress of a kind of information of ID card Put.
Background technology
With the development of Internet technology, user security is increasingly valued by people, the application of real-name authentication It is more and more extensive.In real-name authentication, the image of the release that terminal will can be photographed is sent to server, and server then can be with Information on the automatic identification release, is manually entered, without user so as to improve the efficiency of real-name authentication.Wherein, release It is the card that the information such as numeral, image are printed in clamp, such as identity card and bank card.
During character information (name, address or identification card number such as identity card on) of the server on ID card, meeting The detection image for including the release is first obtained, character detection technique is may then pass through, in the horizontal direction of detection image Detected with vertical direction, so as to extract the character information included in the detection image.
During the disclosure is realized, inventor has found at least there is problems with:
User often occurs that release places crooked situation, at this moment, if in water in the picture of photographing information card Square to vertical direction on detected, will be unable to extract the character information in release.
The content of the invention
In order to overcome problem present in correlation technique, present disclose provides a kind of method of the information of ID card and Device.The technical scheme is as follows:
Obtain the corresponding bianry image of predeterminable area image in the detection image of release;
Closing operation of mathematical morphology treatment is carried out to the bianry image, the first treatment figure comprising at least one connected domain is obtained Picture, the connected domain is the connected domain of correspondence foreground image;
In at least one connected domain, it is determined that the number of the pixel for including meets the first company of preset number condition Logical domain, and determine the corresponding fitting a straight line of first connected domain;
According to the slope of the fitting a straight line, rotation correction, and the inspection after rotation correction are carried out to the detection image In altimetric image, the information in the clamp of described information card is recognized.
Optionally, the corresponding bianry image of predeterminable area image in the detection image for obtaining release, including:
The detection image of release is obtained, according to default image detection algorithm, detects default in the detection image The band of position of reference by location image;
According to the band of position of the predeterminated position reference picture, and the predeterminated position reference picture for prestoring With the position relationship of the predeterminable area image, the band of position of the predeterminable area image is determined in the detection image;
Obtain the corresponding bianry image in the band of position of the predeterminable area image.
So, the band of position of predeterminable area image can be determined according to the band of position of predeterminated position reference picture, is entered And the corresponding bianry image in the band of position of predeterminable area image, the accuracy for obtaining bianry image can be improved.
Optionally, the corresponding bianry image of predeterminable area image in the detection image for obtaining release, including:
The detection image of release is obtained, according to default border detection algorithm, in the detection image, it is determined that described The border of release;
According to the border of described information card, the band of position of the predeterminable area image is determined in the detection image;
Obtain the corresponding bianry image in the band of position of the predeterminable area image.
So, the band of position of predeterminable area image can be determined in the image in the bounds of release, and then The corresponding bianry image in the band of position of predeterminable area image is obtained, the accuracy for obtaining bianry image can be improved.
Optionally, it is described to carry out closing operation of mathematical morphology treatment to the bianry image, including:
Morphology opening operation treatment is carried out to the bianry image, second processing image is obtained;
Closing operation of mathematical morphology treatment is carried out to the second processing image.
So, the noise that the treatment of morphology opening operation is filtered in bianry image can be first passed through, morphology is then carried out again At closed operation, the interference of noise can be effectively reduced, improve the degree of accuracy for the treatment of.
Optionally, the number of the pixel for determining to include meets the first connected domain of preset number condition, including:
It is determined that the first maximum connected domain of the number of the pixel for including.
So, a kind of implementation for determining the first connected domain high can be provided.
Optionally, the corresponding fitting a straight line of determination first connected domain, including:
By least square method, the corresponding fitting a straight line of first connected domain is determined.
So, a kind of implementation of the corresponding fitting a straight line of the connected domain high of determination first can be provided.
According to the second aspect of the embodiment of the present disclosure, there is provided a kind of device of the information of ID card, described device bag Include:
Acquisition module, for the corresponding bianry image of predeterminable area image in the detection image for obtaining release;
Processing module, for carrying out closing operation of mathematical morphology treatment to the bianry image, obtains comprising at least one connection The first treatment image in domain, the connected domain is the connected domain of correspondence foreground image;
Determining module, at least one connected domain, it is determined that the number of the pixel for including meets present count First connected domain of mesh condition, and determine the corresponding fitting a straight line of first connected domain;
Identification module, for the slope according to the fitting a straight line, rotation correction is carried out to the detection image, and in rotation In detection image after transferring to another school just, the information in the clamp of described information card is recognized.
Optionally, the acquisition module, including:
First acquisition submodule, the detection image for obtaining release, according to default image detection algorithm, described The band of position of predeterminated position reference picture is detected in detection image;
First determination sub-module, for the band of position according to the predeterminated position reference picture, and prestore The predeterminated position reference picture and the position relationship of the predeterminable area image, determine described default in the detection image The band of position of area image;
Second acquisition submodule, the corresponding bianry image in the band of position for obtaining the predeterminable area image.
Optionally, the acquisition module, including:
3rd acquisition submodule, the detection image for obtaining release, according to default border detection algorithm, described In detection image, the border of described information card is determined;
Second determination sub-module, for the border according to described information card, determines described default in the detection image The band of position of area image;
4th acquisition submodule, the corresponding bianry image in the band of position for obtaining the predeterminable area image.
Optionally, the processing module, including:
First treatment submodule, for carrying out morphology opening operation treatment to the bianry image, obtains second processing figure Picture;
Second processing submodule, for carrying out closing operation of mathematical morphology treatment to the second processing image.
Optionally, the determining module, is used for:
It is determined that the first maximum connected domain of the number of the pixel for including.
Optionally, the determining module, is used for:
By least square method, the corresponding fitting a straight line of first connected domain is determined.
According to the third aspect of the embodiment of the present disclosure, there is provided a kind of device of the information of ID card, described device bag Include:
Processor;
Memory for storing processor-executable instruction;
Wherein, the processor is configured as:
Obtain the corresponding bianry image of predeterminable area image in the detection image of release;
Closing operation of mathematical morphology treatment is carried out to the bianry image, the first treatment figure comprising at least one connected domain is obtained Picture, the connected domain is the connected domain of correspondence foreground image;
In at least one connected domain, it is determined that the number of the pixel for including meets the first company of preset number condition Logical domain, and determine the corresponding fitting a straight line of first connected domain;
According to the slope of the fitting a straight line, rotation correction, and the inspection after rotation correction are carried out to the detection image In altimetric image, the information in the clamp of described information card is recognized.
The technical scheme provided by this disclosed embodiment can include the following benefits:
In the embodiment of the present disclosure, the corresponding bianry image of predeterminable area image in the detection image of release is obtained, it is right Bianry image carries out closing operation of mathematical morphology treatment, the first treatment image comprising at least one connected domain is obtained, at least one In connected domain, it is determined that the number of the pixel for including meets the first connected domain of preset number condition, and the first connected domain is determined Corresponding fitting a straight line, according to the slope of fitting a straight line, rotation correction, and the detection after rotation correction is carried out to detection image In image, the information in the clamp of ID card so, can carry out rotation correction, so as in water to detection image automatically Square detected to the enterprising line character of vertical direction, so as to avoid placing crooked because of release, and lead to not extract information The situation of the character information in card.
It should be appreciated that the general description of the above and detailed description hereinafter are only exemplary and explanatory, not The disclosure can be limited.
Brief description of the drawings
Accompanying drawing herein is merged in specification and constitutes the part of this specification, shows the implementation for meeting the disclosure Example, and it is used to explain the principle of the disclosure together with specification.In the accompanying drawings:
Fig. 1 is a kind of flow chart of the method for the information of the ID card according to an exemplary embodiment;
Fig. 2 is a kind of schematic diagram of the detection image of the release according to an exemplary embodiment;
Fig. 3 is a kind of schematic diagram of the bianry image according to an exemplary embodiment;
Fig. 4 is the schematic diagram of the image after a kind of opening operation treatment according to an exemplary embodiment;
Fig. 5 is the schematic diagram of the image after a kind of closed operation treatment according to an exemplary embodiment;
Fig. 6 is the schematic diagram of the fitting a straight line of the first connected domain according to an exemplary embodiment;
Fig. 7 is the schematic diagram of the detection image after the rotation correction according to an exemplary embodiment;
Fig. 8 is a kind of schematic diagram of the device of the information of the ID card according to an exemplary embodiment;
Fig. 9 is a kind of schematic diagram of the device of the information of the ID card according to an exemplary embodiment;
Figure 10 is a kind of schematic diagram of the device of the information of the ID card according to an exemplary embodiment;
Figure 11 is a kind of schematic diagram of the device of the information of the ID card according to an exemplary embodiment;
Figure 12 is a kind of structural representation of the server according to an exemplary embodiment.
By above-mentioned accompanying drawing, it has been shown that the clear and definite embodiment of the disclosure, will hereinafter be described in more detail.These accompanying drawings It is not intended to limit the scope that the disclosure is conceived by any mode with word description, but is by reference to specific embodiment Those skilled in the art illustrate the concept of the disclosure.
Specific embodiment
Here exemplary embodiment will be illustrated in detail, its example is illustrated in the accompanying drawings.Following description is related to During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represent same or analogous key element.Following exemplary embodiment Described in implementation method do not represent all implementation methods consistent with the disclosure.Conversely, they be only with it is such as appended The example of the consistent apparatus and method of some aspects described in detail in claims, the disclosure.
Disclosure another exemplary embodiment provides a kind of method of the information of ID card, and the method can be used for In server, wherein, server can be the background server of certain application program.The server can include processor and storage Device.Processor, can be CPU (Central Processing Unit, CPU) etc., can be used for acquisition information The corresponding bianry image of predeterminable area image in the detection image of card, closing operation of mathematical morphology treatment is carried out to bianry image, is obtained To the first treatment image comprising at least one connected domain, then can be at least one connected domain, it is determined that the pixel for including The number of point meets the first connected domain of preset number condition, it is possible to determine the corresponding fitting a straight line of the first connected domain, and then According to the slope of fitting a straight line, rotation correction is carried out to detection image;Memory, can be RAM (Random Access Memory, random access memory), Flash (flash memory) etc., can be used for storing needed for data, the processing procedure for receiving Data generated in data, processing procedure etc., such as detection image, bianry image and closing operation of mathematical morphology Processing Algorithm.Separately Outward, the server can also be including transceiver, communication interface and part etc. power supply.
Below in conjunction with implementation method, the handling process shown in Fig. 1 is described in detail, content can be as follows:
In a step 101, the corresponding bianry image of predeterminable area image in the detection image of release is obtained.
Wherein, release can be the card that the information such as numeral, image are printed in clamp, such as bank card and identity card.
In force, user is frequently necessary to by the information on terminal recognition release, such as carry out real-name authentication, or Person carries out bank card checking etc..By taking real-name authentication as an example, when user needs to carry out real-name authentication, user can click in terminal The corresponding option of real-name authentication, terminal can then receive to should option click commands, then can open input equipment (such as Camera), and detection zone is shown in screen, user can be with the position of mobile terminal, so that the image whole position of release In in the detection zone of display.Terminal can get the detection image of release, the detection image that then will can be got Server is sent to, the information in the clamp of the release is recognized so as to server.
After server receives the detection image of the release of terminal transmission, then can be obtained in the detection image Predeterminable area image, as shown in Figure 2.Server can carry out binary conversion treatment to predeterminable area image, obtain pre-set image area The corresponding bianry image in domain.Wherein, the two values of bianry image are respectively numerical value high and low numerical value, and the pixel of numerical value high can Think the pixel of foreground image, the pixel of low numerical value can be the pixel of background image.Two values are in bianry image The different color of middle correspondence, is 1 with numerical value high in the present embodiment, low numerical value be 0 as a example by illustrate, other situations are therewith It is similar, wherein, 1 in bianry image corresponding color can be white, 0 in bianry image corresponding color can be black, such as Shown in Fig. 3.
The species of Binarization methods has a lot, for example, server can be using adaptive two-tone images algorithm to predeterminable area Image carries out binary conversion treatment.For any pixel point in predeterminable area image, server can determine be with the pixel The rectangular area (such as 21*21) of the pre-set dimension at center, determines the average value of the gray value of pixel in the rectangular area, makees It is gray threshold, if the gray value of the pixel is more than the gray threshold, the gray value of the pixel can be defined as Numerical value high, if the gray value of the pixel is less than the gray threshold, can be defined as low number by the gray value of the pixel Value.So, above-mentioned treatment is carried out for each pixel in predeterminable area image, then can determines the gray scale of each pixel It is numerical value high or low numerical value to be worth, so as to obtain the corresponding bianry image of predeterminable area image.Or, server can also be to default Area image carries out gradient detection process, obtains the corresponding Grad of each pixel, and then can be by the ladder of each pixel Angle value, is compared with default Grads threshold respectively, is numerical value high or low numerical value with the Grad for judging the pixel, obtains The corresponding bianry image of predeterminable area image, specific processing procedure is similar with gray value, repeats no more.
Server determines that the mode of the band of position of predeterminable area image can be diversified, present embodiments provides Two kinds of feasible processing modes.
Mode one, the detection image for obtaining release, according to default image detection algorithm, detect pre- in detection image If the band of position of reference by location image;According to the band of position of predeterminated position reference picture, and the default position for prestoring The position relationship of reference picture and predeterminable area image is put, the band of position of predeterminable area image is determined in detection image;Obtain Take the corresponding bianry image in the band of position of predeterminable area image.
In force, predeterminated position reference picture can be the band of position for determining the other information in release Image, predeterminated position reference picture be typically in release can be easily and fast the image for detecting.For example, release It is identity card, then predeterminated position reference picture can be facial image and national emblem image etc..Predeterminable area image can be information The image of any information in card in addition to predeterminated position reference picture, predeterminable area image can be set by technical staff Put.For example, predeterminable area image can be the image of ID card No., or address image etc., or identity card has The image of effect phase.
In due to the release of same type, the location of each information is fixed, so can be advance in server In all types of releases of storage, the band of position of predeterminated position reference picture and the position relationship of predeterminable area image.For example, In identity card, ID card No. is located at the lower section of facial image, and address is located at the left side in the lower half region of facial image, date of birth Phase is located at the left side of the upper half area of facial image, as shown in Figure 2.After server gets the detection image of release, can be with According to default image detection algorithm (such as face recognition algorithms or faster rcnn image detection algorithms), in detection image The band of position of middle detection predeterminated position reference picture, then can determine that predeterminated position is referred to according to the type of the release The position relationship of image and predeterminable area image, and then according to the band of position of the predeterminated position reference picture, and default position The position relationship of reference picture and predeterminable area image is put, the band of position of predeterminable area image is determined in detection image.Example Such as, after facial image is detected, it may be determined that the rectangular region of the lower section of facial image, using the region as predeterminable area The band of position of image.
Or, server can also determine the band of position of predeterminated position reference picture, then obtain the band of position Coordinate, the band of position is usually rectangular region, and its coordinate can be expressed as (x0,y0,w0,h0,).Wherein, (x0,y0) it is rectangular The coordinate on a certain summit in shape region, the summit can be the summit in the upper left corner, w0Can be the width of rectangular region, h0Can Think the height of rectangular region.Accordingly, the coordinate of the band of position of predeterminable area image, can be with predeterminated position with reference to figure The coordinate representation of the band of position of picture, for example, the coordinate of the band of position of predeterminable area image is (xid,yid,wid,hid),xid =x0-2.2*w0, yid=y0+1.25*h0, wid=3.8*w0, hid=h0.So, server can be according to predeterminated position with reference to figure The coordinate of the band of position of picture, determines the coordinate of the band of position of predeterminable area image, so as in detection image, it is determined that default The band of position of area image.
Server determines that behind the band of position of determination predeterminable area image, predeterminable area figure can be obtained in detection image The corresponding bianry image in the band of position of picture, to carry out subsequent treatment, as shown in Figure 3.
Mode two, the detection image for obtaining release, according to default border detection algorithm, in detection image, it is determined that The border of release;According to the border of release, the band of position of predeterminable area image is determined in detection image;Obtain default The corresponding bianry image in the band of position of area image.
In force, predeterminable area image can be the image of any information in release, and predeterminable area image can be with It is configured by technical staff.For example, release is identity card front, then predeterminable area image can be the figure of ID card No. Picture, release is the identity card back side, then predeterminable area image can be the image of the term of validity.Server gets the inspection of release After altimetric image, border detection algorithm of the prior art, the border of detection information card, Ran Houke in detection image can be used With the border according to the release for detecting, the image in bounds for determining release in detection image.Due to identical In the release of type, the location of each information is fixed, so can prestore all types of information in server In card, the band of position of the predeterminated position reference picture in release, and then can be in the image in the bounds of release In, the image of the band of position content is obtained, so as to the corresponding bianry image in the band of position for obtaining predeterminable area image.
For example, in bank card, bank's card number is located in the region of the lower middle of bank card.Server gets release Detection image after, the border of bank card according to default border detection algorithm, can be detected in detection image, then can be with Determine the image in bounds, and then the rectangular region of lower middle in the images, can be determined, wrapped in the region The image for containing, the as image of bank's card number.
Server determines that behind the band of position of determination predeterminable area image, predeterminable area figure can be obtained in detection image The corresponding bianry image in the band of position of picture, to carry out subsequent treatment.
In a step 102, closing operation of mathematical morphology treatment is carried out to bianry image, obtains comprising at least one connected domain One treatment image.
Wherein, the connected domain can be the connected domain of correspondence foreground image.
In force, Morphological scale-space algorithm can be prestored in server, Morphological scale-space algorithm can include corruption Erosion treatment and expansion process.Wherein, corrosion treatment can be used for eliminating less image, such as boundary point is eliminated, so that side What boundary internally shrank.In corrosion treatment, for any pixel point, it may be determined that pre-set dimension centered on the pixel The pixel region of pixel region, such as 3x3, then by the pixel value of the pixel, respectively with the pixel region in other each The pixel value of pixel is carried out and computing, if being as a result 1, the pixel value of the pixel is being set into 1, otherwise, by this The pixel value of pixel is set to 0.Expansion process can be used for the rest filled up between image, can make border to outside Expansion.In expansion process device, if with computing after the result determined be 0, the pixel value of the pixel is set into 0, Otherwise, the pixel value of the pixel is set to 1.
In Morphological scale-space algorithm, first carry out expansion process, after carry out the computing of corrosion treatment and be properly termed as closed operation, close Computing can be used for minuscule hole in filler body, connection adjacent object, and smooth its border.Server gets preset areas After the corresponding bianry image of area image, closing operation of mathematical morphology treatment can be carried out to the bianry image, so that will wherein position ratio The image that the pixel of the numerical value high being closer to is constituted links together, and connected domain is obtained, so as to obtain comprising at least one First treatment image of connected domain.In addition, server can also set the number of times of expansion process and corrosion treatment, for example, service Device can first carry out 6 expansion process, 6 corrosion treatments then be carried out again, to realize optimal treatment effect, as shown in Figure 5.
Optionally, server can first carry out morphology opening operation treatment to bianry image, eliminate the noise in image, so Carry out closing operation of mathematical morphology treatment again afterwards, corresponding processing procedure can be as follows:Bianry image is carried out at morphology opening operation Reason, obtains second processing image;Closing operation of mathematical morphology treatment is carried out to second processing image.
In force, in Morphological scale-space algorithm, corrosion treatment is first carried out, the computing of rear expansion process can be described as out fortune Calculate, opening operation can be eliminated in bianry image, comprising adjacent numerical value high pixel the less image of number, so as to disappear Except the noise in bianry image, as shown in Figure 4.After server gets the corresponding bianry image of predeterminable area image, can be right Bianry image carries out morphology opening operation treatment, the second processing image after the noise that is eliminated, then to second processing image Closing operation of mathematical morphology treatment is carried out, the first treatment image is obtained, as shown in Figure 5.
In step 103, at least one connected domain, it is determined that the number of the pixel for including meets preset number condition The first connected domain, and determine the corresponding fitting a straight line of the first connected domain.
In force, server can respectively count the number of the pixel that each connected domain in the first treatment image is included Mesh, then can determine that the number of the pixel for including meets the first connected domain of preset number condition, the number of the first connected domain It can also be multiple that mesh can be one.For example, server can determine that the number of the pixel for including is more than certain preset number The connected domain of threshold value, or, it may be determined that the maximum preset number connected domain of the number of the pixel for including.Server determines After first connected domain, fitting algorithm of the prior art can be based on, the corresponding fitting a straight line of the first connected domain be determined, to enter Row subsequent treatment.When the number of the first connected domain is multiple, server can respectively determine each first connected domain Corresponding fitting a straight line.Wherein, fitting algorithm can be least square method, accordingly, server can by least square method, Determine the corresponding fitting a straight line of the first connected domain.
Optionally, server can determine the first maximum connected domain of the number of the pixel for including.
In force, after server determines the number of the pixel that each connected domain is included, can in these connected domains, It is determined that the maximum connected domain (i.e. the first connected domain) of the number of the pixel for including, to reduce the treating capacity of server.
At step 104, according to the slope of fitting a straight line, rotation correction is carried out to detection image, and after rotation correction Detection image in, the information in the clamp of ID card.
In force, after server determines the corresponding fitting a straight line of the first connected domain, the oblique of the fitting a straight line can be calculated Rate, and then determine the fitting a straight line and horizontal direction or the angle of vertical direction, as shown in Figure 6.Server can be according to the folder Angle, determines the anglec of rotation of detection image, according to the anglec of rotation, rotation correction is carried out to detection image, then can be in rotation In detection image after transferring to another school just, the information in the clamp of ID card, as shown in Figure 7.For example, fitting a straight line and level side To angle be 30 °, then the anglec of rotation can be determined to turn clockwise 30 °.Then detection image is turned clockwise 30 °. In addition, for when the first connected domain is multiple, accordingly, server can determine the slope of multiple fitting a straight lines, clothes Business device can determine the average value of multiple slopes, obtain G-bar, then according to G-bar, detection image be rotated Correction.
In the embodiment of the present disclosure, the corresponding bianry image of predeterminable area image in the detection image of release is obtained, it is right Bianry image carries out closing operation of mathematical morphology treatment, the first treatment image comprising at least one connected domain is obtained, at least one In connected domain, it is determined that the number of the pixel for including meets the first connected domain of preset number condition, and the first connected domain is determined Corresponding fitting a straight line, according to the slope of fitting a straight line, rotation correction, and the detection after rotation correction is carried out to detection image In image, the information in the clamp of ID card so, can carry out rotation correction, so as in water to detection image automatically Square detected to the enterprising line character of vertical direction, so as to avoid placing crooked because of release, and lead to not extract information The situation of the character information in card.
Disclosure further example embodiment is provided and additionally provides a kind of device of the information of ID card, such as Fig. 8 Shown, the device includes:Acquisition module 810, processing module 820, determining module 830 and identification module 840.
Acquisition module 810, for the corresponding bianry image of predeterminable area image in the detection image for obtaining release;
Processing module 820, for carrying out closing operation of mathematical morphology treatment to the bianry image, obtains comprising at least one company The first treatment image in logical domain, the connected domain is the connected domain of correspondence foreground image;
Determining module 830, at least one connected domain, it is determined that the number of the pixel for including meets default First connected domain of number condition, and determine the corresponding fitting a straight line of first connected domain;
Identification module 840, for the slope according to the fitting a straight line, rotation correction is carried out to the detection image, and In detection image after rotation correction, the information in the clamp of described information card is recognized.
Optionally, as shown in figure 9, the acquisition module 810, including:
First acquisition submodule 811, the detection image for obtaining release, according to default image detection algorithm, The band of position of predeterminated position reference picture is detected in the detection image;
First determination sub-module 812, for the band of position according to the predeterminated position reference picture, and prestores The predeterminated position reference picture and the position relationship of the predeterminable area image, determine in the detection image described pre- If the band of position of area image;
Second acquisition submodule 813, the corresponding bianry image in the band of position for obtaining the predeterminable area image.
Optionally, as shown in Figure 10, the acquisition module 810, including:
3rd acquisition submodule 814, the detection image for obtaining release, according to default border detection algorithm, In the detection image, the border of described information card is determined;
Second determination sub-module 815, for the border according to described information card, determines described pre- in the detection image If the band of position of area image;
4th acquisition submodule 816, the corresponding bianry image in the band of position for obtaining the predeterminable area image.
Optionally, as shown in figure 11, the processing module 820, including:
First treatment submodule 821, for carrying out morphology opening operation treatment to the bianry image, obtains second processing Image;
Second processing submodule 822, for carrying out closing operation of mathematical morphology treatment to the second processing image.
Optionally, the determining module 830, is used for:
It is determined that the first maximum connected domain of the number of the pixel for including.
Optionally, the determining module 830, is used for:
By least square method, the corresponding fitting a straight line of first connected domain is determined.
On the device in above-described embodiment, wherein modules perform the concrete mode of operation in relevant the method Embodiment in be described in detail, explanation will be not set forth in detail herein.
In the embodiment of the present disclosure, the corresponding bianry image of predeterminable area image in the detection image of release is obtained, it is right Bianry image carries out closing operation of mathematical morphology treatment, the first treatment image comprising at least one connected domain is obtained, at least one In connected domain, it is determined that the number of the pixel for including meets the first connected domain of preset number condition, and the first connected domain is determined Corresponding fitting a straight line, according to the slope of fitting a straight line, rotation correction, and the detection after rotation correction is carried out to detection image In image, the information in the clamp of ID card so, can carry out rotation correction, so as in water to detection image automatically Square detected to the enterprising line character of vertical direction, so as to avoid placing crooked because of release, and lead to not extract information The situation of the character information in card.
It should be noted that:Information of the device of the information of the ID card that above-described embodiment is provided in ID card When, only carried out with the division of above-mentioned each functional module for example, in practical application, as needed can divide above-mentioned functions With being completed by different functional module, will the internal structure of equipment be divided into different functional modules, to complete above description All or part of function.In addition, the device of the information of the ID card that above-described embodiment is provided and ID card The embodiment of the method for information belongs to same design, and it implements process and refers to embodiment of the method, repeats no more here.
The another exemplary embodiment of the disclosure provides a kind of block diagram of the device 1900 of the information of ID card.Example Such as, device 1900 may be provided in a server.Reference picture 12, device 1900 includes processing assembly 1922, its further bag One or more processors, and the memory resource as representated by memory 1932 are included, can be by processing component for storing The instruction of 1922 execution, such as application program.In memory 1932 store application program can include one or one with On each correspond to the module of one group of instruction.Additionally, processing assembly 1922 is configured as execute instruction, it is above-mentioned right to perform The method that equipment is controlled.
Device 1900 can also include that a power supply module 1926 is configured as the power management of performs device 1900, one Wired or wireless network interface 1950 is configured as device 1900 being connected to network, and input and output (I/O) interface 1958.Device 1900 can operate the operating system in memory 1932, such as Windows ServerTM, Mac based on storage OS XTM, UnixTM, LinuxTM, FreeBSDTM or similar.
Device 1900 can include memory, and one or more than one program, one of them or one Procedure above is stored in memory, and is configured to one or one by one or more than one computing device Procedure above includes the instruction for carrying out following operation:
Obtain the corresponding bianry image of predeterminable area image in the detection image of release;
Closing operation of mathematical morphology treatment is carried out to the bianry image, the first treatment figure comprising at least one connected domain is obtained Picture, the connected domain is the connected domain of correspondence foreground image;
In at least one connected domain, it is determined that the number of the pixel for including meets the first company of preset number condition Logical domain, and determine the corresponding fitting a straight line of first connected domain;
According to the slope of the fitting a straight line, rotation correction, and the inspection after rotation correction are carried out to the detection image In altimetric image, the information in the clamp of described information card is recognized.
Optionally, the corresponding bianry image of predeterminable area image in the detection image for obtaining release, including:
The detection image of release is obtained, according to default image detection algorithm, detects default in the detection image The band of position of reference by location image;
According to the band of position of the predeterminated position reference picture, and the predeterminated position reference picture for prestoring With the position relationship of the predeterminable area image, the band of position of the predeterminable area image is determined in the detection image;
Obtain the corresponding bianry image in the band of position of the predeterminable area image.
Optionally, the corresponding bianry image of predeterminable area image in the detection image for obtaining release, including:
The detection image of release is obtained, according to default border detection algorithm, in the detection image, it is determined that described The border of release;
According to the border of described information card, the band of position of the predeterminable area image is determined in the detection image;
Obtain the corresponding bianry image in the band of position of the predeterminable area image.
Optionally, it is described to carry out closing operation of mathematical morphology treatment to the bianry image, including:
Morphology opening operation treatment is carried out to the bianry image, second processing image is obtained;
Closing operation of mathematical morphology treatment is carried out to the second processing image.
Optionally, the number of the pixel for determining to include meets the first connected domain of preset number condition, including:
It is determined that the first maximum connected domain of the number of the pixel for including.
Optionally, the corresponding fitting a straight line of determination first connected domain, including:
By least square method, the corresponding fitting a straight line of first connected domain is determined.
In the embodiment of the present disclosure, the corresponding bianry image of predeterminable area image in the detection image of release is obtained, it is right Bianry image carries out closing operation of mathematical morphology treatment, the first treatment image comprising at least one connected domain is obtained, at least one In connected domain, it is determined that the number of the pixel for including meets the first connected domain of preset number condition, and the first connected domain is determined Corresponding fitting a straight line, according to the slope of fitting a straight line, rotation correction, and the detection after rotation correction is carried out to detection image In image, the information in the clamp of ID card so, can carry out rotation correction, so as in water to detection image automatically Square detected to the enterprising line character of vertical direction, so as to avoid placing crooked because of release, and lead to not extract information The situation of the character information in card.
Those skilled in the art will readily occur to its of the disclosure after considering specification and putting into practice disclosure disclosed herein Its embodiment.The application is intended to any modification, purposes or the adaptations of the disclosure, these modifications, purposes or Person's adaptations follow the general principle of the disclosure and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.Description and embodiments are considered only as exemplary, and the true scope of the disclosure and spirit are by following Claim is pointed out.
It should be appreciated that the disclosure is not limited to the precision architecture for being described above and being shown in the drawings, and And can without departing from the scope carry out various modifications and changes.The scope of the present disclosure is only limited by appended claim.

Claims (13)

1. a kind of method of the information of ID card, it is characterised in that methods described includes:
Obtain the corresponding bianry image of predeterminable area image in the detection image of release;
Closing operation of mathematical morphology treatment is carried out to the bianry image, the first treatment image comprising at least one connected domain is obtained, The connected domain is the connected domain of correspondence foreground image;
In at least one connected domain, it is determined that the number of the pixel for including meets the first connection of preset number condition Domain, and determine the corresponding fitting a straight line of first connected domain;
According to the slope of the fitting a straight line, rotation correction, and the detection figure after rotation correction are carried out to the detection image As in, the information in the clamp of described information card is recognized.
2. method according to claim 1, it is characterised in that the predeterminable area in the detection image of the acquisition release The corresponding bianry image of image, including:
The detection image of release is obtained, according to default image detection algorithm, predeterminated position is detected in the detection image The band of position of reference picture;
According to the band of position of the predeterminated position reference picture, and the predeterminated position reference picture that prestores and institute The position relationship of predeterminable area image is stated, the band of position of the predeterminable area image is determined in the detection image;
Obtain the corresponding bianry image in the band of position of the predeterminable area image.
3. method according to claim 1, it is characterised in that the predeterminable area in the detection image of the acquisition release The corresponding bianry image of image, including:
The detection image of release is obtained, according to default border detection algorithm, in the detection image, described information is determined The border of card;
According to the border of described information card, the band of position of the predeterminable area image is determined in the detection image;
Obtain the corresponding bianry image in the band of position of the predeterminable area image.
4. method according to claim 1, it is characterised in that described to be carried out at closing operation of mathematical morphology to the bianry image Reason, including:
Morphology opening operation treatment is carried out to the bianry image, second processing image is obtained;
Closing operation of mathematical morphology treatment is carried out to the second processing image.
5. method according to claim 1, it is characterised in that the number of the pixel that the determination is included meets present count First connected domain of mesh condition, including:
It is determined that the first maximum connected domain of the number of the pixel for including.
6. method according to claim 1, it is characterised in that the corresponding fitting of determination first connected domain is straight Line, including:
By least square method, the corresponding fitting a straight line of first connected domain is determined.
7. a kind of device of the information of ID card, it is characterised in that described device includes:
Acquisition module, for the corresponding bianry image of predeterminable area image in the detection image for obtaining release;
Processing module, for carrying out closing operation of mathematical morphology treatment to the bianry image, obtains comprising at least one connected domain First treatment image, the connected domain is the connected domain of correspondence foreground image;
Determining module, at least one connected domain, it is determined that the number of the pixel for including meets preset number bar First connected domain of part, and determine the corresponding fitting a straight line of first connected domain;
Identification module, for the slope according to the fitting a straight line, rotation correction is carried out to the detection image, and in rotation school In detection image after just, the information in the clamp of described information card is recognized.
8. device according to claim 7, it is characterised in that the acquisition module, including:
First acquisition submodule, the detection image for obtaining release, according to default image detection algorithm, in the detection The band of position of predeterminated position reference picture is detected in image;
First determination sub-module, for the band of position according to the predeterminated position reference picture, and prestore it is described Predeterminated position reference picture and the position relationship of the predeterminable area image, determine the predeterminable area in the detection image The band of position of image;
Second acquisition submodule, the corresponding bianry image in the band of position for obtaining the predeterminable area image.
9. device according to claim 7, it is characterised in that the acquisition module, including:
3rd acquisition submodule, the detection image for obtaining release, according to default border detection algorithm, in the detection In image, the border of described information card is determined;
Second determination sub-module, for the border according to described information card, determines the predeterminable area in the detection image The band of position of image;
4th acquisition submodule, the corresponding bianry image in the band of position for obtaining the predeterminable area image.
10. device according to claim 7, it is characterised in that the processing module, including:
First treatment submodule, for carrying out morphology opening operation treatment to the bianry image, obtains second processing image;
Second processing submodule, for carrying out closing operation of mathematical morphology treatment to the second processing image.
11. devices according to claim 7, it is characterised in that the determining module, are used for:
It is determined that the first maximum connected domain of the number of the pixel for including.
12. devices according to claim 7, it is characterised in that the determining module, are used for:
By least square method, the corresponding fitting a straight line of first connected domain is determined.
A kind of 13. devices of the information of ID card, it is characterised in that including:
Processor;
Memory for storing processor-executable instruction;
Wherein, the processor is configured as:
Obtain the corresponding bianry image of predeterminable area image in the detection image of release;
Closing operation of mathematical morphology treatment is carried out to the bianry image, the first treatment image comprising at least one connected domain is obtained, The connected domain is the connected domain of correspondence foreground image;
In at least one connected domain, it is determined that the number of the pixel for including meets the first connection of preset number condition Domain, and determine the corresponding fitting a straight line of first connected domain;
According to the slope of the fitting a straight line, rotation correction, and the detection figure after rotation correction are carried out to the detection image As in, the information in the clamp of described information card is recognized.
CN201611171572.1A 2016-12-17 2016-12-17 A kind of method and apparatus of the information of ID card Pending CN106778744A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611171572.1A CN106778744A (en) 2016-12-17 2016-12-17 A kind of method and apparatus of the information of ID card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611171572.1A CN106778744A (en) 2016-12-17 2016-12-17 A kind of method and apparatus of the information of ID card

Publications (1)

Publication Number Publication Date
CN106778744A true CN106778744A (en) 2017-05-31

Family

ID=58892138

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611171572.1A Pending CN106778744A (en) 2016-12-17 2016-12-17 A kind of method and apparatus of the information of ID card

Country Status (1)

Country Link
CN (1) CN106778744A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107527055A (en) * 2017-08-04 2017-12-29 佛山市国方商标服务有限公司 Image divides card processing method, device and image search method, device and system
CN114322849A (en) * 2020-09-29 2022-04-12 昆山午力电子有限公司 Article characteristic positioning system based on image recognition

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105528602A (en) * 2015-10-30 2016-04-27 小米科技有限责任公司 Region identification method and device
CN105528600A (en) * 2015-10-30 2016-04-27 小米科技有限责任公司 Region identification method and device
CN105868759A (en) * 2015-01-22 2016-08-17 阿里巴巴集团控股有限公司 Method and apparatus for segmenting image characters
CN106056117A (en) * 2016-06-20 2016-10-26 北京小米移动软件有限公司 Image processing method and device for rectangular object

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105868759A (en) * 2015-01-22 2016-08-17 阿里巴巴集团控股有限公司 Method and apparatus for segmenting image characters
CN105528602A (en) * 2015-10-30 2016-04-27 小米科技有限责任公司 Region identification method and device
CN105528600A (en) * 2015-10-30 2016-04-27 小米科技有限责任公司 Region identification method and device
CN106056117A (en) * 2016-06-20 2016-10-26 北京小米移动软件有限公司 Image processing method and device for rectangular object

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨帆: "《数字图像处理与分析(第3版)》", 31 May 2015, 北京航空航天大学出版社 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107527055A (en) * 2017-08-04 2017-12-29 佛山市国方商标服务有限公司 Image divides card processing method, device and image search method, device and system
CN114322849A (en) * 2020-09-29 2022-04-12 昆山午力电子有限公司 Article characteristic positioning system based on image recognition

Similar Documents

Publication Publication Date Title
US20200184059A1 (en) Face unlocking method and apparatus, and storage medium
US20200143162A1 (en) Document verification and identity verification method and device
TWI737040B (en) Fingerprint recognition method, chip and electronic device
CN105893920B (en) Face living body detection method and device
EP3736766A1 (en) Method and device for blurring image background, storage medium, and electronic apparatus
KR20210137103A (en) Optimization of target-related image detection based on color space conversion technology
CN106991423A (en) Whether the method and device of watermark is included in identification specification picture
WO2020082731A1 (en) Electronic device, credential recognition method and storage medium
CN105450411A (en) Method, device and system for utilizing card characteristics to perform identity verification
US20210166015A1 (en) Certificate image extraction method and terminal device
KR20200118842A (en) Identity authentication method and device, electronic device and storage medium
CN111626163A (en) Human face living body detection method and device and computer equipment
US20230091865A1 (en) Face image verification method and apparatus, electronic device, and storage medium
CN109902611A (en) Detection method, device and the terminal device of target certificate
CN106778744A (en) A kind of method and apparatus of the information of ID card
CN111428740A (en) Detection method and device for network-shot photo, computer equipment and storage medium
WO2021046773A1 (en) Facial anti-counterfeiting detection method and apparatus, chip, electronic device and computer-readable medium
EP2863337A2 (en) Methods and systems for detecting biometric characteristics in an image
WO2022199395A1 (en) Facial liveness detection method, terminal device and computer-readable storage medium
US11620657B2 (en) System, method, and computer program product for authenticating identification documents
CN106599889A (en) Method and apparatus for recognizing characters
CN112532884A (en) Identification method and device and electronic equipment
CN112581344A (en) Image processing method and device, computer equipment and storage medium
KR101757682B1 (en) Outside diversion preventing method of security image and system therof
CN111538975B (en) Image processing method and device

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20170531

RJ01 Rejection of invention patent application after publication