IP Library › Granted Patent US 12,608,816
Granted Patent B2
US 12,608,816 · App. 17/980,029 · Granted Apr 21, 2026

Advanced Hough-based on-device document localization

Inventors: Daniil Vyacheslavovich Tropin (Vologda, RU); Aleksandr Mikhailovich Ershov (Ulyanovsk, RU); Dmitry Petrovich Nikolaev (Moscow, RU); Vladimir Viktorovich Arlazarov (Moscow, RU)
Assignee: Smart Engines Service, LLC
G06T7/13G06T3/40G06T7/155G06T7/168G06T7/90G06V30/414G06T2207/20061G06T2207/30176
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,608,816
App. No.
17/980,029
Granted
Apr 21, 2026
Kind
B2
Abstract

Advanced Hough-Based On-Device Document Localization. In an embodiment, lines are detected in an input image of a document. The lines are searched for candidate quadrilaterals. For at least a subset of the found candidate quadrilaterals, a contour score is calculated, and the candidate quadrilaterals are saved or discarded based on their contour scores. For each saved candidate quadrilateral, a contrast score is calculated. A final candidate quadrilateral is selected, based on the combined contour and contrast scores for the saved candidate quadrilaterals, to represent the borders of the document.

Claims (131)

1 . A method comprising using at least one hardware processor to:

receive an input image of a document, the input image comprising pixel data captured by an image sensor;

detect a plurality of edges in the document by processing the pixel data of the input image;

detect a plurality of lines based on the plurality of edges using a computer-implemented line detection algorithm;

search the plurality of lines for combinations of the plurality of lines that represent a plurality of new candidate quadrilaterals;

for each of at least a subset of the plurality of new candidate quadrilaterals,

calculate a contour score for each new candidate quadrilateral,

when a saved set of candidate quadrilaterals has not yet reached a predetermined maximum size K, add said new candidate quadrilateral to the saved set, and,

when the saved set of candidate quadrilaterals has reached the predetermined maximum size K,

when the contour score of said new candidate quadrilateral is not greater than a contour score of any candidate quadrilateral in the saved set, discard the new candidate quadrilateral, and,

when the contour score of said new candidate quadrilateral is greater than a contour score of at least one candidate quadrilateral in the saved set, discard a candidate quadrilateral with a lowest contour score from the saved set, and add said new candidate quadrilateral to the saved set, such that the saved set never exceeds the predetermined maximum size K;

after the search, for each candidate quadrilateral in the saved set,

calculate a contrast score for each candidate quadrilateral, and

calculate a combined score from the contour score and the contrast score calculated for each candidate quadrilateral; and

select a candidate quadrilateral having a highest combined score from the saved set to represent borders of the document.

2 . The method of claim 1 , wherein the input image is a lower resolution version of an original image, and wherein the method further comprises using the at least one hardware processor to refine the selected candidate quadrilateral by:

extracting a region that represents each border in the selected candidate quadrilateral;

applying a similarity transformation to the selected candidate quadrilateral to produce a transformed quadrilateral, wherein the similarity transformation

makes each of the extracted regions, representing a horizontal border, horizontal,

makes each of the extracted regions, representing a vertical border, vertical, and

scales the selected candidate quadrilateral to a higher resolution; and

detecting lines in the transformed quadrilateral.

3 . The method of claim 1 , wherein the search comprises:

searching for combinations of four lines from the plurality of lines; and

searching for combinations of three lines from the plurality of lines, and, for each combination of three lines that is found, interpolating a fourth line based on the three lines and a known aspect ratio of the document.

4 . The method of claim 1 , further comprising using the at least one hardware processor to, for each of the plurality of new candidate quadrilaterals, before calculating the contour score for the new candidate quadrilateral:

determine whether or not an inverse image of the new candidate quadrilateral differs from an ideal rectangle representing the document by a predefined threshold difference; and,

when the inverse image of the new candidate quadrilateral differs from the ideal rectangle by the predefined threshold difference, discard the new candidate quadrilateral without calculating the contour score for the new candidate quadrilateral and without adding the new candidate quadrilateral to the saved set.

5 . The method of claim 4 , wherein determining whether or not the inverse image of the new candidate quadrilateral differs from the ideal rectangle by the predefined threshold difference comprises calculating whether an aspect ratio of the inverse image of the new candidate quadrilateral differs from an aspect ratio of the ideal rectangle by more than a predetermined percentage.

6 . The method of claim 4 , wherein determining whether or not the inverse image of the new candidate quadrilateral differs from the ideal rectangle by the predefined threshold difference comprises calculating whether a difference between an angle of the inverse image of the new candidate quadrilateral and an angle of 90 degrees exceeds a predetermined number of degrees.

