Jump to content


Photo

Kak. Or Ibk For Fusion. It Sucks Less.

Macros Matte SecondMan

  • Please log in to reply
115 replies to this topic

#46 Kristof

Kristof

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 263 posts

Posted 10 October 2012 - 05:13 AM

So you have people in here mentioning "Kak" all the time, and how they love it. Sounds like your sense of humor alright, from what I remember :) Showed it to Jan E. earlier this week and he had to chuckle too.

Looking forward to give it a try and thanks for sharing.
  • Lemoroyalkeme and soodaCabton like this

#47 SecondMan

SecondMan

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 1,797 posts

Posted 10 October 2012 - 11:27 AM

:)

Say hi to Jan E.! It's been a while! :) - and let me know what you think ;)

#48 Kristof

Kristof

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 263 posts

Posted 10 October 2012 - 05:41 PM

Will do! :)

#49 John Paul Docherty

John Paul Docherty

    Power Pig

  • Adv Members
  • PipPipPipPip
  • 43 posts

Posted 12 October 2012 - 08:04 AM

Hey Pieter

Finally got a chance to fiddle with this but I'm afraid I fell at the first post - I must be missing something basic as I can't really get it to work.

Following your vfxpedia page as much as I can make sense of it I tried to make a colour weight image to input into a second kak. I connected my blue screen footage to the foreground image input of a new Kak 2.2 node (footage is 10 bit dpx files but I bumped them up to 32 bit float as you specify) then used your pick function to select the blue screen colour in the incoming image. The swatch turns the correct blue so that seems to work.

I then selected "hard matte" helper (as per your vfxpedia entry) and viewed the Kak node - I see the original image, unchanged. So I change the output at the bottom to "color weight" and the screen goes blank, no matte or image.

At this point "color weight" at the bottom is set to the default, "internal". Changing it to external doesn't do anything, changing it to "screen color" gives me a full screen of exactly the selected blue colour with no variation. Changing the output to "kick ass key" gives me a purple overlay with the original image underneath (I'm assuming this is the overlay representing the hard matte mentioned in your vfxpedia entry) but no visible "hard matte", just a solid screen of purple with the image under it.

I've tried upping the squeeze matte figures and the weighting figures to 5 or greater - no change. Fiddling with pretty much everything else doesn't seem to do anything either.

As you know I have a fair bit of experience with lots of other keyers including the Nuke IBK and Ultimatte (which would seem to be in the same vein) but I can't seem to figure out what your required workflow is or what most of the sliders are supposed to do. Any chance of a basic idiots setup guide?

Doh
Paul

ps - I was using 6.4b1104 on vista 64 bit.

#50 SecondMan

SecondMan

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 1,797 posts

Posted 12 October 2012 - 12:15 PM

Hey Paul,



Yeah, apologies, it does appear that the "it sucks less" bit hasn't trickled through to the manual yet. :)
It's now the number one priority...

In the meantime, at risk of making it sound even more complicated, I'll try to write a basic work-flow here and clarify a few misconceptions, which no doubt arose when I named my controls.
Whenever next I do get a moment - I am totally swamped in work right now - I will post some images to illustrate, too.

How I use KAK:

first steps (output set to Kick Ass Key):

- feed the blue screen footage into the Foreground input.
- set the Screen Type (Blue/Green).
- set Helper to Hold FG and pick a screen color.
- set Helper to KAK.

Right now you should at least see it do something, and if you're lucky, sometimes you get a pretty good key right there.

second steps (now we start dealing with Color Weight and how to check it - keep output set to Kick Ass Key):

- set Helper to Hard Matte.

Now, this is where people understandably get confused. KAK internally pulls a first key, a very rough and hard one, to try to separate what is definitely screen color from what is definitely foreground color.
Based on this first internal key (and what I have called the Hard Matte) the Color Weight is constructed by pulling screen colors into the area of the foreground image and in so doing, making a clean plate.
The pink/purple overlay is a representation of that first hard key.

