CompuServe Thread

#Image Processing!

13 messages in this thread
#69809From: Suresh KavanDec 4, 1993 5:07 PM
**HELP** Does anyone know the logic behind a Chromakey operation??? In other words if I have two source pixel sets: (R1,G1,B1) and (R2,G2,B2) and image two is being 'CHROMAKEYED' BEHINF image 1, What is the logic required to produce my destination pixel??? (Rd,Gd,Bd). If anyone knows, please help..this is driving me nutzoid!!! Oh, last question..is it possible to do this in 3DS R3 VP (or anywhere else for that matter??). Thanks.
#69811From: John EllisDec 4, 1993 6:10 PM
Suresh: In VP the Key color is used to provide transparency to areas of you image that match the key color. The best key colors are Blue and Green. The way it works is this. Lets say you have two images, a background of a shopping mall, and an image of a man. You want to use composite the man over the background, and you image of the man has no Alpha information so you decide to use the Key feature of VP. To make the key work effectively, you take you image of the man and paint out his surrounding background with blue, so that you have a man with a blue background. Note the value of the blue you have, this is the value you put in the Key Color box. Then when you composite the image the areas that were blue in your image now reveal the background so that you man appears over the image of the shopping mall. Certain factors need to be taken into account, the key colors have to match, and the gamma value of your image has to match that which your compositing. The gamma can effect how well your key works. See page 8-142 of the reference manual. I would recommend using the Key only when you can't map with Alpha as you can loose anti-aliasing if the edges are blended very carefully. -JE
#69824From: Suresh KavanDec 4, 1993 7:51 PM
mmmh, your response is certainly true..but consider this problem : I have 300 frames of a Man against a blue background. Bacuase of lighting and camera resolution etc..the Background *IS NOT* a constant RGB value. I want to Composite the man onto another image. What I do know is that Blue will be the dominant color in the background…However, just replacing pixels where B>G and B>R won't work because blue eyes will become background colour *AND* the shadow of the man on the blue background is lost! This appears to be quite a tricky piece of logic and I can't figure it out.. ….*YET* ..Video Post will only cut it if the area outside of the man is a solid consistent color. VP will let me do Luma keying, but as far as I can make out, true ChromaKeying is not possible. SK.
#69838From: John EllisDec 4, 1993 8:53 PM
Suresh: There are many different ways to do things and Chroma Keying maybe not be the best method for what you are trying to do. If you can be more explicit as to what it is you are trying to do, I think I can help. -JE
#69848From: Suresh KavanDec 4, 1993 11:23 PM
OK..this is the intent : I have a video segment (300-600 frames) that I've captured as sequential TGA's. The video is of a man against a blue chroma background. As the man walks around you can see a dark shadow against the floor and against the back wall (all blue remember!)..I want to compositie this man into a Three Dimensional world – Replacing the chroma background with a 3D animation. The shadows need to be 'captured' and placed on the new 3d Background. I have done some tests with Adobe Premiere and *its ChromaKey* does it perfectly – except, premiere is an absolute dog at handling full color 24 bit images (esp. a large sequence of them). ANY IDEAS ?
#69852From: John EllisDec 5, 1993 1:44 AM
Suresh: Alot is going to depend on the quality of your original video and how it was captured. In Film and Television a very evenly lit blue (or green) screen is used for a background because even there with sophisticated equipment you can have problems if the background is not lit correctly. If your background is evenly lit you could still have problems with VP as is is very sensitive to Chroma values. If you can't do an area fill with something like Tips chances are you're going to have problems with VP as well. If the quality of your captures is very good (Broadcast Quality) and the background is evenly lit you could composite this sequence in a real Video environment with an Ultimatte and retain the shadows. Short of that you'll have to go in and hand paint each frame with an area fill so that you can guarantee the chroma value. Depending on the quality your require, Animator Pro might work very successful for you. If you really need to get it done and it has to be done right you could use a Quantel paintbox which is designed for tough jobs like this, but also has a high price tag as well. -JE -JE
#69872From: Suresh KavanDec 5, 1993 12:28 PM
Thanks for the thoughts John…I do, of course have one last ssolution : The D-I-Y solution! If I can figure out the logic, I'll write a little program that reads the targa's and replaces pixels based on a logic set…now if only someone can tell me the logic set! SK Thanks for your help.
#69875From: John EllisDec 5, 1993 1:11 PM
Suresh: Like so much in animation its kinda trial by fire. Regarding the D-I-Y, you might consider writing your own IXP for a function like this. But I suspect this would be one of the better challenges you have encountered. On the other hand it would have applications for other programs which could also be marketable. Truevision has a manual on the Targa format which is fairly inexpensive, you might want to check in the Truevision Forum. For information on IXP's you might want to get in touch with Gus Grubba has he has worked extensively with them. Best of luck, be interested to know what develops. -JE
#69902From: CSA/CADec 5, 1993 8:10 PM
Suresh, Sounds like you could use Ron Scott's Hi-Res QFX version 4, due shortly, where the batch processing has been restored. With that, you could change a range of blue (as in the background) to a single color, which you could then easily key out. My approach when I encountered a situation like this was to load some sample frames into TIPS (these were all .TGA images @ 512×486) & note the RGB values of the background. Then I wrote a 'C' utility to read the file & change the pixels that met the specified range. Used a DOS batch (FOR %%1 in (*.TGA), etc.) to rewrite the file to a different directory. Fortunately, I didn't have any blue eyes to account for, although you could test nearby pixels to determine if you were well inside an object (not contiguous with the background). Kevin Krell – Computer Support Associates
#70153From: Suresh KavanDec 7, 1993 10:26 AM
Thanks for the reply, its not a bad set of ideas..but imagine a hand in front of a blue background. There are three 'objects'. The background, the hand, and the shadow of the hand. I need to eliminate the background completely. Compositie the shadow onto the new background and leave the hand untouched. Ideas?? SK.
#70194From: CSA/CADec 7, 1993 3:25 PM
Suresh, The trouble here would be to set the amount of transparency for the shadow. Kevin Krell – Computer Support Associates
#69817From: MARTIN G FOSTERDec 4, 1993 6:21 PM
Suresh, the logic of chromakeying surely must be that pixels of a certain colour (or maybe just hue) in an image will be transparent. 3dsr3 allows alpha to be a key colour of any r,g,b or h,l,s value.
#69825From: Suresh KavanDec 4, 1993 7:53 PM
See my Reply to John. (I wish it were as simple as that, but that doesn't seem to work. I have tried copying the Blue to channel to be an Alpha Channel..but it doesn't work very well). SK.