# Patent

## Title
Mobile image capture, processing, and electronic form generation

## Abstract

In various embodiments, methods, systems, and computer program products for capturing and processing digital images captured by a mobile device are disclosed. In one embodiment, a method includes capturing image data using a mobile device, the image data depicting a digital representation of a document; defining, based on the image data, a plurality of candidate edge points corresponding to the document; defining four sides of a tetragon based on at least some of the plurality of candidate edge points; determining a plurality of fields within the tetragon; for each field, determining at least a field location and a field data type; associating each determined field location with each field data type to generate a plurality of metadata labels; and associating the plurality of metadata labels with an image of an electronic form.

## Background
PRIORITY CLAIM
This application is a continuation-in-part of U.S. patent application Ser. No. 14/569,375, filed Dec. 12, 2014, which is a continuation of U.S. patent application Ser. No. 14/334,558, filed Jul. 17, 2014 (since issued as U.S. Pat. No. 8,971,587), which is a continuation of U.S. patent application Ser. No. 13/740,123, filed Jan. 11, 2013 (since issued as U.S. Pat. No.8,855,375), which claims the benefit of priority from U.S. Provisional Application No. 61/586,062 filed Jan. 12, 2012, and from U.S. Provisional Application No. 61/720,958 filed Oct. 31, 2012. The aforementioned applications are also herein incorporated by reference.
RELATED APPLICATIONS
This application is related to U.S. Pat. No. 9,058,515, granted Jun. 15, 2015; U.S. Pat. No. 8,885,229, granted Nov. 11, 2014; U.S. Pat. No. 8,855,375, granted Oct. 7, 2014; U.S. Pat. No. 8,345,981, granted Jan. 1, 2013; U.S. Patent Publication No. 2014/0270439, published Sep. 18, 2014; and U.S. Patent Publication No. 2014/0270536, published Sep. 18, 2014; each of which is herein incorporated by reference in its entirety.


FIELD OF INVENTION
The present invention relates to image capture and image processing, and more particularly to capturing and processing digital images using a mobile device.
BACKGROUND OF THE INVENTION
Digital images having depicted therein a document such as a letter, a check, a bill, an invoice, etc. have conventionally been captured and processed using a scanner or multifunction peripheral coupled to a computer workstation such as a laptop or desktop computer. Methods and systems capable of performing such capture and processing are well known in the art and well adapted to the tasks for which they are employed.
However, in an era where day-to-day activities, computing, and business are increasingly performed using mobile devices, it would be greatly beneficial to provide analogous document capture and processing systems and methods for deployment and use on mobile platforms, such as smart phones, digital cameras, tablet computers, etc.
A major challenge in transitioning conventional document capture and processing techniques is the limited processing power and image resolution achievable using hardware currently available in mobile devices. These limitations present a significant challenge because it is impossible or impractical to process images captured at resolutions typically much lower than achievable by a conventional scanner. As a result, conventional scanner-based processing algorithms typically perform poorly on digital images captured using a mobile device.
In addition, the limited processing and memory available on mobile devices makes conventional image processing algorithms employed for scanners prohibitively expensive in terms of computational cost. Attempting to process a conventional scanner-based image processing algorithm takes far too much time to be a practical application on modern mobile platforms.
A still further challenge is presented by the nature of mobile capture components (e.g. cameras on mobile phones, tablets, etc.). Where conventional scanners are capable of faithfully representing the physical document in a digital image, critically maintaining aspect ratio, dimensions, and shape of the physical document in the digital image, mobile capture components are frequently incapable of producing such results.
Specifically, images of documents captured by a camera present a new line of processing issues not encountered when dealing with images captured by a scanner. This is in part due to the inherent differences in the way the document image is acquired, as well as the way the devices are constructed. The way that some scanners work is to use a transport mechanism that creates a relative movement between paper and a linear array of sensors. These sensors create pixel values of the document as it moves by, and the sequence of these captured pixel values forms an image. Accordingly, there is generally a horizontal or vertical consistency up to the noise in the sensor itself, and it is the same sensor that provides all the pixels in the line.
In contrast, cameras have many more sensors in a nonlinear array, e.g., typically arranged in a rectangle. Thus, all of these individual sensors are independent, and render image data that is not typically of horizontal or vertical consistency. In addition, cameras introduce a projective effect that is a function of the angle at which the picture is taken. For example, with a linear array like in a scanner, even if the transport of the paper is not perfectly orthogonal to the alignment of sensors and some skew is introduced, there is no projective effect like in a camera. Additionally, with camera capture, nonlinear distortions may be introduced because of the camera optics.
Further, upon capturing and processing the image, it would be advantageous to convert the captured image data into a directly useable form, e.g. an electronic document or fillable form, which may be stored or passed to subsequent workflows to facilitate use of the information depicted in the image data.
In view of the challenges presented above, it would be beneficial to provide an image capture and processing algorithm and applications thereof that compensate for and/or correct problems associated with image capture and processing using a mobile device, while maintaining a low computational cost via efficient processing methods, and which enables the in-line conversion of such images into electronic documents useful in a wide array of practical applications.
SUMMARY OF THE INVENTION
In various embodiments, methods, systems, and computer program products for capturing and processing digital images captured by a mobile device are disclosed. The claimed algorithms are specifically configured to perform and facilitate loan application processing by capturing an image of a document using a mobile device, and analyzing the image (optionally in conjunction with additional data that may also be captured, determined, or otherwise provided to the loan application process) to determine loan-relevant information. Select loan-relevant information may be extracted, compiled, and/or analyzed to facilitate processing of the loan application. Feedback may be provided to facilitate facile application processing, e.g. by ensuring all requisite information is submitted with the loan application. Image capture and document detection are preferably performed using the mobile device, while all other functions may be performed using the mobile device, a remote server, or some combination thereof.
In one embodiment, a method includes capturing image data using a mobile device, the image data depicting a digital representation of a document; defining, based on the image data, a plurality of candidate edge points corresponding to the document; defining four sides of a tetragon based on at least some of the plurality of candidate edge points; determining a plurality of fields within the tetragon; for each field, determining at least a field location and a field data type; associating each determined field location with each field data type to generate a plurality of metadata labels; and associating the plurality of metadata labels with an image of an electronic form.
In another embodiment, a system includes: a processor configured to execute logic, and logic. The logic is configured to cause the processor to: receive image data captured using a mobile device, the image data depicting a digital representation of a document; define, based on the image data, a plurality of candidate edge points corresponding to the document; define four sides of a tetragon based on at least some of the plurality of candidate edge points; determine a plurality of fields within the tetragon; for each field, determine at least a field location and a field data type; associate each determined field location with each field data type to generate a plurality of metadata labels; and associate the plurality of metadata labels with an image of an electronic form.
In yet another embodiment, a computer program product includes a non-transitory computer readable medium having embodied therewith computer readable program code. The computer readable program code includes: computer readable program code configured to capture image data using a mobile device, the image data depicting a digital representation of a document; computer readable program code configured to define, based on the image data, a plurality of candidate edge points corresponding to the document; computer readable program code configured to define four sides of a tetragon based on at least some of the plurality of candidate edge points; and computer readable program code configured to determine a plurality of fields within the tetragon; computer readable program code configured to for each field, determine at least a field location and a field data type; computer readable program code configured to associate each determined field location with each field data type to generate a plurality of metadata labels; and computer readable program code configured to associate the plurality of metadata labels with an image of an electronic form.
Other embodiments within the scope of the present inventive concepts will become clear based upon carefully reviewing the following detailed descriptions in conjunction with the figures.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 illustrates a network architecture, in accordance with one embodiment.
FIG. 2 shows a representative hardware environment that may be associated with the servers and/or clients of FIG. 1, in accordance with one embodiment.
FIG. 3A is a schematic representation of a digital image comprising a digital representation of a document, according to one embodiment.
FIG. 3B is a schematic representation of a digital image comprising a digital representation of a document and a plurality of page detection analysis windows, according to one embodiment.
FIG. 3C is a schematic representation of a digital image comprising a digital representation of a document characterized by a plurality of candidate edge points, according to one embodiment.
FIG. 3D is a schematic representation of a large analysis window comprising a plurality of pixels of a digital image, and a small analysis window within the large analysis window, according to one embodiment.
FIG. 4 is a schematic representation of a digital image comprising a digital representation of a document bounded by a target tetragon, according to one embodiment.
FIG. 5 is a flowchart of a method, according to one embodiment.



