Log in

View Full Version : removing face imperfections etc.


kingmob
3rd August 2004, 01:00
Lately i'm trying to get some 'overdone' effects in my movies. One i'd really like ot put in is a neatimage like effect, giving (when overdone) the slightly plastic look to faces and bodies as you see in a magazine like playboy. Is there a specific filter or a way i could get this in a video?

Besides that i'd love to be able to get a certain effect like they have for instance in the movie "saving private ryan", where it has a bit of a harsh look to it (maybe a bit too sharp). It looks like they use it in CSI too.

I'd like to use these things to, for instance, make it look really hot on my holiday :).

Mug Funky
3rd August 2004, 17:34
the CSI look is a too-sharp resizing filter used in their telecine, plus a sharpen filter applied afterwards.

the "overdone" look can be achieved with denoisers - i can get it quite easily with my "funkydenoise" script, as it was in fact ported from a photoshop action i made for the very purpose you're wanting - making faces look "magazine-y"

you'll need masktools to run this one (make sure it's a current version of masktools...)

[code]
function gauss (clip c,int "radius",bool "conv",int "precision", float "a", float "b") {

radius=default(radius,4)
conv=default(conv,false)
precision=default(precision,8)
mul=int(pow(2,precision))
a = default(a,1)
b = default(b,0)

Function siney(string s,int stop,int len,int mul)
{
eqn = string(round(mul*pow(sin(pi*stop/len),2)))
#(stop == 0) ? s : eqn + " " + siney(s,stop-1,len)
return (stop == 0) ? s : siney(s,stop-1,len,mul) + " " + eqn
}

matrix=siney("",radius*2,radius*2,mul)
matrix=matrix.midstr(2,(matrix.strlen()-3))

(conv==false)?c.bilinearresize(4*(c.width/(radius*2)),4*(c.height/(radius*2)))
\.bicubicresize(c.width,c.height,a,b):
\c.yv12convolution(horizontal=matrix,vertical=matrix,Y=3,U=3,V=3,usemmx=true)
}

function FunkyDenoise(clip c, int "radius", int "cut", int "rolloff", float "gamma", bool "fast", bool "conv",int "precision")
{
# set up defaults...
radius=default(radius,8)
cut=default(cut,0)
gamma=default(gamma,1.5)
rolloff=default(rolloff,20)
fast=default(fast,false)
conv=default(conv,false)
precision=default(precision,8)

# remap numbers
low = cut + 127
high = low + rolloff

lowpass=c.gauss(radius,conv,precision)

edge = overlay(lowpass,c,mode="difference").levels(low,gamma,high,0,255,coring=false)
slowclip=overlay(lowpass,c,mask=edge)

highpass=subtract(lowpass,c).temporalsoften(2,3,3,16,2)
fastclip=subtract(lowpass,highpass)

out = (fast==true)? fastclip:slowclip

return out
#return edge
}
[code]

the first function there is a general purpose blurrer filter that i use enough to justify separating it out from any one script.

usage:

copy the script into something like "funkydenoise.avsi" and place in plugins directory.

radius - blurring radius... the default is 8, and should be left at that if you're doing DCT encoding (mpeg..), but it probably doesn't matter.

cut - this is the hard cutoff point in the detail mask. basically, raise it to allow more smoothing. it's like a regular threshold for any denoiser, but should probably be left at the default (0)

rolloff - this is the best one to tweak for denoising. it controls how gradually the noise mask fades into the unsmoothed original clip. a good value for a mildly grainy source is 20 (the default). raise it to denoise more.

gamma - this controls the "steepness" of the rolloff. higher gamma = more subtle transition into blur. if you raise rolloff, you'll probably want to raise gamma as well.

conv - true/false. this determines whether the blur is made by either downsize/upsize (quick, and surprisingly good), or by convolution similar to photoshop's gaussian blur (actually, it convolves by a sine curve determined my radius). leave this off (default) unless you REALLY want a smoother blur. typically there's jack-all difference except for a speed hit.


eg: funkydenoise(radius=8,rolloff=40,gamma=3) will give a nice smooth picture. gamma=2 will make the picture smoother at the cost of lost details.

[edit]

bear in mind that if a blemish on a face is too obvious, it'll probably be left in by my filter... you'd need to export frames into photoshop and use the healing tool to get rid of blemishes completely.

CraigBjorn
3rd August 2004, 18:43
Just out of curiousity, could any of you post images of the results of these "filters"

kingmob
3rd August 2004, 21:33
Many, many thanks. I figured it was some sort of smoothing filter, but i don't have the capacity to write something like that myself :). I'll play around with it, but that will be a while since i'm busy :(. So don't be mad if you don't get any feedback on your script for a while please...

Mug Funky
12th August 2004, 11:04
tis allright... the script isn't exactly new, so i know the results it gives. if you have any weirdnesses with it and aren't sure how to tweak it optimally, just post a pic.

btw, i haven't used the above script for a while - i use a modded version of it that does temporal filtering as well (at a similar speed :)), so let me know if it's still working...

[edit]

@ craigbjorn:

coming soon... just gotta find some appropriate pics to try it on.