to verify:

- set Output to Color Weight

What you now see in the RGB is your Color Weight (or clean plate). If you look at the alpha channel in there, you should see exactly the same as you see represented by that pink area you can see when Output is set to Kick Ass Key, with the Hard Matte Helper.
The Hard Matte Helper is simply for verifying that alpha against your Foreground image, without having to change your Output and delving into the alpha channel. (*)
If the default settings in KAK give you a nice Color Weight already - great :) - if not, do the following:

- zero out all the default values for Size, Erode, Patch Black etc...

Your Color Weight should now simply consist of your Foreground Image multiplied by the Hard Matte, with a big black hole where your foreground was.
The explanations for Bleed Size, Erode, Patch Black and Edge Erode all need to be rewritten. But in a nutshell:

- increase Bleed Size - your screen color will now eat into that black area.
- increase Erode to get rid of any foreground colors left. this one actually influences the Hard Matte too.
- increase Patch Black to fill up all the black left - you might have to overshoot this one (go over 400) in some cases.
- increase Edge Erode to get rid of nasty artifacts.

- set Helper back to KAK.
- set Output back to Kick Ass Key.

Once you get to this point, and you have a basic key that is not too bad, all of the other settings will make a lot more sense.
For the Integration settings, you will want to feed in a Background image and set Helper to Key On BG to see what you are doing.

Now, to combine 2 KAKs (KAK_1 and KAK_2):

- feed a foreground into KAK_1.Foreground and follow the steps outlined above, down to the Color Weight ones.
- keep Output set to Color Weight.
- add a second KAK.
- set KAK_2 Screen Type.
- feed the foreground image also into KAK_2.
- feed the output of KAK_1 into KAK_2.ColorWeight.
- set KAK_2 Color Weight to External.

KAK_2 should now output a key.

I hope this helps to shed some light on some obscurities, and I'll keep posting more updates here. Do let me know how you're getting on!

Cheers,
Pieter

(*) As of version 2 of KAK, the Hard Matte can also be used as a garbage matte by turning on the garbage matte parameter in the Keyer section. Apart from this, the Hard Matte is NOT a direct component of your final matte. It is part of the Color Weight process.

#51 John Paul Docherty

John Paul Docherty

    Power Pig

  • Adv Members
  • PipPipPipPip
  • 43 posts

Posted 16 October 2012 - 10:22 AM

Hey Pieter

Many thanks for this - I finally got a chance to try it out, but I guess I'm still being dumb. I followed your instructions using Kak2.2 -

---------------------first steps (output set to Kick Ass Key):

- feed the blue screen footage into the Foreground input.
- set the Screen Type (Blue/Green).
- set Helper to Hold FG and pick a screen color.
- set Helper to KAK.

Right now you should at least see it do something, and if you're lucky, sometimes you get a pretty good key right there
-------------------------------------------------------------

but when I set helper to KAK the image disappears, no matte, no rgb, no nothing.

I fiddled around about and found when I set "Color Weight" to "Screen Color" (as opposed to the default "Internal") I got a reasonable starting key - is this right?

I then selected "Hard Matte" (output is still set to Kick Ass Key) and I get a purple overlay over the whole image and the alpha is a solid full screen matte. If I select "color weight" as output I do get a blue full frame of my rgb screen color but again the matte is full screen alpha. This confuses me - obviously a matte is being pulled because when I select KAK in Helpers I can see it. But when I select Hard Matte the matte is a full screen alpha. I tried zeroing out the values in bleed etc as you suggest but nothing changes.

I guess where I'm getting lost is the bit -
------------------------
KAK internally pulls a first key, a very rough and hard one, to try to separate what is definitely screen color from what is definitely foreground color.
-------------------------------

