Log in

View Full Version : New Filters: Conditional Temporal Median Filter and DeSpot filter


Pages : 1 2 [3] 4

Vesi
4th September 2007, 09:01
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\VagueDenoiser.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\despot.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mvtools.dll")
DGDecode_mpeg2source("C:\Documents and Settings\vesi\Desktop\test\test.d2v",cpu=4,info=3)
ColorMatrix(Mode="Rec.601->Rec.709",scaling=2,threads=2)
edeintted = AssumeTFF().SeparateFields().SelectEven().EEDI2(field=-1)
tdeintted = TDeint(edeint=edeintted,order=1)
tfm(order=1,clip2=tdeintted).tdecimate(hybrid=1)
crop( 2, 44, -2, -50)

BicubicResize(704,320,0,0.5) # Bicubic (Neutral)
VagueDenoiser(threshold=0.8, method=0, nsteps=6, chromaT=0.8)

here is the script. Source is dvd9 and rip size will be 1400MB.problem is i have never used Desopt and MVtools, so this is like start for me:) and deficult to know how to use it with deferent sources.

Fizick
4th September 2007, 16:58
if your dots is white, use settings Despot(sign=-1)

Fizick
4th September 2007, 21:27
full script:

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\VagueDenoiser.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\despot.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mvtools.dll")
DGDecode_mpeg2source("C:\Documents and Settings\vesi\Desktop\test\test.d2v",cpu=4,info=3)
ColorMatrix(Mode="Rec.601->Rec.709",scaling=2,threads=2)
edeintted = AssumeTFF().SeparateFields().SelectEven().EEDI2(field=-1)
tdeintted = TDeint(edeint=edeintted,order=1)
tfm(order=1,clip2=tdeintted).tdecimate(hybrid=1)
crop( 2, 44, -2, -50)

i = last
vf = MVAnalyse(i, isb=false,idx=1)
f = MVCompensate(i, vf,idx=1)
vb = MVAnalyse(i, isb=true,idx=1)
b = MVCompensate(i, vb,idx=1)
Interleave(f, i, b)
DeSpot(sign=-1)
SelectEvery(3,1)

BicubicResize(704,320,0,0.5) # Bicubic (Neutral)
VagueDenoiser(threshold=0.8, method=0, nsteps=6, chromaT=0.8)


i have got your test clip (first 4 meg),
the cript works for frames 2,36, 130, 132.
But for frame 32 (and some others) the pupils of the eyes partially removed.
there is no any ideal filter. :(

Vesi
5th September 2007, 10:03
thanks alot Fizick. will give it try and let you know.

Vesi
8th September 2007, 01:08
i did the rip and quality was an awesome, thanks alot. as you saw the Screen shots or the spots, if i get more spots for example in source what should i change then, which parmeters. thanks again

Fizick
23rd October 2007, 20:28
if your spots are quite large, try increase pwidth and pheight.
but it may result in ugly artefactes (false detecting).

Vesi
10th January 2008, 23:31
Edit:

kiwiusa
28th January 2008, 17:12
All,

I have the only copy of some 8mm film that has been captured onto PAL VHS and I'm trying to clean it up as best I can.

The best results I have had so far is by decimating every second frame as some of the scratches seem to last 3 frames, but I'm sure I'm missing something.

Here is a link to a small clip, if somebody would be so kind as to give me some pointers.

http://rapidshare.com/files/87194482/clip.mpv

Thanks,

Al

johnmeyer
28th January 2008, 17:54
You have to use a capture method that captures one frame of film to one frame of video (like Moviestuff's Workprinter). Otherwise the scratch filter won't work.

kiwiusa
28th January 2008, 18:30
You have to use a capture method that captures one frame of film to one frame of video (like Moviestuff's Workprinter). Otherwise the scratch filter won't work.

Thanks for the reply John,

As the original 8mm film is now lost and I have the only remaining VHS tape copy, re-recording it is not an option.

What is the best I can hope for given these limitations?

Al

Fizick
28th January 2008, 19:25
you soult try :
1) restore original (about 16) fps
2) apply a filters
3) convert to 25 fps backward

your clip (first megabyte downloded) is fine restored to 16.666 fps with:

