Abstract:
A system and method of converting the content of a regular whiteboard into an electronic document. This system and method provides an effective, economical and easy to use way to convert whiteboard content as an enhanced and easily editable electronic document though the use of a still or video camera. It uses a series of image processing steps to clip borders, rectify the whiteboard image and correct colors.

Description:
BACKGROUND 
   1. Technical Field 
   This invention is directed toward a system and method for creating editable whiteboard content. More specifically, the invention is directed toward a system and method for converting an image of a whiteboard into an editable electronic document. 
   2. Background Art 
   Meetings constitute a large part of many workers&#39; working time. Making more efficient use of this time spent in meetings translates into a big increase in productivity. 
   Many meeting scenarios use a whiteboard extensively for brainstorming sessions, lectures, project planning meetings, patent disclosures, and so on. Note-taking and copying what is written on the board often interferes with many participants&#39; active contribution and involvement during these meetings. As a result, some efforts have been undertaken to capture whiteboard content in some automated fashion. 
   Several technologies have been developed to capture the whiteboard content automatically. One of the earliest, the whiteboard copier, is a special electronic whiteboard with a built-in copier. With a click of a button, the whiteboard content is scanned and printed. Once the whiteboard content is on paper, it can be photocopied, faxed, put away in the file cabinet, or scanned into digital form. 
   More recent technologies attempt to capture the whiteboard content in digital form from the start. They generally fall into two categories—those that capture images of the whiteboard and those that track pen location and infer whiteboard content therefrom. 
   The devices in the first category capture images of the whiteboard directly. National Television System Committee (NTSC)-resolution video cameras are often used because of their low cost. Since these cameras usually do not have enough resolution to clearly capture what is written on a typical conference room size whiteboard, several video frames must be stitched together to create a single whiteboard image. Another device in this first category is the digital still camera. As high-resolution digital cameras get cheaper, taking snapshots of the board with a digital camera may become a popular choice. However, photographs of a whiteboard are often difficult to read because of light reflections and skewed camera angles relative to the whiteboard. Additionally, such snapshots are not editable in typical office productivity software such as word processors, databases, drawing programs and the like. 
   Devices in the second category track the location of the pen used to write on the whiteboard at high frequency and infer the content of the whiteboard from the history of the pen coordinates. Sometimes they include an add-on device attached to the side of a conventional whiteboard and use special cases for the dry-ink pens and eraser. Each pen emits ultrasonic pulses when pressed against the board. Two receivers at the add-on device use the difference in time-of-arrival of the audio pulses to triangulate the pen coordinates. Since the history of the pen coordinates is captured, the content on the whiteboard at any given moment can be reconstructed later. The user of this type of whiteboard recording can play back the whiteboard content like a movie. Because the content is captured in vector form, it can be transmitted and archived with low bandwidth and small storage requirements. 
   Electronic whiteboards also use pen tracking technology. They go one step further than the systems using the previously discussed add-on devices by making the whiteboard an interactive device. The user writes on a monitor with a special stylus that is tracked by the computer. The computer renders the strokes on the screen wherever the stylus touches the screen—as if the ink is deposited by the stylus. Because the strokes are computer generated, they can be edited, re-flowed, and animated. The user can also issue gesture commands to the computer and show other computer applications on the same screen. 
   Electronic whiteboards, however, currently still have limited installation base due to their high cost and small sizes (the size of an electronic whiteboard rarely exceeds 6 feet in diagonal). Furthermore, systems with pen-tracking devices have the following disadvantages: 1) If the system is not on or the user writes without using the special pens, the content cannot be recovered by the device; 2) Many people like to use their fingers to correct small mistakes on the whiteboard instead of the special eraser. This common behavior causes extra strokes to appear on the captured content; 3) People have to use special dry-ink pen adapters, which make them much thicker and harder to press, for some of the devices; and 4) Imprecision of pen tracking sometimes causes mis-registration of adjacent pen strokes. 
   It is noted that in the remainder of this specification, the description refers to various individual publications identified by a numeric designator contained within a pair of brackets. For example, such a reference may be identified by reciting, “reference [1]” or simply “[1]”. A listing of the publications corresponding to each designator can be found at the end of the Detailed Description section. 
   SUMMARY 
   The invention is directed toward a system and method of converting the content of a regular whiteboard into an electronic document. This system and method provides an effective, economical and user-friendly way to convert an image of whiteboard content to an enhanced and easily editable electronic document though the use of a camera. It uses a series of image processing process actions to do such things as clip borders, rectify the whiteboard image and correct colors for improved legibility. 
   The system and method of the invention starts by acquiring an image of a whiteboard or similar planar object (e.g., poster) with an analog or digital camera. The image could be acquired with a still camera or a video camera. If the image is captured with an analog camera it should be digitized prior to further processing. Although the system and method of the invention could be used with any planar object the following paragraphs will describe the invention in terms of converting an image of a whiteboard to an electronic document. 
   The whiteboard is first located in the image. In one embodiment of the invention, this is done by detecting four strong edges corresponding to the whiteboard edges. The whiteboard usually appears to be a general quadrangle, rather than a rectangle, in an image because of the camera&#39;s perspective projection. If a whiteboard does not have strong enough edges, an interface is provided for a user to manually localize the quadrangle. Alternate conventional ways of detecting whiteboard boundaries in the image may also be used. 
   The system then estimates the actual aspect ratio of the whiteboard from the quadrangle located in the image. Besides the aspect ratio, the focal length of the camera can also be estimated. 
   Once the aspect ratio is obtained, the image is rectified. From the estimated aspect ratio, and by choosing the “largest” whiteboard pixel as the standard pixel in the final image, the desired resolution of the final image can be computed. A planar mapping (in one embodiment a 3×3 homography matrix) is then computed from the original image quadrangle to the final image rectangle, and the whiteboard image is rectified accordingly. 
   The background color of the whiteboard is white balanced. This involves two procedures. The first is the estimation of the background color (the whiteboard color under the same lighting without anything written on it). This is not a trivial task because of the complex lighting environment, whiteboard reflection and the quality of strokes written on the whiteboard. The second procedure concerns the actual white-balancing. In the white-balancing process, the background is made uniformly white. Additionally, the color saturation of the pen strokes is increased. The output of the system and method according to the invention is a crisp legible image that ready to be integrated with any other electronic document. 
   This output is then ready to be vectorized using image vectorization procedures. Image vectorization transforms a bitmap image into vector drawings such as freeform curves, lines and arcs. Tablet PC inks use a vector representation, and therefore a whiteboard image after vectorization can be exported into a Tablet PC. Microsoft&#39;s® Tablet PC is a design for a fully-equipped personal computer that allows a user to take notes using natural handwriting on a stylus or digital pen-sensitive touch screen instead of requiring the use of a keyboard. 
   The system and method according to the invention has many advantages. For instance, it is very easy and inexpensive to obtain editable images and text using a simple image of a conventional whiteboard with regular dry ink marker markings. No expensive electronic whiteboard or tracking system is required. Furthermore, the vectorized form of the whiteboard content is more useful for handwriting recognition and can more efficiently be compressed. Additionally, the contents of the whiteboard formatted in vectorized form is efficient to transmit since it requires little bandwidth. 
   In addition to the just described benefits, other advantages of the present invention will become apparent from the detailed description which follows hereinafter when taken in conjunction with the drawing figures which accompany it. 

   
     DESCRIPTION OF THE DRAWINGS 
     The file of this patent contains at least one drawing executed in color. Copies of this patent with color drawing(s) will be provided by the U.S. Patent and Trademark Office upon request and payment of the necessary fee. 
     The specific features, aspects, and advantages of the invention will become better understood with regard to the following description, appended claims, and accompanying drawings where: 
       FIG. 1  is a diagram depicting a general purpose computing device constituting an exemplary system for implementing the invention. 
       FIG. 2  is a general flow diagram of the system and method according to the invention. 
       FIG. 3  is a flow diagram depicting the process of automatically detecting a whiteboard in an image according to the system and method of the invention. 
       FIG. 4  is a flow diagram depicting the edge detection process according to the system and method according to the invention. 
       FIG. 5  is a flow diagram depicting the process of using a Hough transform to identify straight lines in the image in the system and method according to the invention. 
       FIG. 6  is a flow diagram depicting the process of forming a quadrangle encompassing the whiteboard in the system and method according to the invention. 
       FIG. 7  is an example of a bad quadrangle. 
       FIG. 8  is a flow diagram depicting the system and process of verifying an identified quadrangle in the system and method according to the present invention. 
       FIG. 9  shows the geometry of a rectangle. 
       FIG. 10  depicts the rectification of a whiteboard image. Left is the original shape and right is the rectified shape. 
       FIG. 11  depicts a flow diagram showing quadrangle rectification according to the system and method of the invention. 
       FIG. 12  shows the rectified version of the first two images shown in  FIG. 8 , using estimated aspect ratio. They correspond to  FIG. 13A  and  FIG. 13B . The rectified images look almost identical despite that the original images were taken from quite different angles. Other rectified images are also similar, and are thus not shown. 
       FIGS. 13A–13F  depict six images of the same whiteboard taken from different angles. 
       FIG. 14  is a flow diagram depicting the white-balancing according to the system and method of the invention. 
       FIG. 15  is a flow diagram depicting the calculation of whiteboard color according to the system and method of the invention. 
       FIGS. 16A–16D  depict an example of automatic whiteboard detection and rectification:  FIG. 16A  is an original image together with the detected corners shown in small white squares.  FIG. 16B  shows and edge image.  FIG. 16C  is a Hough image with ρ in horizontal axis and θ in vertical axis.  FIG. 16D  is a cropped and rectified whiteboard image. 
       FIGS. 17A–D  should an example of automatic whiteboard detection and rectification.  FIG. 17A  is the original image together with the detected corners shown in small red dots (note that the upper right corner is outside of the image);  FIG. 17B  is an edge image.  FIG. 17C  is a Hough image with ρ in the horizontal axis and θ in the vertical axis.  FIG. 17D  is a cropped and rectified whiteboard image according to the system and method of the invention. 
       FIGS. 18A–18D  show a failure example.  FIG. 18A  is an original image together with the detected corners shown in small red dots.  FIG. 18B  is an edge image.  FIG. 18C  is a Hough image with ρ in horizontal axis and θ in vertical axis.  FIG. 18D  is a cropped and rectified whiteboard image. 
       FIGS. 19A and 19B  shows the system and method according to the invention working on a whiteboard with complex drawings and complex lighting conditions. 
       FIGS. 20A and 20B  show the system and method according to the invention working on a poster.  FIG. 20A  shows the original image of the poster.  FIG. 20B  shows the transformed image of the poster using the system and method according to the invention. 
       FIG. 21A and 21B  show two images of the same whiteboard but taken from very different angles.  FIG. 21A  is taken from the front.  FIG. 21B  is taken from the side. The aspect ratio estimated from both images is very close to ground truth. The estimated aspect ratio for  FIG. 21A  is 1.06 and for  FIG. 21B  the aspect ratio is 1.056. The manually measured aspect ratio is 1.05 (the whiteboard size is 42″ by 40″. The estimated focal length is 842 pixels for  FIG. 21A  and 781 for  FIG. 21B .  FIG. 21B  was taken with a small zoom out. 
   

   DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
   In the following description of the preferred embodiments of the present invention, reference is made to the accompanying drawings that form a part hereof, and in which is shown by way of illustration specific embodiments in which the invention may be practiced. It is understood that other embodiments may be utilized and structural changes may be made without departing from the scope of the present invention. 
   1.0 Exemplary Operating Environment 
     FIG. 1  illustrates an example of a suitable computing system environment  100  on which the invention may be implemented. The computing system environment  100  is only one example of a suitable computing environment and is not intended to suggest any limitation as to the scope of use or functionality of the invention. Neither should the computing environment  100  be interpreted as having any dependency or requirement relating to any one or combination of components illustrated in the exemplary operating environment  100 . 
   The invention is operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with the invention include, but are not limited to, personal computers, server computers, hand-held or laptop devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. 
   The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices. 
   With reference to  FIG. 1 , an exemplary system for implementing the invention includes a general purpose computing device in the form of a computer  110 . Components of computer  110  may include, but are not limited to, a processing unit  120 , a system memory  130 , and a system bus  121  that couples various system components including the system memory to the processing unit  120 . The system bus  121  may be any of several types of bus structures including a memory bus or memory controller, a peripheral bus, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus also known as Mezzanine bus. 
   Computer  110  typically includes a variety of computer readable media. Computer readable media can be any available media that can be accessed by computer  110  and includes both volatile and nonvolatile media, removable and non-removable media. By way of example, and not limitation, computer readable media may comprise computer storage media and communication media. Computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by computer  110 . Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. The term “modulated data signal” means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, RF, infrared and other wireless media. Combinations of the any of the above should also be included within the scope of computer readable media. 
   The system memory  130  includes computer storage media in the form of volatile and/or nonvolatile memory such as read only memory (ROM)  131  and random access memory (RAM)  132 . A basic input/output system  133  (BIOS), containing the basic routines that help to transfer information between elements within computer  110 , such as during start-up, is typically stored in ROM  131 . RAM  132  typically contains data and/or program modules that are immediately accessible to and/or presently being operated on by processing unit  120 . By way of example, and not limitation,  FIG. 1  illustrates operating system  134 , application programs  135 , other program modules  136 , and program data  137 . 
   The computer  110  may also include other removable/non-removable, volatile/nonvolatile computer storage media. By way of example only,  FIG. 1  illustrates a hard disk drive  141  that reads from or writes to non-removable, nonvolatile magnetic media, a magnetic disk drive  151  that reads from or writes to a removable, nonvolatile magnetic disk  152 , and an optical disk drive  155  that reads from or writes to a removable, nonvolatile optical disk  156  such as a CD ROM or other optical media. Other removable/non-removable, volatile/nonvolatile computer storage media that can be used in the exemplary operating environment include, but are not limited to, magnetic tape cassettes, flash memory cards, digital versatile disks, digital video tape, solid state RAM, solid state ROM, and the like. The hard disk drive  141  is typically connected to the system bus  121  through anon-removable memory interface such as interface  140 , and magnetic disk drive  151  and optical disk drive  155  are typically connected to the system bus  121  by a removable memory interface, such as interface  150 . 
   The drives and their associated computer storage media discussed above and illustrated in  FIG. 1 , provide storage of computer readable instructions, data structures, program modules and other data for the computer  110 . In  FIG. 1 , for example, hard disk drive  141  is illustrated as storing operating system  144 , application programs  145 , other program modules  146 , and program data  147 . Note that these components can either be the same as or different from operating system  134 , application programs  135 , other program modules  136 , and program data  137 . Operating system  144 , application programs  145 , other program modules  146 , and program data  147  are given different numbers here to illustrate that, at a minimum, they are different copies. A user may enter commands and information into the computer  110  through input devices such as a keyboard  162  and pointing device  161 , commonly referred to as a mouse, trackball or touch pad. Other input devices (not shown) may include a microphone, joystick, game pad, satellite dish, scanner, or the like. These and other input devices are often connected to the processing unit  120  through a user input interface  160  that is coupled to the system bus  121 , but may be connected by other interface and bus structures, such as a parallel port, game port or a universal serial bus (USB). A monitor  191  or other type of display device is also connected to the system bus  121  via an interface, such as a video interface  190 . In addition to the monitor, computers may also include other peripheral output devices such as speakers  197  and printer  196 , which may be connected through an output peripheral interface  195 . Of particular significance to the present invention, a camera  163  (such as a digital/electronic still or video camera, or film/photographic scanner) capable of capturing a sequence of images  164  can also be included as an input device to the personal computer  110 . Further, while just one camera is depicted, multiple cameras could be included as an input device to the personal computer  110 . The images  164  from the one or more cameras are input into the computer  110  via an appropriate camera interface  165 . This interface  165  is connected to the system bus  121 , thereby allowing the images to be routed to and stored in the RAM  132 , or one of the other data storage devices associated with the computer  110 . However, it is noted that image data can be input into the computer  110  from any of the aforementioned computer-readable media as well, without requiring the use of the camera  163 . 
   The computer  110  may operate in a networked environment using logical connections to one or more remote computers, such as a remote computer  180 . The remote computer  180  may be a personal computer, a server, a router, a network PC, a peer device or other common network node, and typically includes many or all of the elements described above relative to the computer  110 , although only a memory storage device  181  has been illustrated in  FIG. 1 . The logical connections depicted in  FIG. 1  include a local area network (LAN)  171  and a wide area network (WAN)  173 , but may also include other networks. Such networking environments are commonplace in offices, enterprise-wide computer networks, intranets and the Internet. 
   When used in a LAN networking environment, the computer  110  is connected to the LAN  171  through a network interface or adapter  170 . When used in a WAN networking environment, the computer  110  typically includes a modem  172  or other means for establishing communications over the WAN  173 , such as the Internet. The modem  172 , which may be internal or external, may be connected to the system bus  121  via the user input interface  160 , or other appropriate mechanism. In a networked environment, program modules depicted relative to the computer  110 , or portions thereof, may be stored in the remote memory storage device. By way of example, and not limitation,  FIG. 1  illustrates remote application programs  185  as residing on memory device  181 . It will be appreciated that the network connections shown are exemplary and other means of establishing a communications link between the computers may be used. 
   The exemplary operating environment having now been discussed, the remaining parts of this description section will be devoted to a description of the program modules embodying the invention. 
   2.0 System and Method for Converting Whiteboard Content into an Electronic Document 
   2.1 General Overview. 
   As mentioned previously, the invention converts the content of a regular whiteboard into an electronic document that can be manipulated with office productivity software or exported into a Tablet PC or similar device. As shown in  FIG. 2 , process actions  202  and  204 , the system and method of the invention starts by acquiring an image of a whiteboard and locating the whiteboard in the image. If the image is not captured with a digital still or video camera, the image should be digitized before further processing. In one embodiment of the invention, the boundaries of the whiteboard are located by detecting four strong edges. The whiteboard usually appears to be a general quadrangle rather than a rectangle in the image because of the camera&#39;s perspective projection. 
   If the whiteboard does not have strong enough edges, an interface can be provided for a user to manually identify the quadrangle formed by the whiteboard edges. 
   Once the whiteboard has been localized, the system and method according to the invention then estimates the actual aspect ratio of the whiteboard from the quadrangle in the image (process action  206  ). Besides the aspect ratio, the focal length of the camera can also be estimated. 
   The image is then rectified (process action  208 ). From the estimated aspect ratio, and by choosing the “largest” whiteboard pixel as the standard pixel in the final image, the desired resolution of the final image can be computed. A planar mapping (in one embodiment using a 3×3 homography matrix) is then computed from the original image quadrangle to the final image rectangle, and the whiteboard image is rectified accordingly. 
   The background color of the whiteboard is also white balanced, as shown in process action  210 ). This involves two procedures. The first is the estimation of the background color (the whiteboard color under perfect lighting without anything written on it). The second procedure concerns the actual white-balancing. The background is made uniformly white and the color saturation of the pen strokes is increased. The output of the system and method according to the invention is then a crisp image or document ready to be integrated with any office productivity software (process action  212 ). 
   This output is then ready to be vectorized using image vectorization procedures (process action  214 ). Image vectorization transforms a bitmap image into vector drawings such as freeform curves, lines and arcs. Tablet PC inks use a vector representation, and therefore a whiteboard image after vectorization can be exported into a Tablet PC or to the office productivity software for use in, for example, handwriting recognition. 
   The general system and method according to the invention having been described, the next paragraphs provide details of the aforementioned process actions. 
   2.2 Automatic Whiteboard Detection. 
   To realize the full potential of digital technologies, the system automatically detects the whiteboard within the image. In general, in the embodiment as shown in  FIG. 3 , this process involves edge detection of objects in the input image (process actions  302  and  304 ). Then straight lines are located in the image using the Hough transform (process action  306 ). A quadrangle encompassing the whiteboard is formed (process action  308 ) and optionally verified (process action  310 ). Then the quadrangle is optionally refined (process action  312 ). The details of how the whiteboard boundaries are automatically detected and used to form a quadrangle are described in detail in the following paragraphs. 
   2.2.1 Edge Detection 
   There are many operators for edge detection that are known in the art [1, 2, 3]. The general concept behind edge detection is that the largest changes in pixel intensity in an image define the edge of an object. Typically a threshold is used to decide on a pixel-by-pixel basis whether the change in intensity is sufficient to constitute an edge. In the implementation of one embodiment of the invention, the process actions of which are shown in  FIG. 4 , the color image of the whiteboard is first converted into a gray level image (process action  402 ). Then, as shown in process action  404 , a Sobel filter is used to compute the gradient in the x and y directions with the masks shown below: 
   
     
       
         
           
             
               
                 
                   G 
                   x 
                 
                 = 
                 
                   
                     
                       
                         - 
                         1 
                       
                     
                     
                       
                         - 
                         2 
                       
                     
                     
                       
                         - 
                         1 
                       
                     
                   
                   
                     
                       0 
                     
                     
                       0 
                     
                     
                       0 
                     
                   
                   
                     
                       1 
                     
                     
                       2 
                     
                     
                       1 
                     
                   
                 
               
             
             
               
                 
                     
                 
                 ⁢ 
                 
                   
                     G 
                     y 
                   
                   = 
                   
                     
                       
                         
                           - 
                           1 
                         
                       
                       
                         0 
                       
                       
                         1 
                       
                     
                     
                       
                         
                           - 
                           2 
                         
                       
                       
                         0 
                       
                       
                         2 
                       
                     
                     
                       
                         
                           - 
                           1 
                         
                       
                       
                         0 
                       
                       
                         1 
                       
                     
                   
                 
               
             
           
         
       
     
   
   The overall gradient is then computed by absolute values G=|G x |+|G y |, as indicated in process action  406 . If the gradient G is greater than the gradient threshold T G , that pixel is considered as an edge of an object (process action  408 ). T G =40 in a tested embodiment of the invention. The edge detection masks exaggerate the difference of the edges along their respective directions. 
   If the automatic edge detection process cannot identify any strong or pronounced edges, an interface can be provided to allow a user to localize a quadrangle encompassing the whiteboard in the image. In one embodiment this interface allows the user to select the four corners of the whiteboard in the image, which is displayed on a computer screen or the like, by using a mouse cursor or similar device. 
   2.2.2 Hough Transform 
   The Hough Transform is a conventional robust technique to detect straight lines. As shown in  FIG. 5 , process action  502 , the image space is subdivided into accumulator cells. An edge detected in the edge detection process has an orientation, and is considered as a line (process action  504 ). The orientation of the line is determined using the equations below. If the parameters of the line fall into a cell, that cell receives a vote (process action  506 ). Once all of the lines have been processed, the cells that receive a significant number of votes represent cells that have strong edge support in the image, as shown in process action  508 . This implementation differs from previous uses of the Hough transform in that this system and method detects oriented lines. The orientation information is useful in a later stage for forming a reasonable quadrangle, and is also useful to establish two lines nearby but with the opposite orientation. The latter is important because one usually sees two lines around the border, and if one does not distinguish them, the detected line is not very accurate. The normal representation of a line is used:
 
 x   0  cos θ+ y   0  sin θ=ρ
 