7 . The method of claim 1 , wherein the contour score is calculated as:

Contour

⁢

Score

=

∑

{

b

}

w

⁡

(

b

)

1

+

∑

{

b

}

(

1

-

c

⁡

(

b

)

)

-

∑

{

b

}

w

′

(

b

)

wherein {b} are the combination of lines in the new candidate quadrilateral,

wherein w(b) is a total edge intensity inside a segment b,

wherein w′(b) is a total edge intensity of segments that lie on a straight line containing segment b, do not intersect each other, have one common point within segment b, and have at least the threshold length, and

wherein c(b) is a fraction of non-zero edge pixels inside segment b.

8 . The method of claim 7 , further comprising using the at least one hardware processor to, for each of the plurality of new candidate quadrilaterals, before calculating the contour score for the new candidate quadrilateral:

determine whether or not each of w(b), w′(b), and c(b) has a value that is outside a respective range; and,

when determining that any of w(b), w′(b), and c(b) have a value that is outside the respective range, discard the new candidate quadrilateral without calculating the contour score for the new candidate quadrilateral and without adding the new candidate quadrilateral to the saved set.

9 . The method of claim 1 , wherein, for each candidate quadrilateral in the saved set, the contrast score is calculated based on an χ 2 distance between red-green-blue (RGB) pixel histograms of inner areas and outer areas of the candidate quadrilateral.

10 . The method of claim 9 , wherein, for each candidate quadrilateral in the saved set, the contrast score is calculated after projectively normalizing the candidate quadrilateral.

11 . The method of claim 1 , wherein detecting the plurality of edges comprises generating a horizontal edge map for primarily horizontal edges and a vertical edge map for primarily vertical edges.

12 . The method of claim 11 , wherein generating each of the horizontal edge map and the vertical edge map comprises:

applying morphological filtering to the input image;

calculating derivative values along a respective axis of the input image;

averaging the derivative values;

suppressing non-maxima having absolute derivative values greater than one;

collecting connectivity components; and

filtering the collected connectivity components, based on size, to produce remaining edges,

wherein the respective edge map comprises the remaining edges.

13 . The method of claim 12 , wherein generating each of the horizontal edge map and the vertical edge map further comprises blurring the remaining edges using a Gaussian function.

14 . The method of claim 11 , wherein detecting the plurality of lines comprises:

detecting primarily horizontal lines from the horizontal edge map; and

detecting primarily vertical lines from the vertical edge map.

15 . The method of claim 14 , wherein detecting the plurality of lines comprises, for each of the horizontal edge map and the vertical edge map:

applying a Fast Hough Transform to one or more regions of the respective edge map;

determining a global maximum across all of the one or more regions based on the Fast Hough Transform;

selecting up to a predetermined number of local maxima within each of the one or more regions based on the global maximum; and

applying an inverse of the Fast Hough Transform to the one or more regions to convert the local maxima into straight lines.

16 . The method of claim 15 , wherein selecting up toa predetermined number of local maxima within each of the one or more regions based on the global maximum comprises selecting a local maximum only if that local maximum exceeds a threshold percentage of the global maximum and that local maximum lies more than a threshold number of pixels away, by an l 2 norm, from all previously selected local maxima.

17 . The method of claim 1 , wherein the combined score is a linear combination of the contour score and the contrast score.

18 . The method of claim 1 , wherein the at least one hardware processor is comprised in a mobile device.

19 . A system comprising:

at least one hardware processor; and

software configured to, when executed by the at least one hardware processor,

receive an input image of a document, the input image comprising pixel data captured by an image sensor;

detect a plurality of edges in the document by processing the pixel data of the input image;

detect a plurality of lines based on the plurality of edges using a computer-implemented line detection algorithm;

search the plurality of lines for combinations of the plurality of lines that represent a plurality of new candidate quadrilaterals,

for each of at least a subset of the plurality of new candidate quadrilaterals,

calculate a contour score for each new candidate quadrilateral,

when a saved set of candidate quadrilaterals has not yet reached a predetermined maximum size K, add said new candidate quadrilateral to the saved set, and,

when the saved set of candidate quadrilaterals has reached the predetermined maximum size K,

when the contour score of said new candidate quadrilateral is not greater than a contour score of any candidate quadrilateral in the saved set, discard the new candidate quadrilateral, and,

