i Primatte Software Keyer Plug
Transcription
i Primatte Software Keyer Plug
Primatte Software Keyer Plug-in Reference Plug-in Release 3.0 for Primatte V5 Notice Quantel Limited accepts no responsibility for the accuracy of the information contained herein and reserves the right to change the contents without prior notice. This document does not form part of the product’s Technical or Functional Specification and does not form part of any contractual agreement. This manual is a change controlled document. Please quote the revision status of this manual when reordering. This Document is Revision “B”. Copyright © Quantel Ltd 2011 i Notices Trade Marks Most of the product names mentioned in this manual are manufacturer trademarks and are used within this manual only for the purpose of identification. Quantel iQ and Quantel QEffects are trademarks of Quantel Limited. Primatte is distributed and licensed by Photron USA, Inc., San Diego, CA, USA Primatte was developed by IMAGICA DIGIX Inc., Tokyo, Japan Primatte is a trademark of IMAGICA DIGIX Inc., Tokyo, Japan ii About This Manual The information for this manual was written by Scott Gross of Photron USA, Inc: 3113 Woodleigh Lane Cameron Park, CA 95682 Phone: 1-530-677-9980 Fax: 1-530-677-9981 Mobile: 1-530-613-3212 E-mail: [email protected] URL: http://www.primatte.com Skype: scottagross This manual was revised for Quantel by Barry Hicks of Video Design Software (VDS), and published by the Quantel Technical Publications Department. This is a change controlled document. Each page of this document is given an issue letter (shown at the bottom of each page with the drawing number and revision date) which represents the status of the page. Revision A on any page indicates that the page is the original. Any changes to any pages will raise the revision status of the document. When re-ordering, always quote the document type, the documents number and revision status along with the unit’s serial number: B 02/11 XXXXXX Release 3.0 All pages iii Contents Keying Using the Primatte Software Plug-in Using the Primatte Software Keyer Plug-in 2 General Menu Operation Selecting the Primatte Plug-in Configuration Buttons Hybrid Rendering (new in Primatte V5) Key Mode Selection Select BG (Key) Color Cleaning Foreground & Background Removing Color Spill Spill Process Functions Fine Tuning the Composite Make Foreground Transparent Restore Detail Spill Sampling Tools Matte Sampling Tools Detail Sampling Tools Adjust Buttons Adjust Lighting Buttons (new in Primatte V5) Auto Compute Rendering the Whole Clip 2 3 4 10 11 12 13 15 15 18 19 20 20 20 20 21 25 27 28 More about the Primatte Algorithms The Primatte Algorithm Explanation of how Primatte RT+ works Explanation of how Primatte RT works 28 29 35 36 iv Primatte Software Keyer Plug-in Reference Keying Using the Primatte Software Plug-in 1 Using the Primatte Software Keyer Plug-in General Menu Operation Quantel offers two Primatte plug-ins, a Hardware Assisted Keyer Plug-in, (found under the “Key” menu in QEffects), and a Software Keyer Plug-in, found under the “QPlugin” menu (also in QEffects). The Hardware Assisted Keyer Plug-in, discussed in a separate document, has faster performance, but fewer features and lower precision than the Software Keyer Plug-in. The Software Keyer Plug-in, discussed in this reference manual, offers Primatte’s full feature set and precision, but renders in software and thus may have slower performance. The screen shot below shows the QEffects menu when QPlugin is enabled and the Primatte Software Keyer Plug-in is selected. When the Primatte Software Keyer plug-in is selected, the menu area at the bottom of the screen displays keying menus while the desktop provides a visual representation of the keying process being performed at the current frame position in the clip. The above screen shot shows a blue screen image, and this document uses the term “blue screen” throughout. However, the foreground image could just as easily utilize another key color, for example, green screen. See the “Plugins” chapter in the QEffects Application Reference for further details on general QPlugin operation. 2 Selecting the Primatte Software Keyer Plug-in Use the Primatte Software Keyer Plug-in to key out areas of a specific color (usually blue or green screen) in the current layer, a “foreground” image or clip. To apply the Primatte Software Keyer Plug-in to the current layer, turn on the “Qplugin” button (to the far left of the QEffects menu under “Text”). Use the blue list box button immediately under “Favourites” to select “Imagica” as the Plugin Producer .Then in the blue list box immediately below, select “Primatte” as the current plug-in (see the buttons labeled “enable Primatte” in the screen shot below). During plug-in operation, you will see the composite displayed on the screen when the “video” button is on. When the “key” button is on, you will see the matte (alpha channel) generated by the keyer plug-in. You can use the undo and redo buttons to the lower left of the menus to undo and redo each step as you adjust your plug-in settings. The Primatte menus appear to the right of the “Imagica” and “Primatte” buttons used to enable the plugin (as described above). The left half of the Primatte menus (containing the buttons BG Image, Ext Mask, View, Algorithm, Median Sampling, Floating Point, Auto Compute, etc) is always visible. The right half of the Primatte menus differs depending on whether the Setup or Adjust toggle buttons are selected. When the Setup toggle button is selected, the Key Mode Selection buttons appear in the right half of the Primatte menus (as shown in the screen shot above). When the Adjust toggle button is selected, the Adjust buttons appear, as shown in the screen shot below. When the Adjust Light toggle button is selected, the Adjust Lighting buttons appear, also shown in a screen shot below. These buttons are described further on the following pages. 3 Adjust buttons Adjust Lighting buttons Configuration Buttons The buttons on the left half of the Primatte menus are generally used to configure Primatte before starting the actual keying process. These buttons are summarized as follows. We then discuss the actually keying process further on the following pages. BG Image Use this button to select a background image. Bring up the clips bin, then drag and drop the desired background clip or image from the clips bin to the adjacent button labeled “No Clip Selected” as shown above. Enable the “On” button next to this to turn on the background image. Note that this button will often remain unused in its default state, as you will often use QEffects’ layering capability to composite the keyed foreground clip over one or more background layers. To rephrase, if you use the “BG Image” button, the Primatte plug-in composites the current foreground layer over a single “BG Image” or clip. Otherwise, Quantel composites the Primatte plug-in’s result (with key channel) over the other Quantel “background” layers. More explanation below when we discuss the “View” button. BG Image button with “ALEX BG” clip assigned and turned “On” Ext Mask Use this button to select a garbage matte (external mask). Bring up the clips bin, then drag and drop the desired external mask clip or image from the clips bin to the adjacent button labeled “No Clip Selected” as shown above. Enable the “On” button next to this to turn on the external mask. When enabled, white pixels in the external mask remove (cut out) pixels from the foreground image, whereas black pixels in the external mask leave the foreground intact (and gray pixels attenuate the foreground based on their brightness). Ext Mask button with “blonde matte” clip assigned and turned “On” View 4 This button controls what Primatte displays as its render result, including the following options: Keyed FG, Composite, Matte, Proc FG, FG, BG, Ext Matte, Defocus Source, Status, Adj Light FG, Adj Light BG, and Hybrid Matte. The default is Keyed FG, which you will normally use when you have multiple Quantel layers and you’re compositing a Primatte-keyed foreground layer over them. The other options can be useful for preview when adjusting the key, and to help see what Primatte is doing as it operates: 5 Keyed FG Displays Primatte’s final result, as a processed foreground image with spill suppression in the RGB channels (displayed when the “video” button is on), and a Primatte-generated key in the alpha channel (displayed when the “key” button is on). Use when you’re compositing Primatte’s result over other Quantel layers. Composite Use only when you’ve assigned a background clip or image using the “BG Image” button as described above. Displays the foreground image composited over the assigned background, as rendered by Primatte. Matte The key channel generated by Primatte. This is identical to the alpha channel when using the “Keyed FG” view. Use this view when picking colors and refining your result, for example when using the “Clean BG Noise” and “Clean FG Noise” tools as described later in this document. 6 Proc FG Displays the processed foreground as generated by Primatte, with spill suppression applied. This is identical to the RGB channels when using the “Keyed FG” view. This view shows the foreground against a black background usually with a lot of false coloring or noisy pixels around it. The noisy pixels are generated to maintain the fine hair or thin foreground detail, and have spill suppression applied, which cancels out blue or green spill that might appear around the edges of the keyed foreground. Because the matte (key) values around the noisy pixels will be very small and will be multiplied against the noise, the end result will be highly desirable (the noise values will be very transparent and will composite well against the background). FG Displays the original foreground image (which can be useful for reference when previewing). BG Displays the original background image assigned using the “BG Image” button (as discussed earlier, this button will often be unused when doing multi-layer composites in Quantel). Ext Matte Displays the external matte image assigned using the “Ext Matte” button as described earlier (this can be useful for reference during previewing). Defocus Source Displays the foreground with Grain Removal applied (Grain Removal is discussed later in this document). This can be useful for reference during previewing. Status Displays a color coded image showing how the keyed foreground has changed from the original foreground. This may be helpful for troubleshooting difficult keys. Each pixel in this view is color coded as follows: Black = keyed FG is100% transparent. White = keyed FG is 100% opaque w/ RGB same as original. Yellow = keyed FG 100% opaque, RGB different from original. Blue = semi-transparent areas of keyed FG. Adj Light FG Displays the foreground, with Adjust Lighting applied to areas of backing color (for example, areas of blue screen). Adj Light BG Displays the extrapolated backing screen generated by Adjust Lighting processing. This is then applied to the original foreground to generate the Adj Light FG in the previous view. Hybrid Matte Displays the shrunken matte used for Hybrid Rendering (this is applied to the foreground areas with original colors). This concludes discussion of the View button. 7 Algorithm The Primatte Software Plug-in offers two alternate, faster algorithms – Primatte RT and Primatte RT+ - that you can choose for faster rendering results at the expense of precision. The algorithm choices are further described below, with “Primatte” being the default with highest precision: Primatte The default Primatte algorithm delivers the best results and supports both the Solid Color and the Complement Color spill suppression methods. It is the algorithm that uses three multifaceted polyhedrons (as described further down in this document) to separate the 3D RGB color space. It is also the default algorithm mode and, because it is computationally intensive, it may take the longest to render. Primatte RT Primatte RT is the simplest algorithm and therefore, the fastest. It uses only a single planar surface to separate the 3D RGB color space and, as a result, does not have the ability to separate out the foreground from the backing screen as carefully as the above Primatte algorithm. Other disadvantages of the Primatte RT algorithm is that it does not work well with less saturated backing screen colors, and it does not support the Complement Color spill suppression method. Primatte RT+ Primatte RT+ is in between the above two options. It uses a six planar surface color separation algorithm and will deliver results in between the other two in both quality and performance. Other disadvantages of the Primatte RT+ algorithm is that it does not work well with less saturated backing screen colors, and it does not support the Complement Color spill suppression method. This concludes discussion of the Algorithm button. Reset 8 Press this button to reset all Primatte parameters to their default state, and to restore the current (target) layer to its original un-keyed foreground contents (with blue or green screen visible). Median Sampling The Median picking feature is useful to filter out noisy pixels when doing sampling and picking operations. For example, if you have a noisy image and pick a region to sample, normally all the pixels in that region are used for the processing. To improve upon this, you can optionally ask Primatte to apply a 3x3 median filter on the sampled input pixels prior to performing the sampling operation. Turn on the “Median Sampling” box to enable this. Floating Point By default, the Primatte library does all internal calculations in integer mode using 16-bits per RGB component. Turn on the “Floating Point” box to do all internal calculations in floating point resolution. Floating point precision can produce higher quality images and is faster. Auto Compute This is a shortcut feature which for many keying jobs, allows you to skip the first several steps in defining your key (in other words, skip the Smart Select BG, Select BG Color, Clean BG Noise, and Clean FG Noise steps, all of which are described below). Auto Compute is described in more detail in a later section of this document. Note also that Auto Compute has been improved for Primatte V5. 9 Hybrid Rendering On the “Adj Light” page, to the far right, is the Hybrid Render button. Turn this button on to enable Hybrid Rendering, as described below (first press the “Adj Light” button to reveal this page of controls): If you encounter areas where a color in the foreground object is very close to the backing screen color, you may experience a common problem inherent in blue/green screen matting. When you want to have a nice smooth edge as in this sample, you need to compromise and, as a result, end up with a bluish shirt that is bleached and semi-transparent. If you try to maintain the original blue of the cloth, then you will get rough and bluish edge on other areas of the foreground object. Even though the shirt color is slightly different from the backing color, the edge of the FG object frequently includes almost same color because the edge pixels are a mixture of the backing color and the foreground object. This is why this problem often occurs. The new Hybrid Rendering mode internally prepares both settings and combines the better portion from each result. In the “View” button, discussed previously, there is a new mode to view the matte used in Hybrid Rendering. Refer to that section for further details. In addition, below the Hybrid Render button, there are two sliders where you can adjust the matte used for hybrid rendering. The Blur slider adjusts the blur applied to the hybrid matte, while the Erode slider adjusts the amount the hybrid matte is shrunk. Refer to the section on the Adjust Lighting buttons for further details. The screen shots below show an example with original (left), result (center), and result with Hybrid Rendering (right): 10 Key Mode Selection When the Setup toggle button is on, the Key Mode Selection buttons appear in the right half of the Primatte menu. The basic functionality of the Primatte keyer plug-in is based around these ‘mode selection’ boxes (Smart Select BG, Select BG Color, Clean BG Noise, Clean FG Noise, Spill +/-, Matte +/-, Detail +/-, Matte Sponge, Spill Sponge, Make FG Transparent, Restore Detail and Fine Tuning), and the image area of the desktop. Only one of the mode selection boxes can be on at once, and this determines how the plug-in operates when the user selects colors on the image. These different modes represent the different steps to be taken to produce a high quality composite image. The first step required to produce a key using Primatte is Smart Select BG. This button comes up highlighted as the default selection when the Primatte plug-in is first opened. 11 Smart Select BG Turn on the Smart Select BG box, then pick the key (background) color from the image area using the pen (you will see a red box outlining the area you’re picking as you drag, as shown in the screen shot below). When you release, you should see the composite, with keyed foreground based on the colors you’ve picked. Be sure that the “video” button (below the timeline and to the right) is selected so you can see the composite, and that you have the proper “View” selected (as discussed previously). When picking colors, position the cursor in the key color of the image area near the foreground objects and sample the targeted background color. Hold down the pen and drag it within the image area to select and average the key color, or make a single pixel selection to sample a single color. When pen pressure is released, the compositing process will start. If the foreground shot was made under ideal lighting conditions, then 90-95% of the composite will be accomplished in this one step. TIP: If you dragged the cursor on the key color (for example, blue screen) area, Primatte averages the multi-pixel sample to get a single color to adjust to. Sometimes Primatte works best when only a single pixel is sampled instead of a range of pixels. The color selected at this point in the procedure is critical to the operation of the plug-in from this point forward. Should you encounter problems later in the process after having selected a range of key color shades, try Smart Select BG again with a single dark key color pixel or single light key color pixel. TIP: If the foreground image has a shadow in it that you want to keep in the composite, do not select any of the darker pixels in the shadow, and the shadow will come along with the rest of the keyed foreground image. Select BG Color Primatte V5 introduced the Smart Select BG button. There is still a Select BG Color button. Although Smart Select BG is preferred, the Select BG Color button may still be useful in some cases. The following explains the differences: Select BG Color: Uses the traditional Primatte method of taking the sampled backing screen color, projecting a line in the opposite direction on the hue wheel and generating artificial pixels that MAY represent the FG object. Then, using the artificially generated foreground pixels, internally does the Clean FG Noise operation and creates the shape of the middle and outer polyhedrons. It then renders the composite using the generated polyhedrons. Smart Select BG: Gets the sampled backing screen color and then analyzes the original foreground image and determines the foreground areas using the new Primatte V5 foreground detection routine. Then, internally, using the newly determined foreground areas, performs the Clean FG Noise operation and determines a more desirable shape for the middle and outer polyhedrons. It then renders the composite using the generated polyhedrons. NOTE: The Smart Select BG operational mode is optimized for blue or green backing screens. Primatte will work equally well with any color backing screen. It does not have to be a specific shade of green or blue. If you are using a different color, please use the Select BG Color operational mode to start the operation. 12 Cleaning Foreground & Background The second and third steps in using the Primatte plug-in require the Key (matte) to be displayed in the image area. Switch the View button to Matte, as discussed above, to display the key signal generated by Primatte. Note that the second and third steps should not be necessary when using the Smart Select BG operational mode described above. These steps are included here in case the Smart Select BG operation did not give the desired results, or in case the older Select BG Color mode was used. Press the Clean BG Noise box. If View is set to Matte, the image area will display the current key. If there are any white regions in the dark “blue screen” area, it is noise and should be removed. Move the cursor into these areas and sample these 'white noise' regions. When pen pressure is released, Primatte will process the data and eliminate the noise. Repeat this procedure as often as necessary to clear the noise from the background areas. Sometimes increasing the brightness of your monitor or changing the screen gamma allows you to see noise that would otherwise be invisible. Before Background noise removal After Background noise removal TIP: When clearing noise from around loose flying hair or any background/foreground transitional area, be careful not to select any of areas near the edge of the hair. Leave a little noise around the hair, as this can be cleaned up later using the Fine Tuning tool. TIP: Most pixels displayed as a dark color close to black in a key image will become transparent and virtually allow the background to be the final output in that area. Consequently, there is no need to eliminate all subtle noise in the “blue screen” portions of the image. In particular, if an attempt is made to meticulously remove noise around the foreground object, a smooth composite image is often difficult to generate. 13 If there are darker or gray regions in the middle of the mostly white foreground object, that is, if the key is not 100% in some portion of the targeted foreground, select the Clean FG Noise mode. Use the same techniques as with the Clean BG Noise mode, but this time, sample the darker pixels in the foreground area until that area is as white as possible. Again, stay away from the edges of the foreground object. Before Foreground Noise Removal 14 After Foreground Noise Removal Removing Color Spill The previous steps are necessary to create a clean 'matte' or 'key'. With this key, the foreground can be composited onto any background image. However, if there is 'spill' on the foreground object from light that was reflected off the original background, a final operation is necessary to remove that background spill to get a more natural looking composite. Before Spill Removal After Spill Removal After the first three steps mentioned on earlier pages, there may still be some blue fringing on areas around the hair or a blue tinge to the face or clothing caused by light reflecting from the physical chroma key background. There are two ways to remove the spill color in Primatte. The simple method is to select the Spill Sponge mode (ensure the “video” button is on, and the View button is set properly as described earlier, so you can see the composite) and then sample the spill areas away. By just positioning the cursor over a bluish pixel on the foreground object and selecting it, the blue will disappear and be replaced by a more natural color. You can also drag on the screen to select a region of pixels containing spill. Note: This operation works on foreground 'color regions'. In the image above, samples should be made on the hair fringes, and also on the inside of the left arm below the sleeve. Spill Process functions: When the Adjust toggle button is on, a group of “Adjust buttons” appear on the right half of the Primatte menu. Included in these is the Spill Process list box, which controls which colors replace the foreground areas with spill. When Complement is on, Primatte replaces color spill with the background color's complementary color. For a spill (key) color of blue, this is usually a yellowish color. Complement is the default setting, as shown below. 15 The Solid Replace function replaces color spill with a solid color, selected in the Palette menu (shown below). The replacement color in this mode is by default gray (R128, G128, B128). When Solid Replace mode is selected, the Palette menu is displayed to the right of the Spill Process buttons, allowing the user to select a color other than gray. Note: If the foreground object was a person wearing a red shirt and the user was having difficulty removing the blue spill from the shirt, he could use this feature and select a color close to the red shirt color to replace the spill. This sometimes results in a better edge around the foreground object. The Palette menu allows the selection of and displays the current Solid Replace color (by default, it is gray; R128, G128, B128). By clicking on an area of the color wheel, the user is selecting a color (other than the complement) to be used in replacing color spill. A number of color pots appear to the left of the color wheel. These allow you to select preset colors, including several shades of gray. Selecting any of these shades of gray positions the color selector cursor at the center of the color wheel. The gray scale value can then be controlled from the gray scale bar (to the right of the color wheel). 16 Defocus Replacement mode The Defocus Replacement mode uses a defocused copy of the background image to determine the spill replacement colors instead of a solid palette color or just the complement color. This mode can result in good color tone on the foreground object even with a high contrast background. As in the example below, spill can even be removed from frosted glass using this feature and still retain the translucency. On the negative side, the Defocus Replacement mode sometimes results in the fine edge detail of the foreground objects getting lost. Another problem could occur if the user wanted to later change the size of the foreground image against the background. Since the background/foreground alignment would change, the applied color tone from the defocused image might not match the new alignment. Blue Suppression of a Frosted Glass Object 17 Fine Tuning the Composite If the spilled color was not totally removed using the above procedure, a finetuning operation should follow for more subtle and sophisticated removal of the spilled background color. Select the Fine Tuning mode, then using the cursor, sample a small range of the pixels exhibiting color spill that you want to remove. When you lift the pen, three fine tuning number boxes will appear: LPoly-spill, MPoly-matte, and SPoly-detail. At this time, Primatte will display the selected color in a color swatch box (just to the right of the number boxes). For most images, the LPoly-spill function (which affects the Large Polyhedron, further details in the last section below) is all that is required to remove any remaining color spill. Cursor movement on the LPoly-spill control performs a color adjustment of the sampled color against the background. The more to the right the cursor moves (while dragging), the less of the key color component (or spill) will be included. The more to the left the cursor moves, the closer the color component of the selected region will be to the original foreground image. If moving the control all the way to the right does not achieve the desired result, re-sample the color on the monitor image and again move the LPoly-spill control to the right. These operations are additive and can be repeated as necessary to get the desired results. Note that when using the LPoly-spill control in Fine Tuning mode to remove spill, spill colors will be replaced based on the setting of the Spill Process list box (to Complement, Solid Replace, or Defocus). TIP: It is better to make several small adjustments to the spill areas than a single large one. The two other Fine Tuning number boxes can be used in the same way for different key adjustments. The SPoly-detail function controls the matte softness for the color that is closest to the background color. For example, you can recover lost rarefied smoke in the foreground by selecting the Fine Tuning operational mode, clicking on the area of the image where the smoke just starts to disappear and moving the SPoly-detail control to the left. 18 Note that the SPoly-detail control shrinks the small polyhedron and releases pixels that were close to the background color (the small polyhedron contains all the blue or green background colors and is described further in the last section below). The SPoly-detail Control is useful for restoring foreground image pixels that were lost in the original sample because they were so similar to the background color. The MPoly-matte function controls the matte softness for the color that is closest to the foreground color. For example, if you have thick and opaque smoke in the foreground, you can make it semi-transparent by moving the MPoly-matte control to the right after selecting the pixels in the Fine Tuning mode. Note that the MPoly-matte control affects the Medium Polyhedron (further details in the last section below) and adjusts the transparency of the matte against the sampled color. The more to the right this control is moved, the more transparent the foreground object becomes in the selected color region. TIP: If the foreground image changed color dramatically during the finetuning process, you can recover the original color by re-sampling an area of the off-color foreground image and moving the LPoly-spill control slightly to the left. This may introduce some spill back into that color region. Again, use the LPoly-spill control to suppress the spill, but make smaller adjustments this time. If these final 'spill suppression' operations have changed the final compositing results, you may have to return to earlier operations to clean up the matte. If the Composite view looks good, but a 100% foreground area has become slightly transparent, you can clean those transparent areas up by using the Matte Sponge function. After selecting Matte Sponge, just click on the transparent pixels (gray on the white foreground object when viewing the key), and they will become 100% foreground (or white). All of the spillsuppression information will remain intact during this operation. Alternatively, using the matte view, select Fine Tuning mode, then select those transparent areas in the image and move the MPoly-matte control slightly to the left. This will move that color region from 0-99% foreground with spill suppression to 100% foreground with spill suppression and should solve the problem. Make Foreground Transparent When this mode is selected, the opaque foreground color region sampled in the image window becomes slightly translucent. This operation is useful for making foreground objects that are otherwise 100 percent covered with smoke or clouds visible. To use this mode, select the “Make FG Transparent” box then drag on the image and release to select the desired color region of interest in the foreground that you want to make transparent. 19 Restore Detail With this mode selected, the completely transparent background region sampled in the image window becomes translucent. This operation is useful for restoring lost hair details, thin wisps of smoke and the like. It shrinks the small polyhedron slightly. To use this mode, select the “Restore Detail” box, then drag on the image and release to select the color region of interest that you want to make translucent. Spill Sampling Tools (Spill + and Spill -) Using the Spill(+) and Spill(-) modes, you can gradually remove or recover the spill intensity on the foreground object by sampling the referenced color region repeatedly. The conventional Spill Sponge tool removes the spill component in a single action at one level and does not allow sampling the same pixel a second time. Even though just a small amount of spill needed to be removed, the Spill Sponge removed a preset amount without allowing any finer adjustment. Effect of Spill(+/-) Repeatable Sampling Matte Sampling Tools The Matte(+) and Matte(-) modes are used to thicken or attenuate the matte information. If you want a thinner shadow on a foreground object, you can use the Matte(-) mode as many times as you like to make it more transparent. On the other hand, you can use the Matte(+) mode to make the matte thicker in that color region. Effect of Matte(+/-) Repeatable Sampling Detail Sampling Tools The Detail(+) and Detail(-) modes are a refined version of Clean BG Noise and Restore Detail. For example, when you see some dilute noise in the backing area but don't want to remove it completely because it affects some fine detail in a different area, try using Detail(-). It will attenuate the noise gradually as multiple samples are made on the pixel. You should stop the sampling when important fine details start to disappear. Effect of Detail (+/-) Repeatable Sampling 20 Adjust Buttons When the Adjust toggle button is selected, several Adjust buttons appear in the right half of the Primatte menu. These include the Spill Process list box (discussed previously), along with the Grain, Shrink, and Defocus controls. This section discusses the latter controls. Defocus This tool is used to soften a hard-edge that might sometime occur after keying out the background. Moving this number box in a positive direction determines the defocusing level being applied to the matte (key). The direction of the blur can be modified using the Inward Defocus button (see next tool description). Inward Defocus A method of defocusing the matte where the softening is only applied inwardly, toward the center of the foreground subject. The default Primatte defocus feature affects the matte edges in both directions (inward and outward) and sometimes introduces a halo artifact around the foreground object's edge in the composite view. This can be most evident when using the Complement Spill Process mode. With the Inward Defocus button turned on, the matte defocus functions only in the inward direction of the foreground subject (toward the center of the white area). The 21 final result is that it removes small and dark noise in the backing area without picking them up again in the Clean BG Noise mode and sometimes results in softer, cleaner edges on the foreground objects and no halo effect around the foreground object. Shrink Determines the degree of background penetration into the foreground around the silhouette of the foreground object. The effect is likened to ’shrinking’ the matte (key). Note: With using this feature, foreground details like wisps of hair and smoothness of motion blur may be adversely affected. Set it to 0 for optimum results with such details. Grain Type The Grain Tools are used when a foreground image is highly compromised by film grain. As a result of such grain, when backing screen noise is completely removed, the edges of the foreground object often become harsh and jagged leading to a poor key. These tools were created to, hopefully, help when a compositing artist is faced with a grainy image. These tools default to off, when the Grain Type list box is set to No Grain. To enable grain removal, set the Grain Type list box to one of the following values: Small Grain When Small Grain is selected, the user gets the average color of a small region of the area around the sampled pixel. This should be used when the grain is very dense. Medium Grain When Medium Grain is selected, the user gets the average color of a medium-sized region of the area around the sampled pixel. This should be used when the grain is less dense. Large Grain When Large Grain is selected, the user gets the average color of a larger region of the area around the sampled pixel. This should be used when the grain is very loose. When you enable grain removal, a Grain Tolerance number box appears below the Grain Type list box. The larger the grain size the larger the resulting reduction in grain. However, if the grain size is too large then it may result in loss of edge and foreground areas. The grain tolerance is very sensitive and so you should try to use small values otherwise it can cause weird results: 22 23 As said, the Grain Tools handle cases when there is a lot of noise in the foreground image that makes producing a good extraction difficult. For example, consider the following case: Doing too much ‘clean background’ (Clean BG Noise) sampling to reduce the noise in the background will adversely affect the edges and loose detail: In this case, the Grain Tools can used to clean the background but still preserve the fine edges as follows. Just set the Grain Type and Grain Tolerance controls as described above, then use the Clean BG Noise tool to remove gray areas from the background. 24 Adjust Lighting Buttons When the Adjust Light toggle button is selected, controls for Adjust Lighting appear to the right, as shown below. Adjust Lighting is an optional feature that automatically will improve the lighting of the foreground to account for poor actual lighting. For example, you can have images which have many different hues of blue because the lighting was not well controlled. Essentially a new “adjusted light” foreground is generated which will be used in further Primatte processing. This will make the traditional Primatte keying algorithm produce superior results. The implementation uses a patent pending algorithm that generates a grid to analyze which parts of the image are considered true blue/green screen or foreground or a simulated blue/green color will be generated. The Adjust Lighting algorithm uses a set of samples in the image that it establishes on a regular grid pattern. The algorithm will determine if they are classified as a pure blue/green background sample, or a simulated background sample or a foreground sample. The simulated case is generated based on the neighborhood grid samples. To enable Adjust Lighting, simply turn on the Adjust Lighting button, to the bottom left as shown in the screen shot above. To the right, below the blue Adjust Lighting label, appear the following three other controls. The default settings for these will often be fine, but the controls are there in case you need to make precise changes: Outer Boundary Often you can find noisy or black pixels on the boundary. To avoid these from polluting the results of the adjust lighting operation, you can set a boundary that will be ignored for the processing. The default is 5. Grid Size Increase this value if you would like more precision in the Adjust Lighting process. The default is 12. Threshold The threshold used in the Adjust Lighting algorithm to determine if a grid pixel should be treated as a pure blue/green background sample, or a simulated background sample or a foreground sample. The default is 10. In the “View” button, discussed previously, there are two new modes to view the intermediate results used by Adjust Lighting. Refer to that section for further details. Also grouped with the Adjust Lighting buttons, to the far right, is a button to enable or disable Hybrid Render. Below this, there are two sliders where you can adjust the matte used for hybrid rendering. The Blur slider adjusts the blur applied to the hybrid matte, while the Erode slider adjusts the amount the hybrid matte is shrunk. Refer to the previous section on Hybrid Rendering for further details. The images on the following page show an example of how Adjust Lighting improves your chromakey results. 25 Original Foreground Keyed Image Keyed Image with Adjust Light enabled 26 Auto Compute Using the Auto Compute button may make your keying operation much easier. You can click on this button as a first step and it may automatically sense the backing screen color, eliminate it and even get rid of some of the foreground and background noise that would normally be cleaned up in Steps 2 (Clean BG Noise) and 3 (Clean FG Noise) of the Primatte operation. If you get good results with Auto Compute, you can proceed immediately with spill removal (using Spill Sponge, Spill +/-, etc). When you turn on the Auto Compute button, two related number boxes appear. You can use these two controls to fine tune the results of Auto Compute (the composite will update each time you adjust either slider): FG This number box controls cleanup of noise in the foreground. Positive values have a stronger effect on FG noise, while negative values have a milder effect on FG noise. BG This number box controls cleanup of noise in the background. Positive values have a stronger effect on BG noise, while negative values have a milder effect on BG noise. For Primatte V5, Auto Compute has been improved to better handle cases where the background area is small, and cases where the foreground contains similar colors to the background. 27 Rendering the Whole Clip When the desired composite has been achieved, the whole clip needs to be processed before it can be used elsewhere. Select the Render box to start the rendering process. When complete, the resulting composite will be available in the library. See the “Using QEffects” chapter in the QEffects Application Reference for further details on rendering. More about the Primatte Polyhedral Slicing Algorithms There are three Primatte algorithms: Primatte, Primatte RT+, and Primatte RT. Here is a chart that shows the main differences between them: These algorithms are discussed in detail in the following sections. 28 The Primatte Algorithm Explanation of how Primatte works The Primatte chroma key algorithm is a sophisticated method of color space segmentation that can be easily explained to help a user achieve maximum effectiveness with the tool. Basically, Primatte segments all the colors in the foreground image into one of four separate categories. The result is a 'spill suppressed' foreground image and a matte which is used to apply the modified foreground to a suitable background. Primatte works in 3D RGB color space. Here is a visual representation of the Primatte algorithm after an image has been processed. By operating the Primatte interface, the user essentially creates three concentric, multi-faceted polyhedrons. These can be pictured as three globes (polyhedrons or polys), one within the other, which share a common center point. The creation of these polyhedrons separates all possible foreground colors into one of four regions; inside the small polyhedron (1), between the small and medium polyhedrons (2), between the medium and the large polyhedrons (3) and outside the large polyhedron (4). 29 The four regions created are described as follows: Region 1 (inside the small polyhedron) - This region contains all of the foreground image colors that are considered 100% background. These are the green or blue or whatever colors that were used as the backing (key) color of the foreground image. Region 2 (between the small and medium polyhedrons) - This region contains all the foreground colors that are at the edges of the foreground object(s), in glass, glass reflections, shadows, sheets of water and other transparent and semi-transparent color regions. These color regions also have spill suppression applied to them to remove color spill from the backing screen. Region 3 (between the medium and large polyhedrons) - This region contains all the foreground image colors that are 100% foreground but have spill suppression applied to them to remove color spill from the backing screen. Otherwise they are 100% solid foreground colors. Region 4 (outside the large polyhedron) - This region contains all the 100% foreground image colors that are not modified from the original foreground image. There is no spill suppression applied to these colors. 30 In the first step in using Primatte (Select BG Color), the user is asked to indicate the backing (key) color on the original foreground image. The sample should usually be taken from a 'medium shaded' area near the foreground object. By 'medium shaded' area, it is meant that if green is the backing color and the green area of the foreground image has many shades of green ranging from very pale green to almost black, a shade of green in-between these extreme ranges should be chosen. If good results are not obtained using this sample, Primatte should be reset and another sample taken using a slightly darker or lighter shade of green. The first sample of Primatte often determines the final result as the center point of all three polyhedrons is created based on this first sample. A single pixel may be selected or a range of pixels (rectangular sample). If a range of pixels is taken, the sample will be averaged to get a single color sample. This single pixel or averaged color sample then becomes the center of the small polyhedron. A few other shades around that color are included in the original small polyhedron. NOTE: It is recommended that a single pixel be selected as the first sample as you then have some idea where the center point of the polyhedrons is located. If a rectangular sample is made, you can only guess at the average color that ends up being the center point. You can get an idea how this sample affects the algorithm by resetting the Primatte plug-in, going to the Matte View and clicking around on the green or blue screen area while in the Select BG Color operation mode. You can immediately see the results of the initial settings of the polyhedrons in this way. After making a sample of the backing screen (key) color in the first step, the result is a small golf ballshaped poly as shown in the following image. The second step in using Primatte is to clean up the backing color area by adding additional shades of green or blue to the small poly. This second step (Clean BG Noise) is usually executed while viewing the black and white Matte View. Before BG Noise Removal 31 After BG Noise Removal While in the Clean BG Noise sampling mode, the user samples the white milky regions as shown in the left-hand image above. As the user samples these regions, they turn to black as shown in the right-hand image above. What is happening in the Primatte algorithm is that these new shades of green or blue (the white milky areas in the matte view) are added to the small poly. The left hand image below shows the new pixels sampled (white dots) in relation to the small poly, and the image next to it shows how the small poly extends outward to encompass the newly sampled colors into the small poly. The advantage of this technique is that the polyhedron distorts to enclose only the shades of blue or green that are in the backing screen. Other shades of blue or green around these colors are left undisturbed in the foreground. Other chroma keyers expand from a golf ball-sized shape to a baseball to a basketball to a beach ball. Since it expands in all directions, many shades of color are relegated to 100% background making it hard to get good edges around the foreground objects. Now that the user has created a small polyhedron, they must shape the medium and large polys. A default medium and large poly are both automatically created and are then modified based on the next couple of Primatte operations. The third Primatte step (Clean FG Noise) is to sample and eliminate gray areas in the 100% foreground area of the image. After FG Noise Removal Before FG Noise Removal 32 Again, the user makes several samples on the dark, grayish areas on the foreground object until it is solid white in color. Primatte is shaping the large polyhedron with each color region that is sampled. Care should be taken in both this and the previous steps to not sample too close to the edges of the foreground object. Getting too close to the foreground object's edges will result in hard edges around the foreground object. Primatte uses these samples to modify and shape the polys to the desired shape. At this point, the matte or key has been created and would allow the foreground objects to be composited into a new background image. If the user changes the display mode from black and white Matte View to color Keyed FG View (or Composite View if a BG Image is used), there is usually 'color spill' on the edges (and sometimes the center) of the foreground objects. When on the edges of the foreground object, this spill comes from where the edges of the foreground object blended into the backing color. If it is on the center of the foreground object, it usually results from reflected color from the backing screen. The next Primatte step, either Spill Sponge, Fine Tuning or Spill(-), can now be used to eliminate this spill color. Let's take a look at what is happening in the Primatte algorithm while this next step is performed. Here is what the various tools in Primatte do to the Polyhedrons when they are used: As you can see above, the Spill Sponge bulges the large polyhedron in the color region specified. A color region is specified by clicking on the image in a particular area with spill present. For example, if the user clicks on some spill on the cheek of a foreground person, Primatte goes to the section of the large polyhedron closest to that particular flesh tone and bulges the polyhedron there. As a result, the flesh tones move from outside the large poly to in-between the medium and large polys. This is Region 3 and, if you remember, is 100% foreground with spill suppression. As a result of the suppression, the spill is removed from that cheek color and all other shades of that color on the foreground. The user would then continue to sample areas of the image where spill exists and each sample would remove spill from another color region. When all spill has been removed, the user should have a final composite. As a last step, the user should go back to the Matte View and make sure that gray, transparent areas have not appeared in the foreground area. If there are any, the Matte Sponge operation mode should be selected and those gray pixels should be sampled until they have all turned white again. 33 The Matte Sponge and Spill Sponge tools bulge or dent the polyhedrons a pre-selected amount. If the desired results are not achieved or the results are too extreme for the image, a manual method can be applied. The user should then choose Fine Tuning mode, select a color region of interest and then move the appropriate slider (number box) to get the desired results. For example, to remove spill, select a region of the composite image with spill on it. Move the LPolyspill (large poly) slider to the right a little bit - the large poly will bulge and the spill should disappear. Move it a little more, if necessary. Moving this slider to the right removes spill (moves the colors from outside the large poly to between the medium and large polyhedrons), and moving it to the left dents the large poly and moves that color region to outside the large poly. If the user samples a foreground object shadow and then moves the MPoly-matte (medium poly) slider to the right, the shadow will become more transparent. This is useful for matching composited shadows to shadows on the plate photography. It can also be used to make clouds or smoke more transparent. If some foreground detail disappears during the composite, the user can select where the detail should be and then move the SPoly-detail (small poly) slider to the left. This dents the small poly in that color region and releases the detail pixels from the small poly into the visible region between the small and medium polyhedrons. The Spill Sponge and Matte Sponge tools are 'shortcut tools' that automatically move the sliders a pre-selected amount as a timesaving step for the user. Other 'shortcut tools' include the Make FG Transparent tool and the Restore Detail tool. These 'shortcut tools' are one-step operations where the user clicks on a color region of interest and Primatte performs a pre-calculated operation. Hopefully, most operations using Primatte would only require these tools, but the manual operation of the Fine Tuning sliders is always an option. 34 The Spill(-) tool bulges the large poly a small amount incrementally in the color region that is clicked on and the Spill(+) tool dents it a small amount with each click. The Matte(-) and Matte(+) tools do the same to the medium poly and the Detail(-) and Detail(+) do it to the small poly. Explanation of how Primatte RT+ works The Primatte RT+ algorithm differs from the Primatte algorithm in that it has a six surface color separator instead of the 127-faceted polyhedrons. This makes the Primatte RT+ algorithm much simpler and, therefore, faster to calculate. The results and performance of Primatte RT+ falls in between the Primatte and Primatte RT options. Where the Primatte RT+ algorithm might not work well is with less saturated backing screen colors, and it also does not support the Complement Color spill suppression method (which is the spill suppression method that delivers the best detail). For a well-lit and photographed image or clip, this algorithm will produce good results and render quickly. Here is what a visual representation of the Primatte RT algorithm looks like after an image has been processed: 35 Explanation of how Primatte RT works Primatte RT is the simplest algorithm and, therefore, the fastest. It uses only a single planar surface to separate the 3D RGB color space and, as a result, does not have the ability to separate out the foreground from the backing screen as carefully as the above Primatte algorithm. Like the Primatte RT+ algorithm, Primatte RT might not work well with less saturated backing screen colors and it too does not support the Complement Color spill suppression method (which is the spill suppression method that delivers the best detail). For a well-lit and photographed image or clip, this algorithm will produce good results and render very quickly. Here is what a visual representation of the Primatte RT algorithm looks like after an image has been processed: 36 Index Adj Light FG view mode Adj Light BG view mode Adjust Lighting Adjust Lighting toggle button Adjust toggle button Algorithm Auto Compute BG Image BG view mode Clean BG Noise Clean FG Noise Complement Replace Composite view mode Configuration buttons Defocus Defocus Replace Defocus Source view mode Detail +, Ext Mask Ext Matte view mode FG view mode Fine Tuning Floating Point Grain Tolerance Grain Tools Grain Type Hardware Assisted Plug-in Hybrid Matte (view mode) Hybrid Rendering Inward Defocus Key button Keyed FG view mode LPoly-spill Make Foreground (FG) Transparent Matte +, Matte Sponge Matte view mode Median Sampling MPoly-matte Palette menu Polyhedrons Primatte Algorithm Primatte RT Algorithm Primatte RT+ Algorithm Proc FG view mode Redo Reset Restore Detail Select BG (Key) Color Setup toggle button Shrink Smart Select BG Software Plug-in Solid Replace Spill +, Spill Process Spill Sponge SPoly-detail Undo Video button View 37 7 7 25-26 3, 25 3, 15, 21 8, 28, 29, 35, 36 9, 27 4–6 6 5, 9, 11, 13, 14, 20, 22, 24, 27, 31, 32 5, 9, 11, 14, 27, 32 8, 15, 18, 21 5 4 21 17 7 20, 35 4 6 6 18, 19, 33, 34 9 22-24 22-24 22-24 2 7 10 21 3 5 18, 19, 34 19, 34 20, 35 19, 33, 34 5 9 18, 19, 34 16 8, 18, 19, 20, 29-36 8, 28-34 8. 28, 36 8. 28, 35 6 3 8 20, 34 9, 11, 12, 31 3, 11 22 9, 11, 12 2 16, 18 20, 35 15, 16, 18, 21 11, 15, 20, 27, 33, 34 18, 19, 34 3 3 5-7 38