Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
27th November 2023, 16:25 | #1 | Link |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 703
|
Extract vertical scratches from silent films
So I have been using Spotless followed by makediff before and after it. Works good most of the time to extract the dust and sporadic scratches yet some frames needs to be removed as the filtering sometimes catches movement in the scene etc.
The next step I was hoping to extract vertical (almost static) scratches but it seems harder than I thought. DestripeV is the only script that has been working somewhat to recognize the vert-scratches but alot of other things are detected and makes for unusable result. My idea is that somehow make a detection and isolation of the vertical "anomalies" in the image that are scratches. I have tried to isolate the scratches by masking with ex_edge("kroon") and inverted overlayed motion masks but to no avail. May need another approach, ideas? |
27th November 2023, 17:14 | #2 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
Have a look at the discussion about ProPainter in this recent thread:
Big green line removal with overlay mask possible? Go to post #16. Until seeing that thread, I would have told you that scratch removal was impossible without a lot of manual intervention because scratches persist from one frame to the next, so you can't use the trick of looking at something which doesn't exist in either the previous or next frame and then removing that (this is how dust removal algorithms work). |
28th November 2023, 08:15 | #5 | Link |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 703
|
Thanks everyone, I did not yet try ProPainter but Descratch I have tried and have tweaked and adjusted the params but it seems to miss the scratches mostly and instead identifies other objects as such. Gotta be more careful which scenes I pick to do this on.
|
28th November 2023, 16:59 | #8 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
The big problem with Descratch is that (I think) it is basically a static inpainter, like a delogo filter. However, scratches wander slightly from frame to frame and therefore are not static enough for the painting to work consistently.
|
28th November 2023, 20:39 | #9 | Link |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 703
|
Reit is 5gb
Problem is that I have to do selectevery(3, 1, 4).selectodd() Otherwise I get duplicate frames. link to youtube video: https://www.youtube.com/watch?v=LVV7UutK0Xk My script so far: Code:
converttoyv12() Crop(482, 0, -480, 0) u=last cd=convertToYv12() pr=cd.ex_median("IQMV",Y=3,UV=1) pre=pr.ex_sbr(3,uv=1) /* mo=mmask2() es=ex_edge("kroon").overlay(mode="darken",mo.invert().mt_expand()) ds=es.descratch(mindif = 12, asym = 6, maxgap = 3, maxwidth = 7).DeStripeV(3,1,255,uv=1).overlay(mode="darken",mo.invert().mt_expand()) mt_makediff(es,ds) */ SpotLess(RadT=3, pel=1, tm=false, blksz=8, chroma=false, thsad=520, dc=pre) #bb0.7 mt_makediff(last, u).invert() #trim(7020, 7127) selectevery(3, 1, 4).selectodd() #trim(9827, 9912) #trim(3183, 3491) #trim(23399, 23446) #trim(24414, 24586)++trim(24658, 24681)++trim(25222, 25327) trim(36373, 36637) last.awarpsharp2(depth=26).NNEDI3CL(1, dh=true, dw=true).SinPowResizeMT(2878,2160) prefetch(16) function MMask2(clip C) { ## requires MVTools2 C ## Last==C super = MSuper fvec = MAnalyse(super, isb=false) MMask(super, fvec, ml=100, gamma=0.5, \ kind=0, Ysc=0, thSCD1=400, thSCD2=130) Grayscale Crop(0, 2, C.Width, C.Height, true) return Last.Levels(0, 1, 128, 0, 255, coring=false) } Last edited by anton_foy; 30th November 2023 at 08:10. |
|
|