MPEG2Source("F:\Internet\080128\clip.d2v", cpu=0)
separatefields
selectevery(6,0,1,4,5)
weave

try check rest of your source.

kiwiusa
28th January 2008, 19:53
you soult try :
1) restore original (about 16) fps
2) apply a filters
3) convert to 25 fps backward

your clip (first megabyte downloded) is fine restored to 16.666 fps with:

MPEG2Source("F:\Internet\080128\clip.d2v", cpu=0)
separatefields
selectevery(6,0,1,4,5)
weave

try check rest of your source.


Thank you very much Fizick, I will try that tonight and let you know.

Al

kiwiusa
29th January 2008, 04:20
you soult try :
1) restore original (about 16) fps
2) apply a filters
3) convert to 25 fps backward

your clip (first megabyte downloded) is fine restored to 16.666 fps with:

MPEG2Source("F:\Internet\080128\clip.d2v", cpu=0)
separatefields
selectevery(6,0,1,4,5)
weave

try check rest of your source.

Fizick, you are my hero, the results are awesome. Thank you so very much.

Two quick questions as I am a novice at this.

1) To convert back to 25fps I just used ConvertFPS(25) and the results were fine to my naked eye. Is there a better way?

2) When I re-encode to mpeg2 using TMPGenc prior to DVD building should I save as progressive or interleaved?

Thanks again,

Al

johnmeyer
29th January 2008, 05:10
I would encode to DVD as progressive 25 fps.

Fizick
29th January 2008, 05:54
1. There are many ways to convert to 25 fps. No one is perfect.
Yor clip was converted by somewhat similar to:

# again telecine 16.666 fps to 25 fps (interlaced ?)
assumetff
separatefields
interleave(last,last)
selectevery(8,0,2,1,6,5,7)
weave


It may be also done with special pulldown, MVFlowFps, etc.

My advice is temporary forget about converting to 25 fps (it is off-topic here) and concentrate on:
- perfect restoring to 16.666 (may be some fieldmatcher like TFM-TDecimate can produce more stable results especially on VHS frame drops VHS)
- sime filtering with DeSpot, MVTools, ets (if you want).

I am sure, it takes a while :)

kiwiusa
31st January 2008, 02:30
1. There are many ways to convert to 25 fps. No one is perfect.
Yor clip was converted by somewhat similar to:

# again telecine 16.666 fps to 25 fps (interlaced ?)
assumetff
separatefields
interleave(last,last)
selectevery(8,0,2,1,6,5,7)
weave


It may be also done with special pulldown, MVFlowFps, etc.

My advice is temporary forget about converting to 25 fps (it is off-topic here) and concentrate on:
- perfect restoring to 16.666 (may be some fieldmatcher like TFM-TDecimate can produce more stable results especially on VHS frame drops VHS)
- sime filtering with DeSpot, MVTools, ets (if you want).

I am sure, it takes a while :)


Still working on it but weird things are happening:

If I use your original suggestion

SeparateFields()
SelectEvery(6,0,1,4,5)
Weave()

or

TFM()
TDecimate(Mode=2 ,Rate=16.666)

I get a nice 16.666 frame rate but there are still many areas of the clip where I have up to 6 duplicate frames in a row.

As I'm not concerned about audio sync, is there anyway to decimate "all" duplicates so as to give DeSpot a fair chance?

Alan

kiwiusa
31st January 2008, 16:19
OK, I did some more reading and I'm going to give MultiDecimate a try tonight. I'm also going to switch to a DGIndex input instead of DirectShow to see if that helps.

Wish me luck...

johnmeyer
31st January 2008, 18:30
I have done lots of work with film transfer and also recovering 24p (or 18p or 16p) from film that has been telecined. The transfer process used on that film was different than a true telecine, but similar enough that TFM, with the proper parameters, will probably be able to remove most duplicates. What you need to do is use "separatefields", and then feed that script into VirtualDub. Then, look at each field and see how many duplicates you get, and what pattern they have. When looking at fields, you need to have at least two in a row from each frame of film (because you need both fields to create a full-resolution frame of video). However, as soon as you see a third field, you need to decimate (remove) that. Remember that decimation is done on a per-field basis, not per frame. TFM (and its associated decimation plugin) is definitely the thing to be using for this process.

