# Patent

## Title
Real-time composite image comparator

## Abstract

An apparatus and method for preparing a composite image from a video data stream and for identifying changed features in two composite images. Frames from the video data stream are transformed to a projected 2D image, aligned with adjacent frames and overlapping areas are averaged to provide a higher apparent resolution. The composite image can be stored in real-time. As a second composite image is prepared of the same location at a later time, portions of the second image can be compared to corresponding portions of the stored image after the intensities of the images are equalized. Image areas whose absolute difference exceeds a threshold are again intensity equalized. Areas that are again above threshold can be flagged for further scrutiny, either by a human or by a machine that performs object recognition. In this way, composite video images of a scene can be prepared and compared in real-time.

## Background
This application claims priority from U.S. provisional patent application No. 60/598,738, filed Aug. 4, 2004, entitled “Real-Time Composite Image Comparator,” which is incorporated herein by reference.


TECHNICAL FIELD
The present invention generally relates to image analysis and, more particularly, the invention relates to comparing image data.
BACKGROUND ART
Preparation of imagery from aerial photographs has been an expensive and time-consuming process. Imagery data from aerial photography has been prepared by taking downward looking high resolution aerial photographs, developing the film, assembling and registering the photographs into a mosaic pattern, and digitizing the composite photographs. This process is expensive and time-consuming. A method is needed to inexpensively and quickly prepare high-resolution composite imagery of a scene from a motion picture or video data stream.
SUMMARY OF THE INVENTION
In various embodiments of the invention, an apparatus and method prepare a composite image of a scene, such as a terrain scene, from a video data stream. The video stream includes a series of images with some of the images containing overlapping coverage of the scene. The images are transformed, aligned, and overlapping areas of the images are then averaged. The averaging of overlapping images advantageously provides a much higher apparent resolution. As portions of the composite image of the scene are created, these portions are immediately available for real-time processing including identification of significant differences from images taken earlier of the same scene. The composite image of the scene may be stored for later processing and comparison.
In accordance with one aspect of the invention, an apparatus and method can identify differences in two composite images of a scene. For example, the two images may be an archived composite image of a certain landscape and a composite image prepared from a real-time image data stream of the same landscape. The comparison may occur in real-time while the second composite image is being prepared. Embodiments may use techniques to ensure that the comparison is substantially invariant to seasonal changes (e.g., light) to produce consistent difference results.
Illustrative embodiments of the invention are implemented as a computer program product having a computer usable medium with computer readable program code thereon. The computer readable code may be read and utilized by a computer system in accordance with conventional processes.



BRIEF DESCRIPTION OF THE DRAWINGS
The foregoing features of the invention will be more readily understood by reference to the following detailed description, taken with reference to the accompanying drawings, in which:
FIG. 1 is a flow diagram of a process to transform a video data stream image to a 2D view, according to an embodiment of the invention;
FIG. 2 is a flow diagram showing a process to align a video data stream frame to a previously processed frame, according to an embodiment of the invention;
FIG. 3 is a flow diagram showing averaging of image tile data, according to an embodiment of the invention; and
FIG. 4 is a flow diagram illustrating a process for comparing two composite images to determine significant differences, according to an embodiment of the invention.



DETAILED DESCRIPTION OF SPECIFIC EMBODIMENTS
In various embodiments of the invention, an apparatus and method prepare a composite image of a scene, such as a terrain scene, from a video data stream. The video stream includes a series of images with some of the images containing overlapping coverage of the scene. The images are transformed, aligned, and overlapping areas of the images are then averaged. The averaging of overlapping images advantageously provides a much higher apparent resolution. As portions of the composite image of the scene are created, these portions are immediately available for real-time processing including identification of significant differences from images taken earlier of the same scene. The composite image of the scene may be stored for later processing and comparison.
In accordance with another aspect of the invention, an apparatus and method can identify differences in video data streams in real-time. One image of the scene may be a stored image and the other image may be an image processed in real-time or both images may be stored images. Composite images of the same scene taken at different times are prepared according to the previously described embodiment of the invention. The two images of the scene are compared by adjusting sub-tiles of each image that correspond to the same location to the same average intensity. The absolute difference between the sub-tiles is then calculated and compared to a specified threshold. If the difference in any area of the tile is above the threshold, the average intensity in that specific region may be equalized between the two images. If the difference is still above the threshold, the region is marked for further scrutiny. If desired, the resulting difference image may be passed to analysis packages, as are known in the art, which recognize previously defined patterns. The result is automatic, real-time recognition of predefined changes or events in subsequent video data streams.
Illustrative embodiments of the invention may be implemented as a computer program product having a computer usable medium with computer readable program code thereon. The computer readable code may be read and utilized by a computer system in accordance with conventional processes. Details of illustrative embodiments are discussed below.
Image Compositor
In an embodiment of the present invention, an apparatus and method prepare a composite image of a scene from a series of video images. The image compositor includes an image transformer module, an image alignment module and an image averager module. The filters work in series in real-time so that the image can be archived and/or compared to another image. The purpose of the image compositor is to build a piecewise time invariant image of the scene.
A. Image Transformation
As shown in FIG. 1, the image transformer module 100 uses 110 GPS, a pointing vector, range, and the camera view cone information provided with the video stream to transform the video so that it can be projected onto a planar map. The transform information could also come 110 from other sources such as user defined view cones, or automatically defined monument points for image matching. A simple 3D transform matrix is calculated 120 to project the video image in a linear fashion onto a flat surface. The resulting image is scaled and rotated 130 about multiple coordinate axes so that the perspective view of the camera is compensated for. Each pixel is multiplied by a matrix operation. The transform compensates 140 for non-square pixels, and may use bi-cubic interpolation as part of the scaling process.
B. Image Alignment
As shown in FIG. 2, portions of the image are then aligned 200. Once the image has been projected onto a plane, the image is broken into tiles that are approximately the size of the video resolution, after it has been compensated, so that the pixels are square. Each tile is then subdivided 210 into nine sub-tiles. Each sub-tile is compared 220 to previously stored tiles where they overlap. The process consists of comparing the tile in its current location, with four other adjacent locations. The adjacent locations are 50 percent offset from the center of the sub-tile above, below, left, and right of the sub-tile. The offset images are compared to existing overlapping images using simple correlation techniques. A rotational and scaling matrix is calculated 230 to adjust the whole tile so that it is an exact match to adjacent overlapped images to an accuracy of up to 0.1 pixels. The sub-tile is translated 240 in an iterative process until the correlation is maximized, or a maximum number of iterations have occurred. If there are no overlapping images, the tile is stored in the composite image. If the image fails to correlate, it is checked to verify it is a valid image. If it is a valid image it is passed on to the image averager module 250.
C. Image Averaging
As illustrated in FIG. 3, the image averager module determines 300 where a tile overlaps with existing tiles by comparing 310 the values of the image data. If valid data exists in the new tile 320, and the existing composite image tile has valid data in that region, then the overlapping images are averaged 330 using a modified running average technique. Because each tile is adjusted to a sub-pixel alignment, the resulting averaged composite image has a higher apparent resolution that is available from the video data stream.
If a portion of the new tile does not have existing data in the composite tile 340, then the new information is put into the composite image as is 350. If a portion of the composite image has data, but the new tile does not 360, then the existing data in the composite image remains as it was 370.
Once an image tile moves out of range of a composition area, it may be archived. In a specific embodiment of the invention, an archiver module may use the geometric location of the tile to archive it into a modified quad-tree file storage system. The tree is indexed to allow very quick access to images by geometric location. The top of the tree stores the range of the entire tree. The tree is subdivided geometrically into branches that represent sub-regions of the overall range. As new images are inserted into the tree, the overall range of the tree can grow piecewise. When queried, unpopulated branches of the tree return a null value so that void areas can be quickly determined.
Image Comparator
As illustrated in FIG. 4, the image comparator module takes a tile or portion of an image that has been built in the image compositor and compares 400 the tile to the corresponding location in a second image of the scene, which may be a stored image. The overlapping areas (i.e., areas that correspond to the same location in the scene) are adjusted 410 so that the portions of each image are of the same average intensity. The absolute difference between the two overlapping images portions is then calculated 420. If the difference in any area is above a user defined threshold 430, then the input composite image is examined in the area where a significant difference exists. The average intensity in that region is compensated 440 so that it equals the corresponding region in the second image. The absolute difference is calculated again for that region. If the difference is still above the user defined threshold 450, then it is marked so that the contrast and intensity can be highlighted for the user 460. If desired, the resulting difference image can then be passed to analysis packages, as are known in the art, which recognize previously defined patterns. The image comparator may advantageously provide 470 automatic, real-time recognition of predefined changes or events in subsequent video data streams
In specific embodiments of this aspect of the invention, edges of objects in the image are detected and eliminated before the two images are compared. Objects often differ because of slightly different viewing angles. If these edges are eliminated, then only the internal part of the object is compared. This procedure results in fewer false positive comparisons.
It should be noted that discussion of video data streams is exemplary and not intended to limit the scope of all embodiments. Rather, various embodiments apply to image data that can be represented graphically and recorded to some medium. In illustrative embodiments, the image data is recordable in 2D. In a similar manner, discussion of environmental objects (e.g., a landscape) is exemplary. For example, illustrative embodiments may be used in an interior location (e.g., a building containing a bank, or plane hangar) to detect changes in certain items of interest.
Various embodiments of the invention may be implemented at least in part in any conventional computer programming language. For example, some embodiments may be implemented in a procedural programming language (e.g., “C”), or in an object oriented programming language (e.g., “C++”). Other embodiments of the invention may be implemented as preprogrammed hardware elements (e.g., application specific integrated circuits, FPGAs, and digital signal processors), or other related components.
In some embodiments, the disclosed apparatus and methods may be implemented as a computer program product for use with a computer system. Such implementation may include a series of computer instructions fixed either on a tangible medium, such as a computer readable medium (e.g., a diskette, CD-ROM, ROM, or fixed disk) or transmittable to a computer system, via a modem or other interface device, such as a communications adapter connected to a network over a medium. The medium may be either a tangible medium (e.g., optical or analog communications lines) or a medium implemented with wireless techniques (e.g., WIFI, microwave, infrared or other transmission techniques). The series of computer instructions can embody all or part of the functionality previously described herein with respect to the system.
Those skilled in the art should appreciate that such computer instructions can be written in a number of programming languages for use with many computer architectures or operating systems. Furthermore, such instructions may be stored in any memory device, such as semiconductor, magnetic, optical or other memory devices, and may be transmitted using any communications technology, such as optical, infrared, microwave, or other transmission technologies.
Among other ways, such a computer program product may be distributed as a removable medium with accompanying printed or electronic documentation (e.g., shrink wrapped software), preloaded with a computer system (e.g., on system ROM or fixed disk), or distributed from a server or electronic bulletin board over the network (e.g., the Internet or World Wide Web). Of course, some embodiments of the invention may be implemented as a combination of both software (e.g., a computer program product) and hardware. Still other embodiments of the invention are implemented as entirely hardware, or entirely software.
Although the above discussion discloses various exemplary embodiments of the invention, it should be apparent that those skilled in the art can make various modifications that will achieve some of the advantages of the invention without departing from the true scope of the invention.

