This is very interesting. I'm trying to make that function work right
now, but i'm not completely sure how to "apply it to every pixel"..
Should i use javascript or make a core image filter?
17 jan 2009 kl. 20.43 skrev Dustin O'Connor:
this is a simple chroma key function. doing a little java function
in QC could do a basic key calculation for you. passing in your rgb
values to the function.
f(r,g,b)->a is applied to every pixel in the image. a <= 0 means the
pixel is the green screen, a >= 1 means the pixel is in the
foreground object. Values between 0 and 1 indicate a pixel that is
partially covered by the foreground object. A usable green screen
example, which matches how chroma key was done on an optical printer
is f(r,g,b)->K0*b-K1*g+K2 (K0..2 are user-adjustable constants, 1 is
a good initial guess for all of them).
i just noticed that FX in photo booth. kind of cool. then i noticed
this facial recognition thing eye photo thought that was neat to.
there are a whole bunch of ways to do the background key. first off
if you are trying to replicate the photo booth fx. that is not a
green screen key or chroma key etc..or what normal motion graphics
programs do. like key light luma key primatte etc... seeing there
are so many of those algorithms and if you have a program that can
key a green screen it can make an alpha matte for you as well that
you can import into QC and use as a matte on your green screen
footage.
in all honesty i have not attempted to do this in QC but i will
today. this is the sort of old way to do motion tracking you
subtract the back ground then track the pixel change. well photo
booth seems like it is doing this back ground subtraction, i don't
work at apple so i could be all wrong and this is only a guess is to
how it works. so if you run your image through a few filters,
thresholding maybe blurring a bit, histograming there are tons of
options you want to get the pixel information of what will be the
back ground you subtract later, but you want to filter to make the
calculation easier. so in photo booth it takes a pic of the back
ground without you in it then when you enter the frame it knows what
are new pixels.
so probably the best way to do this is to do a before and after
difference of frames of video feed the difference of the two frames
should then make some sort of luminance for you thus enabling you to
add that calculation as a mask. this is done a lot in motion
tracking and stuff like i said before. i like to split the screen up
into a 6x6 grid really big but i do this to make music so im not
trying to trigger the whole piano every time i move. you will want
to do this grid a lot larger and compare the pixels. pixels are
squares usually.
i suggest just using a program that like i said does a green screen
key all ready, as chris stated fg noise, back ground noise etc
become a problem when you are making an alpha. you really want to
get a good black and white alpha channel or mask can be a very
difficult task with poor green screen footage. a proper green screen
is simple, all the softwares out there can do the key pretty much
with one button click, a bad green screen with shadows maybe wires
and or wrinkles can be much more difficult because of the noise.
seeing that this is a apple list the easiest of there software in my
testing is motion to pull a screen. you have hardly any options but
if its good footage you don't need controls. i guess its the best in
all fairness of being the quickest. FCP is rrr i never use it to
make a key. Shake is the best apple consumer product for keys
because you have lotos of control. i found the other day trying to
work with a bad key i could feed my key back into its self as a
garbage matte and it cleans up a lot of shadows. a little trick i
came up with.
with x code, core image, and quartrz composer etc.. you should be
able to make your own key program if it interests you. pretty much
all the softwares use the same key algorithms so look them on google
figure out what they do and re create them. some would be primate,
chroma, luminance, color, or key light is a popular one.
On Fri, Jan 16, 2009 at 8:03 AM, Chris Wood <[email protected]> wrote:
Jonathan,
There's 2 ways I've used to do it. The first is to use a filter to
remove the background (you would need to have the camera pointing at
a plain coloured background though) and in the filter just compare
to see if the green component is much higher than the other
components, and filter on that. Noise is still an issue, but it can
at least be reduced a bit.
The other way is to do motion detection, and remove anything not
moving. To do that I just used a queue with a length of 2, so I
could feed the current and last frames into a filter. It's fairly
easy to mask out the background, but there are some quite nasty
catches.
Video noise is a huge problem, as it means the whole image is always
moving slightly. You really need a good camera to get rid of it,
otherwise you have to do a lot of noise reduction that can make the
image look blurry.
Another big problem is auto-white balance on the camera, or anything
like that.. if the camera suddenly adjusts anything, the whole image
changes so the background suddenly pops into view for a short time.
Again, a good camera with manual controls would help.
The last problem is that sometimes the thing you want to show stops
moving. Say you're filming somebody talking.. their mouth is moving,
but their eyes might stay still for a short time. They disappear..
and even if they are moving constantly, sometimes there will be an
area with similar colour that doesn't get detected, and you have a
hole..
I guess the way ichat works is to sample the background just once,
when there is nothing in front of it, and use that for comparison.
Then even if you're still, there is still a difference. You still
have the problem of white balance changes, video noise etc., though
so you'll need a fair bit of cleaning done on the image.
Chris
2009/1/16 Jonathan Selander <[email protected]>
Hi,
I've used a couple of patches from the QCTV example application to
create a green screen effect in my composition. However, i just
compared it to Photo Booth which does it much more accurately.
What's the best way to accomplish this? Is there any patch out there
i can use that works well?
The QCTV patch seems to be very susceptible to video noise, so lots
of pixels appear everywhere, so the backdrop isn't solid.
Thanks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected]
)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/psonice%40gmail.com
This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected]
)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/dustin.oconnor%40gmail.com
This email sent to [email protected]
--
Dustin O'Connor
http://numedia-sci.info
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [email protected]