The range of angle θ is [−180°, 180°]. For a given edge at (x 0 , y 0 ), its orientation is computed by θ=a tan 2 (G y , G x ) and its distance ρ=x 0  cos θ+y 0  sin θ. In one embodiment of the invention, the size of each cell in the ρθ-plane is 5 pixels by 2°. In one embodiment all reasonable lines are detected by locating local maxima whose votes are larger than five percent of the maximum number of votes in the Hough space.
 
   Although the Hough transform is used in this embodiment one could use line-fitting or other conventional techniques to determine the straight lines within the image space. 
   2.2.3 Quadrangle Formation 
   As discussed above, the votes of the accumulator cells are first examined for high concentrations and all reasonable lines are detected. The procedure for forming the lines basically identifies clusters of bright spots in the Hough image and is simplified as follows: 
   1) The Hough image is scanned pixel by pixel to find the pixel with the highest value; 
   2) The corresponding line is recorded; 
   3) The pixel and the neighboring pixels (within N pixels) are set to zero and step 1 is repeated until all of the pixel values found to be below a pre-specified threshold are identified and are set as belonging to a given line. 
   Next, as shown in  FIG. 6 , quadrangles are formed with these lines. The lines detected are input for processing (process action  602 ). Any four lines could form a quadrangle, but the total number of quadrangles that could be considered may be prohibitively high. In order to reduce the number, the possible quadrangles are tested for certain conditions and only quadrangles that satisfy the following conditions are retained (process actions  604  through  614 ): 
   The opposite lines should have quite opposite orientations (in one working embodiment, 180° within 30°). 
   The opposite lines should be quite far from each other (in one working embodiment, the difference in ρ is bigger than one fifth image of the image width or height). 
   The angle between two neighboring lines should be close to ±90° (in one working embodiment, within 30°). 
   The orientation of the line segments of the quadrangle should be consistent (either clockwise or counter-clockwise). 
   The quadrangle should be big enough (in one working embodiment the circumference was larger than ((W+H)/4)) of the input image dimensions. 
   The last condition is based on the expectation that a user tries to take an image of the whiteboard as big as possible. 
   2.2.4 Quadrangle Verification 
   The lines detected from Hough space are infinite lines: they do not indicate where the supporting edges are. For example, the four lines in  FIG. 7  would pass all of the tests described in the previous paragraph, although the formed quadrangle is not a real one. Hence, the process of quadrangle verification is employed to identify the four corners of the quadrangle. For example, there might be six intersections between the four identified lines, but there should only be four corners for a quadrangle. To solve this problem, the lines are first sorted by their angle to the horizontal axis. The four corners are the four intersections between the line pairs in the sorting order ( 1  and  2 ,  2  and  3 ,  3  and  4 ,  4  and  1 ). It is then determined how many edges in the image lie on those lines formed by these corners. As shown in  FIG. 8 , to verify whether a quadrangle is a real one, one walks through the side of the quadrangle and counts the number of edges along the sides (process actions  802  and  804 ). In one embodiment of the invention, to determine the number of pixels that should belong to a particular line probabilistic methods are used. An edge within 3 pixels from a side of the quadrangle and having similar orientation is considered to belong to the quadrangle. The ratio of the number of supporting edges to the circumference is calculated, where the circumference is calculated as the sum of the distance between the four pairs of corners, measured in pixels and is used as the quality measure of the quadrangle (process action  806 ). The quadrangle having the highest quality measure is retained as the one that is sought, as shown in process action  808 . 
   2.2.5 Quadrangle Refining 
   Quadrangle refining can optionally be employed to refine the quadrangle that is identified as encompassing the whiteboard. The lines detected by the aforementioned system and process may not be very accurate because of the discretization of the Hough space. To improve accuracy, line fitting is performed for each side. To do this, first all edges in a small neighborhood (e.g., 10 pixels in one embodiment) and having similar orientation are found. Then a least median squares method is used to detect outliers [4], and finally least-squares fitting is performed to the remaining edges [1]. 
   2.3 Estimating Pose and Aspect Ratio of a Rectangular Shape from One Image, and Camera&#39;s Focal Length. 
   Because of perspective distortion, the image of a rectangle appears to be a quadrangle. However, since it is known that the whiteboard is a rectangle in space, it is possible to estimate both the camera&#39;s focal length and the rectangle&#39;s aspect ratio. 
   2.3.1 Geometry of a Rectangle 
   Referring to  FIG. 9 , without loss of generality, it is assumed that the rectangle is on the plane z=0 in the world coordinate system. Let the width and height of the rectangular shape be w and h. Let the coordinates of the four corners, M i (i=1, . . . , 4), be ( 0 , 0 ), (w, 0 ), ( 0 ,h), and (w,h) in the plane coordinate system (z=0). The projection of the rectangle in the image is a quadrangle. The observed corners in the image are denoted by m 1 , m 2 , m 3 , and m 4 , respectively. Furthermore, {tilde over (x)} is used to denote the augmented x vector by adding 1 as the last element to vector x, i.e., {tilde over (x)}=[x 1 , . . . x n , 1] T  if x=[x 1 , . . . x n ] T . 
   The standard pinhole model is used to model the projection from a space point M to an image point m: 
                   λ   ⁢           ⁢     m   ~       =       A   ⁡     [   Rt   ]       ⁢     M   ~                     A   =         [         f       0         u   0             0       sf         v   0             0       0       1         ]     ⁢           ⁢   and   ⁢           ⁢   R     =     [           r   1           r   2           r   3           ]         ⁢                       