when the contour score of said new candidate quadrilateral is greater than a contour score of at least one candidate quadrilateral in the saved set, discard a candidate quadrilateral with a lowest contour score from the saved set, and add said new candidate quadrilateral to the saved set, such that the saved set never exceeds the predetermined maximum size K;

after the search, for each candidate quadrilateral in the saved set,

calculate a contrast score for each candidate quadrilateral, and

calculate a combined score from the contour score and the contrast score calculated for each candidate quadrilateral; and

selecta candidate quadrilateral having a highest combined score from the saved set to represent borders of the document.

20 . A non-transitory computer-readable medium having instructions stored therein, wherein the instructions, when executed by a processor, cause the processor to:

receive an input image of a document, the input image comprising pixel data captured by an image sensor;

detect a plurality of edges in the document by processing the pixel data of the input image;

detect a plurality of lines based on the plurality of edges using a computer-implemented line detection algorithm;

search the plurality of lines for combinations of the plurality of lines that represent a plurality of new candidate quadrilaterals;

for each of at least a subset of the plurality of new candidate quadrilaterals,

calculate a contour score for each new candidate quadrilateral,

when a saved set of candidate quadrilaterals has not yet reached a predetermined maximum size K, add said new candidate quadrilateral to the saved set, and,

when the saved set of candidate quadrilaterals has reached the predetermined maximum size K,

when the contour score of said new candidate quadrilateral is not greater than a contour score of any candidate quadrilateral in the saved set, discard the new candidate quadrilateral, and,

when the contour score of said new candidate quadrilateral is greater than a contour score of at least one candidate quadrilateral in the saved set, discard a candidate quadrilateral with a lowest contour score from the saved set, and add said new candidate quadrilateral to the saved set, such that the saved set never exceeds the predetermined maximum size K;

after the search, for each candidate quadrilateral in the saved set,

calculate a contrast score for each candidate quadrilateral, and

calculate a combined score from the contour score and the contrast score calculated for each candidate quadrilateral; and

