loneboyz
11th December 2015, 18:25
I knew that those are hard to to gets rid of most of the spots and the result can will be destroy the rest of the picture, cause the image degradation.
However, I still need have some tips to better improve.
Below, I have used two different methods and get different results (red outline tag in the picture)
# Example script with external mask from MVTools plugin in DeSpot's documentation
function deSpots(clip i)
{
prefilt=i.DeGrainMedian() # prefiltered for better motion analysis
# analyse and compensate motion forward and backward (to current frame)
ml = 100 # mask scale
thscd1 = 400 # scene change
super=i.MSuper() # super clip
superprefilt=prefilt.MSuper() # super filtered clip
vf = superprefilt.MAnalyse(isb=false) # forward vectors
cf = i.MFlow(super, vf, thscd1 = thscd1) # previous compensated forward
sadf = i.MMask(vf, ml=ml,kind=1,gamma=1, thscd1 = thscd1) # forward SAD mask
msadf=sadf.MT_Binarize(20, upper=true) # binary inverted forward SAD mask
vb = superprefilt.MAnalyse(isb=true) # backward vectors
cb = i.MFlow(super, vb, thscd1 = thscd1) # next compensated backward
sadb = i.MMask(vb, ml=ml, gamma=1, kind=1, thscd1 = thscd1) # backward SAD mask
msadb = sadb.MT_Binarize(20, upper=true) # binary inverted backward SAD mask
msad = MT_Logic(msadf,msadb,"or") # combined inverted SAD mask
msad = msad.MT_Expand() # expanded inverted SAD mask
msadi = Interleave(msad, msad, msad) # interleaved 3-frame inverted SAD mask
# This mask is high (255) where at least one motion estimation is good,
# so these areas will be protected
Interleave(cf,i,cb) # interleave forward compensated, source, and backward compensated
DeSpot(p1=30,p2=12,pwidth=80,pheight=70,mthres=20,merode=33,\
sign=0,show=0,seg=0,color=true,motpn=true, extmask=msadi)
return SelectEvery(3,1) # get filtered source
}
# by Didée
function deSpots2(clip o)
{
osup = o.MSuper(pel=2,sharp=2)
bv1 = osup.MAnalyse(isb=true, delta=1,blksize=8,overlap=4,search=4)
fv1 = osup.MAnalyse(isb=false,delta=1,blksize=8,overlap=4,search=4)
bc1 = o.MCompensate(osup,bv1)
fc1 = o.MCompensate(osup,fv1)
Interleave(fc1,o,bc1)
MedianblurT(0,0,0,1) # or Clense(reduceflicker=false)
return SelectEvery(3,1)
}
Comparison images: Soure Filter - deSpots - deSpots2
http://6.t.imgbox.com/sjoF7kUS.jpg (http://imgbox.com/sjoF7kUS)http://2.t.imgbox.com/0TbIM0Y8.jpg (http://imgbox.com/0TbIM0Y8)http://3.t.imgbox.com/PKWyV1li.jpg (http://imgbox.com/PKWyV1li)
http://8.t.imgbox.com/1pvp0mPz.jpg (http://imgbox.com/1pvp0mPz)http://4.t.imgbox.com/0OLsieJf.jpg (http://imgbox.com/0OLsieJf)http://3.t.imgbox.com/PQJ9y0Ke.jpg (http://imgbox.com/PQJ9y0Ke)
http://9.t.imgbox.com/nvTATjFT.jpg (http://imgbox.com/nvTATjFT)http://7.t.imgbox.com/8U7Axq1T.jpg (http://imgbox.com/8U7Axq1T)http://4.t.imgbox.com/tMcpksFF.jpg (http://imgbox.com/tMcpksFF)
Outputs of deSpot func looks nicer except its result on the second row, the image be distorted. What can I do to change?
However, I still need have some tips to better improve.
Below, I have used two different methods and get different results (red outline tag in the picture)
# Example script with external mask from MVTools plugin in DeSpot's documentation
function deSpots(clip i)
{
prefilt=i.DeGrainMedian() # prefiltered for better motion analysis
# analyse and compensate motion forward and backward (to current frame)
ml = 100 # mask scale
thscd1 = 400 # scene change
super=i.MSuper() # super clip
superprefilt=prefilt.MSuper() # super filtered clip
vf = superprefilt.MAnalyse(isb=false) # forward vectors
cf = i.MFlow(super, vf, thscd1 = thscd1) # previous compensated forward
sadf = i.MMask(vf, ml=ml,kind=1,gamma=1, thscd1 = thscd1) # forward SAD mask
msadf=sadf.MT_Binarize(20, upper=true) # binary inverted forward SAD mask
vb = superprefilt.MAnalyse(isb=true) # backward vectors
cb = i.MFlow(super, vb, thscd1 = thscd1) # next compensated backward
sadb = i.MMask(vb, ml=ml, gamma=1, kind=1, thscd1 = thscd1) # backward SAD mask
msadb = sadb.MT_Binarize(20, upper=true) # binary inverted backward SAD mask
msad = MT_Logic(msadf,msadb,"or") # combined inverted SAD mask
msad = msad.MT_Expand() # expanded inverted SAD mask
msadi = Interleave(msad, msad, msad) # interleaved 3-frame inverted SAD mask
# This mask is high (255) where at least one motion estimation is good,
# so these areas will be protected
Interleave(cf,i,cb) # interleave forward compensated, source, and backward compensated
DeSpot(p1=30,p2=12,pwidth=80,pheight=70,mthres=20,merode=33,\
sign=0,show=0,seg=0,color=true,motpn=true, extmask=msadi)
return SelectEvery(3,1) # get filtered source
}
# by Didée
function deSpots2(clip o)
{
osup = o.MSuper(pel=2,sharp=2)
bv1 = osup.MAnalyse(isb=true, delta=1,blksize=8,overlap=4,search=4)
fv1 = osup.MAnalyse(isb=false,delta=1,blksize=8,overlap=4,search=4)
bc1 = o.MCompensate(osup,bv1)
fc1 = o.MCompensate(osup,fv1)
Interleave(fc1,o,bc1)
MedianblurT(0,0,0,1) # or Clense(reduceflicker=false)
return SelectEvery(3,1)
}
Comparison images: Soure Filter - deSpots - deSpots2
http://6.t.imgbox.com/sjoF7kUS.jpg (http://imgbox.com/sjoF7kUS)http://2.t.imgbox.com/0TbIM0Y8.jpg (http://imgbox.com/0TbIM0Y8)http://3.t.imgbox.com/PKWyV1li.jpg (http://imgbox.com/PKWyV1li)
http://8.t.imgbox.com/1pvp0mPz.jpg (http://imgbox.com/1pvp0mPz)http://4.t.imgbox.com/0OLsieJf.jpg (http://imgbox.com/0OLsieJf)http://3.t.imgbox.com/PQJ9y0Ke.jpg (http://imgbox.com/PQJ9y0Ke)
http://9.t.imgbox.com/nvTATjFT.jpg (http://imgbox.com/nvTATjFT)http://7.t.imgbox.com/8U7Axq1T.jpg (http://imgbox.com/8U7Axq1T)http://4.t.imgbox.com/tMcpksFF.jpg (http://imgbox.com/tMcpksFF)
Outputs of deSpot func looks nicer except its result on the second row, the image be distorted. What can I do to change?