where f is the focal length of the camera, λ is a scalar factor, s is the pixel ratio, A represents a matrix of the camera parameters, u 0  and v 0  describe the coordinates of the image center, and (R, t) describes the 3D transformation between the world coordinate system, in which the rectangle is described, and the camera coordinate system. In the above model, it is assumed that the pixels are not skew. Substituting the 3D coordinates of the corners yields
 λ 1 {tilde over (m)} 1 =At  (2) λ 2   {tilde over (m)}   2   =wAr   1   +At   (3) λ 3   {tilde over (m)}   3   =wAr   2   +At   (4) λ 4   {tilde over (m)}   4   =wAr   1   +hAr   2   +At   (5) 
Substituting (3)-(2), (4)-(2) and (5)-(2) gives respectively
 λ 2   {tilde over (m)}   2 −λ 1   {tilde over (m)}   1   =wAr   1   (6) λ 3   {tilde over (m)}   3 −λ 1   {tilde over (m)}   1   =hAr   2   (7) λ 4   {tilde over (m)}   4 −λ 1   {tilde over (m)}   1   =wAr   1   +hAr   2   (8) 
Substituting (8)-(6)-(7) yields
 λ 4   {tilde over (m)}   4 =λ 3   {tilde over (m)}   3 +λ 2   {tilde over (m)}   2 −λ 1   {tilde over (m)}   1   (9) 
Computing the cross product of each side with {tilde over (m)} 4  yields
 0=λ 3   {tilde over (m)}   3   ×{tilde over (m)}   4 +λ 2   {tilde over (m)}   2   ×{tilde over (m)}   4 −λ 1   {tilde over (m)}   1   ×{tilde over (m)}   4   (10) 
Computing the dot product of the above equation with {tilde over (m)} 3  yields
 λ 3 ( {tilde over (m)}   3   ×{tilde over (m)}   4 )· {tilde over (m)}   3 =λ 1 ( {tilde over (m)}   1   ×{tilde over (m)}   4 )· {tilde over (m)}   4    
Thus,
 
                   λ   2     =         k   2     ⁢     λ   1     ⁢           ⁢   with   ⁢           ⁢     k   2       =         (         m   ~     1     ×       m   ~     4       )     ·       m   ~     3           (         m   ~     2     ×       m   ~     4       )     ·       m   ~     3                   (   11   )               
Similarly, computing the dot product of (10) with {tilde over (m)} 2  yields
 
                   λ   3     =         k   3     ⁢     λ   1     ⁢           ⁢   with   ⁢           ⁢     k   3       =         (         m   ~     1     ×       m   ~     4       )     ·       m   ~     2           (         m   ~     2     ×       m   ~     4       )     ·       m   ~     2                   (   12   )               
