CN105117680B - 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
CN105117680B
CN105117680B CN201510221862.1A CN201510221862A CN105117680B CN 105117680 B CN105117680 B CN 105117680B CN 201510221862 A CN201510221862 A CN 201510221862A CN 105117680 B CN105117680 B CN 105117680B
Authority
CN
China
Prior art keywords
pixel
gradient
line segment
image
high gradient
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.)
Active
Application number
CN201510221862.1A
Other languages
Chinese (zh)
Other versions
CN105117680A (en
Inventor
龙飞
张涛
陈志军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiaomi Inc
Original Assignee
Xiaomi Inc
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 Xiaomi Inc filed Critical Xiaomi Inc
Priority to CN201510221862.1A priority Critical patent/CN105117680B/en
Publication of CN105117680A publication Critical patent/CN105117680A/en
Application granted granted Critical
Publication of CN105117680B publication Critical patent/CN105117680B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (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.The described method includes: obtaining the corresponding gradient bianry image of detection image of release, the two values of the gradient bianry image respectively correspond high gradient and low gradient;In each line segment connected into the gradient bianry image by the pixel of two high gradients, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition;According to the line segment of selection, in the detection image, the boundary of the release is determined;According to the boundary of the release, in the detection image, the information in the clamp of the release is identified.Using the disclosure, the efficiency of the information of ID card can be improved.

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 It sets.
Background technique
With the development of mobile terminal technology, mobile terminal using more and more extensive, function is also stronger and stronger, mobile Terminal, can be with the information on ID card other than it can carry out mobile communication.Wherein, release is printed in clamp The card of the information such as number, image, such as bank card and identity card.By taking release is bank card as an example, user is being paid When, mobile terminal can identify the bank's card number printed on bank card, to make the user do not need input bank's card number, can use The corresponding account of bank's card number is paid.
For mobile terminal in the information on ID card, meeting first acquisition includes the detection image of the release, then The detection image is analyzed, therefrom extracts information related with the content printed in clamp, and then identify the release Information.
In implementing the present disclosure, inventor discovery the prior art has at least the following problems:
Mobile terminal needs to analyze the entire detection image comprising release in the information of ID card, Then the information of the release is identified, in this way, the efficiency that will lead to the information of ID card is lower.
Summary of the invention
In order to overcome the problems, such as present in the relevant technologies, present disclose provides a kind of method of the information of ID card and Device.The technical solution is as follows:
According to the first aspect of the embodiments of the present disclosure, a kind of method of the information of ID card, the method packet are provided It includes:
Obtain the corresponding gradient bianry image of detection image of release, the two values difference of the gradient bianry image Corresponding high gradient and low gradient;
In each line segment connected into the gradient bianry image by the pixel of two high gradients, choose comprising high ladder The number of the pixel of degree meets the line segment of preset number condition;
According to the line segment of selection, in the detection image, the boundary of the release is determined;
According to the boundary of the release, in the detection image, the information in the clamp of the release is identified.
Optionally, it in each line segment connected into the bianry image by the pixel of two high gradients, chooses The number of pixel comprising high gradient meets the line segment of preset number condition, comprising:
For either described release to boundary, using the either direction as first direction, in the gradient two It is worth in image, obtains the image in corresponding first predetermined detection area in boundary of the first direction;
If first direction be up or down, one in the left-half of the image in first predetermined detection area In each line segment that the pixel of a high gradient in the pixel and right half part of a high gradient connects into, choose comprising high ladder The number of the pixel of degree meets the line segment of preset number condition;
If first direction be left or right, one in the top half of the image in first predetermined detection area In each line segment that the pixel of a high gradient in the pixel and lower half portion of a high gradient connects into, choose comprising high ladder The number of the pixel of degree meets the line segment of preset number condition.
Optionally, if first direction is up or down, the left side of the image in first predetermined detection area In the pixel for the high gradient divided, the first kind pixel for the pixel that left side neighbor pixel is low gradient is chosen, described In the pixel of the high gradient of the right half part of image in first predetermined detection area, choosing right side neighbor pixel is low ladder Second class pixel of the pixel of degree, in the pixel and the second class pixel in the first kind pixel Each line segment for connecting into of a pixel in, the number for choosing the pixel comprising high gradient meets the line of preset number condition Section;
If first direction is left or right, the height ladder of the top half of the image in first predetermined detection area In the pixel of degree, the third class pixel for the pixel that upside neighbor pixel is low gradient is chosen, it is default described first In the pixel of the high gradient of the lower half portion of image in detection zone, the pixel that downside neighbor pixel is low gradient is chosen 4th class pixel of point, the picture in a pixel and the 4th class pixel in the third class pixel In each line segment that vegetarian refreshments connects into, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition.
Optionally, if first direction is up or down, the left side in the image in first predetermined detection area In each line segment that the pixel of a high gradient in the pixel and right half part of a high gradient in point connects into, choose The number of pixel comprising high gradient meets preset number condition, and is less than predetermined angle threshold value with the angle of horizontal direction Line segment;
If first direction be left or right, in the image in first predetermined detection area in top half one In each line segment that the pixel of a high gradient in the pixel and lower half portion of a high gradient connects into, choose comprising high ladder The number of the pixel of degree meets preset number condition, and is less than the line of the predetermined angle threshold value with the angle of vertical direction Section.
Optionally, if first direction is up or down, image in first predetermined detection area each In pixel column, retains pixel of the laterally continuous number greater than the high gradient of the second preset number threshold value, get rid of other high The pixel of gradient, one in the left-half of the image in first predetermined detection area that is removed that treated In each line segment that the pixel of a high gradient in the pixel and right half part of high gradient connects into, choosing includes high gradient The number of pixel meet the line segment of preset number condition;
If first direction is left or right, each pixel column of the image in first predetermined detection area In, retain and be longitudinally continuous pixel of the number greater than the high gradient of the second preset number threshold value, gets rid of other high gradients Pixel, a high gradient in the top half of the image in first predetermined detection area that is removed that treated Pixel and lower half portion in a high gradient each line segment for connecting into of pixel in, choose include high gradient pixel The number of point meets the line segment of preset number condition.
Optionally, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition, comprising:
Choose the most line segment of the number of the pixel comprising high gradient;Alternatively,
The number for choosing the pixel comprising high gradient is greater than the line segment of the first preset number threshold value.
According to the second aspect of an embodiment of the present disclosure, a kind of device of the information of ID card, described device packet are provided It includes:
Obtain module, the corresponding gradient bianry image of detection image for obtaining release, the gradient bianry image Two values respectively correspond high gradient and low gradient;
Choose module, each line segment for being connected into the gradient bianry image by the pixel of two high gradients In, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition;
Determining module in the detection image, determines the boundary of the release for the line segment according to selection;
Identification module in the detection image, identifies the card of the release for the boundary according to the release Information with it.
Optionally, the selection module, is used for:
For either described release to boundary, using the either direction as first direction, in the gradient two It is worth in image, obtains the image in corresponding first predetermined detection area in boundary of the first direction;
If first direction be up or down, one in the left-half of the image in first predetermined detection area In each line segment that the pixel of a high gradient in the pixel and right half part of a high gradient connects into, choose comprising high ladder The number of the pixel of degree meets the line segment of preset number condition;
If first direction be left or right, one in the top half of the image in first predetermined detection area In each line segment that the pixel of a high gradient in the pixel and lower half portion of a high gradient connects into, choose comprising high ladder The number of the pixel of degree meets the line segment of preset number condition.
Optionally, the selection module, is used for: if first direction is up or down, in the described first default detection zone In the pixel of the high gradient of the left-half of image in domain, the of the pixel that left side neighbor pixel is low gradient is chosen A kind of pixel is chosen right in the pixel of the high gradient of the right half part of the image in first predetermined detection area Side neighbor pixel is the second class pixel of the pixel of low gradient, a pixel in the first kind pixel and In each line segment that a pixel in the second class pixel connects into, the number for choosing the pixel comprising high gradient is full The line segment of sufficient preset number condition;
If first direction is left or right, the height ladder of the top half of the image in first predetermined detection area In the pixel of degree, the third class pixel for the pixel that upside neighbor pixel is low gradient is chosen, it is default described first In the pixel of the high gradient of the lower half portion of image in detection zone, the pixel that downside neighbor pixel is low gradient is chosen 4th class pixel of point, the picture in a pixel and the 4th class pixel in the third class pixel In each line segment that vegetarian refreshments connects into, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition.
Optionally, the selection module, is used for: if first direction is up or down, in the described first default detection zone The pixel of a high gradient in the pixel and right half part of a high gradient in image in domain in left-half connects In each line segment being connected into, the number for choosing the pixel comprising high gradient meets preset number condition, and the folder with horizontal direction Angle is less than the line segment of predetermined angle threshold value;
If first direction be left or right, in the image in first predetermined detection area in top half one In each line segment that the pixel of a high gradient in the pixel and lower half portion of a high gradient connects into, choose comprising high ladder The number of the pixel of degree meets preset number condition, and is less than the line of the predetermined angle threshold value with the angle of vertical direction Section.
Optionally, the selection module, is used for: if first direction is up or down, in the described first default detection zone In each pixel column of image in domain, retain picture of the laterally continuous number greater than the high gradient of the second preset number threshold value Vegetarian refreshments gets rid of the pixel of other high gradients, the image in first predetermined detection area that is removed that treated Left-half in a high gradient pixel and right half part in a high gradient each line for connecting into of pixel Duan Zhong, the number for choosing the pixel comprising high gradient meet the line segment of preset number condition;
If first direction is left or right, each pixel column of the image in first predetermined detection area In, retain and be longitudinally continuous pixel of the number greater than the high gradient of the second preset number threshold value, gets rid of other high gradients Pixel, a high gradient in the top half of the image in first predetermined detection area that is removed that treated Pixel and lower half portion in a high gradient each line segment for connecting into of pixel in, choose include high gradient pixel The number of point meets the line segment of preset number condition.
Optionally, the selection module, is used for:
Choose the most line segment of the number of the pixel comprising high gradient;Alternatively,
The number for choosing the pixel comprising high gradient is greater than the line segment of the first preset number threshold value.
According to the third aspect of an embodiment of the present disclosure, a kind of device of the information of ID card, described device packet are provided It includes:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
Obtain the corresponding gradient bianry image of detection image of release, the two values difference of the gradient bianry image Corresponding high gradient and low gradient;
In each line segment connected into the gradient bianry image by the pixel of two high gradients, choose comprising high ladder The number of the pixel of degree meets the line segment of preset number condition;
According to the line segment of selection, in the detection image, the boundary of the release is determined;
According to the boundary of the release, in the detection image, the information in the clamp of the release is identified.
The technical scheme provided by this disclosed embodiment can include the following benefits:
In the embodiment of the present disclosure, the corresponding gradient bianry image of detection image of release is obtained, gradient bianry image Two values respectively correspond high gradient and low gradient;It is connected into gradient bianry image by the pixel of two high gradients each In line segment, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition;According to the line segment of selection, examining In altimetric image, the boundary of release is determined;According to the boundary of release, in detection image, in the clamp of ID card Information can be according to the boundary of release in this way, after determining the boundary of release, information in the clamp of ID card, nothing Entire detection image comprising release need to be analyzed, so as to improve ID card information efficiency.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not The disclosure can be limited.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows the implementation for meeting the disclosure Example, and together with specification for explaining the principles of this disclosure.In the accompanying drawings:
Fig. 1 is a kind of flow chart of the method for the information of ID card shown according to an exemplary embodiment;
Fig. 2 is the schematic diagram of gradient bianry image shown according to an exemplary embodiment;
Fig. 3 is the schematic diagram of gradient bianry image shown according to an exemplary embodiment;
Fig. 4 is the schematic diagram of border detection shown according to an exemplary embodiment;
Fig. 5 is a kind of apparatus structure schematic diagram of the information of ID card shown according to an exemplary embodiment;
Fig. 6 is a kind of structural schematic diagram of terminal shown according to an exemplary embodiment.
Through the above attached drawings, it has been shown that the specific embodiment of the disclosure will be hereinafter described in more detail.These attached drawings It is not intended to limit the scope of this disclosure concept by any means with verbal description, but is by referring to specific embodiments Those skilled in the art illustrate the concept of the disclosure.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all implementations consistent with this disclosure.On the contrary, they be only with it is such as appended The example of the consistent device and method of some aspects be described in detail in claims, the disclosure.
An exemplary embodiment of the present disclosure provides a kind of methods of the information of ID card, as shown in Figure 1, this method Process flow may include following step:
In a step 101, the corresponding gradient bianry image of detection image of release is obtained, two of gradient bianry image Numerical value respectively corresponds high gradient and low gradient.
In a step 102, it in each line segment connected into gradient bianry image by the pixel of two high gradients, chooses The number of pixel comprising high gradient meets the line segment of preset number condition.
In step 103, according to the line segment of selection, in detection image, the boundary of release is determined.
At step 104, the information according to the boundary of release, in detection image, in the clamp of ID card.
In the embodiment of the present disclosure, the corresponding gradient bianry image of detection image of release is obtained, gradient bianry image Two values respectively correspond high gradient and low gradient;It is connected into gradient bianry image by the pixel of two high gradients each In line segment, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition;According to the line segment of selection, examining In altimetric image, the boundary of release is determined;According to the boundary of release, in detection image, in the clamp of ID card Information can be according to the boundary of release in this way, after determining the boundary of release, information in the clamp of ID card, nothing Entire detection image comprising release need to be analyzed, so as to improve ID card information efficiency.
Disclosure another exemplary embodiment provides a kind of method of the information of ID card, and this method can be used for In terminal, wherein terminal can be the terminal with the information on ID card, such as mobile phone or tablet computer move Dynamic terminal.The application program for having the function of the information on ID card can be installed, the terminal can in the terminal To include input unit, the input unit can be camera, be also possible to scanner etc., and terminal can pass through input unit Obtain the detection image of release;The terminal may include processor, and the processor can be according to the release got Detection image, the information in the clamp of ID card;The terminal can also include display unit, and the display unit can With liquid crystal display, information that display unit can be obtained with video-stream processor by identifying processing.In addition, the terminal can be with Including components such as memory, sensor, voicefrequency circuit and power supplys.
Below in conjunction with embodiment, process flow shown in FIG. 1 is described in detail, content can be such that
In a step 101, the corresponding gradient bianry image of detection image of release is obtained, two of gradient bianry image Numerical value respectively corresponds high gradient and low gradient.
In an implementation, user can install the application program with the information on ID card at the terminal, Release can be the card that the information such as number, image are printed in clamp, such as bank card and identity card.When user wishes to identify When certain opens the information on release, user can open the application program in terminal, and click information card identifies corresponding option, eventually End can then receive the click commands of the corresponding option, then can open input equipment (such as camera), and show in screen Show detection zone, user can be with the position of mobile terminal, so that the image of release is entirely located in the detection zone of display, eventually The available detection image to release is held, may then pass through sobel border detection algorithm, gradient is carried out to detection image Detection processing obtains the corresponding gradient value of each pixel, and then can be detected the corresponding gradient image of image.In terminal It can be previously stored with Grads threshold, then can will be greater than the ladder of the Grads threshold in the corresponding gradient value of each pixel Angle value will be less than the gradient value of the Grads threshold as low gradient as high gradient.Terminal can be with two values come right respectively High gradient and low gradient are answered, and two values correspond to different colors in gradient image, then terminal can be according to each pixel The gradient value of point, obtains the corresponding gradient bianry image of detection image, as shown in Figure 2.In the present embodiment, corresponding with high gradient Numerical value be 1, the corresponding numerical value of low gradient is illustrated for being 0, other situations are similar therewith, wherein 1 in gradient image Corresponding color can for white, 0 in gradient image corresponding color can be black.
In a step 102, it in each line segment connected into gradient bianry image by the pixel of two high gradients, chooses The number of pixel comprising high gradient meets the line segment of preset number condition.
It in an implementation, can be in the gradient two after terminal obtains the corresponding gradient bianry image of detection image of release It is any to choose two pixels and carry out lines in the pixel that the numerical value for being worth image is 1, several line segments are obtained, it then can be with It determines the number for the pixel for being 1 comprising numerical value in these line segments, and then the number of the pixel comprising high gradient can be chosen Meet the line segment of preset number condition.
Optionally, preset number condition can be diversified, and corresponding treatment process can be such that selection includes height The most line segment of the number of the pixel of gradient;Alternatively, the number for choosing the pixel comprising high gradient is greater than the first present count The line segment of mesh threshold value.
In an implementation, for the every line segment connected into, terminal can determine the pixel that the numerical value that every line segment includes is 1 The number of point, the line segment that the number for the pixel for being 1 comprising numerical value then can be selected most;Alternatively, terminal can also be in determination After the number for the pixel that the numerical value that every line segment includes is 1, the number for choosing the pixel that the numerical value for including is 1 is greater than first The line segment of preset number threshold value.
Optionally, can connect according to high gradient pixel is chosen in the region of image different directions in the pixel of selection In the line segment being connected into, choose and meet the line segment of preset number condition, correspondingly, the treatment process of step 102 can be such that for Either release to boundary, be in either direction first direction, in gradient bianry image, obtain the side of first direction Image in corresponding first predetermined detection area in boundary;If first direction is up or down, in the first predetermined detection area Image left-half in a high gradient pixel and right half part in the pixel of a high gradient connect into Each line segment in, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition;If first direction is Left or right, the then pixel of in the top half of the image in the first predetermined detection area a high gradient and lower half portion In a high gradient each line segment for connecting into of pixel in, the number for choosing the pixel comprising high gradient meets present count The line segment of mesh condition.
In an implementation, for either release to boundary, can in either direction be first direction, can in terminal The corresponding detection zone in boundary (i.e. the first predetermined detection area) to preset first direction, terminal can also be preset The area of first predetermined detection area percentage shared in the entire detection zone of terminal, for example, first direction be it is upper, then First predetermined detection area can be the top one third region of entire detection zone of terminal.Terminal can be in gradient two-value In image, the image in corresponding first predetermined detection area in boundary of first direction is obtained.
If first direction is up or down, terminal can be in the left-half of the image in the first predetermined detection area Any pixel chosen a numerical value and be 1, and the pixel that a numerical value is 1 is arbitrarily chosen in right half part, then connect A line segment being connected into, terminal can own according in the pixel and right half part that all numerical value in left-half are 1 The pixel that numerical value is 1, connects into a plurality of line segment, then can choose in all line segments connected into comprising high gradient The number of pixel meets the line segment of preset number condition.
If first direction is left or right, terminal can be in the top half of the image in the first predetermined detection area Any pixel chosen a numerical value and be 1, and the pixel that a numerical value is 1 is arbitrarily chosen in lower half portion, then connect A line segment being connected into, terminal can own according in the pixel and lower half portion that all numerical value in top half are 1 The pixel that numerical value is 1, connects into a plurality of line segment, then can be in all line segments connected into, and choosing comprising numerical value is 1 The number of pixel meets the line segment of preset number condition.
Optionally, the high gradient pixel for meeting preset condition can be chosen in the predetermined detection area of image different directions Point chooses the line segment for meeting preset number condition in the line segment that connects into of pixel of selection, correspondingly, above-mentioned processing Process can be such that if first direction is up or down, the height of the left-half of the image in the first predetermined detection area In the pixel of gradient, the first kind pixel for the pixel that left side neighbor pixel is low gradient is chosen, in the first default inspection It surveys in the pixel of the high gradient of the right half part of the image in region, chooses the pixel that right side neighbor pixel is low gradient The second class pixel, the pixel in a pixel and the second class pixel in first kind pixel connects into Each line segment in, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition;If first direction is It is adjacent to choose upside then in the pixel of the high gradient of the top half of the image in the first predetermined detection area for left or right Pixel is the third class pixel of the pixel of low gradient, the height of the lower half portion of the image in the first predetermined detection area In the pixel of gradient, the 4th class pixel of the pixel that downside neighbor pixel is low gradient is chosen, in third class pixel In each line segment that a pixel in point and a pixel in the 4th class pixel connect into, choose comprising high gradient The number of pixel meets the line segment of preset number condition.
In an implementation, if first direction is up or down, terminal can be in the image in the first predetermined detection area In the pixel that the numerical value of left-half is 1, choosing left side neighbor pixel is all pixels point that numerical value is 0, as first Class pixel, and in the pixel that the numerical value of the right half part of the image in the first predetermined detection area is 1, choose right side phase Adjacent pixel is all pixels point that numerical value is 0, then can be in one in first kind pixel as the second class pixel In each line segment that a pixel in pixel and the second class pixel connects into, the pixel for being 1 comprising numerical value is chosen Number meets the line segment of preset number condition.
If first direction is left or right, terminal can be in the top half of the image in the first predetermined detection area In the pixel that numerical value is 1, choosing upside neighbor pixel is all pixels point that numerical value is 0, as first kind pixel, and In the pixel that the numerical value of the lower half portion of the image in the first predetermined detection area is 1, choosing downside neighbor pixel is Numerical value is 0 all pixels point, a pixel and the second class pixel as the second class pixel, in first kind pixel In each line segment for connecting into of a pixel in, the number for choosing the pixel for being 1 comprising numerical value meets preset number condition Line segment.
Optionally, line segment can be chosen according to predetermined angle threshold value, correspondingly, above-mentioned treatment process can be as Under: if first direction is up or down, a high gradient in the image in the first predetermined detection area in left-half Pixel and right half part in a high gradient each line segment for connecting into of pixel in, choose include high gradient pixel The number of point meets preset number condition, and is less than the line segment of predetermined angle threshold value with the angle of horizontal direction;If first party To for left or right, then the pixel and lower half of a high gradient in the image in the first predetermined detection area in top half In each line segment that the pixel of a high gradient in part connects into, the number for choosing the pixel comprising high gradient meets in advance If number condition, and the line segment with the angle of vertical direction less than predetermined angle threshold value.
In an implementation, if first direction is up or down, terminal can be in the image in the first predetermined detection area The pixel that a numerical value is 1 is arbitrarily chosen in left-half, and the pixel that a numerical value is 1 is arbitrarily chosen in right half part Point, the line segment then connected into, the pixel and right side that terminal can be 1 according to all numerical value in left-half The pixel that all numerical value are 1 in point, connects into a plurality of line segment, then can determine in these line segments comprising high gradient The number of pixel, and can determine the angle of these line segments and horizontal direction, choose the number of the pixel comprising high gradient Mesh meets preset number condition and is less than the line segment of predetermined angle threshold value with the angle of horizontal direction.For example, preset number condition It is greater than 20 for the number of the pixel comprising high gradient, predetermined angle threshold value is 15 degree, for by high pixel (5,5) and height The line segment that pixel (55,2) connects into, terminal determine that the number of pixel of the line segment comprising high gradient is 30, the line segment Angle with horizontal direction is 8.5 °, then terminal can choose the line segment.
If first direction is left or right, terminal can be in the top half of the image in the first predetermined detection area Any pixel chosen a numerical value and be 1, and the pixel that a numerical value is 1 is arbitrarily chosen in lower half portion, then connect A line segment being connected into, terminal can own according in the pixel and lower half portion that all numerical value in top half are 1 The pixel that numerical value is 1, connects into a plurality of line segment, then can determine the pixel comprising high gradient in these line segments Number, and can determine the angle of these line segments and vertical direction, the number for choosing the pixel comprising high gradient meets in advance If number condition and the line segment for being less than predetermined angle threshold value with the angle of vertical direction.For example, preset number condition is to include height The number of the pixel of gradient is greater than 20, and predetermined angle threshold value is 15 degree, for by high pixel (5,5) and high pixel The line segment that (2,55) connect into, terminal determine that the line segment include the number of the pixel of high gradient is 35, the line segment and vertical The angle in direction is 8.5 °, then terminal can choose the line segment.
Optionally, one part of pixel point can be first excluded in gradient bianry image, then chooses line segment, correspondingly, above-mentioned The treatment process of step can be such that if first direction is up or down, image in the first predetermined detection area it is every In one pixel column, retains pixel of the laterally continuous number greater than the high gradient of the second preset number threshold value, get rid of it The pixel of its high gradient, one in the left-half of the image in first predetermined detection area that is removed that treated In each line segment that the pixel of a high gradient in the pixel and right half part of high gradient connects into, choosing includes high gradient The number of pixel meet the line segment of preset number condition;If first direction is left or right, in the first default detection zone In each pixel column of image in domain, retains and be longitudinally continuous picture of the number greater than the high gradient of the second preset number threshold value Vegetarian refreshments gets rid of the pixel of other high gradients, the image in first predetermined detection area that is removed that treated it is upper In each line segment that the pixel of a high gradient in the pixel and lower half portion of a high gradient in half part connects into, The number for choosing the pixel comprising high gradient meets the line segment of preset number condition.
In an implementation, if first direction is up or down, terminal can be in the image in the first predetermined detection area In each pixel column, determine that laterally consecutive numerical value is the number of 1 pixel, it is big that terminal can retain laterally continuous number The pixel for being 1 in the numerical value of the second preset number threshold value gets rid of the pixel that other numerical value are 1.Terminal can carry out In the left-half of image in removal treated the first predetermined detection area, any pixel chosen a numerical value and be 1, And in right half part, any to choose a numerical value as 1 pixel, the line segment then connected into, terminal can connected into Each line segment in, the number for choosing the pixel for being 1 comprising numerical value meets the line segment of preset number condition.Technical staff can be The second preset number threshold value is preset in application program, so that terminal retains according to the second preset number threshold value or remove pixel Point, technical staff can also preset the number for the pixel that laterally consecutive numerical value is 1 in gradient two-value in the application Shared ratio in the total number of horizontal pixel point in image, then terminal can be according to the laterally consecutive numerical value of the ratio-dependent The quantity threshold of 1 pixel, and then retain or remove pixel.For example, the ratio setting be 1/10, horizontal pixel point it is total Number is 1000, then terminal can retain the pixel that numerical value of the laterally continuous number greater than 100 is 1, gets rid of other numbers The pixel that value is 1.
If first direction is left or right, terminal can be in each pixel of the image in the first predetermined detection area In row, the number for being longitudinally continuous the pixel that numerical value is 1 is determined, terminal can retain that be longitudinally continuous number default greater than second The pixel that the numerical value of quantity threshold is 1 gets rid of the pixel that other numerical value are 1.Terminal can be after being removed processing The first predetermined detection area in image top half in, any pixel chosen a numerical value and be 1, and in lower half In point, any pixel chosen a numerical value and be 1, the line segment then connected into, terminal can in each line segment connected into, The number for choosing the pixel for being 1 comprising numerical value meets the line segment of preset number condition.Technical staff can be in the application The second preset number threshold value is preset, so that terminal retains according to the second preset number threshold value or remove pixel, technology people It is vertical in gradient bianry image that member can also preset the number for being longitudinally continuous the pixel that numerical value is 1 in the application The shared ratio into the total number of pixel, and then retain or remove pixel, as shown in Figure 3.
In step 103, according to the line segment of selection, in detection image, the boundary of release is determined.
In an implementation, after terminal chooses line segment, release in detection image, can be determined according to the line segment of selection Boundary.Choose the case where including the number most line segment of pixel of high gradient for terminal, terminal can it is upper and lower, left, In the corresponding predetermined detection area of right four direction, one line segment of each determination obtains four line segments, and then determines where this four Straight line, then four vertex of available four straight line intersections obtain release so as to connect this four vertex Boundary, as shown in Figure 4.
The case where line segment of first preset number threshold value is greater than for the number that terminal selection includes the pixel of high gradient, If first direction is up or down, terminal can determine the average value of the coordinate of the left end point of each line segment of selection, be sat The corresponding pixel of target average value (can be referred to as the first pixel), can also determine the coordinate of the right endpoint of each line segment of selection Average value, obtain the corresponding pixel of average value (can be referred to as the second pixel) of coordinate, then can connect the first pixel Point and the second pixel, obtain coboundary or the lower boundary of release, if first direction is left or right, terminal can be determined The average value of the coordinate of the upper extreme point for each line segment chosen, the corresponding pixel of average value for obtaining coordinate (can be referred to as third picture Vegetarian refreshments), it can also determine the average value of the coordinate of the lower extreme point of each line segment of selection, obtain the corresponding pixel of average value of coordinate Point (can be referred to as the 4th pixel), then can connect third pixel and the 4th pixel, obtain release left margin or Right margin.
At step 104, the information according to the boundary of release, in detection image, in the clamp of ID card.
It in an implementation, can be in the boundary model in detection image, determining release after terminal determines the boundary of release Interior image is enclosed, and then carries out information extraction in the images, then the information extracted can be analyzed, to identify Information in the clamp of release.
In the embodiment of the present disclosure, the corresponding gradient bianry image of detection image of release is obtained, gradient bianry image Two values respectively correspond high gradient and low gradient;It is connected into gradient bianry image by the pixel of two high gradients each In line segment, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition;According to the line segment of selection, examining In altimetric image, the boundary of release is determined;According to the boundary of release, in detection image, in the clamp of ID card Information can be according to the boundary of release in this way, after determining the boundary of release, information in the clamp of ID card, nothing Entire detection image comprising release need to be analyzed, so as to improve ID card information efficiency.
Disclosure another exemplary embodiment provides a kind of device of the information of ID card, as shown in figure 5, the dress Setting includes: to obtain module 510, chooses module 520, determining module 530 and identification module 540.
Obtain module 510, the corresponding gradient bianry image of detection image for obtaining release, the gradient binary map The two values of picture respectively correspond high gradient and low gradient;
Choose module 520, each line for being connected into the gradient bianry image by the pixel of two high gradients Duan Zhong, the number for choosing the pixel comprising high gradient meet the line segment of preset number condition;
Determining module 530 in the detection image, determines the boundary of the release for the line segment according to selection;
Identification module 540 in the detection image, identifies the release for the boundary according to the release Clamp on information.
Optionally, the selection module 520, is used for:
For either described release to boundary, using the either direction as first direction, in the gradient two It is worth in image, obtains the image in corresponding first predetermined detection area in boundary of the first direction;
If first direction be up or down, one in the left-half of the image in first predetermined detection area In each line segment that the pixel of a high gradient in the pixel and right half part of a high gradient connects into, choose comprising high ladder The number of the pixel of degree meets the line segment of preset number condition;
If first direction be left or right, one in the top half of the image in first predetermined detection area In each line segment that the pixel of a high gradient in the pixel and lower half portion of a high gradient connects into, choose comprising high ladder The number of the pixel of degree meets the line segment of preset number condition.
Optionally, the selection module 520, is used for: if first direction is up or down, in the described first default detection In the pixel of the high gradient of the left-half of image in region, the pixel that left side neighbor pixel is low gradient is chosen First kind pixel is chosen in the pixel of the high gradient of the right half part of the image in first predetermined detection area Right side neighbor pixel is the second class pixel of the pixel of low gradient, a pixel in the first kind pixel In each line segment connected into a pixel in the second class pixel, the number of the pixel comprising high gradient is chosen Meet the line segment of preset number condition;
If first direction is left or right, the height ladder of the top half of the image in first predetermined detection area In the pixel of degree, the third class pixel for the pixel that upside neighbor pixel is low gradient is chosen, it is default described first In the pixel of the high gradient of the lower half portion of image in detection zone, the pixel that downside neighbor pixel is low gradient is chosen 4th class pixel of point, the picture in a pixel and the 4th class pixel in the third class pixel In each line segment that vegetarian refreshments connects into, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition.
Optionally, the selection module 520, is used for: if first direction is up or down, in the described first default detection The pixel of a high gradient in the pixel and right half part of a high gradient in image in region in left-half In each line segment connected into, the number for choosing the pixel comprising high gradient meets preset number condition, and with horizontal direction Angle is less than the line segment of predetermined angle threshold value;
If first direction be left or right, in the image in first predetermined detection area in top half one In each line segment that the pixel of a high gradient in the pixel and lower half portion of a high gradient connects into, choose comprising high ladder The number of the pixel of degree meets preset number condition, and is less than the line of the predetermined angle threshold value with the angle of vertical direction Section.
Optionally, the selection module 520, is used for: if first direction is up or down, in the described first default detection In each pixel column of image in region, retain high gradient of the laterally continuous number greater than the second preset number threshold value Pixel gets rid of the pixel of other high gradients, the figure in first predetermined detection area that is removed that treated The pixel of a high gradient in the pixel and right half part of a high gradient in the left-half of picture connects into each In line segment, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition;
If first direction is left or right, each pixel column of the image in first predetermined detection area In, retain and be longitudinally continuous pixel of the number greater than the high gradient of the second preset number threshold value, gets rid of other high gradients Pixel, a high gradient in the top half of the image in first predetermined detection area that is removed that treated Pixel and lower half portion in a high gradient each line segment for connecting into of pixel in, choose include high gradient pixel The number of point meets the line segment of preset number condition.
Optionally, the selection module 520, is used for:
Choose the most line segment of the number of the pixel comprising high gradient;Alternatively,
The number for choosing the pixel comprising high gradient is greater than the line segment of the first preset number threshold value.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method Embodiment in be described in detail, no detailed explanation will be given here.
In the embodiment of the present disclosure, the corresponding gradient bianry image of detection image of release is obtained, gradient bianry image Two values respectively correspond high gradient and low gradient;It is connected into gradient bianry image by the pixel of two high gradients each In line segment, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition;According to the line segment of selection, examining In altimetric image, the boundary of release is determined;According to the boundary of release, in detection image, in the clamp of ID card Information can be according to the boundary of release in this way, after determining the boundary of release, information in the clamp of ID card, nothing Entire detection image comprising release need to be analyzed, so as to improve ID card information efficiency.
It should be understood that information of the device of the information of ID card provided by the above embodiment in ID card When, only the example of the division of the above functional modules, in practical application, it can according to need and divide above-mentioned function With being completed by different functional modules, i.e., the internal structure of equipment is divided into different functional modules, to complete above description All or part of function.In addition, the device and ID card of the information of ID card provided by the above embodiment The embodiment of the method for information belongs to same design, and specific implementation process is detailed in embodiment of the method, and which is not described herein again.
The another exemplary embodiment of the disclosure provides a kind of structural schematic diagram of terminal.The terminal can be mobile phone etc..
Referring to Fig. 6, terminal 800 may include following one or more components: processing component 802, memory 804, power supply Component 806, multimedia component 808, audio component 810, the interface 812 of input/output (I/O), sensor module 814, and Communication component 816.
The integrated operation of the usual controlling terminal 800 of processing component 802, such as with display, telephone call, data communication, phase Machine operation and record operate associated operation.Processing element 802 may include that one or more processors 820 refer to execute It enables, to perform all or part of the steps of the methods described above.In addition, processing component 802 may include one or more modules, just Interaction between processing component 802 and other assemblies.For example, processing component 802 may include multi-media module, it is more to facilitate Interaction between media component 808 and processing component 802.
Memory 804 is configured as storing various types of data to support the operation in terminal 800.These data are shown Example includes the instruction of any application or method for operating in terminal 800, contact data, and telephone book data disappears Breath, picture, video etc..Memory 804 can be by any kind of volatibility or non-volatile memory device or their group It closes and realizes, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM) is erasable to compile Journey read-only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash Device, disk or CD.
Electric power assembly 806 provides electric power for the various assemblies of terminal 800.Electric power assembly 806 may include power management system System, one or more power supplys and other with for audio output apparatus 800 generate, manage, and distribute the associated component of electric power.
Multimedia component 808 includes the screen of one output interface of offer between the terminal 800 and user.One In a little embodiments, screen may include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen Curtain may be implemented as touch screen, to receive input signal from the user.Touch panel includes one or more touch sensings Device is to sense the gesture on touch, slide, and touch panel.The touch sensor can not only sense touch or sliding action Boundary, but also detect duration and pressure associated with the touch or slide operation.In some embodiments, more matchmakers Body component 808 includes a front camera and/or rear camera.When terminal 800 is in operation mode, such as screening-mode or When video mode, front camera and/or rear camera can receive external multi-medium data.Each front camera and Rear camera can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio component 810 is configured as output and/or input audio signal.For example, audio component 810 includes a Mike Wind (MIC), when audio output apparatus 800 is in operation mode, when such as call mode, recording mode, and voice recognition mode, wheat Gram wind is configured as receiving external audio signal.The received audio signal can be further stored in memory 804 or warp It is sent by communication component 816.
I/O interface 812 provides interface between processing component 802 and peripheral interface module, and above-mentioned peripheral interface module can To be keyboard, click wheel, button etc..These buttons may include, but are not limited to: home button, volume button, start button and lock Determine button.
Sensor module 814 includes one or more sensors, and the state for providing various aspects for terminal 800 is commented Estimate.For example, sensor module 814 can detecte the state that opens/closes of terminal 800, and the relative positioning of component, for example, it is described Component is the display and keypad of terminal 800, and sensor module 814 can also detect 800 1 components of terminal 800 or terminal Position change, the existence or non-existence that user contacts with terminal 800,800 orientation of terminal or acceleration/deceleration and terminal 800 Temperature change.Sensor module 814 may include proximity sensor, be configured to detect without any physical contact Presence of nearby objects.Sensor module 814 can also include optical sensor, such as CMOS or ccd image sensor, at As being used in application.In some embodiments, which can also include acceleration transducer, gyro sensors Device, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 816 is configured to facilitate the communication of wired or wireless way between terminal 800 and other equipment.Terminal 800 can access the wireless network based on communication standard, such as WiFi, 2G or 3G or their combination.In an exemplary implementation In example, communication component 816 receives broadcast singal or broadcast related information from external broadcasting management system via broadcast channel. In one exemplary embodiment, the communication component 816 further includes near-field communication (NFC) module, to promote short range communication.Example Such as, NFC module can be based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band (UWB) technology, Bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, terminal 800 can be believed by one or more application specific integrated circuit (ASIC), number Number processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for executing the above method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided It such as include the memory 804 of instruction, above-metioned instruction can be executed by the processor 820 of terminal 800 to complete the above method.For example, The non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk With optical data storage devices etc..
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is held by the processor of terminal When row, the method for enabling the terminal to execute the information of ID card, this method comprises:
Obtain the corresponding gradient bianry image of detection image of release, the two values difference of the gradient bianry image Corresponding high gradient and low gradient;
In each line segment connected into the gradient bianry image by the pixel of two high gradients, choose comprising high ladder The number of the pixel of degree meets the line segment of preset number condition;
According to the line segment of selection, in the detection image, the boundary of the release is determined;
According to the boundary of the release, in the detection image, the information in the clamp of the release is identified.
Optionally, it in each line segment connected into the bianry image by the pixel of two high gradients, chooses The number of pixel comprising high gradient meets the line segment of preset number condition, comprising:
For either described release to boundary, using the either direction as first direction, in the gradient two It is worth in image, obtains the image in corresponding first predetermined detection area in boundary of the first direction;
If first direction be up or down, one in the left-half of the image in first predetermined detection area In each line segment that the pixel of a high gradient in the pixel and right half part of a high gradient connects into, choose comprising high ladder The number of the pixel of degree meets the line segment of preset number condition;
If first direction be left or right, one in the top half of the image in first predetermined detection area In each line segment that the pixel of a high gradient in the pixel and lower half portion of a high gradient connects into, choose comprising high ladder The number of the pixel of degree meets the line segment of preset number condition.
Optionally, if first direction is up or down, the left side of the image in first predetermined detection area In the pixel for the high gradient divided, the first kind pixel for the pixel that left side neighbor pixel is low gradient is chosen, described In the pixel of the high gradient of the right half part of image in first predetermined detection area, choosing right side neighbor pixel is low ladder Second class pixel of the pixel of degree, in the pixel and the second class pixel in the first kind pixel Each line segment for connecting into of a pixel in, the number for choosing the pixel comprising high gradient meets the line of preset number condition Section;
If first direction is left or right, the height ladder of the top half of the image in first predetermined detection area In the pixel of degree, the third class pixel for the pixel that upside neighbor pixel is low gradient is chosen, it is default described first In the pixel of the high gradient of the lower half portion of image in detection zone, the pixel that downside neighbor pixel is low gradient is chosen 4th class pixel of point, the picture in a pixel and the 4th class pixel in the third class pixel In each line segment that vegetarian refreshments connects into, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition.
Optionally, if first direction is up or down, the left side in the image in first predetermined detection area In each line segment that the pixel of a high gradient in the pixel and right half part of a high gradient in point connects into, choose The number of pixel comprising high gradient meets preset number condition, and is less than predetermined angle threshold value with the angle of horizontal direction Line segment;
If first direction be left or right, in the image in first predetermined detection area in top half one In each line segment that the pixel of a high gradient in the pixel and lower half portion of a high gradient connects into, choose comprising high ladder The number of the pixel of degree meets preset number condition, and is less than the line of the predetermined angle threshold value with the angle of vertical direction Section.
Optionally, if first direction is up or down, image in first predetermined detection area each In pixel column, retains pixel of the laterally continuous number greater than the high gradient of the second preset number threshold value, get rid of other high The pixel of gradient, one in the left-half of the image in first predetermined detection area that is removed that treated In each line segment that the pixel of a high gradient in the pixel and right half part of high gradient connects into, choosing includes high gradient The number of pixel meet the line segment of preset number condition;
If first direction is left or right, each pixel column of the image in first predetermined detection area In, retain and be longitudinally continuous pixel of the number greater than the high gradient of the second preset number threshold value, gets rid of other high gradients Pixel, a high gradient in the top half of the image in first predetermined detection area that is removed that treated Pixel and lower half portion in a high gradient each line segment for connecting into of pixel in, choose include high gradient pixel The number of point meets the line segment of preset number condition.
Optionally, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition, comprising:
Choose the most line segment of the number of the pixel comprising high gradient;Alternatively,
The number for choosing the pixel comprising high gradient is greater than the line segment of the first preset number threshold value.
In the embodiment of the present disclosure, the corresponding gradient bianry image of detection image of release is obtained, gradient bianry image Two values respectively correspond high gradient and low gradient;It is connected into gradient bianry image by the pixel of two high gradients each In line segment, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition;According to the line segment of selection, examining In altimetric image, the boundary of release is determined;According to the boundary of release, in detection image, in the clamp of ID card Information can be according to the boundary of release in this way, after determining the boundary of release, information in the clamp of ID card, nothing Entire detection image comprising release need to be analyzed, so as to improve ID card information efficiency.
Those skilled in the art will readily occur to its of the disclosure after considering specification and practicing disclosure disclosed herein Its embodiment.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or Person's adaptive change follows the general principles of this disclosure and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are by following Claim is pointed out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by the accompanying claims.

Claims (13)

1. a kind of method of the information of ID card, which is characterized in that the described method includes:
The corresponding gradient bianry image of detection image of release is obtained, the two values of the gradient bianry image respectively correspond High gradient and low gradient;
In each line segment connected into the gradient bianry image by the pixel of two high gradients, choose comprising high gradient The number of pixel meets the line segment of preset number condition;
According to the line segment of selection, in the detection image, the boundary of the release is determined;
According to the boundary of the release, in the detection image, the information in the clamp of the release is identified.
2. the method according to claim 1, wherein it is described in the gradient bianry image by two high gradients Each line segment for connecting into of pixel in, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition, Include:
For either described release to boundary, using the either direction as first direction, in the gradient binary map As in, the image in corresponding first predetermined detection area in boundary of the first direction is obtained;
If first direction is up or down, a height in the left-half of the image in first predetermined detection area In each line segment that the pixel of a high gradient in the pixel and right half part of gradient connects into, choose comprising high gradient The number of pixel meets the line segment of preset number condition;
If first direction is left or right, a height in the top half of the image in first predetermined detection area In each line segment that the pixel of a high gradient in the pixel and lower half portion of gradient connects into, choose comprising high gradient The number of pixel meets the line segment of preset number condition.
3. according to the method described in claim 2, it is characterized in that, if first direction is up or down, in advance described first If in the pixel of the high gradient of the left-half of the image in detection zone, choosing the picture that left side neighbor pixel is low gradient The first kind pixel of vegetarian refreshments, the pixel of the high gradient of the right half part of the image in first predetermined detection area In, choose right side neighbor pixel be low gradient pixel the second class pixel, one in the first kind pixel In each line segment that a pixel in a pixel and the second class pixel connects into, the pixel comprising high gradient is chosen The number of point meets the line segment of preset number condition;
If first direction is left or right, the high gradient of the top half of the image in first predetermined detection area In pixel, the third class pixel for the pixel that upside neighbor pixel is low gradient is chosen, in the described first default detection In the pixel of the high gradient of the lower half portion of image in region, the pixel that downside neighbor pixel is low gradient is chosen 4th class pixel, the pixel in a pixel and the 4th class pixel in the third class pixel In each line segment connected into, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition.
4. according to the method described in claim 2, it is characterized in that, if first direction is up or down, in advance described first If a high gradient in the pixel and right half part of a high gradient in the image in detection zone in left-half In each line segment that pixel connects into, the number for choosing the pixel comprising high gradient meets preset number condition, and with level The angle in direction is less than the line segment of predetermined angle threshold value;
If first direction is left or right, a height in the image in first predetermined detection area in top half In each line segment that the pixel of a high gradient in the pixel and lower half portion of gradient connects into, choose comprising high gradient The number of pixel meets preset number condition, and is less than the line segment of the predetermined angle threshold value with the angle of vertical direction.
5. according to the method described in claim 2, it is characterized in that, if first direction is up or down, in advance described first If in each pixel column of the image in detection zone, retaining the height that laterally continuous number is greater than the second preset number threshold value The pixel of gradient gets rid of the pixel of other high gradients, in first predetermined detection area that is removed that treated In image left-half in the pixel of a high gradient connected with the pixel of a high gradient in right half part At each line segment in, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition;
If first direction is left or right, in each pixel column of the image in first predetermined detection area, protect It stays and is longitudinally continuous pixel of the number greater than the high gradient of the second preset number threshold value, get rid of the pixel of other high gradients Point, the picture of a high gradient in the top half of the image in first predetermined detection area that is removed that treated In each line segment that the pixel of a high gradient in vegetarian refreshments and lower half portion connects into, the pixel comprising high gradient is chosen Number meets the line segment of preset number condition.
6. according to the method described in claim 2, it is characterized in that, the number for choosing the pixel comprising high gradient meets The line segment of preset number condition, comprising:
Choose the most line segment of the number of the pixel comprising high gradient;Alternatively,
The number for choosing the pixel comprising high gradient is greater than the line segment of the first preset number threshold value.
7. a kind of device of the information of ID card, which is characterized in that described device includes:
Acquisition module, the corresponding gradient bianry image of detection image for obtaining release, the two of the gradient bianry image A numerical value respectively corresponds high gradient and low gradient;
Module is chosen, in each line segment for being connected into the gradient bianry image by the pixel of two high gradients, choosing The number of the pixel comprising high gradient is taken to meet the line segment of preset number condition;
Determining module in the detection image, determines the boundary of the release for the line segment according to selection;
Identification module, for the boundary according to the release, in the detection image, in the clamp that identifies the release Information.
8. device according to claim 7, which is characterized in that the selection module is used for:
For either described release to boundary, using the either direction as first direction, in the gradient binary map As in, the image in corresponding first predetermined detection area in boundary of the first direction is obtained;
If first direction is up or down, a height in the left-half of the image in first predetermined detection area In each line segment that the pixel of a high gradient in the pixel and right half part of gradient connects into, choose comprising high gradient The number of pixel meets the line segment of preset number condition;
If first direction is left or right, a height in the top half of the image in first predetermined detection area In each line segment that the pixel of a high gradient in the pixel and lower half portion of gradient connects into, choose comprising high gradient The number of pixel meets the line segment of preset number condition.
9. device according to claim 8, which is characterized in that the selection module is used for: if first direction be it is upper or Under, then in the pixel of the high gradient of the left-half of the image in first predetermined detection area, it is adjacent to choose left side Pixel is the first kind pixel of the pixel of low gradient, the right half part of the image in first predetermined detection area High gradient pixel in, the second class pixel of the pixel that right side neighbor pixel is low gradient is chosen, described the In each line segment that a pixel in a pixel and the second class pixel in a kind of pixel connects into, choose The number of pixel comprising high gradient meets the line segment of preset number condition;
If first direction is left or right, the high gradient of the top half of the image in first predetermined detection area In pixel, the third class pixel for the pixel that upside neighbor pixel is low gradient is chosen, in the described first default detection In the pixel of the high gradient of the lower half portion of image in region, the pixel that downside neighbor pixel is low gradient is chosen 4th class pixel, the pixel in a pixel and the 4th class pixel in the third class pixel In each line segment connected into, the number for choosing the pixel comprising high gradient meets the line segment of preset number condition.
10. device according to claim 8, which is characterized in that the selection module is used for: if first direction is Under or, then the pixel and right side of a high gradient in the image in first predetermined detection area in left-half In each line segment that the pixel of a high gradient in point connects into, the number for choosing the pixel comprising high gradient, which meets, to be preset Number condition, and the line segment with the angle of horizontal direction less than predetermined angle threshold value;
If first direction is left or right, a height in the image in first predetermined detection area in top half In each line segment that the pixel of a high gradient in the pixel and lower half portion of gradient connects into, choose comprising high gradient The number of pixel meets preset number condition, and is less than the line segment of the predetermined angle threshold value with the angle of vertical direction.
11. device according to claim 8, which is characterized in that the selection module is used for: if first direction is Under or, then in each pixel column of the image in first predetermined detection area, retains laterally continuous number and be greater than The pixel of the high gradient of second preset number threshold value, gets rid of the pixel of other high gradients, and treated being removed One in the pixel and right half part of a high gradient in the left-half of image in first predetermined detection area In each line segment that the pixel of a high gradient connects into, the number for choosing the pixel comprising high gradient meets preset number condition Line segment;
If first direction is left or right, in each pixel column of the image in first predetermined detection area, protect It stays and is longitudinally continuous pixel of the number greater than the high gradient of the second preset number threshold value, get rid of the pixel of other high gradients Point, the picture of a high gradient in the top half of the image in first predetermined detection area that is removed that treated In each line segment that the pixel of a high gradient in vegetarian refreshments and lower half portion connects into, the pixel comprising high gradient is chosen Number meets the line segment of preset number condition.
12. device according to claim 8, which is characterized in that the selection module is used for:
Choose the most line segment of the number of the pixel comprising high gradient;Alternatively,
The number for choosing the pixel comprising high gradient is greater than the line segment of the first preset number threshold value.
13. a kind of device of the information of ID card characterized by comprising
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
The corresponding gradient bianry image of detection image of release is obtained, the two values of the gradient bianry image respectively correspond High gradient and low gradient;
In each line segment connected into the gradient bianry image by the pixel of two high gradients, choose comprising high gradient The number of pixel meets the line segment of preset number condition;
According to the line segment of selection, in the detection image, the boundary of the release is determined;
According to the boundary of the release, in the detection image, the information in the clamp of the release is identified.
CN201510221862.1A 2015-05-04 2015-05-04 A kind of method and apparatus of the information of ID card Active CN105117680B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510221862.1A CN105117680B (en) 2015-05-04 2015-05-04 A kind of method and apparatus of the information of ID card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510221862.1A CN105117680B (en) 2015-05-04 2015-05-04 A kind of method and apparatus of the information of ID card

Publications (2)

Publication Number Publication Date
CN105117680A CN105117680A (en) 2015-12-02
CN105117680B true CN105117680B (en) 2019-06-14

Family

ID=54665664

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510221862.1A Active CN105117680B (en) 2015-05-04 2015-05-04 A kind of method and apparatus of the information of ID card

Country Status (1)

Country Link
CN (1) CN105117680B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106845508B (en) 2015-12-07 2019-05-17 腾讯科技(深圳)有限公司 The methods, devices and systems of release in a kind of detection image
CN106127211A (en) * 2016-06-22 2016-11-16 北京小米移动软件有限公司 Blank detection method and device
CN109389644B (en) * 2017-08-10 2024-02-13 纵目科技(上海)股份有限公司 Direction gradient enhancement-based parking space line detection method
CN108345893B (en) * 2018-03-15 2021-01-26 京东方科技集团股份有限公司 Straight line detection method and device, computer storage medium and terminal
US10331966B1 (en) * 2018-10-19 2019-06-25 Capital One Services, Llc Image processing to detect a rectangular object
CN111160209B (en) * 2019-12-24 2023-07-25 北京爱医生智慧医疗科技有限公司 Method and device for eliminating noise line segments in text image

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6021256A (en) * 1996-09-03 2000-02-01 Eastman Kodak Company Resolution enhancement system for digital images
CN103473541A (en) * 2013-08-21 2013-12-25 方正国际软件有限公司 Certificate perspective correction method and system
CN104112139A (en) * 2014-06-30 2014-10-22 南京富士通南大软件技术有限公司 Method and system for accurate positioning of LPR license plate
CN104156704A (en) * 2014-08-04 2014-11-19 胡艳艳 Novel license plate identification method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6021256A (en) * 1996-09-03 2000-02-01 Eastman Kodak Company Resolution enhancement system for digital images
CN103473541A (en) * 2013-08-21 2013-12-25 方正国际软件有限公司 Certificate perspective correction method and system
CN104112139A (en) * 2014-06-30 2014-10-22 南京富士通南大软件技术有限公司 Method and system for accurate positioning of LPR license plate
CN104156704A (en) * 2014-08-04 2014-11-19 胡艳艳 Novel license plate identification method and system

Also Published As

Publication number Publication date
CN105117680A (en) 2015-12-02

Similar Documents

Publication Publication Date Title
CN105117680B (en) A kind of method and apparatus of the information of ID card
JP6392468B2 (en) Region recognition method and apparatus
CN106355573B (en) The localization method and device of object in picture
CN105069786B (en) Line detection method and device
CN105095881B (en) Face recognition method, face recognition device and terminal
CN105488511B (en) The recognition methods of image and device
CN105491289B (en) Prevent from taking pictures the method and device blocked
JP6392467B2 (en) Region identification method and apparatus
CN106651955A (en) Method and device for positioning object in picture
JP2018500706A (en) Region recognition method and apparatus
CN106951884A (en) Gather method, device and the electronic equipment of fingerprint
CN104484871B (en) edge extracting method and device
CN105046260B (en) Image pre-processing method and device
KR20170061627A (en) Method and apparatus for area identification
CN106296665B (en) Card image fuzzy detection method and apparatus
CN106250831A (en) Image detecting method, device and the device for image detection
KR20170061630A (en) Method and device for region extraction
CN106778773A (en) The localization method and device of object in picture
CN104933700B (en) A kind of method and apparatus carrying out picture material identification
JP6392900B2 (en) Pressure detection method, apparatus, program, and recording medium
CN105931239B (en) The method and device of image procossing
CN106127751A (en) image detecting method, device and system
CN107360366B (en) Photographing method and device, storage medium and electronic equipment
CN106598429A (en) Method and device for adjusting window of mobile terminal
CN105894042A (en) Method and apparatus for detecting whether document image is covered

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant