IMPROVED CHROMAKEYING SYSTEM

Abstract: A chromakeying panel (20) for use in conjunction with a chromakeying system (10, 14, 50, 60) is disclosed (see figure). The panel (20) comprises a color pattern (40) having plurality of first locations bearing a first color within the color keying spectrum and a plurality of second locations bearing a second color within the color keying spectrum.

Description: IMPROVED CHROMAKEYING SYSTEM FIELD OF THE INVENTION The present invention relates to methods and apparatus for studio imaging including chromakeying. BACKGROUND OF THE INVENTION Background chromakey panels are commonly used in the art of television and video production in order to facilitate merging of a virtual background with fore¬ ground figures. The foreground figures are imaged on the chromakey panel background, and the known color of the chromakey panel background is detected and replaced by the virtual background. One problem associated with such productions is that changes in the foreground image, due to camera displacement, pan, tilt and zoom in and out, are not automatically applied to the background scene. One system designed to solve this problem is the "Virtual Studio" developed by Ultimatte. The "Virtual Studio" requires a special memory head pedestal which measures the camera's pan and tilt angles directly from the camera's mount. A disadvantage of this approach is that in order to obtain a complete perspective transfor¬ mation for the background image, the zoom state of the lens must be read and the instantaneous location of the camera must be determined. Also, this approach requires that each and every camera mount be replaced by a memory head pedestal, resulting in an expensive system and complicated operation if a large number of cameras are employed. Also, the accuracy of this method is inadequate for seamless foreground/background merging. Conventional edge detection methods which are based on smoothing and finding directional derivates are described in the following publication, the disclosure of which is hereby incorporated by reference: Canny, J., "A computational approach to edge detection", IEEE Trans, on PAMI, PAMI-8, No. 6, 1986, 679 - 697. Conventional edge detection methods which are based on Hough transforms are surveyed in the following publication, the disclosure of which is hereby incorpo¬ rated by reference: J. Illingworth and J. Kitler, "A survey of the Hough transform", CVGIP, 44, 1988, 87 - 116. Fig. BA-1 is a simplified block diagram of a state of the art chromakeying system. SUMMARY OF THE INVENTION The present invention seeks to provide improved methods and apparatus for chromakeying. There is thus provided in accordance with a preferred embodiment of the present invention a chroma¬ keying panel for use in conjunction with a chromakeying system having a color keying spectrum, the panel includ¬ ing a plurality of first locations bearing a first color within the color keying spectrum, and a plurality of second locations bearing a second color within the color keying spectrum. Further in accordance with a preferred embodi¬ ment of the present invention the first color and the second color are of the same hue and of different inten¬ sities. There is additionally provided in accordance with a preferred embodiment of the present invention a chromakeying system including a frame grabber operative to grab an image of a foreground image including at least one nonuniform chromakeying panel having a known pattern and a subject, a perspective transformation computation unit operative to compute a perspective transformation by comparing the image of at least one portion of the cap¬ tured panel with the known pattern, and a background generation unit operative to receive a background image, to apply the perspective transformation thereto and to replace the captured portion of at least one panel with the transformed background, thereby to generate a compos¬ ite image. Still further in accordance with a preferred embodiment of the present invention the system also includes a 3D background image source operative to pro¬ vide the background generation unit with a 3D representa- tion of a background scene. Additionally in accordance with a preferred embodiment of the present invention the system also includes a background image sequence source operative to provide the background generation unit with a temporal sequence of background scenes and wherein the perspective transformation computation unit is operative in real time relative to the pace of the temporal sequence. Also in accordance with a preferred embodiment of the present invention the background image sequence source includes a video clip source and wherein the perspective transformation computation unit is operative in video real time. Further in accordance with a preferred embodi¬ ment of the present invention the system also includes a graphically animated background image source operative to provide the background generation unit with a graphically animated background scene. Still further in accordance with a preferred embodiment of the present invention the system also includes a photographed background image source operative to provide the background generation unit with a photo¬ graphed background scene. Additionally in accordance with a preferred embodiment of the present invention the system includes a user interface communicating with the background genera¬ tion unit and operative to determine, for individual virtual object locations within the background image, whether the virtual object location is in front of the subject or in back of the subject and wherein the back¬ ground generation unit is operative to superimpose the subject over back virtual object locations and to super¬ impose front virtual object locations over the subject. Further in accordance with a preferred embodi¬ ment of the present invention each individual virtual object location includes a single pixel within the background image. Still further in accordance with a preferred embodiment of the present invention the system includes a rangefinder boresighted to the camera imaging at least one chromakey panel and the subject and operative to measure the range of a plurality of locations within the camera's field of view and wherein the background gener¬ ation unit is operative to merge overlaying background image locations and subject locations such that the overlaying location having a smaller range is included in the composite image. Further in accordance with a preferred embodi¬ ment of the present invention the system also includes a plurality of cameras imaging at least one chromakey panel and the subject. Still further in accordance with a preferred embodiment of the present invention the at least one chromakey panel includes a plurality of chromakey panels. Additionally in accordance with a preferred embodiment of the present invention the background gener¬ ator is operative to replace chromakey panel pixels with a transformed background also in the case that the cam¬ era's momentary field of view is larger than the chroma¬ key panel's field of view. There is further provided in accordance with a preferred embodiment of the present invention a chroma¬ keying method for use in conjunction with a chromakeying system having a color keying spectrum, the method includ¬ ing providing a chromakeying panel including a plurality of first locations bearing a first color within the color keying spectrum and a plurality of second locations bearing a second color within the color keying spectrum, and imaging a foreground image including the panel and a subject. There is additionally provided in accordance with a preferred embodiment of the present invention a chromakeying method including grabbing an image of a foreground image including at least one nonuniform chromakeying panel having a known pattern and a subject, computing a perspective transformation by comparing the image of at least one panel with the known pattern, and receiving a background image, applying the perspective transformation thereto and replacing at least one panel with the transformed background, thereby to generate a composite image. BRIEF DESCRIPTION OF THE DRAWINGS The present invention will be understood and appreciated from the following detailed description, taken in conjunction with the drawings in which: Fig. BA-1 is a simplified block diagram of a prior art chromakeying system; Fig. 1 is a simplified block diagram of a chromakeying system constructed and operative in accord¬ ance with a preferred embodiment of the present inven¬ tion; Fig. 2 is a simplified flowchart of a preferred method of operation for the perspective transformation computation unit, perspective transforming unit and chromakeying unit of Fig. 1; Fig. 3 is a simplified block diagram of an application for the apparatus of Fig. 1, in a multi- camera studio; Fig. 4 is a modification of the apparatus of Fig. 1 in which a range-finder with spatial resolution, boresighted to the camera, is used to obtain range data for foreground objects; Fig. 5 is a diagram of a portion of a pattern for a chromakey panel constructed and operative in ac¬ cordance with a preferred embodiment of the present invention; and Fig. 6 illustrates the effect of camera dis¬ placement on the panel portion of Fig. 5; Fig. 7 illustrates the effect of zoom on the panel portion of Fig. 5; Fig. 8 illustrates the effect of roll on the panel portion of Fig. 5; Fig. 9 illustrates the effect of a combination of camera tilt and displacement on the panel portion of Fig. 5; and Fig. 10 illustrates the effect of a combination of camera pan and displacement on the panel portion of Fig. 5. DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS Fig. BA-1 illustrates a prior art chromakeying system comprising a chromakeyer 250 and background image storage system 260. The prior art system 260 includes a background data bank for generating a "virtual" back¬ ground scene. Reference is now made to Fig. 1 which illus¬ trates an improved chromakeying system which is con¬ structed and operative in accordance with a preferred embodiment of the present invention. The apparatus of Fig. 1 includes a conventional camera 10 mounted on a conventional pedestal 14. The camera 10 images a chroma¬ key panel 20 which is a backdrop for a subject or fore¬ ground object 30 such as a human figure. The chromakey panel typically comprises a colored pattern 40 having the following characteristics: a. the pattern includes two or more shades both or all fall within the chromakeying spectrum of the appara¬ tus, b. The pattern allows the imaged pattern to be warped to the known actual pattern, and c. The pattern allows perspective distortions of the actual pattern during imaging, due to zoom, linear displacement and angular displacement of the camera 10, to be detected and applied to a virtual background. A sample pattern having the above characteris¬ tics is described in more detail below with reference to Fig. 5. The apparatus of Fig. 1 also includes a chromakeyer 50 and a background generator 60. The chroma¬ keyer 50 is operative to identify the areas within the camera's output image which correspond to the chromakey panel and to replace these areas with a virtual back¬ ground supplied by background generator 60. A particular feature of the present invention is that the background supplied by background generator 60 is in perspective with respect to the current camera's orientation and preferably has integrated therewithin other features of the foreground image such as blur, shading and lighting non-uniformity. The background generator 60 includes a conven¬ tional frame grabber 70 which grabs the foreground image from the camera 10 and feeds it to a perspective trans¬ formation computation unit 80. The perspective transfor¬ mation computation unit 80 is operative to analyze the perspective transformation of the chromakey panel pattern in the grabbed foreground image, by comparison with the known chromakey panel pattern. Preferably, other imaging features which affect the panel pattern are also ana¬ lyzed, such as blur, shading and lighting non-uniformity. Perspective transformation computation unit 80 feeds the transformation parameters to a perspective transformation unit 90 which applies the perspective transformation to the desired virtual background image. The virtual background may be supplied from any suitable source such as a hard disk 100, an analog video recorder 110 (disk, cassette or tape) associated with a frame grabber 126 or from an animation computer 132. The output of the system is an image 142 which may be broadcasted or otherwise displayed to an audience which includes a virtual background having the foreground image perspective and other realistic effects such as blur, lighting and shading. It is appreciated that the perspective effect and the blur and lighting effects in image 142 vary over time in exact correspondence with the variation over time of the same effects in the origi¬ nal foreground image. Reference is now made to Fig. 2 which is a simplified flowchart of a preferred method of operation for the perspective transformation computation unit, perspective transforming unit and chromakeying unit of Fig. 1. The method of Fig. 2 preferably comprises the following steps: STEP 120: The frame grabber grabs and digitizes the output of the camera, one field at a time or one frame at a time. It is preferable to process field by field due to the camera's angular motion. STEP 122: If the current grabbed field belongs to the first frame of the session, proceed to step 140. Otherwise proceed to step 124, i.e. if the current grabbed field is a subsequent frame of the session: STEP 124: Search for the pattern portion ana¬ lyzed in the previous field, in a window surrounding the corresponding location in the previous field. Alterna¬ tively, the search may be conducted inside a window surrounding a new location whose distance from the loca¬ tion in the previous field is determined by predicting the camera's angular speed according to the detected pattern locations in the last consecutive fields. To detect the pattern edges, conventional edge detection methods may be employed, such as either of the following: Canny, J., "A computational approach to edge detection", IEEE Trans, on PAMI, PAMI-8, No. 6, 1986, 679 - 697; or J. Illingworth and J. Kitler, "A survey of the Hough transform", CVGIP, 44, 1988, 87 - 116. STEP 130: Decision: Does the current field belong to a "new" frame, i.e. does it directly follow a new cut in which the camera has been switched, or is the current frame a consecutive frame, i.e. an additional frame from the same camera location as the previous frame. The processing after step 130 is on a field by field basis. If the frame is a new frame, then: STEP 140: Optionally, find the panel within the camera output image by searching for an area of pixels whose colors fall within the chromakey spectrum. Pattern edge detection may then be performed from this starting point rather than from an arbitrary starting point. STEP 150: Perform edge detection on the cap¬ tured panel portion, preferably with single pixel or subpixel accuracy, using conventional edge detection methods such as those described in the above-referenced Canny and Illingworth publications. The pattern lines are then constructed using the detected edges. Edge detec¬ tion is typically performed along each of the horizontal and vertical dimensions at least until two edges have been found along one of the dimensions and three edges along the other of the dimensions and altogether five lines have been defined. Finding two lines in one dimen¬ sion and three lines in the other results in six vertices connecting these lines which are subsequently matched to the known panel pattern as described below with reference to step 160. STEP 154: Within the detected edges, distin¬ guish the pattern from non-pattern features which ob¬ scure the pattern, such as shadows, lens distortions, and lighting nonuniformities. For example, the pattern fea¬ tures may be distinguished by their straight-line seg¬ ments, as in the pattern of Fig. 5, because the non- pattern features usually have curved edges. Also, non- pattern edges such as those due to lighting nonuniformi- ties are often smooth whereas the pattern edges are sharp in the direction perpendicular to camera motion. The locations of the non-pattern edges are stored in order to allow subsequent correction of the virtual background image. The non-pattern edges are ignored in the subse¬ quent analysis. Also stored is an indication of the color intensity map inside the shadow edges or within lighting nonuniformity contours or inside any contour isolating regions of lens abberation, such as vignetting. STEP 158: Optionally, quantify the blur intro¬ duced into the pattern by the camera's scanning during the imaging field time. The blur level at a plurality of locations within the image is stored so that the same blur level can be virtually applied to the virtual back¬ ground. Typically, the blur level is stored as a "map" which indicates the blur level associated with a grid of pixels located on the detected lines. The blur levels at other image points may be interpolated from this map. STEP 160: For at least four locations (typical¬ ly vertices) in the imaged panel portion, find the same number of matching locations (vertices) in the original panel pattern. For example, locations may be matched on the basis of unique ratios between line segments, as described below in detail with reference to Fig. 5. For localization, two line segments are normally required in one direction, so three detected lines are normally needed in the perpendicular dimension. At least four imaged panel locations ( _, ^) are typically matched to a corresponding number of origi¬ nal panel pattern locations (X^Y^). STEP 164: Use the paired locations to compute the linear displacement, angular displacement and zoom change of the imaging camera with respect to the previous orientation or with respect to the original camera orien¬ tation. The computations may be based on the following equations 1 - 7 for perspective transformation, where: X 0 , Y Q , Z Q = the linear displacement of the imaging camera; The angular displacement parameters are (pan), β (tilt), and gamma (roll), respectively; f = the zoom of the imaging camera; R χ (α) = Rotation about the X-axis; R y (β) = Rotation about the Y-axis; and R z ( ) = Rotation about the Z-axis. Eq. 4 R = R y (?) R χ («) R ∑ (7) ι( χ i- χ o) +q ι( γ i - γ o)-'-ι z o P -(X. -X 0 )-.q 2 (Y | -Y 0 )-r 2 Z 0 Eq. 7 y, = f P3( X 0- X i ) + C '3( Y 0- Y i ) + _ Z 0 STEP 170: Receive the background image from the framegrabber 70 or hard disk 100 or animation computer 132 of Fig. 1 and transform the background image so as to reproduce the linear displacement, angular displacement and focal length change of the imaging camera. Every background pixel i whose center is in (X^, Y i ) coordi¬ nates, is now transformed to location ( _,y_) using equations (1 - 7) . Typically, this operation is per¬ formed inversely: for each destination pixel i whose center is at (x^_, y i ) the source location (X i ,Y i ) is computed using the inverse of equations 6 and 7. The destination pixel value is then computed by weighting the source neighboring pixels using nearest neighbors, bi¬ linear approximations or tri-linear approximations. STEP 174: Optionally, the transformed image is corrected so as to virtually apply the stored blur, shadow and lighting nonuniformities data to the trans¬ formed image, thereby to emulate, within the background, the same type of effects which are occurring in the foreground. STEP 180: The composite image is generated by replacing the chromakey panel pixels in the foreground image with the corresponding pixels of the transformed and corrected background image. Fig. 3 is a simplified block diagram of an application for the apparatus of Fig. 1, in a multi- camera studio which includes an array of n cameras 10 and a switcher 150 which enables a producer to switch from one camera to another. It is appreciated that only one background generator 60 is required for the array of cameras 10. Fig. 4 is a modification of the apparatus of Fig. 1 which generates a perspectively transformed 3D background. A storage medium 260, such as a computer hard disk array, is provided which stores a virtual 3D back¬ ground. A rangefinder 270 with spatial resolution, typi- cally a pulsed laser transmitter/detector module, is boresighted to the imaging camera and scans the camera's field of view measuring the range to each visible pixel or a group of pixels using pulse "time of flight". Range- finder 270 is associated with the camera 10 and pedestal 14 and is operative to detect the range to each pixel or group of pixels visible in the captured image. A laser controller and detector's signal processor 274 is associ¬ ated with rangefinder 270 and is operative to control laser pulse timing and to extract momentary range from the received echoes. The chromakeyer 50 is replaced by a chromakeyer 280 which is augmented with an occlusion analysis func¬ tion. Chromakey panel pixels are replaced with the trans¬ formed and preferably corrected virtual background. For each background pixel the range measured with the range¬ finder is compared to the Z-value of the corresponding background pixel. If the Z value is smaller than the range, the Chromakey displays the background pixel. Reference is now made to Fig. 5 which is a diagram of a portion of a pattern for a chromakey panel constructed and operative in accordance with a preferred embodiment of the present invention. The pattern portion of Fig. 5 typically com¬ prises an uneven checkerboard of quadrilaterals having two alternating shades within the chromakey spectrum. The edges of the quadrilaterals are arranged along two dimen¬ sions, which may be perpendicular, such as the horizontal and vertical dimensions, but need not necessarily be so. The pattern portion of Fig. 5 preferably has the follow¬ ing attribute for each dimension d: For every vertex 610, the ratio between the length of the line segment 620 on one side thereof, along the dimension d, and the length of the line segment 630 on the other side thereof, along the dimension d, is unique. In other words, there is no other vertex whose adjacent line segments along the dimension d or along both directions have the same ratio between their lengths. This attribute allows vertices, when detected, to be localized by computing the above ratio and compar¬ ing it to the known ratios associated with the various vertices. For example, in the illustrated embodiment, the ratio between the lengths of segments 620 and 630 is 2 and none of the vertices of Fig. 5, other than vertex 610, have the same ratio. Preferably, the pattern also has the following pair of attributes: a. At least two pattern vertices in one direction and three in the other direction are included in the minimal field of view (maximum magnification) of the camera, b. In the maximal field of view (minimal magnifi¬ cation) of the camera, the imaging camera resolution is sufficient to allow adjacent edges to be separated by conventional edge detection methods. A suitable panel may be approximately 3 m x 3 m in size and may have an uneven checkerboard pattern, such that the sequence of ratios between adjacent line seg¬ ments along one or each dimension is a permutation of the following numbers: 1.01, 1.03, 1.05, 1.07, 1.09, 1.11, 1.13, 1.15, 1.17, 1.19, .... The largest line segment may be determined by computation such that at least six pattern vertices are included in the minimal field of view (maximum magnification) of the camera. The permuta¬ tion of the above sequence of numbers is preferably such that small ratios are adjacent to large ratios. For example, the first 6 numbers may be: 1.01, 1.19, 1.03, 1.17, 1.05, 1.15, and so on. The field of view of the camera can, if de¬ sired, exceed the size of the chromakey panel. Reference is also made to Figs. 6 - 10 which illustrate the effects of camera displacement; zoom; roll; a combination of tilt and displacement; and a combination of pan and displacement, respectively, on the panel portion of Fig. 5. In the present specification and claims, roll, tilt and pan are the angular displacements about the Z axis, X axis and Y axis, respectively, where the panel plane is the X-Y plane. In Fig. 9, the camera is first tilted and then displaced in parallel to the panel plane to capture the same panel portions. In Fig. 10, the camera is first panned and then displaced in parallel to the panel plane to capture the same panel portions. The abbreviations "FG" and "BG" are used for "foreground" and "background", respectively. The term "foreground" refers to the subject (such as the protago¬ nists of a talk show) and the chromakey panel which is the backdrop. The term "background" refers to the image which replaces the chromakey panel, such as an image of an outdoor scene. It is appreciated that the software components of the present invention may, if desired, be implemented in ROM (read-only memory) form. The software components may, generally, be implemented in hardware, if desired, using conventional techniques. It is appreciated that various features of the invention which are, for clarity, described in the con¬ texts of separate embodiments may also be provided in combination in a single embodiment. Conversely, various features of the invention which are, for brevity, de¬ scribed in the context of a single embodiment may also be provided separately or in any suitable subcombination. It will be appreciated by persons skilled in the art that the present invention is not limited to what has been particularly shown and described hereinabove. Rather, the scope of the present invention is defined only by the claims that follow:

Claims: CLAIMS 1. A chromakeying panel for use in conjunction with a chromakeying system having a color keying spec¬ trum, the panel comprising: a plurality of first locations bearing a first color within the color keying spectrum; and a plurality of second locations bearing a second color within the color keying spectrum. 2. A panel according to claim 1 wherein the first color and the second color are of the same hue and of different intensities. 3. A chromakeying system comprising: a frame grabber operative to grab an image of a foreground image including at least one nonuniform chromakeying panel having a known pattern and a subject; a perspective transformation computation unit operative to compute a perspective transformation by comparing the image of at least one panel with the known pattern; and a background generation unit operative to receive a background image, apply the perspective trans¬ formation thereto and replace at least one panel with the transformed background, thereby to generate a composite image. 4. A system according to claim 3 and also compris¬ ing a 3D background image source operative to provide the background generation unit with a 3D representation of a background scene. 5. A system according to claim 3 or claim 4 and also comprising a background image sequence source opera¬ tive to provide the background generation unit with a temporal sequence of background scenes and wherein the perspective transformation computation unit is operative in real time relative to the pace of the temporal se¬ quence. 6. A system according to claim 5 wherein the background image sequence source comprises a video clip source and wherein the perspective transformation compu¬ tation unit is operative in video real time. 7. A system according to any of claims 3 - 6 and also comprising a graphically animated background image source operative to provide the background generation unit with a graphically animated background scene. 8. A system according to any of claims 3 - 6 and also comprising a photographed background image source operative to provide the background generation unit with a photographed background scene. 9. A system according to any of the preceding claims 3 - 6 and also comprising a user interface commu¬ nicating with the background generation unit and opera¬ tive to determine, for individual virtual object loca¬ tions within the background image, whether the virtual object location is in front of the subject or in back of the subject and wherein the background generation unit is operative to superimpose the subject over back virtual object locations and to superimpose front virtual object locations over the subject. 10. A system according to claim 9 wherein each individual virtual object location comprises a single pixel within the background image. 11. A system according to any of the preceding claims 3 - 10 and also comprising a rangefinder bore¬ sighted . to the camera imaging at least one chromakey panel and the subject and operative to measure the range of a plurality of locations within the camera's field of view and wherein the background generation unit is operative to merge overlaying background image locations and subject locations such that the overlaying location having a smaller range is included in the composite image. 12. A system according to any of the preceding claims 3 - 11 and also comprising a plurality of cameras imaging at least one chromakey panel and the subject. 13. A system according to any of the preceding claims 3 - 12 wherein said at least one chromakey panel comprises a plurality of chromakey panels. 14. A system according to any of the preceding claims 3 - 13 in which the background generator is opera¬ tive to replace chromakey panel pixels with a transformed background also in the case that the entire chromakey panel is included within the camera's momentary field of view. 15. A chromakeying method for use in conjunction with a chromakeying system having a color keying spec¬ trum, the method comprising: providing a chromakeying panel including a plurality of first locations bearing a first color within the color keying spectrum and a plurality of second locations bearing a second color within the color keying spectrum; and imaging a foreground image including said panel and a subject. 16. A chromakeying method comprising: grabbing an image of a foreground image includ¬ ing at least one nonuniform chromakeying panel having a known pattern and a subject; computing a perspective transformation by comparing the image of at least one panel with the known pattern; and receiving a bac .ground image, applying the perspective transformation thereto and replacing at least one panel with the transformed background, thereby to generate a composite image.

Inventors: SHARIR AVI, TAMIR MICHAEL, SHARIR, AVI, TAMIR, MICHAEL
Applicants: ORAD INC, SHARIR AVI, TAMIR MICHAEL, ORAD, INC., SHARIR, AVI, TAMIR, MICHAEL
Application year: 1995
Main classification: H04N9
IPC codes: H04N5, H04N9