Substituting (11) into (6) yields,
   r   1 =λ 1   w   −1   A   −1   n   2   (13) 
with
   n   2   =k   2   {tilde over (m)}   2   −{tilde over (m)}   1   (14) 
Similarly, substituting (12) into (7) yields
   r   2 =λ 1   h   −1   A   −1   n   3   (15) 
with
   n   3   =k   3   {tilde over (m)}   3   −{tilde over (m)}   1   (16) 
   From the properties of a rotation matrix, r 1 ·r 2 =0. Therefore, from (13) and (15), one obtains
 
 n   2   T   A   −T   A   −1   n   3 =0  (17)
 
   Again from the properties of a rotation matrix, r 1 ·r 1 =1 and r 2 ·r 2 =1. Therefore, from (13) and (15), the following is derived
 
1=λ 1   2   w   −2   n   2   T   A   −T   A   −1   n   2   (18)
 
1=λ 1   2   h   −2   n   3   T   A   −T   A   −1   n   3   (19)
 
Dividing these two equations gives the aspect ratio of the rectangular shape:
 
                     (     w   h     )     2     =         n   2   T     ⁢     A     -   T       ⁢     A     -   1       ⁢     n   2           n   3   T     ⁢     A     -   T       ⁢     A     -   1       ⁢     n   3                 (   20   )               