As I can't see this internal key I'm afraid I don't really understand what this means. So, as nothing I do seems to create any sort of key at all in the purple overlay sadly I can't really move forward to try all those other wonderful and mysterious sounding options that you've clearly worked so hard on. Not sure what I'm doing wrong but I just can't seem to get past the initial setup . . .

cheers
Paul

#52 SecondMan

SecondMan

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 1,797 posts

Posted 16 October 2012 - 12:00 PM

Hey Paul,

Ah - something does make sense there... I do wonder what it is you're trying to key, is it something transparent or with huge amounts of spill?

It has to do with this:

------------------------
KAK internally pulls a first key, a very rough and hard one, to try to separate what is definitely screen color from what is definitely foreground color.
-------------------------------

You can see that key, that's what the purple overlay is. If it's solid, it means it considers the entire image as being either blue or green screen before doing anything else. Which is not so good.

What Screen Color mode does, is skip the whole Color Weight Generation stage and that first key, and just keys against a solid colour. With nice even screens and lots of transparency to deal with (motion blur, or things like smoke) this can be a very useful option, not to mention fast. In Screen Color mode, however, whatever result you get in the Hard Matte is meaningless, as it's part of a process that is being skipped.

In your case then, it makes sense that when Color Weight is set to Screen Color, it gives you a result, and when set to Internal it does not.

If you're familiar with IBK, what's represented in the KAK purple overlay, is pretty much equal to what you find in the alpha channel of a IBKColour gizmo. The Color Weight is similar to the IBKColour RGB.

So somehow this means that the way my colour picker math works doesn't do the wonders it's intended to do, with your footage.

So here's what you can try:

- turn on the Hard Matte Helper.

- go into the Color Weight Generation options.

- turn on Finetune Screen Color.

Depending on whether you're dealing with blue or green screen, try dialling Blue or Green Low/High respectively, while looking at the purple overlay. See if you can extract a matte that way. Once a matte is there, you should get a result that makes more sense.

And if that doesn't work, you can even try not picking a screen colour at all, and make that Hard Matte work with the Finetune Screen Color sliders exclusively.

I am currently writing up a few intro videos on KAK, and will make sure I better explain exactly what the different mattes/keys etc mean.

In the meantime, I wonder if you could send me a still of what it is you're trying to key, even if it's a jpeg or png. I can take a look at it and it's actually more helpful to see where the tool fails, than to see where it succeeds. :)

Hope this helps!

Cheers,
Pieter

#53 John Paul Docherty

John Paul Docherty

    Power Pig

  • Adv Members
  • PipPipPipPip
  • 43 posts

Posted 17 October 2012 - 04:34 AM

Hey Pieter

Thanks for the clarifications - I'll try to test them ASAP. Unfortunately I can't send you a still as the film it's from is opening Nov 9 in the states and it is seriously security conscious stuff - I'll mail you separately about this. Thing is it's a pretty good screen with decent exposure and not a lot of spill. The initial key pulled when I hit the KAK helper and select screen color the key is very good, which I'm assuming demonstrates that the image is fine. There is very little transparency. Which is why I'm surprised that the "hard matte" is completely opaque, without any sign of a key. It's Alexa LogC footage converted to dpx files, if that makes a difference.

I'll try and dig out another blue screen that I can test this with and send you image.

cheers
Paul

#54 John Paul Docherty

John Paul Docherty

    Power Pig

  • Adv Members
  • PipPipPipPip
  • 43 posts

Posted 17 October 2012 - 11:10 AM

Hooray - got it to work by mucking about with "fine tune Screen colour" sliders as you suggested.