## Claims

1. A computerized method for preparing a first composite image and a second composite image of a first scene comprising: a. using a computer, providing a first series of images from the first scene, at least two images in the first series of images containing an overlapping area in the first scene; b. using the computer, aligning the at least two images in the first series of images; c. using the computer, averaging the intensity of the images in the area of overlap of the at least two images in the first series of images; and d. using the computer, forming the first composite image from the non-overlapping areas of the at least two images in the first series of images and the averaged overlapping area of the at least two images in the first series of images; e. using the computer, storing the first composite image; f. using the computer, preparing the second composite image of the first scene including: i. providing a second series of images from the first scene, at least two images in the second series of images containing an overlapping area in the first scene, ii. aligning the at least two images in the second series of images, iii. averaging the area of overlap of the at least two images in the second series of images, and iv. forming the second composite image from the non-overlapping areas of the at least two images in the second series of images and the averaged overlapping areas of the at least two images in the second series of images; g. using the computer, adjusting a given area of the first composite image to approximately equal the average intensity of a given area of the second composite image, the given area of the first composite image and the given area of the second composite image corresponding to the same location in the first scene; h. using the computer, calculating the absolute difference in intensity between the given area of the first composite image after adjustment and the given area of the second composite image and identifying a selected portion of the given area of the first composite image where the absolute difference is above a threshold; and adjusting the average intensity of the selected portion of the given area of the first composite image to approximately equal the average intensity of the corresponding portion of the given area of the second composite image and marking the selected portion where the absolute difference between the selected portion and the corresponding area in the second composite image is above the threshold.