select a candidate quadrilateral having a highest combined score from the saved set to represent borders of the document.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 3, 2022
From: TROPIN, DANIIL VYACHESLAVOVICH; ERSHOV, ALEKSANDR MIKHAILOVICH; NIKOLAEV, DMITRY PETROVICH; ARLAZAROV, VLADIMIR VIKTOROVICH
To: SMART ENGINES SERVICE, LLC
Reel/Frame 061649/0743 →
Priority Claims (1)
RU 2021132191 · Nov 3, 2021 · national
Continuity (1)
Related Publication 20230137300A1 · May 4, 2023
References Cited (37)
US 7672507B2 · Fan · 2010 [cited by examiner]
US 8645818B2 · Kuwata · 2014 [cited by examiner]
US 10134163B2 · Liu et al. · 2018 [cited by applicant]
US 20130101229A1 · Holeva · 2013 [cited by examiner]
US 20130182002A1 · Macciola · 2013 [cited by examiner]
US 20170372134A1 · Zagaynov · 2017 [cited by examiner]
US 20190164313A1 · Ma · 2019 [cited by examiner]
US 20220174182A1 · Imaizumi · 2022 [cited by examiner]
CN 105096299B · 2019 [cited by examiner]
Contour and Texture Analysis for Image Segmentation, Jitendra Malik, Serge Belongie, Thomas Leungâand Jianbo Shi (Year: 2001). [cited by examiner]
Bulatov et al., “Smart IDReader: Document Recognition in Video Stream,” 2017 14th IAPR International Conference on Document Analysis and Recognition, 2017 IEEE, pp. 39-44. [cited by applicant]
Esser et al., “Information Extraction Efficiency of Business Documents Captured with Smartphones and Tablets,” In Proceedings of the 2013 ACM symposium on Document engineering, pp. 111-114. [cited by applicant]
Giovanni Buttarelli, “The EU GDPR as a clarion call for a new global digital gold standard,” International Data Privacy Law, 2016, vol. 6 No. 2, pp. 77-78. [cited by applicant]
Andreeva et al., “Document recognition method based on convolutional neural network invariant to 180 degree rotation angle,” Math-Net.Ru, All Russian mathematical portal, DOI: https://doi.org/10.14357/20718632190408, Hφ… [cited by applicant]
Zhang et al., “Whiteboard scanning and image enhancement,” Digital Signal Processing 17 (2007) pp. 414-432. [cited by applicant]
Zhukovsky et al., “Segments Graph-Based Approach for Document Capture in a Smartphone Video Stream,” 2017 14th IAPR International Conference on Document Analysis and Recognition, 2017 IEEE, pp. 337-342. [cited by applicant]
Hartl et al., “Rectangular Target Extraction for Mobile Augmented Reality Applications,” 21st International Conference on Pattern Recognition (ICPR 2012), Nov. 11-15, 2012. Tsukuba, Japan, 2012 IAPR, pp. 81-84. [cited by applicant]
Skoryukina et al., “Real Time Rectangular Document Detection on Mobile Devices,” Proc. of SPIE vol. 9445 94452A-1, 2015 SPIE, 6 pgs. [cited by applicant]
Tropin et al., “Improved Algorithm of ID Card Detection by a Priori Knowledge of the Document Aspect Ratio,” Proc. SPIE 11605, Thirteenth International Conference on Machine Vision, 116051F (Jan. 4, 2021); doi:10.1117/1… [cited by applicant]
Tropin et al., “Approach for Document Detection by Contours and Contrasts,” 2020 25th International Conference on Pattern Recognition (ICPR), Milan, Italy, Jan. 10-15, 2021, 2020 IEEE, pp. 9689-9695. [cited by applicant]
Puybareau et al., “Real-Time Document Detection in Smartphone Videos,” 2018 IEEE, pp. 1498-1502. [cited by applicant]
Sánchez-Rivero et al., “Capture of Identity Document Images in the Wild: Detection and Quality Assessment,” Cicci 2020, 7 pgs. [cited by applicant]
Attivissimo et al., “An Automatic Reader of Identify Documents,” 2019 IEEE International Conference on Systems, Man and Cybernetics (SMC), Bari, Italy. Oct. 6-9, 2019, 2019 IEEE, pp. 3525-3530. [cited by applicant]
Ngoc et al., “Document detection in videos captured by smartphones using a saliency-based method,” 2019 International Conference on Document Analysis and Recognition Workshops (ICDARW), 2019 IEEE, pp. 19-24. [cited by applicant]
Leal et al., “Smartphone Camera Document Detection via Geodesic Object Proposals,” 2016 IEEE, 6 pgs. [cited by applicant]
Castelblanco et al., “Machine Learning Techniques for Identity Document Verification in Uncontrolled Environments: A Case Study,” MCPR 2020, LNCS 12088, pp. 271-281. [cited by applicant]
Zhu et al., “Coarse-to-fine document localization in natural scene image with regional attention and recursive corner refinement,” International Journal on Document Analysis and Recognition, vol. 22, Issue 3, Sep. 2019,… [cited by applicant]
Ricardo Batista das Neves Junior et al., “HU-PageScan: a fully convolutional neural network for document page crop,” IET Image Process., 2020, vol. 14 Iss. 15, pp. 3890-3898. [cited by applicant]
Sheshkus et al, “Houghencoder: Neural Network Architecture for Document Image Semantic Segmentation,” 2020 IEEE, pp. 1946-1950. [cited by applicant]
Martin L. Brady, “A Fast Discrete Approximation Algorithm for the Radon Transform,” SIAM J. Comput., vol. 27, No. 1, Feb. 1998, pp. 107-119. [cited by applicant]
Javed et al., “Real-time Document Localization in Natural Images by Recursive Application of a CNN,” 2017 14th IAPR International Conference on Document Analysis and Recognition, 2017 IEEE, pp. 105-110. [cited by applicant]
Burie et al., “ICDAR2015 Competition on Smartphone Document Capture and OCR (SmartDoc),” 2015 13th International Conference on Document Analysis and Recognition (ICDAR), 2015 IEEE, pp. 1161-1165. [cited by applicant]
Arlazarov et al., “MIDV-500: a dataset for identity document analysis and recognition on mobile devices in video stream,” Computer Optics 2019, 43(5), pp. 818-824. [cited by applicant]
Chazalon et al., “A Semi-Automatic Groundtruthing Tool for Mobile-Captured Document Segmentation,” 2015 13th International Conference on Document Analysis and Recognition (ICDAR), 2015 IEEE, pp. 621-625. [cited by applicant]
Konovalenko et al., “Maximal Coordinate Discrepancy as Accuracy Criterion of Image Projective Normalization for Optical Recognition of Documents,” Bulletin of the South Ural State University. Ser. Mathematical Modelling… [cited by applicant]
Chiron et al., “ID documents matching and localization with multi-hypothesis constraints,” 2020 25th International Conference on Pattern Recognition (ICPR), Milan, Italy, Jan. 10-15, 2021, 2020 IEEE, pp. 3644-3651. [cited by applicant]
Tropin et al., “Advanced Hough-based method for on-device document localization.” KOMΠblOTepha OøTKa 45.5 (2021), 12 pgs. [cited by applicant]