This equation says clearly that the absolute size of the rectangle cannot be determined from an image. This is obvious since a bigger rectangular shape will give the same image if it is located further away from the camera.
 
   2.3.3 Estimating Camera&#39;s Focal Length and Rectangle&#39;s Aspect Ratio. 
   In the last subsection, two fundamental constraints (17) and (20) were derived. Now one can extract useful information from the quadrangle in the image. 
   No knowledge is assumed of the rectangle in the space (i.e., unknown width and height). Since there are only two constraints, some knowledge of the camera will be assumed. Fortunately, with modern cameras, it is very reasonable to assume that the pixels are square (i.e., s=1) and the principal point is at the image center (i.e., known as u 0  and v 0 ). Given u 0 , v 0  and s, it is possible to compute the focal length f from equation (17). This gives 
                         f   2     =       -     1       n   23     ⁢     n   33     ⁢     s   2           +     {         [         n   21     ⁢     n   31       -       (         n   21     ⁢     n   33       +       n   23     ⁢     n   31         )     ⁢     u   o       +       n   23     ⁢     n   33     ⁢     u   o   2         ]     ⁢     s   2       +                       [         n   22     ⁢     n   32       -       (         n   22     ⁢     n   33       +       n   23     ⁢     n   32         )     ⁢     v   o       +       n   23     ⁢     n   33     ⁢     v   o   2         ]     }                 (   21   )               