DETAILED DESCRIPTION
The following description is made for the purpose of illustrating the general principles of the present invention and is not meant to limit the inventive concepts claimed herein. Further, particular features described herein can be used in combination with other described features in each of the various possible combinations and permutations.
Unless otherwise specifically defined herein, all terms are to be given their broadest possible interpretation including meanings implied from the specification as well as meanings understood by those skilled in the art and/or as defined in dictionaries, treatises, etc.
It must also be noted that, as used in the specification and the appended claims, the singular forms “a,” “an” and “the” include plural referents unless otherwise specified.
The present application refers to image processing of images (e.g. pictures, figures, graphical schematics, single frames of movies, videos, films, clips, etc.) captured by cameras, especially cameras of mobile devices. As understood herein, a mobile device is any device capable of receiving data without having power supplied via a physical connection (e.g. wire, cord, cable, etc.) and capable of receiving data without a physical data connection (e.g. wire, cord, cable, etc.). Mobile devices within the scope of the present disclosures include exemplary devices such as a mobile telephone, smartphone, tablet, personal digital assistant, iPod®, iPad®, BLACKBERRY® device, etc.
However, as it will become apparent from the descriptions of various functionalities, the presently disclosed mobile image processing algorithms can be applied, sometimes with certain modifications, to images coming from scanners and multifunction peripherals (MFPs). Similarly, images processed using the presently disclosed processing algorithms may be further processed using conventional scanner processing algorithms, in some approaches.
Of course, the various embodiments set forth herein may be implemented utilizing hardware, software, or any desired combination thereof. For that matter, any type of logic may be utilized which is capable of implementing the various functionality set forth herein.
One benefit of using a mobile device is that with a data plan, image processing and information processing based on captured images can be done in a much more convenient, streamlined and integrated way than previous methods that relied on presence of a scanner. However, the use of mobile devices as document(s) capture and/or processing devices has heretofore been considered unfeasible for a variety of reasons.
In one approach, an image may be captured by a camera of a mobile device. The term “camera” should be broadly interpreted to include any type of device capable of capturing an image of a physical object external to the device, such as a piece of paper. The term “camera” does not encompass a peripheral scanner or multifunction device. Any type of camera may be used. Preferred embodiments may use cameras having a higher resolution, e.g. 8 MP or more, ideally 12 MP or more. The image may be captured in color, grayscale, black and white, or with any other known optical effect. The term “image” as referred to herein is meant to encompass any type of data corresponding to the output of the camera, including raw data, processed data, etc.
General Embodiments
In one embodiment, a method includes capturing image data using a mobile device, the image data depicting a digital representation of a document; defining, based on the image data, a plurality of candidate edge points corresponding to the document; defining four sides of a tetragon based on at least some of the plurality of candidate edge points; determining a plurality of fields within the tetragon; for each field, determining at least a field location and a field data type; associating each determined field location with each field data type to generate a plurality of metadata labels; and associating the plurality of metadata labels with an image of an electronic form.
In another embodiment, a system includes: a processor configured to execute logic, and logic. The logic is configured to cause the processor to: receive image data captured using a mobile device, the image data depicting a digital representation of a document; define, based on the image data, a plurality of candidate edge points corresponding to the document; define four sides of a tetragon based on at least some of the plurality of candidate edge points; determine a plurality of fields within the tetragon; for each field, determine at least a field location and a field data type; associate each determined field location with each field data type to generate a plurality of metadata labels; and associate the plurality of metadata labels with an image of an electronic form.
In yet another embodiment, a computer program product includes a non-transitory computer readable medium having embodied therewith computer readable program code. The computer readable program code includes: computer readable program code configured to capture image data using a mobile device, the image data depicting a digital representation of a document; computer readable program code configured to define, based on the image data, a plurality of candidate edge points corresponding to the document; computer readable program code configured to define four sides of a tetragon based on at least some of the plurality of candidate edge points; and computer readable program code configured to determine a plurality of fields within the tetragon; computer readable program code configured to for each field, determine at least a field location and a field data type; computer readable program code configured to associate each determined field location with each field data type to generate a plurality of metadata labels; and computer readable program code configured to associate the plurality of metadata labels with an image of an electronic form.
An application may be installed on the mobile device, e.g., stored in a nonvolatile memory of the device. In one approach, the application includes instructions to perform processing of an image on the mobile device. In another approach, the application includes instructions to send the image to a remote server such as a network server. In yet another approach, the application may include instructions to decide whether to perform some or all processing on the mobile device and/or send the image to the remote site. Examples of how an image may be processed are presented in more detail below.
One illustrative methodology for correction of projective and non-linear optical effects is an extension of a known algorithm for edge detection, such as the algorithm(s) described in U.S. Pat. Nos. 7,545,529 and 6,370,277, which are herein incorporated by reference. Such illustrative methodologies may include some or all of the algorithmic features disclosed herein as the extension on known algorithms, which do not include the specific functionalities disclosed herein.
It may be useful to understand how page detection is performed prior to discussing the differences introduced in order to deal with images captured by area sensors (cameras). In one approach, the edge detection algorithm goes from the boundaries of the image into the image, looking for points that are sufficiently different from what is known about the properties of the background. However, the background in the images captured by even the same mobile device may be different every time, so a new technique to identify the document(s) in the image is provided.
In one embodiment, edges of the document(s) are detected. Any method of edge detection known in the art may be used. For example, the technique described in U.S. patent application Ser. No. 12/206,594, filed Sep. 8, 2008 and which is incorporated by reference, may be used. Moreover, an outside-to-inside edge detection technique, inside-to-outside edge detection technique, or combination of both may be used.
Turning now to the figures, FIG. 1 illustrates a network architecture 100, in accordance with one embodiment. As shown in FIG. 1, a plurality of remote networks 102 are provided including a first remote network 104 and a second remote network 106. A gateway 101 may be coupled between the remote networks 102 and a proximate network 108. In the context of the present network architecture 100, the networks 104, 106 may each take any form including, but not limited to a LAN, a WAN such as the Internet, public switched telephone network (PSTN), internal telephone network, etc.
In use, the gateway 101 serves as an entrance point from the remote networks 102 to the proximate network 108. As such, the gateway 101 may function as a router, which is capable of directing a given packet of data that arrives at the gateway 101, and a switch, which furnishes the actual path in and out of the gateway 101 for a given packet.
Further included is at least one data server 114 coupled to the proximate network 108, and which is accessible from the remote networks 102 via the gateway 101. It should be noted that the data server(s) 114 may include any type of computing device/groupware. Coupled to each data server 114 is a plurality of user devices 116. Such user devices 116 may include a desktop computer, lap-top computer, hand-held computer, mobile device, printer or any other type of logic. It should be noted that a user device 111 may also be directly coupled to any of the networks, in one embodiment.
A peripheral 120 or series of peripherals 120, e.g., facsimile machines, printers, networked and/or local storage units or systems, etc., may be coupled to one or more of the networks 104, 106, 108. It should be noted that databases and/or additional components may be utilized with, or integrated into, any type of network element coupled to the networks 104, 106, 108. In the context of the present description, a network element may refer to any component of a network.
According to some approaches, methods and systems described herein may be implemented with and/or on virtual systems and/or systems which emulate one or more other systems, such as a UNIX system which emulates an IBM z/OS environment, a UNIX system which virtually hosts a MICROSOFT WINDOWS environment, a MICROSOFT WINDOWS system which emulates an IBM z/OS environment, etc. This virtualization and/or emulation may be enhanced through the use of VMWARE software, in some embodiments.
In more approaches, one or more networks 104, 106, 108, may represent a cluster of systems commonly referred to as a “cloud.” In cloud computing, shared resources, such as processing power, peripherals, software, data, servers, etc., are provided to any system in the cloud in an on-demand relationship, thereby allowing access and distribution of services across many computing systems. Cloud computing typically involves an Internet connection between the systems operating in the cloud, but other techniques of connecting the systems may also be used.
FIG. 2 shows a representative hardware environment associated with a user device 116 and/or server 114 of FIG. 1, in accordance with one embodiment. FIG. 2 illustrates a typical hardware configuration of a workstation having a central processing unit (CPU) 210, such as a microprocessor, and a number of other units interconnected via one or more buses 212 which may be of different types, such as a local bus, a parallel bus, a serial bus, etc., according to several embodiments.
The workstation shown in FIG. 2 includes a Random Access Memory (RAM) 214, Read Only Memory (ROM) 216, an I/O adapter 218 for connecting peripheral devices such as disk storage units 220 to the one or more buses 212, a user interface adapter 222 for connecting a keyboard 224, a mouse 226, a speaker 228, a microphone 232, and/or other user interface devices such as a touch screen, a digital camera (not shown), etc., to the one or more buses 212, communication adapter 234 for connecting the workstation to a communication network 235 (e.g., a data processing network) and a display adapter 236 for connecting the one or more buses 212 to a display device 238.
The workstation may have resident thereon an operating system such as the MICROSOFT WINDOWS Operating System (OS), a MAC OS, a UNIX OS, etc. It will be appreciated that a preferred embodiment may also be implemented on platforms and operating systems other than those mentioned. A preferred embodiment may be written using JAVA, XML, C, and/or C++ language, or other programming languages, along with an object oriented programming methodology. Object oriented programming (OOP), which has become increasingly used to develop complex applications, may be used.
The description herein is presented to enable any person skilled in the art to make and use the invention and is provided in the context of particular applications of the invention and their requirements. Various modifications to the disclosed embodiments will be readily apparent to those skilled in the art and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the present invention. Thus, the present invention is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
In particular, various embodiments of the invention discussed herein are implemented using the Internet as a means of communicating among a plurality of computer systems. One skilled in the art will recognize that the present invention is not limited to the use of the Internet as a communication medium and that alternative methods of the invention may accommodate the use of a private intranet, a Local Area Network (LAN), a Wide Area Network (WAN) or other means of communication. In addition, various combinations of wired, wireless (e.g., radio frequency) and optical communication links may be utilized.
The program environment in which one embodiment of the invention may be executed illustratively incorporates one or more general-purpose computers or special-purpose devices such hand-held computers. Details of such devices (e.g., processor, memory, data storage, input and output devices) are well known and are omitted for the sake of brevity.
It should also be understood that the techniques of the present invention might be implemented using a variety of technologies. For example, the methods described herein may be implemented in software running on a computer system, or implemented in hardware utilizing one or more processors and logic (hardware and/or software) for performing operations of the method, application specific integrated circuits, programmable logic devices such as Field Programmable Gate Arrays (FPGAs), and/or various combinations thereof. In one illustrative approach, methods described herein may be implemented by a series of computer-executable instructions residing on a storage medium such as a physical (e.g., non-transitory) computer-readable medium. In addition, although specific embodiments of the invention may employ object-oriented software programming concepts, the invention is not so limited and is easily adapted to employ other forms of directing the operation of a computer.
The invention can also be provided in the form of a computer program product comprising a computer readable storage or signal medium having computer code thereon, which may be executed by a computing device (e.g., a processor) and/or system. A computer readable storage medium can include any medium capable of storing computer code thereon for use by a computing device or system, including optical media such as read only and writeable CD and DVD, magnetic memory or medium (e.g., hard disk drive, tape), semiconductor memory (e.g., FLASH memory and other portable memory cards, etc.), firmware encoded in a chip, etc.
A computer readable signal medium is one that does not fit within the aforementioned storage medium class. For example, illustrative computer readable signal media communicate or otherwise transfer transitory signals within a system, between systems e.g., via a physical or virtual network, etc.
It will be clear that the various features of the foregoing methodologies may be combined in any way, creating a plurality of combinations from the descriptions presented above.
It will also be clear to one skilled in the art that the methodology of the present invention may suitably be embodied in a logic apparatus comprising logic to perform various steps of the methodology presented herein, and that such logic may comprise hardware components or firmware components.
It will be equally clear to one skilled in the art that the logic arrangement in various approaches may suitably be embodied in a logic apparatus comprising logic to perform various steps of the method, and that such logic may comprise components such as logic gates in, for example, a programmable logic array. Such a logic arrangement may further be embodied in enabling means or components for temporarily or permanently establishing logical structures in such an array using, for example, a virtual hardware descriptor language, which may be stored using fixed or transmittable carrier media.
It will be appreciated that the methodology described above may also suitably be carried out fully or partially in software running on one or more processors (not shown), and that the software may be provided as a computer program element carried on any suitable data carrier (also not shown) such as a magnetic or optical computer disc. The channels for the transmission of data likewise may include storage media of all descriptions as well as signal carrying media, such as wired or wireless signal media.
Embodiments of the present invention may suitably be embodied as a computer program product for use with a computer system. Such an implementation may comprise a series of computer readable instructions either fixed on a tangible medium, such as a computer readable medium, for example, diskette, CD-ROM, ROM, or hard disk, or transmittable to a computer system, via a modem or other interface device, over either a tangible medium, including but not limited to optical or analogue communications lines, or intangibly using wireless techniques, including but not limited to microwave, infrared or other transmission techniques. The series of computer readable instructions embodies all or part of the functionality previously described herein.
Those skilled in the art will appreciate that such computer readable instructions can be written in a number of programming languages for use with many computer architectures or operating systems. Further, such instructions may be stored using any memory technology, present or future, including but not limited to, semiconductor, magnetic, or optical, or transmitted using any communications technology, present or future, including but not limited to optical, infrared, or microwave. It is contemplated that such a computer program product may be distributed as a removable medium with accompanying printed or electronic documentation, for example, shrink-wrapped software, pre-loaded with a computer system, for example, on a system ROM or fixed disk, or distributed from a server or electronic bulletin board over a network, for example, the Internet or World Wide Web.
Communications components such as input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers.
Communications components such as buses, interfaces, network adapters, etc. may also be coupled to the system to enable the data processing system, e.g., host, to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters.
Various Embodiments of a Mobile Image Capture and Processing Algorithm
Various embodiments of a Mobile Image Capture and Processing algorithm, as well as several mobile applications configured to facilitate use of such algorithmic processing within the scope of the present disclosures are described below. It is to be appreciated that each section below describes functionalities that may be employed in any combination with those disclosed in other sections, including any or up to all the functionalities described herein. Moreover, functionalities of the processing algorithm embodiments as well as the mobile application embodiments may be combined and/or distributed in any manner across a variety of computing resources and/or systems, in several approaches.
An application may be installed on the mobile device, e.g., stored in a nonvolatile memory of the device. In one approach, the application includes instructions to perform processing of an image on the mobile device. In another approach, the application includes instructions to send the image to one or more non-mobile devices, e.g. a remote server such as a network server, a remote workstation, a cloud computing environment, etc. as would be understood by one having ordinary skill in the art upon reading the present descriptions. In yet another approach, the application may include instructions to decide whether to perform some or all processing on the mobile device and/or send the image to the remote site. Examples of how an image may be processed are presented in more detail below.
In one embodiment, there may be no difference between the processing that may be performed on the mobile device and a remote server, other than speed of processing, constraints on memory available, etc. Moreover, there may be some or no difference between various user interfaces presented on a mobile device, e.g. as part of a mobile application, and corresponding user interfaces presented on a display in communication with the non-mobile device.
In other embodiments, a remote server may have higher processing power, more capabilities, more processing algorithms, etc. In yet further embodiments, the mobile device may have no image processing capability associated with the application, other than that required to send the image to the remote server. In yet another embodiment, the remote server may have no image processing capability relevant to the platforms presented herein, other than that required to receive the processed image from the remote server. Accordingly, the image may be processed partially or entirely on the mobile device, and/or partially or entirely on a remote server, and/or partially or entirely in a cloud, and/or partially or entirely in any part of the overall architecture in between. Moreover, some processing steps may be duplicated on different devices.
Which device performs which parts of the processing may be defined by a user, may be predetermined, may be determined on the fly, etc. Moreover, some processing steps may be re-performed, e.g., upon receiving a request from the user. Accordingly, the raw image data, partially processed image data, or fully processed image data may be transmitted from the mobile device, e.g., using a wireless data network, to a remote system. Image data as processed at a remote system may be returned to the mobile device for output and/or further processing.
In a further approach, the image may be partitioned, and the processing of the various parts may be allocated to various devices, e.g., 1/2 to the mobile device and 1/2 to the remote server, after which the processed halves are combined.
In one embodiment, selection of which device performs the processing may be based at least in part on a relative speed of processing locally on the mobile device vs. communication with the server.
In one approach, a library of processing functions may be present, and the application on the mobile device or the application on a remote server simply makes calls to this library, and essentially the meaning of the calls defines what kind of processing to perform. The device then performs that processing and outputs the processed image, perhaps with some corresponding metadata.
Any type of image processing known in the art and/or as newly presented herein may be performed in any combination in various embodiments.
Referring now to illustrative image processing, the camera can be considered an area sensor that captures images, where the images may have any number of projective effects, and sometimes non-linear effects. The image may be processed to correct for such effects. Moreover, the position and boundaries of the document(s) in the image may be found during the processing, e.g., the boundaries of one or more actual pages of paper in the background surrounding the page(s). Because of the mobile nature of various embodiments, the sheet of paper may be lying on just about anything. This complicates image analysis in comparison to processing images of documents produced using a scanner, because scanner background properties are constant and typically known, whereas mobile capture backgrounds may vary almost infinitely according to the location of the document and the corresponding surrounding textures captured in the image background, as well as because of variable lighting conditions.
Accordingly, the non-uniformity of the background of the surface on which the piece of paper may be positioned for capture by the camera presents one challenge, and the non-linear and projective effects present additional challenges. Various embodiments overcome these challenges, as will soon become apparent.
In one exemplary mode of operation, an application on the mobile device may be initiated, e.g., in response to a user request to open the application. For example, a user-selection of an icon representing the application may be detected.
In some approaches, a user authentication may be requested and/or performed. For example, a user ID and password, or any other authentication information, may be requested and/or received from the user.
In further approaches, various tasks may be enabled via a graphical user interface of the application. For example, a list of tasks may be presented. In such case, a selection of one of the tasks by the user may be detected, and additional options may be presented to the user, a predefined task may be initiated, the camera may be initiated, etc.
An image may be captured by the camera of the mobile device, preferably upon receiving some type of user input such as detecting a tap on a screen of the mobile device, depression of a button on the mobile device, a voice command, a gesture, etc. Another possible scenario may involve some level of analysis of sequential frames, e.g. from a video stream. Sequential frame analysis may be followed by a switch to capturing a single high-resolution image frame, which may be triggered automatically or by a user, in some approaches. Moreover, the trigger may be based on information received from one or more mobile device sensors. For example, in one embodiment an accelerometer in or coupled to the mobile device may indicate a stability of the camera, and the application may analyze low-resolution video frame(s) for a document. If a document is detected, the application may perform a focusing operation and acquire a high-resolution image of the detected document. Either the low- or high-resolution image may be further processed, but preferred embodiments utilize the high-resolution image for subsequent processing. In more approaches, switching to single frame mode as discussed above may be unnecessary, particularly for smaller documents such as business cards and receipts. To increase processing rate and reduce consumption of processing resources, document type identification may facilitate determining whether or not to switch to single frame mode and/or capture a high-resolution image for processing. For the present discussion, assume an image of one or more documents is captured.
Given that mobile devices do not typically have the processing power of conventional non-mobile devices, one approach performs some limited processing on the mobile device, for example to let the user verify that the page(s) has been found correctly, that the image is not blurred, and/or that the lighting is adequate, e.g., a preview of sorts.
In one approach, the document(s) within the image captured by the camera may be found.
Additional methods of detecting one or more boundaries of the document(s) are also presented herein. If the document(s) in the image has nonlinearities or is not rectangular, correction processing may be applied.
Once the page(s) are found in the image, one embodiment performs a smooth transformation in order to make the page(s) rectangular, assuming of course the original piece of paper was rectangular. Another useful correction to the image may be mitigation of the unevenness of the illumination.
In one exemplary approach, page detection and rectangularization may be performed substantially as described below.
Various Embodiments of Mobile Page Detection
One exemplary embodiment illustrating an exemplary methodology for performing page detection will now be described with reference to FIGS. 3A-4. With reference to these descriptions, it will become clearer how the advantages implemented for a mobile processing algorithm as described herein handle images captured by area sensors (cameras) and compensate for the inherent difficulties presented thereby.
In one approach, and with particular reference to FIGS. 3A-3B, an edge detection algorithm proceeds from the boundaries of a digital image 300 toward a central region of the image 300, looking for points that are sufficiently different from what is known about the properties of the background.
Notably, the background 304 in the images captured by even the same mobile device may be different every time, so a new technique to identify the document(s) in the image is provided.
Finding page edges within a camera-captured image according to the present disclosures helps to accommodate important differences in the properties of images captured using mobile devices as opposed, e.g., to scanners. For example, due to projective effects the image of a rectangular document in a photograph may not appear truly rectangular, and opposite sides of the document in the image may not have the same length. Second, even the best lenses have some non-linearity resulting in straight lines within an object, e.g. straight sides of a substantially rectangular document, appearing slightly curved in the captured image of that object. Third, images captured using cameras overwhelmingly tend to introduce uneven illumination effects in the captured image. This unevenness of illumination makes even a perfectly uniform background of the surface against which a document may be placed appear in the image with varied brightness, and often with shadows, especially around the page edges if the page is not perfectly flat.
In an exemplary approach, to avoid mistaking the variability within the background for page edges, the current algorithm utilizes one or more of the following functionalities.
In various embodiments, the frame of the image contains the digital representation of the document 302 with margins of the surrounding background 304. In the preferred implementation the search for individual page edges 306 may be performed on a step-over approach analyzing rows and columns of the image from outside in. In one embodiment, the step-over approach may define a plurality of analysis windows 308 within the digital image 300, such as shown in FIGS. 3A-3B. As understood herein, analysis windows 308 may include one or more “background windows,” i.e. windows encompassing only pixels depicting the background 304 of the digital image 300, as well as one or more “test windows” i.e. windows encompassing pixels depicting the background 304 of the digital image 300, the digital representation of the document 302, or both.
In a preferred embodiment, the digital representation of the document may be detected in the digital image by defining a first analysis window 308, i.e. a background analysis window, in a margin of the image corresponding to the background 304 of the surface upon which the document is placed. Within the first analysis window 308, a plurality of small analysis windows (e.g. test windows 312 as shown in FIG. 3D) may be defined within the first analysis window 308. Utilizing the plurality of test windows 312, one or more distributions of one or more statistical properties descriptive of the background 304 may be estimated.
With continuing reference to the preferred embodiment discussed immediately above, a next step in detecting boundaries of the digital representation of the document may include defining a plurality of test windows 312 within the digital image, and analyzing the corresponding regions of the digital image. For each test window 312 one or more statistical values descriptive of the corresponding region of the image may be calculated. Further, these statistical values may be compared to a corresponding distribution of statistics descriptive of the background 304.
In a preferred approach, the plurality of test windows 312 may be defined along a path, particularly a linear path. In a particularly preferred approach, the plurality of test windows 312 may be defined in a horizontal direction and/or a vertical direction, e.g. along rows and columns of the digital image. Moreover, a stepwise progression may be employed to define the test windows 312 along the path and/or between the rows and/or columns. In some embodiments, as will be appreciated by one having ordinary skill in the art upon reading the present descriptions, utilizing a stepwise progression may advantageously increase the computational efficiency of document detection processes.
Moreover, the magnitude of the starting step may be estimated based on the resolution or pixel size of the image, in some embodiments, but this step may be reduced if advantageous for reliable detection of document sides, as discussed further below.
In more embodiments, the algorithm estimates the distribution of several statistics descriptive of the image properties found in a large analysis window 308 placed within the background surrounding the document. In one approach a plurality of small windows 312 may be defined within the large analysis window 308, and distributions of statistics descriptive of the small test windows 312 may be estimated. In one embodiment, large analysis window 308 is defined in a background region of the digital image, such as a top-left corner of the image.
Statistics descriptive of the background pixels may include any statistical value that may be generated from digital image data, such as a minimum value, a maximum value, a median value, a mean value, a spread or range of values, a variance, a standard deviation, etc. as would be understood by one having ordinary skill in the art upon reading the present descriptions. Values may be sampled from any data descriptive of the digital image 300, such as brightness values in one or more color channels, e.g. red-green-blue or RGB, cyan-magenta, yellow, black or CMYK, hue saturation value or HSV, etc. as would be understood by one having ordinary skill in the art upon reading the present descriptions.
As shown in FIG. 3D, each of the small analysis windows 312 may comprise a subset of the plurality of pixels within the large analysis window 308. Moreover, small analysis windows 312 may be of any size and/or shape capable of fitting within the boundaries of large analysis window 308. In a preferred embodiment, small analysis windows 312 may be characterized by a rectangular shape, and even more preferably a rectangle characterized by being three pixels long in a first direction (e.g. height) and seven pixels long in a second direction (e.g. width). Of course, other small analysis window sizes, shapes, and dimensions are also suitable for implementation in the presently disclosed processing algorithms.
In one embodiment, test windows may be employed to analyze an image and detect the boundary of a digital representation of a document depicted in the image. Background windows are used for estimation of original statistical properties of the background and/or reestimation of local statistical properties of the background. Reestimation may be necessary and/or advantageous in order to address artifacts such as uneven illumination and/or background texture variations.
Preferably, statistical estimation may be performed over some or all of a plurality of small analysis window(s) 312 in a large analysis window 308 within the margin outside of the document page in some approaches. Such estimation may be performed using a stepwise movement of a small analysis window 312 within the large analysis window 308, and the stepwise movement may be made in any suitable increment so as to vary the number of samples taken for a given pixel. For example, to promote computational efficiency, an analysis process may define a number of small analysis windows 312 within large analysis window 308 sufficient to ensure each pixel 318 is sampled once. Thus the plurality of small analysis windows 312 defined in this computationally efficient approach would share common borders but not overlap.
In another approach designed to promote robustness of statistical estimations, the analysis process may define a number of small analysis windows 312 within large analysis window 308 sufficient to ensure each pixel 318 is sampled a maximum number of times, e.g. by reducing the step to produce only a single pixel shift in a given direction between sequentially defined small analysis windows 312. Of course, any step increment may be employed in various embodiments of the presently disclosed processing algorithms, as would be understood by one having ordinary skill in the art upon reading the present descriptions.
The skilled artisan will appreciate that large analysis windows 308 utilized to reestimate statistics of local background in the digital image as well as test windows can be placed in the digital image in any which way desirable.
For example, according to one embodiment shown in FIG. 3A, the search for the left side edge in a given row i begins from the calculation of the above mentioned statistics in a large analysis window 308 adjacent to the frame boundary on the left side of the image centered around a given row i.
In still more embodiments, when encountering a possible non-background test window (e.g. a test window for which the estimated statistics are dissimilar from the distribution of statistics characteristic of the last known local background) as the algorithm progresses from the outer region(s) of the image towards the interior regions thereof, the algorithm may backtrack into a previously determined background region, form a new large analysis window 308 and reestimate the distribution of background statistics in order to reevaluate the validity of the differences between the chosen statistics within the small analysis window 312 and the local distribution of corresponding statistics within the large analysis window 308, in some embodiments.
As will be appreciated by one having ordinary skill in the art upon reading the present descriptions, the algorithm may proceed from an outer region of the image 300 to an inner region of the image 300 in a variety of manners. For example, in one approach the algorithm proceeds defining test windows 312 in a substantially spiral pattern. In other approaches the pattern may be substantially serpentine along either a vertical or a horizontal direction. In still more approaches the pattern may be a substantially shingled pattern. The pattern may also be defined by a “sequence mask” laid over part or all of the digital image 300, such as a checkerboard pattern, a vertically, horizontally, or diagonally striped pattern, concentric shapes, etc. as would be understood by one having ordinary skill in the art upon reading the present descriptions. In other embodiments, analysis windows such as large analysis windows 308 and/or small analysis windows 312 may be defined throughout the digital image 300 in a random manner, a pseudo-random manner, stochastically, etc. according to some defined procedure, as would be understood by one having ordinary skill in the art upon reading the present descriptions. The algorithm can proceed with a sequence of test windows in any desirable fashion as long as the path allows to backtrack into known background, and the path covers the whole image with desirable granularity.
Advantageously, recalculating statistics in this manner helps to accommodate for any illumination drift inherent to the digital image 300 and/or background 304, which may otherwise result in false identification of non-background points in the image (e.g. outlier candidate edge points 316 as shown in FIG. 3C.)
In still yet more embodiments, when the difference is statistically valid, the algorithm may jump a certain distance further along its path in order to check again and thus bypass small variations in the texture of the background 304, such as wood grain, scratches on a surface, patterns of a surface, small shadows, etc. as would be understood by one having ordinary skill in the art upon reading the present descriptions.
In additional and/or alternative embodiments, after a potential non-background point has been found, the algorithm determines whether the point lies on the edge of the shadow (a possibility especially if the edge of the page is raised above the background surface) and tries to get to the actual page edge. This process relies on the observation that shadows usually darken towards the real edge followed by an abrupt brightening of the image.
The above described approach to page edge detection was utilized because the use of standard edge detectors may be unnecessary and even undesirable, for several reasons. First, most standard edge detectors involve operations that are time consuming, and second, the instant algorithm is not concerned with additional requirements like monitoring how thin the edges are, which directions they follow, etc. Even more importantly, looking for page edges 306 does not necessarily involve edge detection per se, i.e. page edge detection according to the present disclosures may be performed in a manner that does not search for a document boundary (e.g. page edge 306), but rather searches for image characteristics associated with a transition from background to the document. For example, the transition may be characterized by flattening of the off-white brightness levels within a glossy paper, i.e. by changes in texture rather than in average gray or color levels.
As a result, it is possible to obtain candidate edge points (e.g. candidate edge points 314 as shown in FIG. 3C) that are essentially the first and the last non-background pixels in each row and column on a grid. In order to eliminate random outliers (e.g. outlier candidate edge points 316 as shown in FIG. 3C) and to determine which candidate edge points 314 correspond to each side of the page, it is useful in one approach to analyze neighboring candidate edge points.
In one embodiment, a “point” may be considered any region within the digital image, such as a pixel, a position between pixels (e.g. a point with fractional coordinates such as the center of a 2-pixel by 2-pixel square) a small window of pixels, etc. as would be understood by one having ordinary skill in the art upon reading the present descriptions. In a preferred embodiment, a candidate edge point is associated with the center of a test window (e.g. a 3-pixel×7-pixel window) that has been found to be characterized by statistics that are determined to be different from the distribution of statistics descriptive of the local background.
As understood herein, a “neighboring” candidate edge point, or a “neighboring” pixel is considered to be a point or pixel, respectively, which is near or adjacent a point or pixel of interest (e.g. pixel 318), e.g. a point or pixel positioned at least in part along a boundary of the point or pixel of interest, a point or pixel positioned within a threshold distance of the point or pixel of interest (such as within 2, 10, 64 pixels, etc. in a given direction, within one row of the point or pixel of interest, within one column of the point or pixel of interest), etc. as would be understood by one having ordinary skill in the art upon reading the present descriptions. In preferred approaches, the “neighboring” point or pixel may be the closest candidate edge point to the point of interest along a particular direction, e.g. a horizontal direction and/or a vertical direction.
Each “good” edge point ideally has at least two immediate neighbors (one on each side) and does not deviate far from a straight line segment connecting these neighbors and the “good” edge point, e.g. the candidate edge point and the at least two immediately neighboring points may be fit to a linear regression, and the result may be characterized by a coefficient of determination (R2) not less than 0.95. The angle of this segment with respect to one or more borders of the digital image, together with its relative location determines whether the edge point is assigned to top, left, right, or bottom side of the page. In a preferred embodiment, a candidate edge point and the two neighboring edge points may be assigned to respective corners of a triangle. If the angle of the triangle at the candidate edge point is close to 180 degrees, then the candidate edge point may be considered a “good” candidate edge point. If the angle of the triangle at the candidate edge point deviates far from 180 degrees by more than a threshold value (such as by 20 degrees or more), then the candidate edge point may be excluded from the set of “good” candidate edge points. The rationale behind this heuristic is based on the desire to throw out random errors in the determination of the first and last non-background pixels within rows and columns. These pixels are unlikely to exist in consistent lines, so checking the neighbors in terms of distance and direction is particularly advantageous in some approaches.
For speed, the step of this grid may start from a large number such as 32, but it may be reduced by a factor of two and the search for edge points repeated until there are enough of them to determine the Least Mean Squares (LMS) based equations of page sides (see below). If this process cannot determine the sides reliably even after using all rows and columns in the image, it gives up and the whole image is treated as the page.
The equations of page sides are determined as follows, in one embodiment. First, the algorithm fits the best LMS straight line to each of the sides using the strategy of throwing out worst outliers until all the remaining supporting edges lie within a small distance from the LMS line. For example, a point with the largest distance from a substantially straight line connecting a plurality of candidate edge points along a particular boundary of the document may be designated the “worst” outlier. This procedure may be repeated iteratively to designate and/or remove one or more “worst” outliers from the plurality of candidate edge point. In some approaches, the distance with which a candidate edge point may deviate from the line connecting the plurality of candidate edge points is based at least in part on the size and/or resolution of the digital image.
If this line is not well supported all along its stretch, the algorithm may attempt to fit the best second-degree polynomial (parabola) to the same original candidate points. The algorithmic difference between finding the best parabola vs. the best straight line is minor: instead of two unknown coefficients determining the direction and offset of the line there are three coefficients determining the curvature, direction, and offset of the parabola; however, in other respects the process is essentially the same, in one embodiment.
If the support of the parabola is stronger than that of the straight line, especially closer to the ends of the candidate edge span, the conclusion is that the algorithm should prefer the parabola as a better model of the page side in the image. Otherwise, the linear model is employed, in various approaches.
Intersections of the four found sides of the document may be calculated in order to find the corners of (possibly slightly curved) page tetragon, (e.g. tetragon 400 as shown in FIG. 4 and discussed in further detail below). In the preferred implementation in order to do this it is necessary to consider three cases: calculating intersections of two straight lines, calculating intersections of a straight line and a parabola, and calculating intersections of two parabolas.
In the first case there is a single solution (since top and bottom page edges 306 stretch mostly horizontally, while left and right page edges 306 stretch mostly vertically, the corresponding LMS lines cannot be parallel) and this solution determines the coordinates of the corresponding page corner.
The second case, calculating intersections of a straight line and a parabola, is slightly more complicated: there can be zero, one, or two solutions of the resulting quadratic equation. If there is no intersection, it may indicate a fatal problem with page detection, and its result may be rejected. A single solution is somewhat unlikely, but presents no further problems. Two intersections present a choice, in which case the intersection closer to the corresponding corner of the frame is a better candidate—in practice, the other solution of the equation may be very far away from the coordinate range of the image frame.
The third case, calculating intersections of two parabolas, results in a fourth degree polynomial equation that (in principle) may be solved analytically. However, in practice the number of calculations necessary to achieve a solution may be greater than in an approximate iterative algorithm that also guarantees the desired sub-pixel precision.
One exemplary procedure used for this purpose is described in detail below with reference to rectangularization of the digital representation of the document 302, according to one approach.
There are several constraints on the validity of the resulting target tetragon (e.g. tetragon 400 as discussed in further detail below with regard to FIG. 4). Namely, the tetragon is preferably not too small (e.g., below a predefined threshold of any desired value, such as 25% of the total area of the image), the corners of the tetragon preferably do not lie too far outside of the frame of the image (e.g. not more than 100 pixels away), and the corners themselves should preferably be interpretable as top-left, top-right, bottom-left and bottom-right with diagonals intersecting inside of the tetragon, etc. If these constraints are not met, a given page detection result may be rejected, in some embodiments.
In one illustrative embodiment where the detected tetragon of the digital representation of the document 302 is valid, the algorithm may determine a target rectangle. Target rectangle width and height may be set to the average of top and bottom sides of the tetragon and the average of left and right sides respectively.
In one embodiment, if skew correction is performed, the angle of skew of the target rectangle may be set to zero so that the page sides will become horizontal and vertical. Otherwise, the skew angle may be set to the average of the angles of top and bottom sides to the horizontal axis and those of the left and right sides to the vertical axis.
In a similar fashion, if crop correction is not performed, the center of the target rectangle may be designated so as to match the average of the coordinates of the four corners of the tetragon; otherwise the center may be calculated so that the target rectangle ends up in the top left of the image frame, in additional embodiments.
In some approaches, if page detection result is rejected for any reason, some or all steps of the process described herein may be repeated with a smaller step increment, in order to obtain more candidate edge points and, advantageously, achieve more plausible results. In a worst-case scenario where problems persist even with the minimum allowed step, the detected page may be set to the whole image frame and the original image may be left untouched.
Now with particular reference to an exemplary implementation of the inventive page detection embodiment described herein, in one approach page detection includes performing a method 1900 such as shown in FIG. 19. As will be appreciated by one having ordinary skill in the art upon reading the present descriptions, the method 1900 may be performed in any environment, including those described herein and represented in any of the Figures provided with the present disclosures.
In one embodiment, method 1900 includes operation 1902, where a plurality of candidate edge points corresponding to a transition from a digital image background to the digital representation of the document are defined.
In various embodiments, defining the plurality of candidate edge points in operation 1902 may include one or more additional operations such as operations 1904-1920, described below.
In operation 1904, according to one embodiment, a large analysis window (e.g. large analysis window 308 as shown in FIGS. 3A-3B and 3D is defined within the digital image 300. Preferably, a first large analysis window is defined in a region depicting a plurality of pixels of the digital image background 304, but not depicting the non-background (e.g. the digital representation of the document 302) in order to obtain information characteristic of the digital image background 304 for comparison and contrast to information characteristic of the non-background (e.g. the digital representation of the document 302, such as background statistics discussed in further detail below with reference to operation 1910). For example, the first large analysis window 308 may be defined in a corner (such as a top-left corner) of the digital image 300. Of course, the first large analysis window may be defined in any part of the digital image 300 without departing from the scope of the present disclosures.
Moreover, as will be understood by one having ordinary skill in the art upon reading the present descriptions, the large analysis window 308 may be any size and/or characterized by any suitable dimensions, but in preferred embodiments the large analysis window 308 is approximately forty pixels high and approximately forty pixels wide.
In particularly preferred approaches, the large analysis window 308 may be defined in a corner region of the digital image. For example, with reference to FIG. 3A, a digital image 300 is shown, the digital image 300 comprising a digital representation of a document 302 having a plurality of sides 306 and a background 304. As described above with reference to operation 1904, the large analysis window 308 may be defined in a region comprising a plurality of background pixels and not including pixels corresponding to the digital representation of the document 302. Moreover, the large analysis window 308 may be defined in the corner of the digital image 300, in some approaches.
In operation 1906, according to one embodiment, a plurality of small analysis windows 312 may be defined within the digital image 300, such as within the large analysis window 308. The small analysis windows 312 may overlap at least in part with one or more other small analysis windows 312 such as to be characterized by comprising one or more overlap regions 320 as shown in FIG. 3D. In a preferred approach all possible small analysis windows 312 are defined within the large analysis window 308. Of course, small analysis windows may be defined within any portion of the digital image, such as shown in FIG. 3B, and preferably small analysis windows may be defined such that each small analysis window is characterized by a single center pixel.
In operation 1908, according to one embodiment, one or more statistics are calculated for one or more small analysis windows 312 (e.g. one or more small analysis windows 312 within a large analysis window 308) and one or more distributions of corresponding statistics are estimated (e.g. a distribution of statistics estimated across a plurality of small analysis windows 312). In another embodiment, distributions of statistics may be estimated across one or more large analysis window(s) 308 and optionally merged.
Moreover, values may be descriptive of any feature associated with the background of the digital image, such as background brightness values, background color channel values, background texture values, background tint values, background contrast values, background sharpness values, etc. as would be understood by one having ordinary skill in the art upon reading the present descriptions. Moreover still, statistics may include a minimum, a maximum and/or a range of brightness values in one or more color channels of the plurality of pixels depicting the digital image background 304 over the plurality of small windows 312 within the large analysis window 308.
In operation 1910, according to one embodiment, one or more distributions of background statistics are estimated. By estimating the distribution(s) of statistics, one may obtain descriptive distribution(s) that characterize the properties of the background 304 of the digital image 300 within, for example, a large analysis window 308.
The distribution(s) preferably correspond to the background statistics calculated for each small analysis window, and may include, for example, a distribution of brightness minima, a distribution of brightness maxima, etc., from which one may obtain distribution statistical descriptors such as the minimum and/or maximum of minimum brightness values, the minimum and/or maximum of minimum brightness values, minimum and/or maximum spread of brightness values, minimum and/or maximum of minimum color channel values, minimum and/or maximum of maximum color channel values, minimum and/or maximum spread of color channel values etc. as would be appreciated by one having ordinary skill in the art upon reading the present descriptions. Of course, any of the calculated background statistics (e.g. for brightness values, color channel values, contrast values, texture values, tint values, sharpness values, etc.) may be assembled into a distribution and any value descriptive of the distribution may be employed without departing from the scope of the present disclosures.
In operation 1912, according to one embodiment, a large analysis window, such as analysis window 308 as shown in FIGS. 3A-3B is defined within the digital image 300.
Moreover, window shapes may be defined by positively setting the boundaries of the window as a portion of the digital image 300, may be defined by negatively, e.g. by applying a mask to the digital image 300 and defining the regions of the digital image 300 not masked as the analysis window. Moreover still, windows may be defined according to a pattern, especially in embodiments where windows are negatively defined by applying a mask to the digital image 300. Of course, other manners for defining the windows may be employed without departing from the scope of the present disclosures.
In operation 1914, according to one embodiment, one or more statistics are calculated for the analysis window 312. Moreover, in preferred embodiments each analysis window statistic corresponds to a distribution of background statistics estimated for the large analysis window 308 in operation 1910. For example, in one embodiment maximum brightness corresponds to distribution of background brightness maxima, minimum brightness corresponds to distribution of background brightness minima, brightness spread corresponds to distribution of background brightness spreads, etc. as would be understood by one having ordinary skill in the art upon reading the present descriptions.
In operation 1916, according to one embodiment, it is determined whether a statistically significant difference exists between at least one analysis window statistic and the corresponding distribution of background statistics. As will be appreciated by one having ordinary skill in the art upon reading the present descriptions, determining whether a statistically significant difference exists may be performed using any known statistical significance evaluation method or metric, such as a p-value, a z-test, a chi-squared correlation, etc. as would be appreciated by a skilled artisan reading the present descriptions.
In operation 1918, according to one embodiment, one or more points (e.g. the centermost pixel 318 or point) in the analysis window for which a statistically significant difference exists between a value describing the pixel 318 and the corresponding distribution of background statistics is designated as a candidate edge point. The designating may be accomplished by any suitable method known in the art, such as setting a flag corresponding to the pixel, storing coordinates of the pixel, making an array of pixel coordinates, altering one or more values describing the pixel 318 (such as brightness, hue, contrast, etc.), or any other suitable means.
In operation 1920, according to one embodiment, one or more of operations 1912-1918 may be repeated one or more times. In a preferred embodiment, a plurality of such repetitions may be performed, wherein each repetition is performed on a different portion of the digital image. Preferably, the repetitions may be performed until each side of the digital representation of the document has been evaluated. In various approaches, defining the analysis windows 308, 312 may result in a plurality of analysis windows 308, 312 which share one or more borders, which overlap in whole or in part, and/or which do not share any common border and do not overlap, etc. as would be understood by one having ordinary skill in the art upon reading the present descriptions.
In a particularly preferred embodiment, the plurality of repetitions may be performed in a manner directed to reestimate local background statistics upon detecting a potentially non-background window (e.g. a window containing a candidate edge point or a window containing an artifact such as uneven illumination, background texture variation, etc.).
In operation 1922, according to one embodiment, four sides of a tetragon 400 are defined based on the plurality of candidate edge points. Preferably, the sides of the tetragon 400 encompass the edges 306 of a digital representation of a document 302 in a digital image 300. Defining the sides of the tetragon 400 may include, in some approaches, performing one or more least-mean-squares (LMS) approximations.
In more approaches, defining the sides of the tetragon 400 may include identifying one or more outlier candidate edge points, and removing one or more outlier candidate edge points from the plurality of candidate edge points. Further, defining the sides of the tetragon 400 may include performing at least one additional LMS approximation excluding the one or more outlier candidate edge points.
Further still, in one embodiment each side of the tetragon 400 is characterized by an equation chosen from a class of functions, and performing the at least one LMS approximation comprises determining one or more coefficients for each equation, such as best coefficients of second degree polynomials in a preferred implementation. According to these approaches, defining the sides of the tetragon 400 may include determining whether each side of the digital representation of the document falls within a given class of functions, such as second degree polynomials or simpler functions such as linear functions instead of second degree polynomials.
In preferred approaches, performing method 1900 may accurately define a tetragon around the four dominant sides of a document while ignoring one or more deviations from the dominant sides of the document, such as a rip 310 and/or a tab 320 as depicted in FIGS. 3A-3C and 4.
Additional and/or alternative embodiments of the presently disclosed tetragon 400 may be characterized by having four sides, and each side being characterized by one or more equations such as the polynomial functions discussed above. For example, embodiments where the sides of tetragon 400 are characterized by more than one equation may involve dividing one or more sides into a plurality of segments, each segment being characterized by an equation such as the polynomial functions discussed above.
Defining the tetragon 400 may, in various embodiments, alternatively and/or additionally include defining one or more corners of the tetragon 400. For example, tetragon 400 corners may be defined by calculating one or more intersections between adjacent sides of the tetragon 400, and designating an appropriate intersection from the one or more calculated intersections in cases where multiple intersections are calculated. In still more embodiments, defining the corners may include solving one or more equations, wherein each equation is characterized by belonging to a chosen class of functions such as Nth degree polynomials, etc. as would be understood by one having ordinary skill in the art upon reading the present descriptions.
In various embodiments, a corner of the tetragon 400 may be defined by one or more of: an intersection of two curved adjacent sides of the tetragon 400; an intersection of two substantially straight lines; and an intersection of one substantially straight line and one substantially curved line.
In operation 1924, according to one embodiment, the digital representation of the document 302 and the tetragon 400 are output to a display of a mobile device. Outputting may be performed in any manner, and may depend upon the configuration of the mobile device hardware and/or software.
Moreover, outputting may be performed in various approaches so as to facilitate further processing and/or user interaction with the output. For example, in one embodiment the tetragon 400 may be displayed in a manner designed to distinguish the tetragon 400 from other features of the digital image 300, for example by displaying the tetragon 400 sides in a particular color, pattern, illumination motif, as an animation, etc. as would be understood by one having ordinary skill in the art upon reading the present descriptions.
Further still, in some embodiments outputting the tetragon 400 and the digital representation of the document 302 may facilitate a user manually adjusting and/or defining the tetragon 400 in any suitable manner. For example, a user may interact with the display of the mobile device to translate the tetragon 400, i.e. to move the location of the tetragon 400 in one or more directions while maintaining the aspect ratio, shape, edge lengths, area, etc. of the tetragon 400. Additionally and/or alternatively, a user may interact with the display of the mobile device to manually define or adjust locations of tetragon 400 corners, e.g. tapping on a tetragon 400 corner and dragging the corner to a desired location within the digital image 300, such as a corner of the digital representation of the document 302.
Referring again to FIG. 4, one particular example of an ideal result of page detection is depicted, showing the digital representation of the document 302 within the digital image 300, and having a tetragon 400 that encompasses the edges of the digital representation of the document 302.
In some approaches page detection such as described above with reference to FIG. 19 and method 1900 may include one or more additional and/or alternative operations, such as will be described below.
In one approach, method 1900 may further include capturing one or more of the image data containing the digital representation of the document and audio data relating to the digital representation of the document. Capturing may be performed using one or more capture components coupled to the mobile device, such as a microphone, a camera, an accelerometer, a sensor, etc. as would be understood by one having ordinary skill in the art upon reading the present descriptions.
In another approach, method 1900 may include defining a new large analysis window 309 and reestimating the distribution of background statistics for the new large analysis window 309 upon determining that the statistically significant difference exists, i.e. essentially repeating operation 1908 and/or 1910 in a different region of the digital image 300 near a point where a potentially non-background point has been identified, such as near one of the edges 306 of the document.
In several exemplary embodiments, a large analysis window 308 may be positioned near or at the leftmost non-background pixel in a row or positioned near or at the rightmost non-background pixel in a row, positioned near or at the topmost non-background pixel in a column, positioned near or at bottommost non-background pixel in a column.
Approaches involving such reestimation may further include determining whether the statistically significant difference exists between at least one small analysis window (e.g. a test window) statistic and the corresponding reestimated distribution of large analysis window statistics. In this manner, it is possible to obtain a higher-confidence determination of whether the statistically significant difference exists, and therefore better distinguish true transitions from the digital image background to the digital representation of the document as opposed to, for example, variations in texture, illumination anomalies, and/or other artifacts within the digital image.
Moreover, with or without performing reestimation as described above may facilitate the method 1900 avoiding one or more artifacts such as variations in illumination and/or background texture, etc. in the digital image, the artifacts not corresponding to a true transition from the digital image background to the digital representation of the document. In some approaches, avoiding artifacts may take the form of bypassing one or more regions (e.g. regions characterized by textures, variations, etc. that distinguish the region from the true background) of the digital image.
In some approaches, one or more regions may be bypassed upon determining a statistically significant difference exists between a statistical distribution estimated for the large analysis window 308 and a corresponding statistic calculated for the small analysis window 312, defining a new large analysis window near the small analysis window, reestimating the distribution of statistics for the new large analysis window, and determining that the statistically significant difference does not exist between the reestimated statistical distribution and the corresponding statistic calculated for the small analysis window 312.
In other approaches, bypassing may be accomplished by checking another analysis window 312 further along the path and resuming the search for a transition to non-background upon determining that the statistics of this checked window do not differ significantly from the known statistical properties of the background, e.g. as indicated by a test of statistical significance.
As will be appreciated by the skilled artisan upon reading the present disclosures, bypassing may be accomplished by checking another analysis window further along the path.
In still further approaches, page detection may additionally and/or alternatively include determining whether the tetragon 400 satisfies one or more quality control metrics; and rejecting the tetragon 400 upon determining the tetragon 400 does not satisfy one or more of the quality control metrics. Moreover, quality control metrics may include measures such as a LMS support metric, a minimum tetragon 400 area metric, a tetragon 400 corner location metric, and a tetragon 400 diagonal intersection location metric.
In practice, determining whether the tetragon 400 satisfies one or more of these metrics acts as a check on the performance of method 1900. For example, checks may include determining whether the tetragon 400 covers at least a threshold of the overall digital image area, e.g. whether the tetragon 400 comprises at least 25% of the total image area. Furthermore, checks may include determining whether tetragon 400 diagonals intersect inside the boundaries of the tetragon 400, determining whether one or more of the LMS approximations were calculated from sufficient data to have robust confidence in the statistics derived therefrom, i.e. whether the LMS approximation has sufficient “support,” (such as an approximation calculated from at least five data points, or at least a quarter of the total number of data points, in various approaches), and/or determining whether tetragon 400 corner locations (as defined by equations characterizing each respective side of the tetragon 400) exist within a threshold distance of the edge of the digital image, e.g. whether tetragon 400 corners are located more than 100 pixels away from an edge of the digital image in a given direction. Of course, other quality metrics and/or checks may be employed without departing from the scope of these disclosures, as would be appreciated by one having ordinary skill in the art upon reading the present descriptions.
In one approach, quality metrics and/or checks may facilitate rejecting suboptimal tetragon 400 definitions, and further facilitate improving the definition of the tetragon 400 sides. For example, one approach involves receiving an indication that the defining the four sides of the tetragon 400 based on the plurality of candidate edge points failed to define a valid tetragon 400, i.e. failed to satisfy one or more of the quality control metrics; and redefining the plurality of candidate edge points. Notably, in this embodiment redefining the plurality of candidate edge points includes sampling a greater number of points within the digital image than a number of points sampled in the prior, failed attempt. This may be accomplished, in one approach, by reducing the step over one or more of rows or columns of the digital image and repeating all the steps of the algorithm in order to analyze a larger number of candidate edge points. The step may be decreased in a vertical direction, a horizontal direction, or both. Of course, other methods of redefining the candidate edge points and/or resampling points within the digital image may be utilized without departing from the scope of the present disclosures.
Further still, page detection may include designating the entire digital image as the digital representation of the document, particularly where multiple repetitions of method 1900 failed to define a valid tetragon 400, even with significantly reduced step in progression through the digital image analysis. In one approach, designating the entire digital image as the digital representation of the document may include defining image corners as document corners, defining image sides as document sides, etc. as would be understood by one having ordinary skill in the art upon reading the present descriptions.
As described herein, the diagonals of the tetragon 400 may be characterized by a first line connecting a calculated top left corner of the tetragon 400 to a calculated bottom right corner of the tetragon 400, and second line connecting a calculated top right corner of the tetragon 400 and a calculated bottom left corner of the tetragon 400. Moreover, the first line and the second line preferably intersect inside the tetragon 400.
In various approaches, one or more of the foregoing operations may be performed using a processor, and the processor may be part of a mobile device, particularly a mobile device having an integrated camera.
Additional Image Processing
In many approaches, the presently disclosed inventive concepts may further include image processing such as described in detail in the related Patent Documents herein incorporated by reference, including but not limited to rectangularization, illumination detection and normalization, blur detection, resolution estimation, etc. Similarly, the presently disclosed inventive concepts may be used in conjunction with data extraction and validation, without departing from the scope of these descriptions.
Mobile Document Classification and Data Extraction
Preferably, upon detecting the tetragon as described above, the presently disclosed inventive concepts include determining the type of document depicted in the image, and extracting therefrom relevant information, e.g. information depicted in one or more fields of a standard form.
Accordingly, the presently disclosed inventive concepts may include performing classification and/or extraction operation(s) as described in U.S. Patent Publication No. 2014/0270439; and/or U.S. Patent Publication No. 2014/0270536 to extract as much information as possible from the image based on the object class and corresponding extraction model.
More preferably, the detected document (as indicated by the defined tetragon) is classified and information depicted on the document is determined with respect to (1) location; and (2) identity. Most preferably, information depicted on the document is determined, and associated with the image as a plurality of metadata labels defining the location where the information is located within the image, and the type of information (e.g. “name,” “address,” “social security number,” etc.). The type of information may be defined with respect to relevance in a subsequent workflow or processing operation for which the document and/or image are useful.
Additionally and/or alternatively, it may be possible to determine a type of information expected for a particular “field” of a document, even if the field does not depict any such information therein. For example, based on a field name or location (e.g. relative position in comparison with one or more other fields) it is possible to determine a type of information appropriate for entry into a particular empty field, and thus an appropriate metadata label may be generated on this basis even when the information is not necessarily present in the image captured.
Generating Electronic Form from Captured Image
Advantageously, upon processing the digital image to detect the document and determine the location and/or type of information depicted thereon, it is possible to utilize the image as a “background” layer upon which multiple fields may be overlayed in an electronic document format (such as printable document format, PDF). In this manner, the mobile device may serve as a complete capture-to-form imaging and processing solution. Of course, the mobile device may be utilized in conjunction with one or more other mobile devices, servers, etc. to facilitate processing and form generation, in more embodiments.
In more approaches, it is possible to combine results from capturing and processing an image of a document with a pre-existing electronic document. For example, in one approach it is useful to employ a document background generated by some industry standard. For instance, the insurance industry has standard forms for a particular type of claim. A Tillable electronic version of the standard claim may be obtained, and used as a background layer upon which extracted information may be overlayed, rather than overlaying the extracted information onto the image of the captured document. Thus, a user submitting that particular type of claim could capture an image of a document depicting some or all of the necessary information (preferably an image of the standard form for that particular type of claim) and fill in the extracted fields on that background instead of on the one captured.
Field taxonomy may also be custom generated, or based on a predefined standard, to facilitate downstream use of extracted information according to industry-standard nomenclature, for example.
Thus, in one embodiment, a method 500 is shown in FIG. 5. The method 500 is generally configured for capturing and processing images of documents as described herein, and further configured to facilitate generating electronic documents and forms directly from captured image data, and/or using standard forms as a background layer upon which fields may be overlayed. The method 500 may be performed in any suitable environment, including those depicted in FIGS. 1-4, among others.
In one instance, method 500 includes operation 502, where image data are captured using a mobile device. The image data depict a digital representation of a document.
In another approach, method 500 includes operation 504, where a plurality of candidate edge points corresponding to the document are defined based on the image data.
In yet another approach, method 500 includes operation 506, where four sides of a tetragon are defined based on at least some of the plurality of candidate edge points.
In still another embodiment, method 500 includes operation 508, a plurality of fields are determined within the tetragon. The plurality of fields may be determined using any known technique, and preferably are determined based on a learn-by-example (LBE) discriminative classification technique.
In additional approaches, method 500 includes operation 510, where a field location and field data type are determined for each field. Field data type may include any contextually appropriate classification of information depicted in a field, such as field value, field format, a descriptive identifier of a field value (e.g. name, address, phone number, date of birth, balance, date due, etc. as would be understood by a person having ordinary skill in the art upon reading the present descriptions. Field location may be determined in terms of absolute or relative location, e.g. an absolute set of coordinates (e.g. pixel coordinates) and/or relative position with reference to one or more additional features of the document (e.g. number of pixels above, below, left or right of a particular reference feature).
In an exemplary embodiment, method 500 includes operation 512, in which each determined field is associated with the correspondingly determined field location information and field data type. Preferably, the information are associated as a plurality of metadata labels, such that in operation 514 the metadata labels may be associated with an image of an electronic form.
It will be further appreciated that embodiments of the present invention may be provided in the form of a service deployed on behalf of a customer to offer service on demand. For example, in one approach it is advantageous for a user to be provided capabilities including capturing an image of a document and generating therefrom an electronic form as set forth above, as well as the ability to transmit that form, e.g. via email, SMS notification, or any other suitable medium, to a third party for subsequent use. For example, the third party may include a client, service provider, customer, etc. requesting information from the user. By providing that information in an electronic form, preferably a standard form or a form expected by the third party, the information may be provided in a facile and secure manner to facilitate the third party processing the necessary information to conduct the underlying workflow, e.g. an insurance claim or loan application process.
While various embodiments have been described above, it should be understood that they have been presented by way of example only, and not limitation. Thus, the breadth and scope of an embodiment of the present invention should not be limited by any of the above-described exemplary embodiments, but should be defined only in accordance with the following claims and their equivalents.

## Claims

1. A computer implemented method, comprising:
capturing image data using a mobile device, the image data depicting a digital representation of a document;
defining, using a possessor and based on the image data, a plurality of candidate edge points corresponding to the document;
defining four sides of a tetragon based on at least some of the plurality of candidate edge points;
determining a plurality of fields within the tetragon;
for each field, determining at least a field location and a field data type;
associating each determined field location with each field data type to generate a plurality of metadata labels;
associating the plurality of metadata labels with an image of an electronic form
extracting data from the tetragon; and
populating the electronic form with the extracted data.

2. The method as recited in claim 1, wherein the electronic form is the digital representation of the document within the tetragon.

3. The method as recited in claim 1, further comprising generating the electronic form based on the digital representation of the document within the tetragon.

4. The method as recited in claim 3, wherein generating the electronic form comprises:
extracting the tetragon;
rectangularizing the tetragon;
rendering the rectangularized tetragon as a background layer of a digital image;
overlaying a plurality of fields on the background layer; and
associating one of the metadata labels with each of the plurality of fields based on a location of the field.

5. The method as recited in claim 1, further comprising generating the electronic form based on an image of a standard form.

6. The method as recited in claim 1, further comprising determining a type of the document, wherein determining the plurality of fields within the tetragon is based at least in part on the determined type of document.

7. The method as recited in claim 1, further comprising validating the extracted data.

8. The method as recited in claim 1, wherein the electronic form comprises a fillable printable document format (PDF) document.

9. A system, comprising: a processor configured to execute logic, the logic being configured to cause the processor to:
receive image data captured using a mobile device, the image data depicting a digital representation of a document;
define, based on the image data, a plurality of candidate edge points corresponding to the document;
define four sides of a tetragon based on at least some of the plurality of candidate edge points;
determine a plurality of fields within the tetragon;
for each field, determine at least a field location and a field data type;
associate each determined field location with each field data type to generate a plurality of metadata labels;
associate the plurality of metadata labels with an image of an electronic form
extract data from the tetragon; and
populate the electronic form with the extracted data.

10. The system as recited in claim 9, wherein the electronic form is the digital representation of the document within the tetragon.

11. The system as recited in claim 9, further comprising logic configured to cause the processor to generate the electronic form based on the digital representation of the document within the tetragon.

12. The system as recited in claim 11, wherein the logic configured to cause the processor to generate the electronic form comprises logic configured to cause the processor to:
extracting the tetragon;
rectangularizing the tetragon;
rendering the rectangularized tetragon as a background layer of a digital image;
overlaying a plurality of fields on the background layer; and
associating one of the metadata labels with each of the plurality of fields based on a location of the field.

13. The system as recited in claim 9, further comprising logic configured to cause the processor to generate the electronic form based on an image of a standard form.

14. The system as recited in claim 9, further comprising logic configured to cause the processor to determine a type of the document, wherein determining the plurality of fields within the tetragon is based at least in part on the determined type of document.

15. The system as recited in claim 9, further comprising logic configured to cause the processor to validate the extracted data.

16. The system as recited in claim 9, wherein the electronic form comprises a fillable printable document format (PDF) document.

17. The system as recited in claim 16, further comprising transmitting the PDF document via electronic mail.

18. A computer program product comprising a non-transitory computer readable medium having embodied therewith computer readable program code, the computer readable program code comprising:
computer readable program code configured to capture image data using a mobile device, the image data depicting a digital representation of a document;
computer readable program code configured to define, based on the image data, a plurality of candidate edge points corresponding to the document;
computer readable program code configured to define four sides of a tetragon based on at least some of the plurality of candidate edge points; and
computer readable program code configured to determine a plurality of fields within the tetragon;
computer readable program code configured to for each field, determine at least a field location and a field data type;
computer readable program code configured to associate each determined field location with each field data type to generate a plurality of metadata labels;
computer readable program code configured to associate the plurality of metadata labels with an image of an electronic form
extract data from the tetragon; and
populate the electronic form with the extracted data.