kiwiusa
1st February 2008, 15:17
Fizick and John,

Firstly, thanks for all the help. You guys are great.

The change from DirectShow to Dindex did the trick and I didn't need to use MultiDecimate. In fact in my 2 hour video, I can only detect about 4 dup's now.

Despot is handling everything except at scene changes (which I expected). I also used some MVTools stabilization and Descratch.

It all looks good.

Thanks again

Al

johnmeyer
8th February 2008, 21:07
I don't think I posted this. It is my script for "despotting" 16mm film. Each frame of video contains one frame of film and therefore can be treated as progressive. After years of not quite getting despot to work right, the results with this script are amazingly good and seem to work across many different exposure and film stocks. The key to getting things to work was using the motion compensation.

Hope this helps someone.
AVISource("J:\OPRFHS 1969 FILMS\1969-09-13 LaGrange0001.avi")
loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools.dll")
loadplugin("c:\Program Files\AviSynth 2.5\plugins\despot.dll")
i = ConvertToYV12() # for Despot
vf = MVAnalyse(i, isb=false,idx=1)
f = MVCompensate(i, vf,idx=1)
vb = MVAnalyse(i, isb=true,idx=1)
b = MVCompensate(i, vb,idx=1)
Interleave(f, i, b)
DeSpot(show=0,p2=4,mthres=8,p1=15,pwidth=70,pheight=70,mwidth=20,mheight=15,interlaced=false,merode=33,ranked=true,p1percent=0,dilate=0,fitluma=true,blur=4,motpn=false,seg=0,sign=1)

output=SelectEvery(3,1)
stackvertical(i,output)
Obviously, you comment out the "stackvertical" command when doing final output.

kiwiusa
21st February 2008, 16:40
Or have I got some version problems with dlls etc.

Here is my very simple AVSp test script.

setmemorymax(512)

IL = ([<"Interlaced ?", 0, 1, 1>] == 0) ? false : true

version()

ConvertToYV12(Interlaced=IL)

despot(Interlaced = IL)

Everytime I move the slider I get an Access Violation error.

Any help or redirection greatly appreciated.

Al

Fizick
23rd February 2008, 09:44
1.What with avisynth 2.5.7?
2.What without Avsp?
3. What is despot version?

kiwiusa
23rd February 2008, 17:49
Hi Fizick,

I get the same results with AviSynth 2.5.7 (Dec 31, 2006) as below.

Exception exceptions.WindowsError: 'exception: access violation reading 0x03D1001F' in <bound method PClip.__del__ of <avisynth.PClip instance at 0x02812A58>> ignored

AvsP is Version 2.0.2
Despot is Version 3.5.1.0

Hope this helps,

Al

johnmeyer
27th March 2008, 00:46
Despot doesn't work on some frames. It works fine for dozens of frames, and then stops working for several frames. I have spent hours changing every conceivable parameter, but can't get it to work. I am now wondering if it is a bug. This doesn't appear to have anything to do with a scene change, or with anything that could be confused with a scene change.

I am using Despot Version 3.5.1.

Here is the script:

# Despot test script

loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools.dll")
loadplugin("c:\Program Files\AviSynth 2.5\plugins\deflicker.dll")
loadplugin("c:\Program Files\AviSynth 2.5\plugins\despot.dll")

Avisource("d:\test.avi")

i = ConvertToYV12()
vf = MVAnalyse(i, isb=false,idx=1)
f = MVCompensate(i, vf,idx=1)
vb = MVAnalyse(i, isb=true,idx=1)
b = MVCompensate(i, vb,idx=1)
Interleave(f, i, b)

Deflicker(percent=99, lag=5,scene=15, info=false)
DeSpot(show=1,p2=5,mthres=9,p1=22,pwidth=70,pheight=110,mwidth=7,mheight=10,mscene=90,interlaced=false, \
merode=73,ranked=true,p1percent=0,dilate=0,fitluma=true,blur=4,motpn=true,seg=0,sign=1)

SelectEvery(3,1)


I have uploaded this script, along with a short DV AVI file that illustrates the problem (and I've included the DLLs for Despot and Deflicker, just to make sure we're all on the same page). Here is the link (this is only good for seven days):

http://download.yousendit.com/DE86CE26252A263E

