WO2017071058A1 - 区域识别方法及装置 - Google Patents

区域识别方法及装置 Download PDF

Info

Publication number
WO2017071058A1
WO2017071058A1 PCT/CN2015/099264 CN2015099264W WO2017071058A1 WO 2017071058 A1 WO2017071058 A1 WO 2017071058A1 CN 2015099264 W CN2015099264 W CN 2015099264W WO 2017071058 A1 WO2017071058 A1 WO 2017071058A1
Authority
WO
WIPO (PCT)
Prior art keywords
area
document image
predetermined
predetermined edge
document
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2015/099264
Other languages
English (en)
French (fr)
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 RU2016110142A priority Critical patent/RU2641449C2/ru
Priority to MX2016003578A priority patent/MX361846B/es
Priority to KR1020167005380A priority patent/KR101782633B1/ko
Priority to JP2017547042A priority patent/JP6400226B2/ja
Publication of WO2017071058A1 publication Critical patent/WO2017071058A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/10Image acquisition
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/41Analysis of document content
    • G06V30/414Extracting the geometrical structure, e.g. layout tree; Block segmentation, e.g. bounding boxes for graphics or text
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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

Definitions

  • the present disclosure relates to the field of image processing, and in particular, to an area recognition method and apparatus.
  • the automatic identification technology of the ID card is a technology for recognizing the text information on the ID card through image processing.
  • the related art provides an automatic identification method for an identity card, which scans an ID card according to a fixed relative position by an ID card scanning device, and obtains a scanned image of the ID card; and performs character recognition on n predetermined regions in the scanned image. At least one of name information, gender information, ethnic information, date of birth information, address information, and citizenship number information.
  • ID images obtained directly from the camera there is still a large difficulty in recognition.
  • the present disclosure provides an area identification method and apparatus.
  • the technical solution is as follows:
  • a region identification method comprising:
  • the predetermined edge being an edge located in a predetermined direction of the document
  • identifying a predetermined edge of the document in the document image includes:
  • the method further includes:
  • the document image is reduced in advance according to a predetermined reduction ratio.
  • the method further includes:
  • Connected domain processing is performed on a predetermined area in the processed document image.
  • determining at least one information area in the document image according to the predetermined edge comprises:
  • the relative positional relationship is a relative positional relationship between the predetermined edge and the information region.
  • the document is a second generation ID card
  • the predetermined edge is the lower edge of the second generation ID card
  • the information area is the citizenship number area of the second generation ID card
  • Determining at least one information area according to a predetermined edge and a relative positional relationship including:
  • the area of the predetermined height above the lower edge is determined as the citizenship number area.
  • the method further includes:
  • the document image is tilt corrected according to the slope of the predetermined edge.
  • the slope correction is performed on the document image based on the slope of the predetermined edge, including:
  • the document image is rotated at an angle, and the predetermined edge in the rotated document image is parallel to the horizontal direction.
  • the area of the information area is cut to obtain at least one character area, including:
  • n is a positive integer according to a continuous row set consisting of rows in which the accumulated value of the foreground pixels in the first histogram is greater than the first threshold;
  • the second histogram is calculated according to the vertical direction, and the second histogram includes: the abscissa of each column of pixels and the accumulated value of the foreground pixels in each column of pixels, n ⁇ i ⁇ 1, i is a positive integer;
  • n i character regions are identified.
  • an area identifying apparatus comprising:
  • An identification module configured to identify a predetermined edge of the document in the document image, the predetermined edge being an edge located in a predetermined direction of the document;
  • a determining module configured to determine at least one information area in the document image according to the predetermined edge
  • the cutting module is configured to perform area cutting on the information area to obtain at least one character area.
  • the identification module comprises:
  • a filtering sub-module configured to perform Sobel level filtering and binarization on the document image to obtain a processed document image
  • the detection sub-module is configured to perform line detection on a predetermined area in the processed document image to obtain a target line, and identify the target line as a predetermined edge of the document.
  • the apparatus further includes:
  • the reduction module is configured to perform a reduction process on the document image in a predetermined reduction ratio in advance.
  • the apparatus further includes:
  • the connectivity module is configured to perform connected domain processing on a predetermined area in the processed document image.
  • the determining module is configured to determine the at least one information region according to the predetermined edge and the relative positional relationship, the relative positional relationship being a relative positional relationship between the predetermined edge and the information region.
  • the document is a second generation ID card
  • the predetermined edge is the lower edge of the second generation ID card
  • the information area is the citizenship number area of the second generation ID card
  • a determination module configured to determine an area located at a predetermined height above the lower edge as a citizenship number area.
  • the apparatus further includes:
  • a correction module configured to perform a slope correction on the document image based on a slope of the predetermined edge.
  • the correction module includes:
  • An angle determining submodule configured to determine an angle between the predetermined edge and the horizontal direction according to a slope of the predetermined edge
  • the rotation sub-module is configured to rotate the document image according to an angle, and the predetermined edge in the rotated document image is parallel to the horizontal direction.
  • the cutting module comprises:
  • the binarization sub-module is configured to binarize the information area to obtain a binarized information area
  • a first calculation sub-module configured to calculate a first histogram in a horizontal direction for the binarized information region, the first histogram comprising: a vertical coordinate of each row of pixels and a foreground pixel in each row of pixels The accumulated value of the point;
  • a row identification sub-module configured to identify n rows of text regions according to a continuous row set of rows in which the accumulated value of the foreground pixels in the first histogram is greater than the first threshold, where n is a positive integer;
  • a second calculation sub-module configured to calculate a second histogram according to a vertical direction for the i-th line of text regions, the second histogram comprising: an abscissa of each column of pixels and a foreground pixel of each column of pixels Cumulative value, n ⁇ i ⁇ 1, i is a positive integer;
  • the character recognition sub-module is configured to identify n i character regions according to a continuous column set consisting of columns in which the accumulated value of the foreground color pixel in the second histogram is greater than the second threshold.
  • an area identifying apparatus comprising:
  • a memory for storing processor executable instructions
  • processor is configured to:
  • the predetermined edge being an edge located in a predetermined direction of the document
  • identifying a predetermined edge of the document in the document image By identifying a predetermined edge of the document in the document image; determining at least one information area in the document image according to the predetermined edge; performing area cutting on the information area to obtain at least one character area; and solving the related art image for direct shooting
  • the identification of certain information areas is difficult and the positioning of some information areas is inaccurate; the information area is determined by the predetermined edge in the document image, and the information area is cut, so that the information area is accurately positioned and the information is accurately The effect of the character area in the area for accurate recognition.
  • FIG. 1 is a flowchart of an area identification method according to an exemplary embodiment
  • FIG. 2A is a flowchart of an area identification method according to another exemplary embodiment
  • FIG. 2B is a schematic diagram showing a binary image of a document according to an exemplary embodiment
  • 2C is a schematic diagram of line detection in a document image according to an exemplary embodiment
  • FIG. 3A is a flowchart of an area identification method according to another exemplary embodiment
  • FIG. 3B is a schematic diagram of a connected domain processed document image according to an exemplary embodiment
  • FIG. 4 is a flowchart of an area identification method according to another exemplary embodiment
  • FIG. 5A is a flowchart of an area identification method according to another exemplary embodiment
  • FIG. 5B is a schematic diagram of calculating a first histogram according to a horizontal direction, according to an exemplary embodiment
  • FIG. 5C is a schematic diagram of a continuous row set, according to an exemplary embodiment
  • FIG. 5D is a schematic diagram of calculating a second histogram in a vertical direction, according to an exemplary embodiment
  • FIG. 5E is a schematic diagram of a continuous column set, according to an exemplary embodiment
  • FIG. 6 is a block diagram of an area identifying apparatus according to an exemplary embodiment
  • FIG. 7 is a block diagram of an area identifying apparatus according to another exemplary embodiment.
  • FIG. 8 is a block diagram of an area identifying apparatus according to another exemplary embodiment.
  • FIG. 9 is a block diagram of an area identifying apparatus according to another exemplary embodiment.
  • FIG. 10 is a block diagram of an area identifying apparatus according to another exemplary embodiment.
  • FIG. 11 is a block diagram of an area identifying apparatus, according to an exemplary embodiment.
  • FIG. 1 is a flowchart of an area identification method according to an exemplary embodiment. As shown in FIG. 1, the area identification method includes the following steps.
  • a predetermined edge of the document in the document image is identified, the predetermined edge being an edge located in a predetermined direction of the document;
  • the ID image is an image obtained directly from the document, such as an ID card image, a social security card image, and the like.
  • step 104 at least one information area is determined in the document image according to the predetermined edge
  • the position of the predetermined edge in the document image is relatively fixed, and the positioning difficulty of the predetermined edge is usually lower than the positioning difficulty of the information area, so that each information area can be determined in the document image according to the predetermined edge.
  • the information area refers to the area in the document image that carries the text information, such as: the name information area, the date of birth information area, the gender area, the address information area, the citizenship number information area, the number information area, the information area of the issuing authority, and the effective date. At least one of an information area and the like information area.
  • the information area is area cut to obtain at least one character area.
  • the information area includes multiple characters.
  • at least one character area can be obtained by area cutting.
  • a character area is an area that includes a single character. Characters can be Chinese characters, English letters, numbers, or characters in other languages.
  • the area identifying method determines at least one information area in the document image according to the predetermined edge by identifying a predetermined edge of the document in the document image; and performing area cutting on the information area to obtain at least one
  • the character area solves the problem that the identification of certain information areas in the document image obtained by direct shooting is difficult and the positioning of some information areas is inaccurate in the related art; the information area is determined by the predetermined edge in the document image, The information area is cut to accurately locate the information area and accurately identify the character area in the information area.
  • FIG. 2A is a flowchart of an area identification method according to another exemplary embodiment. As shown in FIG. 2A, the area identification method includes the following steps.
  • step 202 Sobel level filtering and binarization are performed on the document image to obtain a processed document image
  • a rectangular area for guiding shooting is set in the shooting interface, and when the user aligns the rectangular area with the document, the document image is captured.
  • Binarization refers to comparing the gray value of the pixel in the image of the document with the preset gray threshold, and dividing the pixel in the image into two parts: a pixel group larger than the preset gray threshold and less than the preset gray level.
  • the threshold pixel group the two partial pixel groups respectively display two different colors of black and white in the document image, and obtain the binarized document image, as shown in FIG. 2B.
  • the pixel of one color in the foreground is called the foreground pixel, that is, the white pixel of FIG. 2B
  • the pixel of one color of the background is called the background pixel, that is, the pixel of FIG. 2B Black pixel points.
  • step 204 linearly detecting a predetermined area in the processed document image to obtain a target straight line, and identifying the target straight line as a predetermined edge of the document;
  • the predetermined area is an area where a predetermined edge of the document in the document image may exist.
  • the predetermined area is an area in which the lower edge of the document is in the document image, or the predetermined area is an area in which the upper edge of the document is in the document image, and the like.
  • the processed document image is linearly detected.
  • the line detection is implemented by a straight line fitting algorithm or a Hough transform algorithm to obtain a target line and identify the target line as a predetermined edge of the document in the document image.
  • the line of the lower edge of the document is detected in the image of the document. After straight line fitting or Hough transform, there is a straight line below the ID image. The line is identified as the predetermined edge of the document in the document image. The position of the lower edge of the document in the document image is exemplarily shown in Figure 2C.
  • step 206 at least one information area is determined in the document image according to the predetermined edge
  • the relative positional relationship refers to the relative positional relationship between the predetermined edge of the document image and the information area.
  • the certificate is a second-generation ID card
  • the edge of the reservation is the lower edge of the second-generation ID card
  • information The area is the citizenship number area of the second generation ID card
  • step 206 can also be implemented as: determining the area of the predetermined height above the lower edge as the citizenship number area.
  • the citizenship number area is located above the predetermined edge of the document image; for example, the address information area is located at the upper left position of the predetermined edge of the document image.
  • the information area is area cut to obtain at least one character area.
  • the information area includes multiple characters.
  • at least one character area can be obtained by area cutting.
  • a character area is an area that includes a single character. Characters can be Chinese characters, English letters, numbers, or characters in other languages.
  • the area identification method obtaineds the processed document image by performing Sobel level filtering and binarization on the document image; and performing line detection on the predetermined area in the processed document image.
  • the predetermined edge in the document image can be found more quickly.
  • the terminal performs a reduction process on the ID image according to the size of the ID image in advance. That is, prior to step 202, the method further includes step 201.
  • the terminal performs connected domain processing on the predetermined area in the processed document image. That is, after step 202, the method further includes step 203, as shown in FIG. 3A:
  • step 201 the document image is previously subjected to reduction processing in accordance with a predetermined reduction ratio.
  • the terminal performs a reduction process on the document image in accordance with a predetermined reduction ratio according to the size of the document image, and obtains a document image after the reduction process.
  • the reduction processing of the document image can improve the speed of finding a predetermined edge in the document image.
  • step 203 the connected area processing is performed on the predetermined area in the processed document image.
  • the processed document drawing For example, the connected domain processing is performed to remove the larger area and the smaller area composed of the foreground pixels in the binary image, so that the predetermined edge in the document image can be more accurately identified.
  • the image of the certificate processed by the connected domain is as shown in FIG. 3B.
  • the area recognition method provided by the embodiment improves the search speed of the predetermined edge in the document image by performing the reduction processing on the document image in advance according to a predetermined reduction ratio.
  • the accuracy of determining the predetermined edge in the document image is improved, and the accuracy in the subsequent identification information area can be improved.
  • the document has a slight angular rotation in the document image, i.e. the position of the document in the document image is not horizontal, but is at an angle to the horizontal.
  • the terminal performs a slope correction on the document image according to the slope of the predetermined edge. That is, after step 204, the method further includes step 205a and step 205b, as shown in FIG. 4:
  • step 205a an angle between the predetermined edge and the horizontal direction is determined according to the slope of the predetermined edge
  • the terminal calculates an angle between the predetermined edge of the document image and the horizontal direction.
  • the angle is the angle between the document and the horizontal direction.
  • step 205b the document image is rotated at an angle, and the predetermined edge in the rotated document image is parallel to the horizontal direction.
  • the area recognition method provided by the embodiment improves the accuracy of the subsequent identification information area by performing rotation correction on the predetermined edge of the document image so that the documents in the document image are parallel to the horizontal direction.
  • step 208 performs a process of region cutting the information region.
  • it can be implemented as the following steps 208a to 208e, as shown in FIG. 5A:
  • step 208a the information area is binarized to obtain a binarized information area
  • the information area is a citizenship number area.
  • the information area is pre-processed.
  • the pre-processing may include: operations such as denoising, filtering, and extracting edges; and binarizing the pre-processed information region.
  • the first histogram is calculated according to the horizontal direction for the binarized information region, and the first histogram includes: a vertical coordinate of each row of pixel points and an accumulated value of the foreground color pixel points in each row of pixel points. ;
  • the first histogram is vertical
  • the straight direction indicates the vertical coordinate of each row of pixels
  • the horizontal direction indicates the cumulative value of the number of foreground pixels in each row of pixels, as shown in FIG. 5B.
  • step 208c according to the contiguous row set consisting of the rows in which the accumulated value of the foreground color pixel in the first histogram is greater than the first threshold, n rows of text regions are identified, where n is a positive integer;
  • the accumulated value of the foreground color pixel in each row of pixels can be obtained, and the accumulated value of the foreground color pixel in each row of pixels is compared with the first threshold, and the first histogram is A set of consecutive rows consisting of rows of scene pixels having a cumulative value greater than the first threshold is determined to be the row in which the text region is located.
  • the continuous line set means that the line whose accumulated value of the foreground color pixel is larger than the first threshold is a continuous m line, and the set of the consecutive m line pixel points is as shown in FIG. 5C, for the m line pixel in the figure. Point, the accumulated value of the foreground color pixel in the left histogram is greater than the first threshold.
  • the m-line pixel corresponds to the citizenship number line "0421199" in the ID image.
  • the text area may be two or more lines. At this time, each successive line set is recognized as a line of text area, and n consecutive line sets are identified as n lines of text area.
  • the second histogram is calculated according to the vertical direction, and the second histogram includes: the abscissa of each column of pixels and the accumulated value of the foreground pixels in each column of pixels, n ⁇ i ⁇ 1, i is a positive integer;
  • a second histogram is calculated in a vertical direction, the second histogram indicating the abscissa of each column of pixels in the horizontal direction and the foreground pixel in each column of pixels in the vertical direction.
  • the cumulative number of pixels, the foreground pixel is the white pixel in the binarized image, as shown in Figure 5D.
  • n i character regions are identified according to a continuous column set consisting of columns in which the accumulated value of the foreground pixels in the second histogram is greater than the second threshold.
  • an accumulated value of the foreground color pixel points in each column of pixels can be obtained, and the accumulated value of the foreground color pixel points in each column of pixels is compared with a second threshold value, and the foreground color pixel in the second histogram is obtained.
  • a contiguous set of columns consisting of columns whose accumulated value is greater than the second threshold is determined to be the column in which the character region is located.
  • the continuous column set means that the column whose accumulated value of the foreground color pixel is larger than the second threshold is a continuous p column, and the set of the consecutive p column pixel points is as shown in FIG. 5E, and the continuous column set is p, Second A continuous white area formed in the histogram. For the p column pixel points in the graph, the accumulated values of the foreground color pixel points located in the lower side histogram are all greater than the second threshold.
  • the p column of pixels corresponds to the character area "3" in the document image.
  • Each successive set of columns is identified as a character region, and n consecutive sets of columns are identified as n character regions.
  • n character regions In Fig. 5E, 18 character regions can be identified.
  • step 208d and step 208e are executed once for each line of text, for a total of n times.
  • the characters contained in the character region can also be identified by character recognition technology.
  • the text can be a single character of a Chinese character, an English letter, a number, or other language.
  • the area identification method determines the n-line text area in the information area by binarizing the information area and calculating the first histogram according to the horizontal direction in the binarized information area. Then, by calculating the second histogram in the vertical direction for the n-line character regions, and identifying the character regions corresponding to each character, the accuracy of the character regions in the identification information region can be improved.
  • FIG. 6 is a block diagram of an area identifying apparatus according to an exemplary embodiment. As shown in FIG. 6, the area identifying apparatus includes but is not limited to:
  • the identification module 610 is configured to identify a predetermined edge of the document in the document image, the predetermined edge being an edge located in a predetermined direction of the document;
  • the ID image is an image obtained directly from the document, such as an ID card image, a social security card image, and the like.
  • a determining module 620 configured to determine at least one information area in the document image according to the predetermined edge
  • the position of the predetermined edge in the document image is relatively fixed, and the positioning difficulty of the predetermined edge is generally lower than the positioning difficulty of the information area, so the determination module 620 can determine the respective information areas in the document image according to the predetermined edge.
  • the information area refers to the area in the document image that carries the text information, such as: the name information area, the date of birth information area, the gender area, the address information area, the citizenship number information area, the number information area, the information area of the issuing authority, and the effective date. At least the information area, etc. One.
  • the cutting module 630 is configured to perform area cutting on the information area to obtain at least one character area.
  • the information area includes multiple characters.
  • the cutting module 630 can obtain at least one character area by area cutting.
  • a character area is an area that includes a single character. Characters can be Chinese characters, English letters, numbers, or characters in other languages.
  • the area identifying apparatus determines at least one information area in the document image according to the predetermined edge by identifying the predetermined edge of the document in the document image; and performing area cutting on the information area to obtain at least one
  • the character area solves the problem that the identification of certain information areas in the document image obtained by direct shooting is difficult and the positioning of some information areas is inaccurate in the related art; the information area is determined by the predetermined edge in the document image, The information area is cut to accurately locate the information area and accurately identify the character area in the information area.
  • the identification module 610 may include the following sub-modules, as shown in FIG. 7:
  • the filtering sub-module 611 is configured to perform Sobel level filtering and binarization on the ID image to obtain a processed ID image
  • the filtering sub-module 611 performs sobel horizontal filtering on the certificate image, that is, the sobel operator is used to filter in the horizontal direction. Then, the filtered document image is binarized.
  • Binarization refers to comparing the gray value of the pixel in the image of the document with the preset gray threshold, and dividing the pixel in the image into two parts: a pixel group larger than the preset gray threshold and less than the preset gray level.
  • the pixel group of the threshold value presents two different color colors of black and white in the image of the two parts, and obtains the image of the binary image after binarization.
  • the detection sub-module 612 is configured to perform line detection on a predetermined area in the processed document image to obtain a target line, and identify the target line as a predetermined edge of the document.
  • the predetermined area is an area where a predetermined edge of the document in the document image may exist.
  • the predetermined area is an area in which the lower edge of the document is in the document image, or the predetermined area is an area in which the upper edge of the document is in the document image, and the like.
  • the detecting sub-module 612 After obtaining the ID image processed by the filtering sub-module 611, the detecting sub-module 612 performs line detection on the processed document image.
  • the line detection in the detection sub-module 612 uses a straight line fit
  • the algorithm or Hough transform algorithm is implemented to obtain the target line and identify the target line as a predetermined edge of the document in the document image.
  • the area identifying apparatus obtains the processed document image by performing Sobel level filtering and binarization on the document image; and performing line detection on the predetermined area in the processed document image.
  • the apparatus may further include the following modules, as shown in FIG. 8:
  • the reduction module 810 is configured to perform a reduction process on the document image in a predetermined reduction ratio in advance.
  • the reduction module 810 performs a reduction process on the document image in accordance with a predetermined reduction ratio according to the size of the document image, and obtains a document image after the reduction process.
  • the reduction processing of the document image can improve the speed of finding a predetermined edge in the document image.
  • the connectivity module 820 is configured to perform connected domain processing on a predetermined area in the processed document image.
  • the connectivity module 820 After obtaining the ID image processed by the filtering sub-module 611, the connectivity module 820 performs a connected domain processing on the processed ID image to remove a larger area and a smaller area of the foreground image pixel in the binary image. Therefore, the predetermined edge in the document image can be more accurately identified.
  • the determining module 620 is further configured to determine at least one information area according to the predetermined edge and the relative positional relationship, where the relative positional relationship is a relative positional relationship between the predetermined edge and the information area.
  • the certificate is a second generation ID card
  • the predetermined edge is the lower edge of the second generation ID card
  • the information area is the citizen identification number area of the second generation ID card
  • the determining module 620 is configured to be located at the lower edge The area above the predetermined height is determined as the citizenship number area.
  • the area recognition apparatus performs the reduction processing on the document image in accordance with a predetermined reduction ratio in advance, so that the search speed of the predetermined edge in the document image is improved.
  • the document image is made The accuracy of the determination of the predetermined edge is improved, and the accuracy of the subsequent identification information area can be improved.
  • the apparatus may further include the following modules, as shown in FIG. 9:
  • the correction module 910 is configured to perform a slope correction on the document image according to the slope of the predetermined edge.
  • the modification module 910 can include the following submodules:
  • An angle determining sub-module 911 configured to determine an angle between the predetermined edge and the horizontal direction according to a slope of the predetermined edge
  • the terminal calculates the angle between the predetermined edge of the document image and the horizontal direction by the angle determining sub-module 911.
  • the angle is the angle between the document and the horizontal direction.
  • the rotation sub-module 912 is configured to rotate the document image according to an angle, and the predetermined edge in the rotated document image is parallel to the horizontal direction.
  • the terminal rotates the ID image by the rotation sub-module 912 according to the angle calculated by the angle determination sub-module 911.
  • the area identification device provided by the embodiment can correct the accuracy of the subsequent identification information area by performing rotation correction on the predetermined edge of the document image so that the documents in the document image are parallel to the horizontal direction.
  • the cutting module 630 can include the following modules, as shown in FIG.
  • the binarization sub-module 631 is configured to binarize the information area to obtain a binarized information area
  • the information area is a citizenship number area.
  • the binarization sub-module 631 pre-processes the information area.
  • the pre-processing may include: operations such as denoising, filtering, and extracting edges; and binarizing the pre-processed information region.
  • the first calculation sub-module 632 is configured to calculate a first histogram according to a horizontal direction for the binarized information region, where the first histogram comprises: a vertical coordinate of each row of pixels and a foreground color in each row of pixels The accumulated value of the pixel;
  • the first calculation sub-module 632 calculates the first histogram according to the horizontal direction in the information area processed by the binarization sub-module 631, and the first histogram represents the vertical coordinate of each row of pixel points in the vertical direction, at the level
  • the direction represents the cumulative value of the number of foreground pixels in each row of pixels.
  • the row identification sub-module 633 is configured to identify n rows of text regions according to a continuous row set consisting of rows in which the accumulated value of the foreground pixels in the first histogram is greater than the first threshold, where n is a positive integer;
  • the accumulated value of the foreground pixel in each row of pixels can be obtained, and the row identification sub-module 633 compares the accumulated value of the foreground pixel in each row of pixels with the first threshold, and will be the first A continuous line set consisting of rows in which the accumulated value of the foreground pixels in the histogram is larger than the first threshold is determined as the line in which the text area is located.
  • the continuous row set refers to a set in which the accumulated value of the foreground color pixel is larger than the first threshold is a continuous m row, and the continuous m row pixel is composed of a set.
  • Each successive row set is identified as a line of text, and n consecutive rows are identified as n lines of text.
  • the second calculation sub-module 634 is configured to calculate a second histogram according to a vertical direction for the i-th line of text regions, where the second histogram comprises: an abscissa of each column of pixels and a foreground pixel in each column of pixels Cumulative value, n ⁇ i ⁇ 1, i is a positive integer;
  • the second calculation sub-module 634 calculates a second histogram in the vertical direction, the second histogram representing the abscissa of each column of pixels in the horizontal direction, in the vertical
  • the direction represents the cumulative value of the number of foreground pixels in each column of pixels, and the foreground pixel refers to the white pixel in the binarized image.
  • the character recognition sub-module 635 is configured to identify n i character regions according to a continuous column set consisting of columns in which the accumulated value of the foreground color pixel points in the second histogram is greater than the second threshold.
  • an accumulated value of the foreground color pixel points in each column of pixels may be acquired, and the character recognition sub-module 635 compares the accumulated value of the foreground color pixel points in each column of pixels with a second threshold, and the second rectangular In the figure, the cumulative column of the foreground pixel is larger than the second column of the second threshold, and is determined to be the column in which the character region is located.
  • the continuous column set means that the column whose accumulated value of the foreground color pixel is larger than the second threshold is a continuous p column, and the continuous p column pixel group is composed of a set.
  • Each successive set of columns is identified as a character region, and n consecutive sets of columns are identified as n character regions.
  • the area identifying apparatus determines the n-line text area in the information area by binarizing the information area and calculating the first histogram according to the horizontal direction in the binarized information area. Then, by calculating the second histogram in the vertical direction for the n-line character regions, and identifying the character regions corresponding to each character, the accuracy of the character regions in the identification information region can be improved.
  • An exemplary embodiment of the present disclosure provides an area identifying apparatus capable of implementing the area identifying method provided by the present disclosure, the area identifying apparatus comprising: a processor, a memory for storing processor executable instructions;
  • processor is configured to:
  • the predetermined edge being an edge located in a predetermined direction of the document
  • FIG. 11 is a block diagram of an apparatus for an area identification method, according to an exemplary embodiment.
  • device 1100 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a gaming console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
  • apparatus 1100 can include one or more of the following components: processing component 1102, memory 1104, power component 1106, multimedia component 1108, audio component 1110, input/output (I/O) interface 1112, sensor component 1114, and Communication component 1116.
  • Processing component 1102 typically controls the overall operation of device 1100, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations.
  • Processing component 1102 can include one or more processors 1118 to execute instructions to perform all or part of the steps of the above described methods.
  • processing component 1102 can include one or more modules to facilitate interaction between component 1102 and other components.
  • the processing component 1102 can include a multimedia module to facilitate interaction between the multimedia component 1108 and the processing component 1102.
  • Memory 1104 is configured to store various types of data to support operation at device 1100. Examples of such data include instructions for any application or method operating on device 1100, contact data, phone book data, messages, pictures, videos, and the like.
  • the memory 1104 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read only memory
  • EPROM Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Disk Disk or Optical Disk.
  • Power component 1106 provides power to various components of device 1100.
  • Power component 1106 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for device 1100.
  • the multimedia component 1108 includes a screen between the device 1100 and the user that provides an output interface.
  • the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor can sense not only the boundaries of the touch or sliding action, but also the duration and pressure associated with the touch or slide operation.
  • the multimedia component 1108 includes a front camera and/or a rear camera. When the device 1100 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front and rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
  • the audio component 1110 is configured to output and/or input an audio signal.
  • the audio component 1110 includes a microphone (MIC) that is configured to receive an external audio signal when the device 1100 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode.
  • the received audio signal may be further stored in memory 1104 or transmitted via communication component 1116.
  • the audio component 1110 also includes a speaker for outputting an audio signal.
  • the I/O interface 1112 provides an interface between the processing component 1102 and a peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to, a home button, a volume button, a start button, and a lock button.
  • Sensor assembly 1114 includes one or more sensors for providing a status assessment of various aspects to device 1100.
  • the sensor assembly 1114 can detect an open/closed state of the device 1100, the relative positioning of the components, such as a display and a keypad of the device 1100, and the sensor component 1114 can also detect a change in position of a component of the device 1100 or device 1100, the user The presence or absence of contact with device 1100, device 1100 orientation or acceleration/deceleration and temperature change of device 1100.
  • Sensor assembly 1114 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact.
  • Sensor assembly 1114 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 1114 can also include acceleration Degree sensor, gyro sensor, magnetic sensor, pressure sensor or temperature sensor.
  • Communication component 1116 is configured to facilitate wired or wireless communication between device 1100 and other devices.
  • the device 1100 can access a wireless network based on a communication standard, such as Wi-Fi, 2G or 3G, or a combination thereof.
  • communication component 1116 receives broadcast signals or broadcast associated information from an external broadcast management system via a broadcast channel.
  • communication component 1116 also includes a near field communication (NFC) module to facilitate short range communication.
  • NFC near field communication
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IRDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
  • RFID radio frequency identification
  • IRDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • apparatus 1100 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation for performing the above-described region identification method.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A gate array
  • controller microcontroller, microprocessor or other electronic component implementation for performing the above-described region identification method.
  • non-transitory computer readable storage medium comprising instructions, such as a memory 1104 comprising instructions executable by processor 1118 of apparatus 1100 to perform the area identification method described above.
  • the non-transitory computer readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Geometry (AREA)
  • Computer Graphics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Character Input (AREA)
  • Image Analysis (AREA)