A question - is this "fine tuning" the screen color you picked in the "Screen Color" section or is it setting a whole new color for the hard matte? I ask because after I got a good key using your method above and mucking about with the "fine tune screen color" sliders I went back and re-selected the basic blue screen color - in fact I selected a red bit of the foreground - and the final key didn't seem to change at all even though the pick patch was now bright red. It feels like enabling "Fine Tune Screen Color" completely overrides the selected screen color above it when you've got Color Weight set to Internal, which I found pretty confusing. Also where I ended up with the Fine Tune sliders seemed to bear no relation to any colour on screen - red .00311 to .21523, green .3079 to .40006 and blue .5062 to .71854 got me a decent result but I have no idea why, given that the screen is darkish blue, roughly r .06 g .08 b .18. When you get the time to document it a bit more perhaps you could explain what gives here, or maybe make this be driven by a colour picker as well, which might make the relationship a bit more intuitive.

In any case I finally got to fiddle a bit and my initial results looked very good - I quickly got a decent key that was as good as I could get with Primatte with a lot less tweaking and was way better than anything that could be achieved with the unfortunately named ultra keyer. I'm sure some of the more esoteric tweaks will become clearer to me as I test it out against other footage but it's certainly a great and good thing!

cheers
Paul
now happily KAKing away

#55 SecondMan

SecondMan

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 1,797 posts

Posted 17 October 2012 - 02:37 PM

:)

Yay - good to hear! :)

Yes, the finetuning happens after the initial color picking. But used together they can indeed yield unintuitive behaviour. The color picker changes the ratio between R, G and B by shifting them, so the image channels are pushed into a supposedly "ideal" space for the Hard Matte keyer to work best. The finetune settings do an extra color correction - Low lifts and High gains. Since they are so different in how they work, in cases where the color picker fails you might as well not use the color picker at all. Or so it seems.

Personally I don't like those sliders at all, it's another thing originally copied from how IBK works and I suspect there is a way to make that much more pleasant, or even virtually automatic. In the least it should be a bit more predictable as you say.

Whenever you have a moment, could you do me a favour and post, from the high security case where KAK fails, the values of the Screen Color you picked, and one of the foreground color values mistaken for blue screen?

Totally chuffed you like it. :)
Cheers,
Pieter.

#56 John Paul Docherty

John Paul Docherty

    Power Pig

  • Adv Members
  • PipPipPipPip
  • 43 posts

Posted 18 October 2012 - 07:11 AM

If you don't mind a little constructive crit, I think this area is a bit of a problem. I'm uploading a comp with a sample bgd that has the same blue value as the average of the "high security" screen I tested (with a matted out noise area in the foreground) as an example for keying. The blue value looks a bit dark in a default viewer but the original image was Alexa LogC so if this blue is viewed with a sRGB buffer lut you can see it's pretty typical.

Running it into KAK with default settings (see nodes with underlay GOODbluescreen) we get no "purple" hard matte area (KAK_3 shows this) at all. KAK_1 shows the values I arrived at (after a lot of pretty much random fiddling with sliders) that got an obvious hard matte. KAK_2 shows almost the same set of values with a very slight difference - 0.07 in the blue - which now shows up with no matte at all. KAK_4 shows that if you start moving sliders randomly (which is what I did as I still don't understand what they represent or do) you can get negative numbers which give you no matte and leave you a long way from any setting that might show you the hard matte working, particularly given that the sliders values change relative to the range.

I'd suggest that something a little more intuitive needs to be done for the hard matte selection. At the moment I just randomly pulled sliders around until something appeared. Ironically it would seem that the better the blue screen the smaller the range to get a good hard matte is, and as such it is much harder to find this small area on the sliders that defines the "sweet spot" than it would be if the screen were badly exposed and had a wider range of values in it. This is demonstrated in the nodes with the NOISYbluescreen underlay - if the screen is badly lit and has lots of variance you get more visual clues to point you at a usable range. And conversely the better the screen is lit the more "all on" or "all off" the purple area is (as it would be of course) so it is a lot harder to find. I'm still a bit unclear as to why the hard matte generation defaults aren't related to the picked blue screen colour - if you just attach a KAK node to these test images, leave everything at default and just turn on KAK and set the colour weight to "Screen Color" you get a reasonable starting matte, so the information is there. But that's probably just me not knowing what you are doing behind the scenes to derive the clean plate, which I assume makes it problematic to use the basic KAK key as a start point . . .
As you say once you've got your hard matte happening you're away to the races and all your great fine tuning stuff comes into its own, but until you get there you're left pretty much moving loads of sliders around with no visible effect.

My two bits . . .Attached File  KAKtestA.comp   678.89KB   21 downloads

#57 SecondMan

SecondMan

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 1,797 posts

Posted 19 October 2012 - 10:44 AM

Hey Paul,



Good news! Took a good look at these yesterday night and they've proved immensely helpful - thanks again!

I don't want to raise expectations too much too early, but it looks like an update is on its way which will make hard matting a lot easier. In any case I have a setup working that can do your examples in seconds, and in a reproducible way too. When all my other footage passes that same litmus test it will be deemed good to go and I'll build it in. :)