Here's frame 9 from the test clip, with "show" set to true. As you can see from the pink, lots of dirt is being removed:

http://i177.photobucket.com/albums/w208/johnmeyer/GoodDespot.jpg

Then, here is the next frame:

http://i177.photobucket.com/albums/w208/johnmeyer/BadDespot.jpg

While the motion protected areas are still shown (you'll see a few white patches in the trees in the second picture, you won't see any dirt removal (pink). Despot seems to work for about 5-6 frames, and then stops working for 1-3 frames, although this isn't a consistent pattern. This is very old film, so there is some flicker due to how it was processed in 1928. I tried to minimize this by using Deflicker, although it only makes a slight improvement.

This film was captured with a machine that is equivalent to a Workprinter (i.e., frame-by-frame) so there is absolutely zero flicker introduced by the transfer process.

So, if anyone can tell me why this is happening, I'd sure like to know. If it is a bug, hopefully this will help the author track it down.

Quick update (ten minutes after initial post): I think the problem is with the MVAnalyze code, which I took directly from the doc. Without motion comp, Despot does something to every frame.

rfmmars
27th March 2008, 01:58
Thanks for the clip and script. Here is what I did. Ran the script and saved the file. Loaded that file and ran the script again. Loaded that file and ran the script once more. On all runs, a pattern developed and with each run, more frames were cleaned than before. Here's the pattern on the third run.

Bold frames are the cleaned frames

1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
16,17,18,19,20,21,22,23,24,25,
26,27,28,29,30,31,32,33
,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,
50

Hope this will be some help.

EDIT: As you see my frame count is 8 higher than reported by AVSp, This is the number of clicks of the "right arrow in AVSp"

Richard
photorecall.net

johnmeyer
27th March 2008, 03:18
Thanks for the help. I had never thought of interating the script.

I have spent several more hours on this and found that the problem with skipped frames is because of a defect in MVAnalyze, not Despot. I switched to Depan for motion estimation, and the problem went away. I have always suspected that there are problems with MVAnalyze, and if you take my script and comment out the SelectEvery statement, as you step through the video you will see that there is absolutely no motion estimation being done on some frames. It is these frames that don't get any "despotting" because the "previous" and "next" frames (which are generated by MVtools) are identical to the reference frame and therefore Despot doesn't see any differences, and therefore does nothing.

There are still lots of other fun things to do to "perfect" the despotting with this 12 fps clip (whoever took it was cranking really slowly, probably to save film). Because there is so much time between frames, there are huge differences between each adjacent frame, and therefore despot has to deal with lots of stuff that normally wouldn't be a problem at 30 fps.

Didée
27th March 2008, 08:21
Probably that's not a "defect" of MVAnalyze, but rather all the noise & dirt is triggering the scenechange threshold.

For a quick test, increase thSCD1:

f = MVCompensate(i, vf,idx=1, thSCD1=9999)
b = MVCompensate(i, vb,idx=1, thSCD1=9999)

If that eliminates the problem of not-processed frames, then noise is the culprit.

johnmeyer
27th March 2008, 18:04
all the noise & dirt is triggering the scenechange threshold.


Bingo!

I spent all that time working with the mscene parameter in Despot, because the problem sure looked like a scene change issue, but in doing so completely forgot that MVAnalyze has a scene change parameter as well.

This fixed the problem. Many thanks.

johnmeyer
28th March 2008, 22:07
Many thanks for the help. Since the film from which this clip came was filmed in 1928 at 12 fps, the temporal changes between each frame is extreme, which makes motion estimation tough to do, and also the flicker due to how the film was developed (the capture process introduced no flicker) made the scene detection go bonkers (as was pointed out above).

I "solved" the first problem by using a combination of a mask created with MVTools, and the internal motion comp built into Despot. I made huge progress on the second problem (flicker) by using the old VirtualDub filter instead of Deflicker. Getting rid of the flicker prior to doing Despot makes a HUGE difference. Unfortunately, it also blows out the highlights in some places, so I may re-write the script to use the "deflickered" video to drive the despotting, but actually perform the despotting on the original, flickery film. I haven't yet figured out how to do that.

If you are interested, here are two short clips, showing before:

http://www.youtube.com/watch?v=b92SThVVgZ4

and after:

http://www.youtube.com/watch?v=e8c0r_oD8WQ

deras
1st October 2008, 20:59
(first, mi english is not very good).

Hi, I need help to use DeSpot and DeScratch AviSynth plugins with a Super8 video.

I use DeScratch for the black vertical lines, and DeSpot for the black spots in the video, like this (in the bottom and left):

http://i195.photobucket.com/albums/z257/derass/captura_S8_tacanegra_despotNO.jpg

DeScratch reduces some lines, but not a lot, and I think that it's possible to reduce more. And DeSpot I think that don't do anything, I suppose because of the configuration I gived it.

I upload the Super8 video, please, if someone can help me with any information about those plugins, please, write it.

Video: http://www.megaupload.com/?d=FVLAUSQ5

And this is the script I use:


# PLUGINS
LoadPlugin("J:\plugins\mpeg2dec3.dll")
LoadPlugin("J:\plugins\cnr2.dll")
LoadPlugin("J:\plugins\descratch.dll")
LoadPlugin("J:\plugins\despot.dll")
#
# SOURCE
AviSource("J:\S8\videof.avi")
#
# COLOR
CNR2()
Tweak(hue=-5, sat=1.25, bright=15, cont=0.7)
#
DeScratch(mindif=3)
#
DeSpot(median=false)


Thank you to all the people that read my post and help me.

johnmeyer
1st October 2008, 22:23
I can't solve all your problems, but I can point you in the right direction for how to use despot.

First of all, this assumes that your footage is progressive. I capture 16mm, Super8, and 8mm film using a "Workprinter" so I end up with one frame of video for each frame of film. Even if the video is saved using the DV codec, which encodes interlaced, the resulting footage can be treated as progressive because there is no temporal difference between adjacent fields.

Second, you will still need to tweak the settings for despot in the script below because each film is different.

The key to getting despot to work well is to feed it a motion compensated clip, as I do with MVTools in the script below. Before I figured this out, I spent months trying to get despot to work, and it never seemed to do much.

Also, pay attention to the scene detection threshold. If you set that incorrectly, despot will quit working on some frames, because it thinks it has detected a scene change.

# Despot script for B&W 12 fps film with lots of flicker

loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools.dll")
loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\masktools.dll")
loadplugin("c:\Program Files\AviSynth 2.5\plugins\despot.dll")

prefilt=Avisource("E:\Stan's Film\Barney and Google.avi").ConvertToYV12()

i=prefilt

#Create mask
ml = 100 # mask scale
thscd1 = 800 # scene change

vf = prefilt.MVAnalyse(isb=false, truemotion=true) # forward vectors
cf = i.MVFlow(vectors=vf, thscd1 = thscd1) # previous compensated forward
sadf = i.MVMask(vectors=vf, ml=100,kind=1,gamma=1, thscd1 = thscd1)
msadf=sadf.Binarize() # binary inverted forward SAD mask

vb = prefilt.MVAnalyse(isb=true, truemotion=true) # backward vectors
cb = i.MVFlow(vectors=vb, thscd1 = thscd1) # next compensated backward
sadb = i.MVMask(vectors=vb, ml=ml, gamma=1, kind=1, thscd1 = thscd1) # backward SAD mask
msadb = sadb.Binarize() # binary inverted backward SAD mask

msad = Logic(msadf,msadb,"OR") # combined inverted SAD mask
msad = msad.Expand() # expanded inverted SAD mask
msadi = Interleave(msad, msad, msad) # interleaved 3-frame inverted SAD mask

Interleave(cf,i,cb) # interleave forward compensated, source, and backward compensated

DeSpot(show=0,maxpts=1200,p2=5,mthres=11,p1=22,pwidth=100,pheight=140,mwidth=7, \
mheight=5,mscene=90,interlaced=false,merode=58,ranked=true,p1percent=25,dilate=2, \
fitluma=true,blur=2,motpn=false,seg=1,sign=1,extmask=msadi)
SelectEvery(3,1)
#output=SelectEvery(3,1)
#stackvertical(prefilt,output)

Here is a link to about ten seconds of a very dusty 1928 16mm film:
http://www.youtube.com/watch?v=b92SThVVgZ4

and here is the same film after cleaning with the above script. Ignore the first second of the cleaned film (because it wasn't cleaned -- long story). You can open these in separate browser windows and play them side-by-side if you want to get a real-time view of the before/after.

http://www.youtube.com/watch?v=e8c0r_oD8WQ

The difference between the two clips, especially if you view them side-by-side, is pretty remarkable. Despot can do some remarkable things.

As for descratch, I've never gotten it to work properly.

P.S.

I looked at your film, and you won't get very far unless you first do IVTC to remove the redundant fields.

P.P.S. I just looked at the film one field at a time, using separatefields() in AVISynth, and I'm not sure you'll be able to do anything with Despot, even if you first do IVTC. The problem is that the capture method you used ends up blending one frame of film across many, many fields. For instance, if you just do a separatefields command, then on "frame" 3194 (which is actually "field" 3194) you'll see a dust spot start to appear next to the woman's hand holding the purse. That spot comes into full view in subsequent fields, but is still visible in field 3200. That is seven fields. If the transfer is done properly, that spot should only appear on two fields which, when combined together, would be one frame of film. There is no way you can remove a spot when it appears on that many fields.

lansing
22nd October 2008, 04:00
i ran into a similar problem kiwiusa has in post #121 with AvsP, and also with Megui and Virtualdub.

here's my script:

DeSpot(pwidth=50,pheight=50,p1=14,p2=8,mthres=10,mwidth=30,mheight=30,color=true)
LimitedSharpenFaster(strength=25)
FastLineDarkenmod(strength=40,thinning=0)
tweak (bright=12.75)
convolution3d("animehq")
spline36resize (716,540)

when i open it with Megui, either I close the preview window or enqueue the encoding job, the program crashed. Happened the same with Virtualdub when it starts to encode the script. The only program that encode successfully was Avidemux. Any help on this problem?

Fizick
22nd October 2008, 09:23
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
Script error: there is no function named "FastLineDarkenmod"
(F:\Papa\c\despot351\Release\despot66.avs, line 7)
---------------------------
ОК
---------------------------

Any ideas? :)

krieger2005
22nd October 2008, 10:35
Don't know if this is the latest release: http://forum.doom9.org/showpost.php?p=1035405&postcount=3

Fizick
22nd October 2008, 10:55
I have no any problem with AVSP or VDubMod.
Other host are not supported by me :)