2. A method according to claim 1 wherein providing a first series of images includes capturing a video sequence with a video camera.

3. A method according to claim 1 wherein the first scene is a terrain scene.

4. A method according to claim 1 wherein providing the first series of images includes transforming the first series of images using the computer.

5. A method according to claim 4 wherein transforming the first series of images includes projecting the first series of images onto a two-dimensional surface.

6. A method according to claim 1 wherein aligning the at least two images in the first series of images includes correlating portions of the at least two images in the first series of images.

7. A method according to claim 1 wherein adjusting a given area of the first composite image begins executing before preparing the second composite image of the first scene completes.

8. A method according to claim 1 wherein edges are removed from the first composite image and from the second composite image before calculating the absolute difference in intensity between the given area of the first composite image after adjustment and the given area of the second composite image.

9. A computer program product for use on a computer system for preparing a first composite image and a second composite image of a first scene, the computer program product comprising a non-transitory computer readable medium encoded with computer readable program code, the computer readable program code including: a. program code for providing a first series of images from the first scene, at least two images in the first series of images containing an overlapping area in the first scene; b. program code for aligning the at least two images in the first series of images of the first scene; c. program code for averaging the intensity of the image in the area of overlap of the at least two images in the first series of images of the first scene; d. program code for forming the first composite image from the non- overlapping areas of the at least two images in the first series of images and the averaged overlapping area of the at least two images in the first series of images; e. program code for storing the first composite image; f. program code for preparing the second composite image of the first scene including: i. providing a second series of images from the first scene, at least two images in the second series of images containing an overlapping area in the first scene, ii. aligning the at least two images in the second series of images, iii. averaging the area of overlap of the at least two images in the second series of images, and iv. forming the second composite image from the non-overlapping areas of the at least two images in the second series of images and the averaged overlapping areas of the at least two images in the second series of images; g. program code for adjusting a given area of the first composite image to approximately equal the average intensity of a given area of the second composite image, the given area of the first composite image and the given area of the second composite image corresponding to the same location in the first scene; h. program code for calculating the absolute difference in intensity between the given area of the first composite image after adjustment and the given area of the second composite image and identifying a selected portion of the given area of the first composite image where the absolute difference is above a threshold; and i. program code for adjusting the average intensity of the selected portion of the given area of the first composite image to approximately equal the average intensity of the corresponding portion of the given area of the second composite image and marking the selected portion where the absolute difference between the selected portion and the corresponding area in the second composite image is above the threshold.

10. A computer program product according to claim 9, wherein providing a first series of images includes capturing a video sequence comprising the first series of images with a video camera.

11. A computer program product according to claim 9, wherein the first scene is a terrain scene.

12. A computer program product according to claim 9, wherein program code for providing the first series of images includes program code for transforming the first series of images.

13. A computer program product according to claim 12, wherein program code for transforming the first series of images includes program code for projecting the first series of images onto a two-dimensional surface.

14. A computer program product according to claim 9, wherein program code for aligning the at least two images in the first series of images of the first scene includes program code for correlating portions of the at least two images in the first series of images of the first scene.

15. A computer program product according to claim 9 wherein program code for adjusting a given area of the first composite image is configured to begin executing before program code for preparing the second composite image of the first scene completes.

16. A computer program product according to claim 9 wherein the program code is configured so that edges are removed from the first composite image and from the second composite image before calculating the absolute difference in intensity between the given area of the first composite image after adjustment and the given area of the second composite image.