#58 SecondMan

SecondMan

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 1,797 posts

Posted 22 October 2012 - 03:03 PM

v2.5 beta

- massively improved hard matting!

- new "Hard Matte Looms" called Lloyd and Lusty, which are 2 different ways of generating the Hard Matte. They both are more intuitive to use and fine-tune than the previous method, with only one single fine-tuning parameter each. Lusty method yields results closest to those seen in previous versions of KAK.

- fixed Use BG chroma/Use BG Luma don't work properly when BG alpha is transparent/zero.

- added Overall Color Weight Softening in the Color Weight Generation.

- renamed/reordered some color weight parameters to something more meaningful.

- garbage matte now works with an external KAK color weight too.


Get it here first!. :)

Attached Files



#59 John Paul Docherty

John Paul Docherty

    Power Pig

  • Adv Members
  • PipPipPipPip
  • 43 posts

Posted 23 October 2012 - 06:12 AM

Much better! Lloyd gave me an immediate matte that was very close to what I needed, and it seems clear even to me that if you up the fine tune number (greater than 10 in this case) the spread of matte values tightens while if you lower it the spread (negative numbers are ok) it widens the range of blue used. The Lusty setting seems a bit fiddlier and goes the other way i.e. lower values (negative in this case) tighten the spread of matte values and higher allows more variation in the blue. In any case you can now quickly get in the region of the right hard matte value by sliding the finetune up and down, which is a great and good thing. And the slider names are much clearer now.

I look forward to a demo/tutorial/explanation/whatever that illumates the difference between the Lloyd and Lusty method but in the meantime this allowed me to quickly set up a usable colour weight Kak node and when I fed it into a "keyer" Kak node I got a good key pretty much right away, and I then had lots of controls to refine it with. Great work!

#60 SecondMan

SecondMan

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 1,797 posts

Posted 25 October 2012 - 08:57 PM

Haha, great, thanks Paul! :)

I will inverse that Lusty finetune slider for the release version and see if perhaps the sensitivity should be increased a bit as well.

A quick explanation of the difference between the two: Lloyd works like a conventional keyer, in that it performs a high contrast difference key against the selected Screen Color. Lusty is different, in that it is a setup which has a pre-set keyer, but you color correct its input until the screen colours fall into the goldilocks-zone where the keyer works best - I just copied that concept from IBK in KAK 1.0. However since 2.0 I have been working to make it more usable by getting the colours closer to that ideal range by offsetting them against the Screen Color, and in 2.5 I now got rid of all those separate finetune sliders and changed a few defaults to get a more useful initial result.

That is also why Lloyd works more intuitively than Lusty, which I agree is good. I would probably have rid KAK from the first method altogether if it weren't for the fact that they do yield results that are different enough so that either can come out best. Generally speaking though, I would always start with Lloyd. But I feel it is easy enough now to give them both a go and with the separate finetuners you can easily switch back and forth.

Cheers,
Pieter.





Also tagged with one or more of these keywords: Macros, Matte, SecondMan

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users