it is quite possible, that problem is in specific source.
lansing, have you any problem with other clips? if not, upload small part of problem clip.

if yes, try clean your plugins folder :)

lansing
22nd October 2008, 18:48
I've test the script with different source, they have the same crash on VDub and Megui. But when I commented out DeSpot(), everything works fine.
i've also tried both cleaning up the plugin folder and reinstalling Avisynth, the problem still exist. VDubMod works fine encoding though.

CORRECTION: VDub encode fine when not starting it in the job list

Fizick
22nd October 2008, 20:23
lansing, so VirtualDub (what version? or VirtualDubMod?) encode with a crash, only if it starting from job list?

Please say step by step. :)

Also source size, fps, and may be type of encoding (xvid?)

lansing
22nd October 2008, 21:05
lansing, so VirtualDub (what version? or VirtualDubMod?) encode with a crash, only if it starting from job list?

Please say step by step. :)

Also source size, fps, and may be type of encoding (xvid?)

VirtualDub 1.8.6 and VDMod 1.5.10.3 will both encode when I select save as avi. They both crash when I save it as a job and then run it in the Job control window. Closing the video in VD/VDMod, reopening the video, or closing VD/VDMod will also lead to crashes.

this (http://www.mediafire.com/download.php?ynvjz2njimk) is a sample of the source I'm trying to work on

Fizick
22nd October 2008, 21:33
DeSpot version?

lansing
22nd October 2008, 22:07
despot version?

3.5.1.0

Fizick
23rd October 2008, 08:33
I can not confirm a bug.
Anybody else?

i khow about some strange code fragments in Despot, but i can not figure the exact bug place (if any).
may be you can provide virtualdub bug report?

Fizick
23rd October 2008, 14:20
OK, I made trial version 3.5.2, temporal link is here:
http://avisynth.org.ru/despot/despot.dll

I try fix (or prevent) some memory problem (in filter constructor-destructor), but.... it is hard to fix if I had no any problems with 3.5.1. :)