where n 2i  (respectively n 3i ) is the i-th component of n 2  (respectively n 3 ). The solution does not exist when n 23 =0 or n 33 =0. It occurs when k 2 =1 or k 2 =1, respectively.
 
   As soon as ƒ is estimated, the camera&#39;s intrinsic parameters are all known, and the aspect ratio of the rectangle is readily computed by equation (20). 
   (Equation (20) can be used in a different way. If the aspect ratio of the rectangle is given, it is possible to use that equation to estimate the focal length. Together with (17), there are then two equations to estimate the focal length, leading to a more reliable estimation. However, this is not what was assumed in this work). 
   Once A is known, the pose of the rectangle shape can be determined. From (13)
 
 r   1   =A   −1   n   2   /A   −1   n   2   (22)
 
and from (15)
 
 r   2   =A   −1   n   3   /∥A   −1   n   3 ∥  (23)
 
In turn,
 
 r   3   =r   1   ×r   2   (24)
 
The translation vector can be determined from (2), i.e.,
 
 t=λ   1   A   −1   {tilde over (m)}   (25)
 
Note that the translation can only be determined up to a scale factor λ 1 , which depends on the size of the rectangle as can be seen from (18) and (19). This is obvious since a bigger rectangular shape will give the same image if it is located further away from the camera.
 
2.4 Rectification.
 
   The next task is to rectify the whiteboard image into a rectangular shape with the estimated aspect ratio. For that, it is necessary to know the size of the final image. The size is determined in order to preserve in the rectified image maximum information of the original image. In other words, a pixel in the original image should be mapped to at least one pixel in the rectified image. Referring to  FIGS. 10 and 11 , the side lengths of the quadrangle in the original image are denoted by W 1  and W 2  for the upper and lower sides, and by H 1  and H 2  for the left and right side. As shown in process action  1102 , let Ŵ=max(W 1 ,W 2 ) and Ĥ=max(H 1 ,H 2 ). Let {circumflex over (r)}=Ŵ/Ĥ. Denote the estimated aspect ratio by r. The size of the rectified image is determined as follows: W=Ŵ and H=W/r if {circumflex over (r)}≧r; otherwise, H=Ĥ and W=rH (process actions  1104  through  1108 ). Once the size is determined, the rectifying matrix H (homography) is easily computed (process action  1110 ), and the color of the rectified image is computed through bilinear or bi-cubic interpolation from the original image via conventional methods (process action  1112 ).  FIG. 12  shows two rectified images of the wh Other rectified images are also similar, and are thus not shown. 
   2.5 White Balancing. 
   The goal of white balancing or color enhancement is to transform the input whiteboard image into an image with the same pen strokes on uniform background (usually white). For each pixel, the color value=C light , the pen color=C pen , and the whiteboard color=C wb . Since the whiteboard is physically built to be uniformly colored, it can be assumed that C wb  is constant for all the pixels. The lack of uniformity in the input image is due to different amounts of incident light to each pixel. Therefore, the first procedure in white balancing is to estimate C light  for each pixel, the result of which is in fact an image of the blank whiteboard, as shown in  FIG. 14 , process action  1402 . 
   The system computes the blank whiteboard image by inferring the value of pixels covered by the strokes from their neighbors. Rather than computing the blank whiteboard color at the input image resolution, the computation is done at a coarser level to lower the computational cost. This approach is reasonable because the blank whiteboard colors normally vary smoothly. The process actions of estimating the whiteboard color are shown in  FIG. 15  and are as follows: 
   1. Divide the whiteboard region into rectangular cells (process action  1502 ). The cell size should preferably be roughly the same as what the size of a single character on the whiteboard is expected to be (in one working embodiment of the invention this was 15 by 15 pixels). 
   2. Sort the pixels in each cell by their luminance values (process action  1504 ). Since the ink absorbs the incident light, the luminance of the whiteboard pixels is higher than pen stroke pixels. The whiteboard color within the cell is therefore the color with the highest luminance (process action  1506 ). In practice, the colors of the pixels in the top 25 percentile are averaged in order to reduce the error introduced by sensor noise. 
   3. Filter the colors of the cells by locally fitting a plane in the RGB space (process action  1508 ). Occasionally there are cells that are entirely covered by pen strokes, the cell color computed in Step 2 above is consequently incorrect. Those colors are rejected as outliers by the locally fitted plane and are replaced by the interpolated values from its neighbors. 
   Once the image of the blank whiteboard is computed, the input image is color enhanced in two steps: 
   1. Make the background uniformly white (process action  1406 ). For each cell, the computed whiteboard color (equivalent to the incident light C light ) is used to scale the color of each pixel in the cell: 
   
     
       
         
           
             C 
             out 
           
           = 
           
             
               min 
               ⁡ 
               
                 ( 
                 
                   1 
                   , 
                   
                     
                       C 
                       input 
                     
                     
                       C 
                       light 
                     
                   
                 
                 ) 
               
             
             . 
           
         
       
     
   
   2. Reduce the image noise and increase the color saturation of the pen strokes. The value of each color channel of each pixel is remapped according to an S-shaped curve: 0.5–0.5*cos(C out pπ). The steepness of the S-curve is controlled by p. In one working embodiment of the invention, p is set to 0.75 (process action  1408 ). 
   2.6 Vectorization. 
   The vectorized form of data gives a better idea which points in an image belong together. Standard vectorization techniques are used to convert the lines, curves and other whiteboard content into vectors. A curve drawn through the center of the pixels to be vectorized is approximated. The curve is defined by its shape and a predetermined width via conventional methods. 
   3.0 Exemplary Working Embodiment 
   The following paragraphs describe an exemplary working embodiment of the system and method of converting whiteboard content into an editable electronic document. 
   3.1 Experiments with Automatic Whiteboard Rectification. 
   The technique of automatically rectifying the whiteboard was tested with more than 50 images taken by different people with different camera in different rooms. All the tuning parameters were fixed once for all. The success rate was more than 90%. The four failures were due to poor boundary contrast, or to too noisy edge detection. In this subsection, two examples of success ( FIG. 16 ,  17 ) and one example of failure ( FIG. 18 ) are shown. 
     FIG. 16  is a relatively simple example because the whiteboard boundary is very clear. The image resolution is 2272×1704 pixels. The detected edges are shown in white in  FIG. 16B . As can be seen in the Hough image ( FIG. 16C ), the peaks are quite clear. The corners of the whiteboard are accurately estimated, as shown in the small white squares in  FIG. 16A . The cropped and rectified image is shown in  FIG. 16D . The estimated aspect ratio is 1.326, very close to the ground truth 4/3. The estimated focal length is 2149 pixels. 
     FIG. 17  shows another example. The resolution is 1536×1024 pixels. This example has one particular thing to notice: the upper right corner is not in the image. It does not affect the performance of the system and method according to the invention since it first detects boundary lines rather than corners. In  FIG. 17A , the three detected visible corners are shown in small red discs. The fourth corner, although visible, is also accurately estimated, as can be verified by the cropped and rectified image shown in  FIG. 17D , where the invisible region (upper right corner) is filled with black pixels due to lack of information. The estimated aspect ratio is 1.378. Ground truth is not available because the image was provided by an external person. The estimated focal length is 2032 pixels. 
   The system and method of the invention applies not only to whiteboard images but also to posters, as long as the poster&#39;s color is distinct from the walls. Here, however, an example of a failure with a poster is shown ( FIG. 18A ). The failure was due to the fine texture on the wall. As can be seen in  FIG. 18B , the edge image is very noisy, and the number of edges is huge. The noise is also reflected in the Hough image ( FIG. 18C ). The detected corners, as shown in red dots in  FIG. 18A , are not what were expected. For this example, a different edge detector could be applied or the threshold could be changed to ignore the fine texture. 
   3.2 Experimental Results on Aspect Ratio Estimation. 
   In this section, experimental results on aspect ratio are provided. Six images of the same white board, as shown in  FIG. 13A through 13F , were taken from different angles. The most frontal view is image  13 B. The whiteboard was manually measured with a ruler, and the size was about 42″×40″ (note: 1″˜2.54 cm). The aspect ratio was therefore 1.05 and this was used as ground truth. 
   In each image, the four corners of the whiteboard were manually selected with a cursor, and the technique described previously to estimate the focal length of the camera and the aspect ratio of the whiteboard. The results are shown in Table 1. 
                                                                                                 Results with Images Shown in FIG. 13                image                (a)   (b)   (c)   (d)   (e)   (f)                    aspect ratio   1.028   1.035   1.031   1.021   1.019   0.990       error (%)   2.1   1.4   1.8   2.8   3.0   5.7       bounding box   0.966   1.035   0.981   0.892   0.843   0.727       difference (%)   5.1   1.4   6.6   15.1   19.7   30.8       focal length   2202   2442   2073   2058   2131   2030                    