Abstract

本公开揭示了一种区域识别方法及装置,属于图像处理领域。所述区域识别方法包括:通过识别证件图像中证件的预定边缘;根据所述预定边缘在所述证件图像中确定出至少一个信息区域;对所述信息区域进行区域切割,得到至少一个字符区域;解决了相关技术中对于直接拍摄得到的证件图像中的某些信息区域的识别难度大和对某些信息区域的定位不准确的问题;达到了通过证件图像中预定边缘确定出信息区域,并对信息区域进行切割,从而对信息区域准确定位和对信息区域中的字符区域进行准确识别的效果。

Description

区域识别方法及装置
本申请基于申请号为201510727934.X、申请日为2015年10月30日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本公开涉及图像处理领域,特别涉及一种区域识别方法及装置。
背景技术
身份证的自动识别技术是一种通过图像处理对身份证上的文字信息进行识别的技术。
相关技术提供了一种身份证的自动识别方法,通过身份证扫描设备按照固定的相对位置对身份证进行扫描,得到身份证的扫描图像;对扫描图像中的n个预定区域进行文字识别,得到姓名信息、性别信息、民族信息、出生日期信息、地址信息和公民身份号码信息中的至少一种。但是对于直接拍摄得到的身份证图像,仍然有较大的识别难度。
发明内容
为了解决相关技术中的问题,本公开提供一种区域识别方法及装置。所述技术方案如下:
根据本公开实施例的第一方面,提供一种区域识别方法,该方法包括:
识别证件图像中证件的预定边缘,预定边缘是位于证件的预定方向上的边缘;
根据预定边缘在证件图像中确定出至少一个信息区域;
对信息区域进行区域切割,得到至少一个字符区域。
在一个可选的实施例中,识别证件图像中证件的预定边缘,包括:
对证件图像进行索贝尔水平滤波和二值化,得到处理后的证件图像;
对处理后的证件图像中的预定区域进行直线检测,得到目标直线,将目标 直线识别为证件的预定边缘。
在一个可选的实施例中,该方法还包括:
预先对证件图像按照预定缩小比例进行缩小处理。
在一个可选的实施例中,该方法还包括:
对处理后的证件图像中的预定区域进行连通域处理。
在一个可选的实施例中,根据预定边缘在证件图像中确定出至少一个信息区域,包括:
根据预定边缘和相对位置关系,确定出至少一个信息区域,相对位置关系是预定边缘与信息区域之间的相对位置关系。
在一个可选的实施例中,证件是第二代身份证,预定边缘是第二代身份证的下边缘,信息区域是第二代身份证的公民身份号码区域;
根据预定边缘和相对位置关系,确定出至少一个信息区域,包括:
将位于下边缘上方预定高度的区域,确定为公民身份号码区域。
在一个可选的实施例中,该方法还包括:
根据预定边缘的斜率,对证件图像进行倾斜度修正。
在一个可选的实施例中,根据预定边缘的斜率,对证件图像进行倾斜度修正,包括:
根据预定边缘的斜率,确定出预定边缘与水平方向的夹角;
对证件图像按照夹角旋转,旋转后的证件图像中的预定边缘与水平方向平行。
在一个可选的实施例中,对信息区域进行区域切割,得到至少一个字符区域,包括:
对信息区域进行二值化,得到二值化后的信息区域;
对二值化后的信息区域按照水平方向计算第一直方图,第一直方图包括:每行像素点的竖坐标和每行像素点中前景色像素点的累加值;
根据第一直方图中前景色像素点的累加值大于第一阈值的行所组成的连续行集合,识别得到n行文字区域,n为正整数;
对于第i行文字区域,按照竖直方向计算第二直方图,第二直方图包括:每列像素点的横坐标和每列像素点中前景色像素点的累加值,n≥i≥1,i为正整数;
根据第二直方图中前景色像素点的累加值大于第二阈值的列所组成的连续 列集合,识别得到ni个字符区域。
根据本公开实施例的第二方面,提供一种区域识别装置,该装置包括:
识别模块,被配置为识别证件图像中证件的预定边缘,预定边缘是位于证件的预定方向上的边缘;
确定模块,被配置为根据预定边缘在证件图像中确定出至少一个信息区域;
切割模块,被配置为对信息区域进行区域切割,得到至少一个字符区域。
在一个可选的实施例中,识别模块,包括:
滤波子模块,被配置为对证件图像进行索贝尔水平滤波和二值化,得到处理后的证件图像;
检测子模块,被配置为对处理后的证件图像中的预定区域进行直线检测,得到目标直线,将目标直线识别为证件的预定边缘。
在一个可选的实施例中,该装置还包括:
缩小模块,被配置为预先对证件图像按照预定缩小比例进行缩小处理。
在一个可选的实施例中,该装置还包括:
连通模块,被配置为对处理后的证件图像中的预定区域进行连通域处理。
在一个可选的实施例中,确定模块,被配置为根据预定边缘和相对位置关系,确定出至少一个信息区域,相对位置关系是预定边缘与信息区域之间的相对位置关系。
在一个可选的实施例中,证件是第二代身份证,预定边缘是第二代身份证的下边缘,信息区域是第二代身份证的公民身份号码区域;
确定模块,被配置为将位于下边缘上方预定高度的区域,确定为公民身份号码区域。
在一个可选的实施例中,该装置还包括:
修正模块,被配置为根据预定边缘的斜率,对证件图像进行倾斜度修正。
在一个可选的实施例中,修正模块,包括:
夹角确定子模块,被配置为根据预定边缘的斜率,确定出预定边缘与水平方向的夹角;
旋转子模块,被配置为对证件图像按照夹角旋转,旋转后的证件图像中的预定边缘与水平方向平行。
在一个可选的实施例中,切割模块,包括:
二值化子模块,被配置为对信息区域进行二值化,得到二值化后的信息区域;
第一计算子模块,被配置为对二值化后的信息区域按照水平方向计算第一直方图,第一直方图包括:每行像素点的竖坐标和每行像素点中前景色像素点的累加值;
行识别子模块,被配置为根据第一直方图中前景色像素点的累加值大于第一阈值的行所组成的连续行集合,识别得到n行文字区域,n为正整数;
第二计算子模块,被配置为对于第i行文字区域,按照竖直方向计算第二直方图,第二直方图包括:每列像素点的横坐标和每列像素点中前景色像素点的累加值,n≥i≥1,i为正整数;
字符识别子模块,被配置为根据第二直方图中前景色像素点的累加值大于第二阈值的列所组成的连续列集合,识别得到ni个字符区域。
根据本公开实施例的第三方面,提供一种区域识别装置,该装置包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,处理器被配置为:
识别证件图像中证件的预定边缘,预定边缘是位于证件的预定方向上的边缘;
根据预定边缘在证件图像中确定出至少一个信息区域;
对信息区域进行区域切割,得到至少一个字符区域。
本公开的实施例提供的技术方案可以包括以下有益效果:
通过识别证件图像中证件的预定边缘;根据预定边缘在证件图像中确定出至少一个信息区域;对信息区域进行区域切割,得到至少一个字符区域;解决了相关技术中对于直接拍摄得到的证件图像中的某些信息区域的识别难度大和对某些信息区域的定位不准确的问题;达到了通过证件图像中预定边缘确定出信息区域,并对信息区域进行切割,从而对信息区域准确定位和对信息区域中的字符区域进行准确识别的效果。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并于说明书一起用于解释本公开的原理。
图1是根据一示例性实施例示出的一种区域识别方法的流程图;
图2A是根据另一示例性实施例示出的一种区域识别方法的流程图;
图2B是根据一示例性实施例示出的一种证件图像二值化的示意图;
图2C是根据一示例性实施例示出的一种证件图像中直线检测的示意图;
图3A是根据另一示例性实施例示出的一种区域识别方法的流程图;
图3B是根据一示例性实施例示出的一种连通域处理后证件图像的示意图;
图4是根据另一示例性实施例示出的一种区域识别方法的流程图;
图5A是根据另一示例性实施例示出的一种区域识别方法的流程图;
图5B是根据一示例性实施例示出的一种按照水平方向计算第一直方图的示意图;
图5C是根据一示例性实施例示出的一种连续行集合的示意图;
图5D是根据一示例性实施例示出的一种按照竖直方向计算第二直方图的示意图;
图5E是根据一示例性实施例示出的一种连续列集合的示意图;
图6是根据一示例性实施例示出的一种区域识别装置的框图;
图7是根据另一示例性实施例示出的一种区域识别装置的框图;
图8是根据另一示例性实施例示出的一种区域识别装置的框图;
图9是根据另一示例性实施例示出的一种区域识别装置的框图;
图10是根据另一示例性实施例示出的一种区域识别装置的框图;
图11是根据一示例性实施例示出的一种区域识别装置的框图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一 致的装置和方法的例子。
图1是根据一示例性实施例示出的一种区域识别方法的流程图。如图1所示,该区域识别方法包括如下步骤。
在步骤102中,识别证件图像中证件的预定边缘,预定边缘是位于证件的预定方向上的边缘;
证件图像是对证件直接拍摄得到的图像,比如:身份证图像、社会保障卡图像等。
在步骤104中,根据预定边缘在证件图像中确定出至少一个信息区域;
证件图像中的预定边缘的位置是相对固定的,而且预定边缘的定位难度通常是低于信息区域的定位难度的,所以根据预定边缘能够在证件图像中确定出各个信息区域。
信息区域是指证件图像中携带有文字信息的区域,比如:姓名信息区域、出生日期信息区域、性别区域、地址信息区域、公民身份号码信息区域、编号信息区域、颁发证件机关信息区域、有效日期信息区域等等信息区域中的至少一种。
在步骤106中,对信息区域进行区域切割,得到至少一个字符区域。
信息区域中包括有多个字符。对于一个信息区域,通过区域切割能够得到至少一个字符区域。字符区域是包括单个字符的区域。字符可以是汉字、英文字母、数字或者其它语种的字符。
综上所述,本公开实施例中提供的区域识别方法,通过识别证件图像中证件的预定边缘;根据预定边缘在证件图像中确定出至少一个信息区域;对信息区域进行区域切割,得到至少一个字符区域;解决了相关技术中对于直接拍摄得到的证件图像中的某些信息区域的识别难度大和对某些信息区域的定位不准确的问题;达到了通过证件图像中预定边缘确定出信息区域,并对信息区域进行切割,从而对信息区域准确定位和对信息区域中的字符区域进行准确识别的效果。
图2A是根据另一示例性实施例示出的一种区域识别方法的流程图。如图2A所示,该区域识别方法包括以下几个步骤。
在步骤202中,对证件图像进行索贝尔水平滤波和二值化,得到处理后的证件图像;
可选地,在拍摄证件图像时,拍摄界面中设置有用于引导拍摄的矩形区域,用户将矩形区域对准证件时,拍摄得到证件图像。
首先对证件图像进行sobel水平滤波,也即采用sobel算子沿水平方向进行滤波。然后,对滤波后的证件图像进行二值化。二值化是指将证件图像中的像素点的灰度值与预设灰度阈值比较,将证件图像中的像素点分成两部分:大于预设灰度阈值的像素群和小于预设灰度阈值的像素群,将两部分像素群在证件图像中分别呈现出黑和白两种不同的颜色,得到二值化后的证件图像,如图2B所示。其中,位于前景的一种颜色的像素点称之为前景色像素点,也即图2B的白色像素点;位于背景的一种颜色的像素点称之为背景色像素点,也即图2B的黑色像素点。
在步骤204中,对处理后的证件图像中的预定区域进行直线检测,得到目标直线,将目标直线识别为证件的预定边缘;
该预定区域是证件图像中证件的预定边缘可能存在的区域。比如:该预定区域是证件的下边缘在证件图像中的区域,或者,该预定区域是证件的上边缘在证件图像中的区域等等。
在获取到处理后的证件图像后,对处理后的证件图像进行直线检测。可选地,该直线检测采用直线拟合算法或Hough变换算法实现,从而得到目标直线,并将该目标直线识别为证件在证件图像中的预定边缘。
比如:针对索贝尔水平滤波和二值化处理后的证件图像,对证件的下边缘在证件图像中的区域进行直线检测,通过直线拟合或Hough变换后,证件图像的下方存在一条直线,将该直线识别为证件在证件图像中的预定边缘。证件的下边缘在证件图像中的位置,示例性地如图2C所示。
在步骤206中,根据预定边缘在证件图像中确定出至少一个信息区域;
在证件图像的类型已知时,证件图像的预定边缘与证件上其它信息区域之间存在固定的相对位置关系,根据证件图像的预定边缘和该相对位置关系能够确定出至少一个信息区域。
相对位置关系是指证件图像的预定边缘与信息区域之间的相对位置关系。
可选的,证件是第二代身份证,预定边缘是第二代身份证的下边缘,信息 区域是第二代身份证的公民身份号码区域;则步骤206还可以实现为:将位于下边缘上方预定高度的区域,确定为公民身份号码区域。
比如,以第二代身份证为例,公民身份号码区域位于证件图像的预定边缘的上方;又比如,地址信息区域位于证件图像的预定边缘的左上方位置。通过该相对位置关系,能够基于证件图像的预定边缘确定出至少一个信息区域。
在步骤208中,对信息区域进行区域切割,得到至少一个字符区域。
信息区域中包括有多个字符。对于一个信息区域,通过区域切割能够得到至少一个字符区域。字符区域是包括单个字符的区域。字符可以是汉字、英文字母、数字或者其它语种的字符。
综上所述,本公开实施例中提供的区域识别方法,通过对证件图像进行索贝尔水平滤波和二值化,得到处理后的证件图像;对处理后的证件图像中的预定区域进行直线检测,得到目标直线,将目标直线识别为证件的预定边缘;根据预定边缘在证件图像中确定出至少一个信息区域;对信息区域进行区域切割,得到至少一个字符区域;解决了相关技术中对于直接拍摄得到的证件图像中的某些信息区域的识别难度大和对某些信息区域的定位不准确的问题;达到了通过证件图像中预定边缘确定出信息区域,并对信息区域进行切割,从而对信息区域准确定位和对信息区域中的字符区域进行准确识别的效果。
在基于图2A实施例提供的可选实施例中,为了可以更加快速的找到证件图像中的预定边缘。可选的,终端预先根据证件图像的大小对证件图像进行缩小处理。也即,在步骤202之前,该方法还包括步骤201。为了在对处理后的证件图像中的预定区域进行直线检测时,可以得到更加准确的直线。可选的,终端对处理后的证件图像中的预定区域进行连通域处理。也即,在步骤202之后,该方法还包括步骤203,如图3A所示:
在步骤201中,预先对证件图像按照预定缩小比例进行缩小处理。
终端预先根据证件图像的大小按照预定缩小比例对证件图像进行缩小处理,得到缩小处理后的证件图像。对证件图像的缩小处理可以使寻找证件图像中的预定边缘的速度得到提高。
在步骤203中,对处理后的证件图像中的预定区域进行连通域处理。
在获取到索贝尔水平滤波和二值化处理后的证件图像,对处理后的证件图 像进行连通域处理,去除二值化的证件图像中前景色像素点组成的面积较大区域和面积较小区域,从而可以更加准确的识别出证件图像中的预定边缘。经过连通域处理后的证件图像,如图3B所示。
综上所述,本实施例提供的区域识别方法,通过预先对证件图像按照预定缩小比例进行缩小处理,使得对证件图像中预定边缘的寻找速度得到提高。
通过对处理后的证件图像中的预定区域进行连通域处理,使得对证件图像中预定边缘的确定的准确度得到提高,能够提高后续识别信息区域时的准确度。
在基于图2A实施例提供的可选实施例中,证件在证件图像中存在微小角度的旋转,也即证件在证件图像中的位置并不是水平的,而是与水平方向存在夹角的。可选地,终端根据预定边缘的斜率对证件图像进行倾斜度修正。也即,在步骤204之后,该方法还包括步骤205a和步骤205b,如图4所示:
在步骤205a中,根据预定边缘的斜率,确定出预定边缘与水平方向的夹角;
终端计算出证件图像的预定边缘与水平方向的夹角。该夹角即是证件与水平方向的夹角。
在步骤205b中,对证件图像按照夹角旋转,旋转后的证件图像中的预定边缘与水平方向平行。
综上所述,本实施例提供的区域识别方法,通过对证件图像的预定边缘进行旋转校正,使得证件图像中的证件与水平方向平行,能够提高后续识别信息区域时的准确度。
在基于图2A实施例提供的可选实施例中,步骤208对信息区域进行区域切割的过程。可替代实现为如下步骤208a至步骤208e,如图5A所示:
在步骤208a中,对信息区域进行二值化,得到二值化后的信息区域;
以信息区域是公民身份号码区域为例,可选地,先对信息区域进行预处理。其中,预处理可以包括:去噪、滤波、提取边缘等操作;将预处理后的信息区域进行二值化。
在步骤208b中,对二值化后的信息区域按照水平方向计算第一直方图,第一直方图包括:每行像素点的竖坐标和每行像素点中前景色像素点的累加值;
将二值化后的信息区域按照水平方向计算第一直方图,该第一直方图在竖 直方向表示每行像素点的竖坐标,在水平方向表示每行像素点中前景色像素点的个数累加值,如图5B所示。
在步骤208c中,根据第一直方图中前景色像素点的累加值大于第一阈值的行所组成的连续行集合,识别得到n行文字区域,n为正整数;
根据第一直方图可以获取到每一行像素点中前景色像素点的累加值,将每一行像素点中前景色像素点的累加值与第一阈值进行比较,将第一直方图中前景色像素点的累加值大于第一阈值的行所组成的连续行集合,确定为文字区域所在的行。
连续行集合是指:前景色像素点的累加值大于第一阈值的行是连续的m行,该连续的m行像素点所组成的集合,如图5C所示,对于图中的m行像素点,在位于左侧直方图中的前景色像素点的累加值均大于第一阈值。而该m行像素点在证件图像中对应公民身份号码行“0421199”。
当然,若该信息区域是地址信息区域或者其他信息区域,文字区域可能为两行或者两行以上。此时,每个连续行集合识别为一行文字区域,n个连续行集合识别为n行文字区域。
在步骤208d中,对于第i行文字区域,按照竖直方向计算第二直方图,第二直方图包括:每列像素点的横坐标和每列像素点中前景色像素点的累加值,n≥i≥1,i为正整数;
对于识别出的公民身份号码行,按照竖直方向计算第二直方图,该第二直方图在水平方向表示每列像素点的横坐标,在竖直方向表示每列像素点中前景色像素点的个数累加值,前景色像素点是指二值化后的图像中的白色像素点,如图5D所示。
在步骤208e中,根据第二直方图中前景色像素点的累加值大于第二阈值的列所组成的连续列集合,识别得到ni个字符区域。
根据第二直方图可以获取到每一列像素点中前景色像素点的累加值,将每一列像素点中前景色像素点的累加值与第二阈值进行比较,将第二直方图中前景色像素点的累加值大于第二阈值的列所组成的连续列集合,确定为字符区域所在的列。
连续列集合是指:前景色像素点的累加值大于第二阈值的列是连续的p列,该连续的p列像素点所组成的集合,如图5E所示,连续列集合为p,也即第二 直方图中形成的连续白色区域。对于图中的p列像素点,在位于下侧直方图中的前景色像素点的累加值均大于第二阈值。而该p列像素点在证件图像中对应字符区域“3”。
每个连续列集合识别为一个字符区域,n个连续列集合识别为n个字符区域。在图5E中,能够识别出18个字符区域。
若文字区域有n行,则步骤208d和步骤208e会针对每一行文字区域执行一次,共执行n次。
对于识别出的每个字符区域,还可以通过字符识别技术,识别出该字符区域中包含的文字。文字可以是汉字、英文字母、数字或其它语种的单个字符。
综上所述,本实施例提供的区域识别方法,通过对信息区域二值化,并将二值化后的信息区域按照水平方向计算第一直方图,确定信息区域中n行文字区域,再通过分别对n行文字区域按照竖直方向计算第二直方图,识别出每个文字对应的字符区域,能够提高识别信息区域中字符区域的准确度。
下述为本公开装置实施例,可以用于执行本公开方法实施例。对于本公开装置实施例中未披露的细节,请参照本公开方法实施例。
图6是根据一示例性实施例示出的一种区域识别装置的框图,如图6所示,该区域识别装置包括但不限于:
识别模块610,被配置为识别证件图像中证件的预定边缘,预定边缘是位于证件的预定方向上的边缘;
证件图像是对证件直接拍摄得到的图像,比如:身份证图像、社会保障卡图像等。
确定模块620,被配置为根据预定边缘在证件图像中确定出至少一个信息区域;
证件图像中的预定边缘的位置是相对固定的,而且预定边缘的定位难度通常是低于信息区域的定位难度的,所以确定模块620根据预定边缘能够在证件图像中确定出各个信息区域。
信息区域是指证件图像中携带有文字信息的区域,比如:姓名信息区域、出生日期信息区域、性别区域、地址信息区域、公民身份号码信息区域、编号信息区域、颁发证件机关信息区域、有效日期信息区域等等信息区域中的至少 一种。
切割模块630,被配置为对信息区域进行区域切割,得到至少一个字符区域。
信息区域中包括有多个字符。对于一个信息区域,切割模块630通过区域切割能够得到至少一个字符区域。字符区域是包括单个字符的区域。字符可以是汉字、英文字母、数字或者其它语种的字符。
综上所述,本公开实施例中提供的区域识别装置,通过识别证件图像中证件的预定边缘;根据预定边缘在证件图像中确定出至少一个信息区域;对信息区域进行区域切割,得到至少一个字符区域;解决了相关技术中对于直接拍摄得到的证件图像中的某些信息区域的识别难度大和对某些信息区域的定位不准确的问题;达到了通过证件图像中预定边缘确定出信息区域,并对信息区域进行切割,从而对信息区域准确定位和对信息区域中的字符区域进行准确识别的效果。
在基于图6实施例提供的可选实施例中,识别模块610可以包括如下几个子模块,如图7所示:
滤波子模块611,被配置为对证件图像进行索贝尔水平滤波和二值化,得到处理后的证件图像;
首先滤波子模块611对证件图像进行sobel水平滤波,也即采用sobel算子沿水平方向进行滤波。然后,对滤波后的证件图像进行二值化。
二值化是指将证件图像中的像素点的灰度值与预设灰度阈值比较,将证件图像中的像素点分成两部分:大于预设灰度阈值的像素群和小于预设灰度阈值的像素群,将两部分像素群在证件图像中分别呈现出黑和白两种不同的颜色,得到二值化后的证件图像。
检测子模块612,被配置为对处理后的证件图像中的预定区域进行直线检测,得到目标直线,将目标直线识别为证件的预定边缘。
该预定区域是证件图像中证件的预定边缘可能存在的区域。比如:该预定区域是证件的下边缘在证件图像中的区域,或者,该预定区域是证件的上边缘在证件图像中的区域等等。
在获取滤波子模块611处理后的证件图像后,检测子模块612对处理后的证件图像进行直线检测。可选地,检测子模块612中的直线检测采用直线拟合 算法或Hough变换算法实现,从而得到目标直线,并将该目标直线识别为证件在证件图像中的预定边缘。
综上所述,本公开实施例中提供的区域识别装置,通过对证件图像进行索贝尔水平滤波和二值化,得到处理后的证件图像;对处理后的证件图像中的预定区域进行直线检测,得到目标直线,将目标直线识别为证件的预定边缘;根据预定边缘在证件图像中确定出至少一个信息区域;对信息区域进行区域切割,得到至少一个字符区域;解决了相关技术中对于直接拍摄得到的证件图像中的某些信息区域的识别难度大和对某些信息区域的定位不准确的问题;达到了通过证件图像中预定边缘确定出信息区域,并对信息区域进行切割,从而对信息区域准确定位和对信息区域中的字符区域进行准确识别的效果。
在基于图7实施例提供的可选实施例中,该装置还可以包括如下模块,如图8所示:
缩小模块810,被配置为预先对证件图像按照预定缩小比例进行缩小处理。
缩小模块810预先根据证件图像的大小按照预定缩小比例对证件图像进行缩小处理,得到缩小处理后的证件图像。对证件图像的缩小处理可以使寻找证件图像中的预定边缘的速度得到提高。
连通模块820,被配置为对处理后的证件图像中的预定区域进行连通域处理。
在获取到滤波子模块611处理后的证件图像,连通模块820对处理后的证件图像进行连通域处理,去除二值化的证件图像中前景色像素点组成的面积较大区域和面积较小区域,从而可以更加准确的识别出证件图像中的预定边缘。
其中,确定模块620,还被配置为根据预定边缘和相对位置关系,确定出至少一个信息区域,相对位置关系是预定边缘与信息区域之间的相对位置关系。
可选的,证件是第二代身份证,预定边缘是第二代身份证的下边缘,信息区域是第二代身份证的公民身份号码区域;则确定模块620,被配置为将位于下边缘上方预定高度的区域,确定为公民身份号码区域。
综上所述,本实施例提供的区域识别装置,通过预先对证件图像按照预定缩小比例进行缩小处理,使得对证件图像中预定边缘的寻找速度得到提高。
通过对处理后的证件图像中的预定区域进行连通域处理,使得对证件图像 中预定边缘的确定的准确度得到提高,能够提高后续识别信息区域时的准确度。
在基于图7实施例提供的可选实施例中,该装置还可以包括如下模块,如图9所示:
修正模块910,被配置为根据预定边缘的斜率,对证件图像进行倾斜度修正。
可选的,该修正模块910可以包括如下子模块:
夹角确定子模块911,被配置为根据预定边缘的斜率,确定出预定边缘与水平方向的夹角;
终端通过夹角确定子模块911计算出证件图像的预定边缘与水平方向的夹角。该夹角即是证件与水平方向的夹角。
旋转子模块912,被配置为对证件图像按照夹角旋转,旋转后的证件图像中的预定边缘与水平方向平行。
终端通过旋转子模块912将证件图像按照夹角确定子模块911计算出的夹角进行旋转。
综上所述,本实施例提供的区域识别装置,通过对证件图像的预定边缘进行旋转校正,使得证件图像中的证件与水平方向平行,能够提高后续识别信息区域时的准确度。
在基于图7实施例提供的可选实施例中,切割模块630可以包括如下模块,如图10所示:
二值化子模块631,被配置为对信息区域进行二值化,得到二值化后的信息区域;
以信息区域是公民身份号码区域为例,可选地,二值化子模块631先对信息区域进行预处理。其中,预处理可以包括:去噪、滤波、提取边缘等操作;将预处理后的信息区域进行二值化。
第一计算子模块632,被配置为对二值化后的信息区域按照水平方向计算第一直方图,第一直方图包括:每行像素点的竖坐标和每行像素点中前景色像素点的累加值;
第一计算子模块632将二值化子模块631处理后的信息区域按照水平方向计算第一直方图,该第一直方图在竖直方向表示每行像素点的竖坐标,在水平 方向表示每行像素点中前景色像素点的个数累加值。
行识别子模块633,被配置为根据第一直方图中前景色像素点的累加值大于第一阈值的行所组成的连续行集合,识别得到n行文字区域,n为正整数;
根据第一直方图可以获取到每一行像素点中前景色像素点的累加值,行识别子模块633将每一行像素点中前景色像素点的累加值与第一阈值进行比较,将第一直方图中前景色像素点的累加值大于第一阈值的行所组成的连续行集合,确定为文字区域所在的行。
连续行集合是指:前景色像素点的累加值大于第一阈值的行是连续的m行,该连续的m行像素点所组成的集合。
每个连续行集合识别为一行文字区域,n个连续行集合识别为n行文字区域。
第二计算子模块634,被配置为对于第i行文字区域,按照竖直方向计算第二直方图,第二直方图包括:每列像素点的横坐标和每列像素点中前景色像素点的累加值,n≥i≥1,i为正整数;
对于行识别子模块633识别出的公民身份号码行,第二计算子模块634按照竖直方向计算第二直方图,该第二直方图在水平方向表示每列像素点的横坐标,在竖直方向表示每列像素点中前景色像素点的个数累加值,前景色像素点是指二值化后的图像中的白色像素点。
字符识别子模块635,被配置为根据第二直方图中前景色像素点的累加值大于第二阈值的列所组成的连续列集合,识别得到ni个字符区域。
根据第二直方图可以获取到每一列像素点中前景色像素点的累加值,字符识别子模块635将每一列像素点中前景色像素点的累加值与第二阈值进行比较,将第二直方图中前景色像素点的累加值大于第二阈值的列所组成的连续列集合,确定为字符区域所在的列。
连续列集合是指:前景色像素点的累加值大于第二阈值的列是连续的p列,该连续的p列像素点所组成的集合。
每个连续列集合识别为一个字符区域,n个连续列集合识别为n个字符区域。
综上所述,本实施例提供的区域识别装置,通过对信息区域二值化,并将二值化后的信息区域按照水平方向计算第一直方图,确定信息区域中n行文字区域,再通过分别对n行文字区域按照竖直方向计算第二直方图,识别出每个文字对应的字符区域,能够提高识别信息区域中字符区域的准确度。
本公开一示例性实施例提供了一种区域识别装置,能够实现本公开提供的区域识别方法,该区域识别装置包括:处理器、用于存储处理器可执行指令的存储器;
其中,处理器被配置为:
识别证件图像中证件的预定边缘,预定边缘是位于证件的预定方向上的边缘;
根据预定边缘在证件图像中确定出至少一个信息区域;
对信息区域进行区域切割,得到至少一个字符区域。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
图11是根据一示例性实施例示出的一种用于区域识别方法的装置的框图。例如,装置1100可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。
参照图11,装置1100可以包括以下一个或多个组件:处理组件1102,存储器1104,电源组件1106,多媒体组件1108,音频组件1110,输入/输出(I/O)接口1112,传感器组件1114,以及通信组件1116。
处理组件1102通常控制装置1100的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件1102可以包括一个或多个处理器1118来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件1102可以包括一个或多个模块,便于处理组件1102和其他组件之间的交互。例如,处理组件1102可以包括多媒体模块,以方便多媒体组件1108和处理组件1102之间的交互。
存储器1104被配置为存储各种类型的数据以支持在装置1100的操作。这些数据的示例包括用于在装置1100上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器1104可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器 (EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件1106为装置1100的各种组件提供电力。电源组件1106可以包括电源管理系统,一个或多个电源,及其他与为装置1100生成、管理和分配电力相关联的组件。
多媒体组件1108包括在装置1100和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件1108包括一个前置摄像头和/或后置摄像头。当装置1100处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件1110被配置为输出和/或输入音频信号。例如,音频组件1110包括一个麦克风(MIC),当装置1100处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器1104或经由通信组件1116发送。在一些实施例中,音频组件1110还包括一个扬声器,用于输出音频信号。
I/O接口1112为处理组件1102和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件1114包括一个或多个传感器,用于为装置1100提供各个方面的状态评估。例如,传感器组件1114可以检测到装置1100的打开/关闭状态,组件的相对定位,例如组件为装置1100的显示器和小键盘,传感器组件1114还可以检测装置1100或装置1100一个组件的位置改变,用户与装置1100接触的存在或不存在,装置1100方位或加速/减速和装置1100的温度变化。传感器组件1114可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件1114还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件1114还可以包括加速 度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件1116被配置为便于装置1100和其他设备之间有线或无线方式的通信。装置1100可以接入基于通信标准的无线网络,如Wi-Fi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件1116经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,通信组件1116还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IRDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,装置1100可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述区域识别方法。
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器1104,上述指令可由装置1100的处理器1118执行以完成上述区域识别方法。例如,非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。

Claims (19)

  1. 一种区域识别方法,其特征在于,所述方法包括:
    识别证件图像中证件的预定边缘,所述预定边缘是位于所述证件的预定方向上的边缘;
    根据所述预定边缘在所述证件图像中确定出至少一个信息区域;
    对所述信息区域进行区域切割,得到至少一个字符区域。
  2. 根据权利要求1所述的方法,其特征在于,所述识别证件图像中证件的预定边缘,包括:
    对所述证件图像进行索贝尔水平滤波和二值化,得到处理后的所述证件图像;
    对所述处理后的所述证件图像中的预定区域进行直线检测,得到目标直线,将所述目标直线识别为所述证件的所述预定边缘。
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:
    预先对所述证件图像按照预定缩小比例进行缩小处理。
  4. 根据权利要求2所述的方法,其特征在于,所述方法还包括:
    对所述处理后的所述证件图像中的预定区域进行连通域处理。
  5. 根据权利要求1至4任一所述的方法,其特征在于,所述根据所述预定边缘在所述证件图像中确定出至少一个信息区域,包括:
    根据所述预定边缘和相对位置关系,确定出至少一个信息区域,所述相对位置关系是所述预定边缘与所述信息区域之间的相对位置关系。
  6. 根据权利要求5所述的方法,其特征在于,所述证件是第二代身份证,所述预定边缘是所述第二代身份证的下边缘,所述信息区域是所述第二代身份证的公民身份号码区域;
    所述根据所述预定边缘和相对位置关系,确定出至少一个信息区域,包括:
    将位于所述下边缘上方预定高度的区域,确定为所述公民身份号码区域。
  7. 根据权利要求1至4任一所述的方法,其特征在于,所述方法还包括:
    根据所述预定边缘的斜率,对所述证件图像进行倾斜度修正。
  8. 根据权利要求7所述的方法,其特征在于,所述根据所述预定边缘的斜率,对所述证件图像进行倾斜度修正,包括:
    根据所述预定边缘的斜率,确定出所述预定边缘与水平方向的夹角;
    对所述证件图像按照所述夹角旋转,旋转后的所述证件图像中的所述预定边缘与所述水平方向平行。
  9. 根据权利要求1至4任一所述的方法,其特征在于,所述对所述信息区域进行区域切割,得到至少一个字符区域,包括:
    对所述信息区域进行二值化,得到二值化后的信息区域;
    对所述二值化后的信息区域按照水平方向计算第一直方图,所述第一直方图包括:每行像素点的竖坐标和所述每行像素点中前景色像素点的累加值;
    根据所述第一直方图中前景色像素点的累加值大于第一阈值的行所组成的连续行集合,识别得到n行文字区域,n为正整数;
    对于第i行文字区域,按照竖直方向计算第二直方图,所述第二直方图包括:每列像素点的横坐标和所述每列像素点中前景色像素点的累加值,n≥i≥1,i为正整数;
    根据所述第二直方图中前景色像素点的累加值大于第二阈值的列所组成的连续列集合,识别得到ni个字符区域。
  10. 一种区域识别装置,其特征在于,所述装置包括:
    识别模块,被配置为识别证件图像中证件的预定边缘,所述预定边缘是位于所述证件的预定方向上的边缘;
    确定模块,被配置为根据所述预定边缘在所述证件图像中确定出至少一个信息区域;
    切割模块,被配置为对所述信息区域进行区域切割,得到至少一个字符区 域。
  11. 根据权利要求10所述的装置,其特征在于,所述识别模块,包括:
    滤波子模块,被配置为对所述证件图像进行索贝尔水平滤波和二值化,得到处理后的所述证件图像;
    检测子模块,被配置为对所述处理后的所述证件图像中的预定区域进行直线检测,得到目标直线,将所述目标直线识别为所述证件的所述预定边缘。
  12. 根据权利要求11所述的装置,其特征在于,所述装置还包括:
    缩小模块,被配置为预先对所述证件图像按照预定缩小比例进行缩小处理。
  13. 根据权利要求11所述的装置,其特征在于,所述装置还包括:
    连通模块,被配置为对所述处理后的所述证件图像中的预定区域进行连通域处理。
  14. 根据权利要求10至13任一所述的装置,其特征在于,
    所述确定模块,被配置为根据所述预定边缘和相对位置关系,确定出至少一个信息区域,所述相对位置关系是所述预定边缘与所述信息区域之间的相对位置关系。
  15. 根据权利要求14所述的装置,其特征在于,所述证件是第二代身份证,所述预定边缘是所述第二代身份证的下边缘,所述信息区域是所述第二代身份证的公民身份号码区域;
    所述确定模块,被配置为将位于所述下边缘上方预定高度的区域,确定为所述公民身份号码区域。
  16. 根据权利要求10至13任一所述的装置,其特征在于,所述装置还包括:
    修正模块,被配置为根据所述预定边缘的斜率,对所述证件图像进行倾斜度修正。
  17. 根据权利要求16所述的装置,其特征在于,所述修正模块,包括:
    夹角确定子模块,被配置为根据所述预定边缘的斜率,确定出所述预定边缘与水平方向的夹角;
    旋转子模块,被配置为对所述证件图像按照所述夹角旋转,旋转后的所述证件图像中的所述预定边缘与所述水平方向平行。
  18. 根据权利要求10至13任一所述的装置,其特征在于,所述切割模块,包括:
    二值化子模块,被配置为对所述信息区域进行二值化,得到二值化后的信息区域;
    第一计算子模块,被配置为对所述二值化后的信息区域按照水平方向计算第一直方图,所述第一直方图包括:每行像素点的竖坐标和所述每行像素点中前景色像素点的累加值;
    行识别子模块,被配置为根据所述第一直方图中前景色像素点的累加值大于第一阈值的行所组成的连续行集合,识别得到n行文字区域,n为正整数;
    第二计算子模块,被配置为对于第i行文字区域,按照竖直方向计算第二直方图,所述第二直方图包括:每列像素点的横坐标和所述每列像素点中前景色像素点的累加值,n≥i≥1,i为正整数;
    字符识别子模块,被配置为根据所述第二直方图中前景色像素点的累加值大于第二阈值的列所组成的连续列集合,识别得到ni个字符区域。
  19. 一种区域识别装置,其特征在于,所述装置包括:
    处理器;
    用于存储所述处理器可执行指令的存储器;
    其中,所述处理器被配置为:
    识别证件图像中证件的预定边缘,所述预定边缘是位于所述证件的预定方向上的边缘;
    根据所述预定边缘在所述证件图像中确定出至少一个信息区域;
    对所述信息区域进行区域切割,得到至少一个字符区域。
PCT/CN2015/099264 2015-10-30 2015-12-28 区域识别方法及装置 Ceased WO2017071058A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
RU2016110142A RU2641449C2 (ru) 2015-10-30 2015-12-28 Способ и устройство для идентификации области
MX2016003578A MX361846B (es) 2015-10-30 2015-12-28 Método y aparato para identificación de área.
KR1020167005380A KR101782633B1 (ko) 2015-10-30 2015-12-28 영역 인식 방법 및 장치
JP2017547042A JP6400226B2 (ja) 2015-10-30 2015-12-28 領域認識方法及び装置

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510727934.XA CN105528600A (zh) 2015-10-30 2015-10-30 区域识别方法及装置
CN201510727934.X 2015-10-30

Publications (1)

Publication Number Publication Date
WO2017071058A1 true WO2017071058A1 (zh) 2017-05-04

Family

ID=55770814

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/099264 Ceased WO2017071058A1 (zh) 2015-10-30 2015-12-28 区域识别方法及装置

Country Status (8)

Country Link
US (1) US20170124412A1 (zh)
EP (1) EP3163505A1 (zh)
JP (1) JP6400226B2 (zh)
KR (1) KR101782633B1 (zh)
CN (1) CN105528600A (zh)
MX (1) MX361846B (zh)
RU (1) RU2641449C2 (zh)
WO (1) WO2017071058A1 (zh)

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105550633B (zh) * 2015-10-30 2018-12-11 小米科技有限责任公司 区域识别方法及装置
CN106446898A (zh) * 2016-09-14 2017-02-22 宇龙计算机通信科技(深圳)有限公司 一种图像中文字信息的提取方法及装置
CN106778744A (zh) * 2016-12-17 2017-05-31 北京小米移动软件有限公司 一种识别信息卡的信息的方法和装置
CN106778748A (zh) * 2016-12-30 2017-05-31 江西憶源多媒体科技有限公司 基于人工神经网络的身份证快速识别方法及其装置
JP6810892B2 (ja) * 2017-06-05 2021-01-13 京セラドキュメントソリューションズ株式会社 画像処理装置
CN107918935B (zh) * 2017-12-05 2022-03-08 深圳市北电仪表有限公司 嵌入式系统的图像匹配切割装置及切割方法
CN108838099A (zh) * 2018-03-28 2018-11-20 广州大学 基于机器视觉的别针徽章瑕疵检测系统及方法
CN108647680B (zh) * 2018-04-28 2021-11-12 北京盒子鱼教育科技有限公司 图像定位框检测方法和装置
CN110569835B (zh) * 2018-06-06 2024-03-05 北京搜狗科技发展有限公司 一种图像识别方法、装置和电子设备
CN109164932B (zh) * 2018-08-02 2021-07-23 深圳市德明利技术股份有限公司 一种触控识别方法及触控装置
CN109325480B (zh) * 2018-09-03 2024-07-23 安徽华泰高科信息技术有限责任公司 身份信息的录入方法及终端设备
CN111325063B (zh) * 2018-12-14 2024-01-05 航天信息股份有限公司 识别虚拟数字键盘的方法、装置和存储介质
KR102226843B1 (ko) * 2019-02-26 2021-03-12 주식회사 핀그램 오브젝트 검출 시스템 및 그 방법
CN111723627B (zh) * 2019-03-22 2024-07-23 北京搜狗科技发展有限公司 一种图像处理方法、装置和电子设备
CN110533030B (zh) * 2019-08-19 2023-07-14 三峡大学 基于深度学习的太阳胶片图像时间戳信息提取方法
CN110378328B (zh) * 2019-09-16 2019-12-13 图谱未来(南京)人工智能研究院有限公司 一种证件图像处理方法及装置
CN113256490A (zh) * 2020-02-13 2021-08-13 北京小米松果电子有限公司 文档图像的处理方法、装置及介质
CN111898602B (zh) * 2020-08-10 2024-04-16 赞同科技股份有限公司 一种图像中的凭证号码区域识别方法、装置及设备
CN115082919B (zh) * 2022-07-22 2022-11-29 平安银行股份有限公司 一种地址识别方法、电子设备及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010079359A (ko) * 2001-07-09 2001-08-22 전영삼 카드 블랙리스트 데이터의 압축방법 및 그의 전송시스템
CN101510258A (zh) * 2009-01-16 2009-08-19 北京中星微电子有限公司 一种证件验证方法、系统及一种证件验证终端
CN102930265A (zh) * 2012-09-19 2013-02-13 广州市中崎商业机器有限公司 一种多身份证扫描方法及装置
CN102955941A (zh) * 2011-08-31 2013-03-06 汉王科技股份有限公司 身份信息录入方法和装置
CN103488984A (zh) * 2013-10-11 2014-01-01 从兴技术有限公司 基于智能移动设备的二代身份证识别方法及装置
CN104298985A (zh) * 2014-08-11 2015-01-21 东莞中山大学研究院 一种基于迭代的图像文本区域检测方法
CN104573616A (zh) * 2013-10-29 2015-04-29 腾讯科技(深圳)有限公司 一种信息识别方法、相关装置及系统

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08161423A (ja) * 1994-12-06 1996-06-21 Dainippon Printing Co Ltd 照明装置および文字読取装置
US5999647A (en) * 1995-04-21 1999-12-07 Matsushita Electric Industrial Co., Ltd. Character extraction apparatus for extracting character data from a text image
US5889884A (en) * 1995-05-23 1999-03-30 Minolta Co., Ltd. Image forming apparatus capable of recognizing top and bottom of document image
JP3823782B2 (ja) * 2001-08-31 2006-09-20 日産自動車株式会社 先行車両認識装置
JP3931651B2 (ja) * 2001-12-21 2007-06-20 コニカミノルタビジネステクノロジーズ株式会社 画像処理装置
JP4322041B2 (ja) * 2003-04-25 2009-08-26 シャープ株式会社 画像処理装置、画像処理方法、画像処理プログラムおよびそのプログラムを記録したコンピュータ読取可能な記録媒体
RU2309456C2 (ru) * 2005-12-08 2007-10-27 "Аби Софтвер Лтд." Способ распознавания текстовой информации из векторно-растрового изображения
CN100517374C (zh) * 2005-12-29 2009-07-22 佳能株式会社 从复杂背景文档图像提取文本的装置、方法
US8265393B2 (en) * 2007-05-01 2012-09-11 Compulink Management Center, Inc. Photo-document segmentation method and system
US8064729B2 (en) * 2008-04-03 2011-11-22 Seiko Epson Corporation Image skew detection apparatus and methods
JP2010186246A (ja) * 2009-02-10 2010-08-26 Nec Corp 画像処理装置、方法、及び、プログラム
US9639949B2 (en) * 2010-03-15 2017-05-02 Analog Devices, Inc. Edge orientation for second derivative edge detection methods
JP5591578B2 (ja) * 2010-04-19 2014-09-17 日本電産サンキョー株式会社 文字列認識装置および文字列認識方法
KR101295000B1 (ko) * 2013-01-22 2013-08-09 주식회사 케이지모빌리언스 카드 번호의 영역 특성을 이용하는 신용 카드의 번호 인식 시스템 및 신용 카드의 번호 인식 방법
JP6161484B2 (ja) * 2013-09-19 2017-07-12 株式会社Pfu 画像処理装置、画像処理方法及びコンピュータプログラム
US8995774B1 (en) * 2013-09-19 2015-03-31 IDChecker, Inc. Automated document recognition, identification, and data extraction
US9760788B2 (en) * 2014-10-30 2017-09-12 Kofax, Inc. Mobile document detection and orientation based on reference object characteristics
CN104680161A (zh) * 2015-01-09 2015-06-03 安徽清新互联信息科技有限公司 一种身份证数字识别方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010079359A (ko) * 2001-07-09 2001-08-22 전영삼 카드 블랙리스트 데이터의 압축방법 및 그의 전송시스템
CN101510258A (zh) * 2009-01-16 2009-08-19 北京中星微电子有限公司 一种证件验证方法、系统及一种证件验证终端
CN102955941A (zh) * 2011-08-31 2013-03-06 汉王科技股份有限公司 身份信息录入方法和装置
CN102930265A (zh) * 2012-09-19 2013-02-13 广州市中崎商业机器有限公司 一种多身份证扫描方法及装置
CN103488984A (zh) * 2013-10-11 2014-01-01 从兴技术有限公司 基于智能移动设备的二代身份证识别方法及装置
CN104573616A (zh) * 2013-10-29 2015-04-29 腾讯科技(深圳)有限公司 一种信息识别方法、相关装置及系统
CN104298985A (zh) * 2014-08-11 2015-01-21 东莞中山大学研究院 一种基于迭代的图像文本区域检测方法

Also Published As

Publication number Publication date
JP6400226B2 (ja) 2018-10-03
EP3163505A1 (en) 2017-05-03
US20170124412A1 (en) 2017-05-04
KR101782633B1 (ko) 2017-09-27
CN105528600A (zh) 2016-04-27
MX361846B (es) 2018-12-18
KR20170061627A (ko) 2017-06-05
RU2016110142A (ru) 2017-09-28
RU2641449C2 (ru) 2018-01-17
MX2016003578A (es) 2017-07-14
JP2018500702A (ja) 2018-01-11

Similar Documents

Publication Publication Date Title
WO2017071058A1 (zh) 区域识别方法及装置
JP6401873B2 (ja) 領域認識方法及び装置
US10127471B2 (en) Method, device, and computer-readable storage medium for area extraction
RU2639668C2 (ru) Способ и устройство для идентификации области
CN105550633B (zh) 区域识别方法及装置
CN106295638B (zh) 证件图像倾斜校正方法和装置
CN106228168B (zh) 卡片图像反光检测方法和装置
WO2017071064A1 (zh) 区域提取方法、模型训练方法及装置
CN105894042B (zh) 检测证件图像遮挡的方法和装置
CN106250894A (zh) 卡片信息识别方法及装置
CN106296665A (zh) 卡片图像模糊检测方法和装置
CN106056117A (zh) 矩形物体的图像处理方法及装置

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 20167005380

Country of ref document: KR

Kind code of ref document: A

Ref document number: 2017547042

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: MX/A/2016/003578

Country of ref document: MX

ENP Entry into the national phase

Ref document number: 2016110142

Country of ref document: RU

Kind code of ref document: A

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15907119

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15907119

Country of ref document: EP

Kind code of ref document: A1