i will look more after responce.
What I really want, it is to add YUY2 support to DeSpot.

lansing
23rd October 2008, 15:42
OK, I made trial version 3.5.2, temporal link is here:
http://avisynth.org.ru/despot/despot.dll

I try fix (or prevent) some memory problem (in filter constructor-destructor), but.... it is hard to fix if I had no any problems with 3.5.1. :)

i will look more after responce.
What I really want, it is to add YUY2 support to DeSpot.

yes, this one fix it

Fizick
23rd October 2008, 16:09
Well!
I found one more bug with external mask for some width values, will fix it too :)

lansing
23rd October 2008, 23:32
I'm having difficulties tweaking despot for my anime video for hours, a tweaking works for some scenes, and then over worked for other scenes. Here's the sample video (http://www.mediafire.com/download.php?grk1okjtmmt) that I mixed from several different scenes from the same video.

Here's the script from the document that I use:

avisource ("mixed sample.avi")
i = ConvertToYV12()

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

vf = prefilt.MVAnalyse(isb=false, truemotion=true) # forward vectors
cf = i.MVFlow(vectors=vf, thscd1 = thscd1) # previous compensated forward
sadf = MVMask(vectors=vf, ml=ml,kind=1,gamma=1, thscd1 = thscd1) # forward SAD mask
msadf=sadf.Binarize() # binary inverted forward SAD mask

vb = prefilt.MVAnalyse(isb=true, truemotion=true) # backward vectors
cb = i.MVFlow(vectors=vb, thscd1 = thscd1) # next compensated backward
sadb = MVMask(vectors=vb, ml=ml, gamma=1, kind=1, thscd1 = thscd1) # backward SAD mask
msadb = sadb.Binarize() # binary inverted backward SAD mask

msad = Logic(msadf,msadb,"OR") # combined inverted SAD mask
msad = msad.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=15,p2=1,pwidth=40,pheight=40,mthres=4,merode=25,p1percent=10,sign=0,show=0,seg=0,color=true,motpn=true, extmask=msadi)