The second row shows the estimated values of the aspect ratio, while the third row shows its relative error compared to ground truth. The error is mostly less than 3%, except for  FIG. 13F  that was taken from a very skewed angle. There are two major sources contributing to the errors: The first is the precision of the manually clicked points; the second is lens distortion that is currently not modeled. Lens distortion can be clearly observed in  FIG. 13 . The error of the estimated aspect ratio tends to be higher for images taken from a larger angle. This is expected because the relative precision of the corner points is decreasing. For reference, the aspect ratio of the bounding box of the whiteboard image in the fourth row of Table 1, and its relative difference with respect to the ground truth in the fifth row are also provided. The relative difference can go up 30%. It is clear that it is not reasonable to use the aspect ratio of the bounding box to rectify the whiteboard images. The sixth row of Table 1 shows the estimated focal length, which varies around 2200.
 
     FIG. 19  shows the system and method according to the invention working on a whiteboard with complex drawings and complex lighting conditions. 
     FIG. 20  shows that the system and method according to the invention also works on a poster. 
     FIG. 21  shows two images of the same whiteboard but taken from very different angles. The aspect ratio estimated from both images is very close to ground truth. 
   The foregoing description of the invention has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. Many modifications and variations are possible in light of the above teaching. It is intended that the scope of the invention be limited not by this detailed description, but rather by the claims appended hereto. 
   REFERENCES 
   
       
       [1] O. Faugeras,  Three - Dimensional Computer Vision: A Geometric Viewpoint , MIT Press, 1993. 
       [2] O. Faugeras and Q.-T. Luong,  The Geometry of Multiple Images , MIT Press, 2001. 
       [3] R. Hartley and A. Zisserman,  Multiple View Geometry , Cambridge University Press, 1998. 
       [4] Z. Zhang, Parameter estimation techniques: a tutorial with application to conic fitting”,  Image and Vision Computing , 15(1):59–76, 1997.