Motion detection

Abstract: An imaging system that employs sub-framing of sampled image frames (40-42) to improve accuracy of motion detection, sub-frames a pair of image frames (40-42) sampled from an image scene (14) by calculating a correlation metric for each of a set of possible spacial relationships between the image frames (40-42) using the pixel data values from areas of the image frames (40-42) that contain overlapping content. This sub-framing enhances the accuracy of motion detection by eliminating areas of the image frames (40-42) not having overlapping image content.

Description: The present invention pertains to the field of imaging. More particularly, this invention relates to motion tracking using sub-framing of sampled image frames. Imaging systems including image scanners and digital video cameras typically include mechanisms for obtaining digital samples of an image scene. Typically, the digital samples of an image scene are arranged as a series of image frames. Each image frame typically includes an array of pixel data values sampled from the image scene. It is often useful in an imaging system to determine a spatial relationship between image frames sampled from the image scene. The determination of a spatial relationships between image frames may be useful, for example, in tracking the relative motion of an image scanner with respect to the image scene being scanned. In addition, the determination of spatial relationships between image frames in a video imaging system may be useful for estimating the relative motion of objects contained in the image scene. A typical prior technique for determining a spatial relationship between a pair of image frames is to calculate correlation metrics using the pixel data values from the image frames. A correlation metric is usually employed to extract an indication of the differences in image content between the image frames. For example, one such correlation metric is the sum of absolute differences between corresponding pixel data values contained in the image frames. In a typical imaging system, the successive image frames sampled from the image scene are offset from one another in either one dimension or in two dimensions. Such offsets may occur, for example, as an imaging device moves with respect to an image scene being scanned. As a consequence, a pair of successive image frames commonly include areas of overlapping image content and areas of non-overlapping image content. Unfortunately, the pixel data values from the non-overlapping areas usually introduce errors into a correlation metric. Such errors can reduce the accuracy of motion tracking or motion estimation in the imaging system. US-A-5,526,053 discloses motion compensated video signal processing apparatus which detects motion and assigns motion vectors. US-A-5,535,288 also discloses motion vector determination in image processing and video motion estimation, but without excluding content. US-A-5,400,087 discloses a motion vector detector involving interpolation detection. According to a first aspect of the present invention, there is provided a method for motion detection according to claim 1. According to a second aspect of the present invention, there is provided an apparatus for motion detection according to claim 8. In embodiments of the invention, an imaging system employs sub-framing of sampled image frames to improve accuracy of motion detection. The system includes an imaging array for generating sampled image frames containing pixel data values from an image scene. The system performs sub-framing by calculating a correlation metric for each of a set of possible spatial relationships between the image frames using the pixel data values from areas of the image frames that contain overlapping content. The correlation metrics based on overlapping image content enable accurate motion detection in the imaging system. Other features and advantages of the present invention will be apparent from the detailed description that follows. The present invention is described with respect to particular exemplary embodiments thereof and reference is accordingly made to the drawings in which: Figure 1 shows an imaging system which includes elements for sub-framing sampled image frames to improve the accuracy of motion detection; Figure 2 shows a pair of successive image frames which are sampled by an imaging array as it moves with respect to an image scene; Figure 3 illustrates a sub-frame operation on the image frames in one embodiment; Figure 4 shows an imaging system which includes elements that employ motion estimation in sub-framing operations; Figures 5a-5h show a variety of spatial relationships between the image frames as may be indicated by a motion estimate rendered by a motion estimator. Figure 1 shows an imaging system 10 which includes elements for accurate motion detection by sub-framing image frames sampled from an image scene 14. The elements for accurate motion detection in one embodiment include an imaging array 12, an image frame buffer 18, a correlation calculator 22 and a motion tracker 24. These elements may be implemented in a combination of hardware and software including, for example, an embedded processor and memory in the imaging system 10. The imaging array 12 is shown positioned to sample an image scene 14. The imaging array 12 includes an array of photosensitive elements each of which generates a corresponding pixel data sample of the image scene 14. The pixel data samples generated by the imaging array 12 are assembled into image frames and stored in an image frame buffer 18. The image frame buffer 18 in one embodiment has the capacity to store multiple image frames sampled from the image scene 14. In one embodiment, the imaging system 10 is a handheld scanner and the imaging array 12 moves over the image scene 14 as a user moves the image scanner over the image scene 14. In this embodiment, the imaging array 12 is used for motion tracking while a separate imaging array is used to scan the image scene 14. Figure 2 shows a pair of successive image frames 40-42 which are sampled by the imaging array 12 as it moves with respect to the image scene 14. Each image frame 40-42 is an array of N by M digital pixel data values. A shaded area 34 of the image frame 42 represents an area of the image frame 42 that does not overlap the image content of the image frame 40 owing to the movement of the imaging array 12 with respect to the image scene 14. The process of tracking the motion of the imaging array 12 with respect to the image scene 14 includes the determination of correlations between the image content of the image frames 40 and 42. This determination is performed by the correlation calculator 22. The pixel data values from the non-overlapping area 34 would introduce errors into this correlation determination because those pixel data values correspond to a portion of the image scene 14 that is not included in the image frame 40. Therefore, the correlation calculator 22 eliminates or minimizes the contribution of the pixel data values in the area 34 when determining correlations between the image content of the image frames 40-42. The correlation calculator 22 obtains the image frames 40-42 from the image frame buffer 18 and generates a set of correlation metrics 26. The correlation metrics 26 include a correlation metric for each of a set of possible spatial relationships between the image frames 40-42. The possible spatial relationships between the image frames 40-42 are specified by a pair of lag values lx and ly. The lag values lx and ly can be viewed as relative image displacements corresponding to the x and y directions, respectively, of the image frames 40 and 42. The lag values lx lie within a range of -N to +N and the lag values ly lie within a range of -M to +M. The motion tracker 24 uses the correlation metrics 26 to determine an actual relative spatial offset between the image frames 40-42. The motion tracker 24 also maintains a history of the actual spatial offsets between successive image frames from the imaging array 12 as the imaging array 12 moves with respect to the image scene 14. The correlation calculator 22 performs a sub-framing operation on the image frames 40-42 to reduce or eliminate the contribution of the pixels in the area 34 from contributing to the correlation metrics 26. This sub-framing operation is intended to improve the accuracy of the correlation metrics 26 and in turn improve the accuracy of the motion tracking performed by the motion tracker 24. Without sub-framing, the following equation, which may be referred to as a square root of sum of squared differences equation, may be used to determine the correlation metrics 26; where p is a pixel data value from the image frame 40 and q is a pixel data value from the image frame 42. A wide variety of alternative correlation metrics may be employed. Sub-framing is performed in one embodiment by adjusting the ranges of the above summing functions for determining the correlation metrics 26. Figure 3 illustrates a sub-frame operation on the image frames 40-42 in another embodiment. The correlation calculator 22 sub-frames the image frames 40-42 in this embodiment by using only the pixel data values-from an area 50 of the image frame 40 and an area 52 of the image frame 42 to determine the correlation metrics 26. The correlation calculator 22 eliminates the pixel data values that lie outside the areas 50-52 as defined by the Δx and Δy dimensions of a border area of the image frames 40 and 42. The Δx and Δy (delta-x and the delta-y) dimensions are preselected based upon a maximum at which the image frames 40-42 are likely to be offset from one another. In one embodiment, the sampling rate of the imaging array 12 is high enough to ensure that the maximum spacial offset between the image frames 40-42 is likely to be less than one pixel in each dimension. In this embodiment, the Δx and Δy border areas are set to equal the width of one pixel of the image frames 40-42. With sub-framing defined by the areas 50-52, the correlation calculator 22 uses the following equation to determine the correlation metrics 26. In alternative embodiments, the correlation calculator 22 may apply a windowing function to the image frames 40-42 to reduce or eliminate the contributions from pixels outside the areas 50-52 to the correlation metrics 26. Such a windowing function may be realized by multiplying the pixel data values of the image frames 40-42 with a top-hat or a cosine function. This would emphasize the contributions of the pixel data values near the centers of the areas 50-52 and minimize the pixel data values near the border areas of the image frames 40-42. However, such an embodiment requires that a great number of multiplication operations be undertaken for each pair of image frames being correlated. Such multiplication operations may slow down the overall speed of the imaging system 10. Figure 4 shows an imaging system 100 which uses motion estimation in sub-framing operations. The elements for accurate motion detection in the imaging system 100 include the imaging array 12, the image frame buffer 18, the correlation calculator 22 and the motion tracker 24, along with a motion estimator 28. These elements may.be implemented in a combination of hardware and software including, for example, an embedded processor and memory in the imaging system 100. The imaging array 12 scans the image scene 14 and the image frame buffer 18 stores multiple scanned image frames sampled from the image scene 14. The correlation calculator 22 in the imaging system 100 obtains the image frames 40-42 from the image frame buffer 18 and generates the correlation metrics 26. The correlation calculator 22 performs a sub-framing operation on the image frames 40-42 in response to a motion estimate 32 generated by the motion estimator 28. The motion estimate 32 is an estimate of the spacial relationship between the image frames 40-42. Figures 5a-5h show a variety of spatial relationships between the image frames 40-42 as may be indicated by the motion estimate 32 rendered by the motion estimator 28. Also shown are the areas of the image frames 40-42 that are used by the correlation calculator 22 for a sub-framing operation in response to the motion estimate 32. Figure 5a shows the image frame 42 having a relative +Δx offset and a -Δy offset with respect to the image frame 40 as indicated by the motion estimate 32. A sub-frame 54 of the image frame 40 and a sub-frame 56 of the image frame 42 are used by the correlation calculator 22 to render the correlation metrics 26 in response to this motion estimate 32. The correlation calculator 22 eliminates the pixel data values that lie outside of the sub-frames 54 and 56 when calculating the correlation metrics 26. Figure 5b shows the image frame 42 having a -Δx offset and a +Δy offset with respect to the image frame 40 which is indicated by the motion estimate 32. In response to this motion estimate 32, the correlation calculator 22 eliminates the pixel data values located outside of a sub-frame 60 of the image frame 40 and the pixel data values outside of a sub-frame 62 of the image frame 42 when calculating the correlation metrics 26. Figure 5c shows the image frame 42 having a +Δx offset and a +Δy offset with respect to the image frame 40 as indicated by the motion estimate 32. In this example, the correlation calculator 22 eliminates the pixel data values outside of a sub-frame 64 of the image frame 40 and the pixel data values outside of a sub-frame 66 of the image frame 42 when calculating the correlation metrics 26. Figure 5d shows the image frame 42 having a -Δx offset and a -Δy offset with respect to the image frame 40 which is indicated by the motion estimate 32. In response, the correlation calculator 22 eliminates the pixel data values outside of a sub-frame 70 of the image frame 40 and the pixel data values outside of a sub-frame 72 of the image frame 42 when calculating the correlation metrics 26. Figure 5e shows the image frame 42 having a +Δx offset in relation to the image frame 40 as indicated by the motion estimate 32. In response to the +Δx motion estimate 32, the correlation calculator 22 eliminates the pixel data values located outside of a sub-area 74 of the image frame 40 and the pixel data values outside of a sub-area 76 of the image frame 42 when calculating the correlation metrics 26. Figure 5f shows the image frame 42 with a -Δy offset relative to the image frame 40 as indicated by the motion estimate 32. In response, the correlation calculator 22 eliminates the pixel data values located outside of a sub-area 80 of the image frame 40 and the pixel data values located outside of a sub-area 82 of the image frame 42 when calculating the correlation metrics 26. Figure 5g shows the image frame 42 having a -Δx offset with respect to the image frame 40 as indicated by the motion estimate 32. The correlation calculator 22 eliminates the pixel data values outside of a sub-frame 84 of the image frame 40 and the pixel data values outside of a sub-frame 86 of the image frame 42 when calculating the correlation metrics 26 in response to this motion estimate 32. Figure 5h shows the image frame 42 having a +Δy offset with respect to the image frame 40 which is indicated by the motion estimate 32. The correlation calculator 22 eliminates the pixel data values located outside of a sub-frame 90 of the image frame 40 and the pixel data values located outside of a sub-frame 92 of the image frame 42 when calculating the correlation metrics 26. The motion estimator 28 obtains a series of motion vectors 30 from the motion tracker 24. The motion vectors 30 indicate the relative spacial offsets, with sub-pixel resolution, of successive pairs of image frames sampled by the imaging array 12 as it moves with respect to, the image scene 14. The motion estimator 28 logs a history of the motion vectors and uses this history to generate the motion estimate 32. In one embodiment, the motion estimator 28 applies a Kalman filter function to the motion vectors 30 to predict the motion estimate 32. In general, the motion estimate 32 is based upon the likely continuation of previous motion because abrupt and rapid changes in movement of the imaging array 12 with respect to the image scene 14 are unlikely in many applications. For example, if the imaging array 12 is contained in a handheld scanner, then the motion estimate 32 prediction is based upon a continuation of the previous motion of the handheld scanner as indicated by the history of the motion vectors 30. In one embodiment, the sampling rate of the imaging array 12 is high enough to ensure that the maximum offset between the image frames 40-42 is one pixel given the likely rates at which the imaging array 12 may be moved with respect to the image scene 14. As a consequence, the maximum possible spatial offsets between the image frames 40-42 include only the following. lx ly 0 0 0 1 0 -1 1 0 1 1 1 -1 - 1 0 - 1 1 - 1 -1 The correlation metrics 26 computed by the correlation calculator 22 for the image frames 40-42 include nine correlation values - C 0,0 , C 0,1 , C 0,-1 , C 1,0 , C 1,1 , C 1,-1 , C -1,0 , C -1,1 , and C -1,-1 which correspond to these nine possible spatial relationships between the image frames 40-42. The motion tracker 24 fits these nine correlation values to a three-dimensional surface and then determines the minimum of the surface. The position of this minimum is described by a two-dimensional vector that indicates the actual spatial relationship between the image frames 40-42 with sub-pixel resolution. A series of these minima generated by the motion tracker 24 for successive pairs of image frames provides the series of motion vectors 30 for the motion estimator 28. The nine correlation values C 0,0 , C 0,-1 , C 0,-1 , C 1,0 , C 1,1 , C 1,-1 , C -1,0 , C -1,1 , and C -1,-1 differ in the number of terms that are involved in their calculations due to differing alignments of the corresponding sub-frames. For example, the calculation of the correlation value C 0,1 involves fewer terms than the calculation of the correlation value C 0,0 because the sub-frames 80-82 used in the calculation of C 0,0 contain non-overlapping pixels as shown in Figure 5f . These differences in number of terms increase if lag values having a higher magnitude than 1 are used. The difference in the number of terms involved in a square root of sum of squared differences calculation may be compensated by dividing each correlation value by a normalizing factor that accounts for the variation in the number of terms. Alternatively, the sub-frame areas used in calculating the correlation values may themselves be sub-framed so that all pairs of sub-frames involved in correlation calculations have the same number of terms in their correlation sums.for each lag value used. The foregoing detailed description of the present invention is provided for the purposes of illustration and is not intended to be exhaustive c= to limit the invention to the precise embodiment disclosed. Accordingly, the scope of the present invention is defined by the appended claims.

Claims: A method for motion detection, comprising the steps of: generating a pair of successive image frames (40-42) each containing a set of pixel data values sampled from the image scene (14); determining an area (50, 52; 54, 56) of each of the image frames (40-42) that contain overlapping image content from the image scene (14) for each of a set of possible spatial relationships including partial overlap between the images frames (40-42); calculating (22) a correlation metric (26) for each of the set of possible spatial relationships between the image frames (40-42)using the pixel data values exclusively from said areas of the image frames (40-42) that contain overlapping image content; and, fitting the correlation metrics to a three-dimensional surface and determining the minimum of the surface to determine the relative motion (32) between said image frames (40-42) with sub-pixel resolution. The method of claim 1, wherein the step of determining an area of each of the images frames (40-42) comprises the step of determining an area of each image frame such that the area is bounded by a border area having a delta-x dimension and a delta-y dimension. The method of claim 2, wherein the delta-x and the delta-y dimensions are preselected based upon a maximum at which the image frames (40-42) are likely to be offset from one another. The method of claim 3, wherein the delta-x and the delta-y dimensions each have a width which is less than or equal to a width of a pixel of the image frames (40-42). The method of claim 1, wherein the step of calculating a correlation metric comprises the step of calculating a sum of squared differences between the pixel data values from each of the image frames (40-42) in the areas that contain overlapping image content. The method of claim 1, wherein the step of determining an area of each of the image frames (40-42) comprises the steps of: determining an estimate of a spatial relationship between the image frames (40-42); and, selecting the area of each image frame based upon the estimate of the spatial relationship. The method of claim 6, wherein the estimate of the spatial relationship is based upon past motion between image frames (40-42) sampled from the image scene (14). An apparatus for motion detection, comprising: means for generating a pair of successive image frames (40-42) each containing a set of pixel data values sampled from the image scene (14); characterised in that the apparatus further comprises: means for determining an area (50, 52; 54, 56) of each of the image frames (40-42) that contain overlapping image content from the image scene (14) for each of a set of possible spatial relationships including partial overlap between the image frames (40-42); means (22) for calculating a correlation metric (26) for each of the set of possible spatial relationships between the image frames (40-42)using the pixel data values exclusively from said areas of the image frames (40-42) that contain overlapping image content such that correlation metrics enable a determination of a relative motion between the image frames (40-42); and, means for fitting the correlation metrics to a three-dimensional surface and determining the minimum of the surface to determine the relative motion (32) between said image frames (40-42) with sub-pixel resolution. The apparatus of claim 8, wherein the means for determining an area of each of the image frames (40-42) comprises means for determining an area of each image frame such that the area is bounded by a border area having a delta-x dimension and a delta-y dimension. The apparatus of claim 9, wherein the delta-x and the delta-y dimensions are preselected based upon a maximum at which the image frames (40-42) are likely to be offset from one another. The apparatus of claim 10, wherein the delta-x and the delta-y dimensions each have a width which is less than or equal to a width of a pixel of the image frames (40-42). The apparatus of claim 8, wherein the means for calculating a correlation metric comprises means for determining a sum of squared differences between the pixel data values from each of the image frames (40-42) in the areas that contain overlapping image content. The apparatus of claim 8, wherein the means for determining an area of each of the images frames (40-42) comprises: means for determining an estimate of a spatial relationship between the image frames (40-42); means for selecting the area of each image frame based upon the estimate of the spatial relationship. The apparatus of claim 13, wherein the estimate of the spatial relationship is based upon past motion between image frames (40-42) sampled from the image scene (14). The apparatus of claim 8, wherein: a correlation calculator (22) determines said area of each of a pair of image frames (40-42) containing overlapping image content from the image scene (14) dependent on each of a set of possible spatial relationships between the image frames (40-42), the correlation calculator (22) then determining said correlation metric; and a motion tracker (24) determines the relative motion between the image frames (40-42). The system of claim 15, wherein the correlation calculator (22) determines said area of each of the image frames (40-42) by selecting an area of each image frame such that the area is bounded by a border having a delta-x dimension and a delta-y dimension. The system of claim 16, wherein the delta-x and the delta-y dimensions are preselected based upon a maximum at which the image frames (40-42) are likely to be offset from one another. The system of claim 17, wherein the delta-x and the delta-y dimensions each have a width which is less than or equal to a width of a pixel of the image frames (40-42). The system of claim 15, wherein the correlation calculator (22) determines a correlation metric by calculating a sum of squared differences between the pixel data values from each of the image frames (40-42) in the areas that contain overlapping image content. The system of claim 15, further comprising a motion estimator (28) that determines an estimate of a spatial relationship between the image frames (40-42) such that the correlation calculator (22) selects the area of each image frame based upon the estimate of the spatial relationship. The system of claim 20, wherein the estimate of the spatial relationship is based upon past motion between image frames (40-42) sampled from the image scene (14).

Inventors: BEARD DAVID, BLALOCK TRAVIS N, TULLIS BARCLAY J, BEARD, DAVID, BLALOCK, TRAVIS N., TULLIS, BARCLAY J.
Applicants: AGILENT TECHNOLOGIES INC, HEWLETT PACKARD CO, AGILENT TECHNOLOGIES, INC. (A DELAWARE CORPORATION), HEWLETT-PACKARD COMPANY (A DELAWARE CORPORATION)
Application year: 1999
Main classification: H04N5
IPC codes: H04N5, G06T7, G01S3