SelectEvery(3,1) # get filtered source

The script give acceptable result keeping the stars in one scene while removing spots on the other, but for the scene when it is a panning of a door, there're several false spots that has been removed.

Any suggestion about how can I compromise this?

Fizick
24th October 2008, 07:58
Try seg=1 or 2. it should be safer.
sorry, i have have no time to check your clip.

lansing
25th October 2008, 23:36
thanks, I'll try my luck here.

I'm thinking to resize the video to a bigger size and run despot to wipe out the tiny spots, and then run despot again with another setting to remove the bigger spots. But I'm kind of confuse with the order of the script,

will this script do what I just meant?


AVISource("source.avi")

source = spline36resize (716,540)

backward_vectors = source.MVAnalyse(isb = true, truemotion=true, delta = 1, idx = 1)
# we use explicit idx for more fast processing
forward_vectors = source.MVAnalyse(isb = false, truemotion=true, delta = 1, idx = 1)
forward_compensation = source.MVFlow(forward_vectors, idx=1, thSCD1=500) # or use MVCompensate
backward_compensation = source.MVFlow(backward_vectors, idx=1, thSCD1=500) # or use MVCompensate
# create interleaved 3 frames sequences
interleave(forward_compensation, source, backward_compensation)

DeSpot(setting)

selectevery(3,1) # return filtered central (not-compensated) frames only

DeSpot(setting)

johnmeyer
25th October 2008, 23:41
I don't think that re-sizing the video to make the spots bigger will do anything, except chew up time, and possibly degrade your video.

lansing
28th October 2008, 04:35
@john
in my case, I'm going to upsize it before or after anyway, so it worth a test.

after a few harsh days of trials and errors, I'm just going to surrender to the saying that there's no one setting that will work for the whole clip. What I'm really looking for now is a parameter/way to tell despot not to despot certain segments of the clip, ie. frame 100 to 200?

thetoof
28th October 2008, 04:57
source=your file

source.your filtering with despot...
filtered=last

section1=filtered.trim(0,99)
section2=source.trim(100,200)
section3=filtered.trim(201,0)

section1+section2+section3

That's only a skeleton... but the logic is quite easy to understand.