Guest User

RemoveSpots.avsi

a guest
Nov 27th, 2012
658
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.03 KB | None | 0 0
  1. #
  2. #
  3. # File: RemoveSpots.avsi
  4. #
  5. # RemoveSpots and moution compensated RemoveSpots functions
  6. #
  7. # Functions:
  8. #
  9. # function NullClip(clip clp)
  10. #
  11. # function RemoveSpots(clip clp, int "limit", bool "_grey")
  12. # function RemoveSpotsMC(clip clp, int "limit", bool "_grey", int "Vectors")
  13. #
  14. # function RemoveSpotsMC2(clip clp, int "type", bool "show", int "Vectors")
  15. #
  16. # function RemoveSpotsMC3(clip clp, int "Vectors", int "Show")
  17. #
  18. # function RemoveSpotsMC4(clip clp, int "Vectors", int "Show")
  19. #
  20. # function RemoveSpotsMC5(clip clp, int "Vectors", int "Show")
  21. #
  22. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEDIRT_20050507\removedirt.dll")
  23. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEDIRT_20050507\removedirts.dll")
  24. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEGRAIN-1_0\repair.dll")
  25. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEGRAIN-1_0\removegrain.dll")
  26. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEGRAINT-1_0\repairt.dll")
  27. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEGRAINT-1_0\removegraint.dll")
  28. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\MVTOOLS-V2_5_11_3\mvtools2.dll")
  29. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEDIRT_20050507\removedirt.dll")
  30. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\FLUXSMOOTH_25_DLL_20040729\fluxsmooth.dll")
  31. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\VAGUEDENOISER_25_DLL_20050926\vaguedenoiser.dll")
  32. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\DEFLICKER_25_DLL_20040816\deflicker.dll")
  33. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\DESPOT_3_6_1\despot.dll")
  34. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\MASKTOOLS-V2_0A48\mt_masktools-25.dll")
  35. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\MASKTOOLS-V1_5_8\masktools.dll")
  36. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\FFT3DFILTER_20070220\fft3dfilter.dll")
  37. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\DEPAN_20061128\depan.dll")
  38. # LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\DEPAN_20061128\depanestimate.dll")
  39. # ############ ONLY EDIT LOCATIONS BELOW
  40.  
  41. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\RemoveDirtSSE2.dll")
  42. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\removedirtSSE2.dll")
  43. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\RepairSSE2.dll")
  44. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\RemovegrainSSE2.dll")
  45. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\RepairTSSE2.dll")
  46. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\RemoveGrainT.dll")
  47. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\mvtools2.dll")
  48. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\removedirtSSE2.dll")
  49. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\fluxsmooth.dll")
  50. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\vaguedenoiser.dll")
  51. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\deflicker.dll")
  52. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\despot.dll")
  53. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\mt_masktools-25.dll")
  54. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\masktools.dll")
  55. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\fft3dfilter.dll")
  56. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\depan.dll")
  57. LoadPlugin("C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\depanestimate.dll")
  58.  
  59. (_use_VDub_ == true) ? LoadVirtualDubPlugin("C:\PROGRAM FILES\VIRTUALDUB 1.9.11\PLUGINS\spotremover.vdf", "SpotRemover", 11) : NOP()
  60.  
  61.  
  62.  
  63. function NullClip(clip clp)
  64. {
  65. return BlankClip(clp, length=0)
  66. }
  67.  
  68.  
  69.  
  70. # =============================================================================
  71. #
  72. #
  73. function RemoveSpots(clip clp, int "limit", bool "_grey")
  74. {
  75. _grey = Default(_grey, false)
  76. limit = Default(limit, 16)
  77.  
  78. clmode = 17
  79.  
  80. clensed = Clense(clp, grey=_grey, cache=4)
  81. sbegin = ForwardClense(clp, grey=_grey, cache=-1)
  82. send = BackwardClense(clp, grey=_grey, cache=-1)
  83. alt = Repair(SCSelect(clp, sbegin, send, clensed, debug=true), clp, mode=limit, modeU = _grey ? -1 : limit)
  84. restore = Repair(clensed, clp, mode=limit, modeU = _grey ? -1 : limit)
  85. clp = RestoreMotionBlocks(clensed, restore, neighbour=clp, alternative=alt, gmthreshold=70, dist=1, \
  86. dmode=2, debug=false, noise=10, noisy=12, grey=_grey)
  87.  
  88. return clp
  89. }
  90.  
  91.  
  92. function RemoveSpotsMC(clip clp, int "limit", bool "_grey", int "Vectors")
  93. {
  94. _grey = Default(_grey, false)
  95. limit = Default(limit, 16)
  96. Vectors = Default(Vectors, 1)
  97.  
  98. Vectors = (Vectors < 1) ? 1 : (Vectors > 3) ? 3 : Vectors
  99.  
  100. super = MSuper(clp, pel=2, sharp=2)
  101. bvec3 = (Vectors == 3) ? MAnalyse(super, isb=true, delta=3, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
  102. bvec2 = (Vectors >= 2) ? MAnalyse(super, isb=true, delta=2, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
  103. bvec1 = MAnalyse(super, isb=true, delta=1, blksize=8, overlap=4, truemotion=true)
  104. fvec1 = MAnalyse(super, isb=false, delta=1, blksize=8, overlap=4, truemotion=true)
  105. fvec2 = (Vectors >= 2) ? MAnalyse(super, isb=false, delta=2, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
  106. fvec3 = (Vectors == 3) ? MAnalyse(super, isb=false, delta=3, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
  107. backw3 = (Vectors == 3) ? MFlow(clp, super, bvec3) : NullClip(clp)
  108. backw2 = (Vectors >= 2) ? MFlow(clp, super, bvec2) : NullClip(clp)
  109. backw1 = MFlow(clp, super, bvec1)
  110. forw1 = MFlow(clp, super, fvec1)
  111. forw2 = (Vectors >= 2) ? MFlow(clp, super, fvec2) : NullClip(clp)
  112. forw3 = (Vectors == 3) ? MFlow(clp, super, fvec3) : NullClip(clp)
  113.  
  114. clp = (Vectors == 1) ? interleave(backw1, clp, forw1) : \
  115. (Vectors == 2) ? interleave(backw2, backw1, clp, forw1, forw2) : \
  116. interleave(backw3, backw2, backw1, clp, forw1, forw2, forw3)
  117.  
  118. clp = RemoveSpots(clp, limit=limit, _grey=_grey)
  119.  
  120. clp = (Vectors == 1) ? SelectEvery(clp, 3, 1) : \
  121. (Vectors == 2) ? SelectEvery(clp, 5, 2) : \
  122. SelectEvery(clp, 7, 3)
  123.  
  124. return clp
  125. }
  126.  
  127.  
  128.  
  129. # =============================================================================
  130. #
  131. # SpotRemover() function VirtualDub
  132. #
  133. function RemoveSpotsMC2(clip clp, int "type", bool "show", int "Vectors")
  134. {
  135. # Constant
  136. #
  137. TypeMax = 4
  138.  
  139. # Variables
  140. #
  141. type = Default(type, 1)
  142. show = Default(show, false)
  143. Vectors = Default(Vectors, 2)
  144.  
  145. type = (type < 1) ? 1 : (type > TypeMax) ? TypeMax : type
  146. Vectors = (Vectors < 1) ? 1 : (Vectors > 3) ? 3 : Vectors
  147.  
  148. # create auxialiary smooth clip for easier motion detection
  149. #
  150. filter = clp.DeFlicker(noise=6).Blur(1.58)
  151.  
  152. # this is for internal use by MVtools functions. MVtools' version must be 2.0 or higher.
  153. #
  154. super = MSuper(clp, pel=2, sharp=2)
  155. superfi = MSuper(filter, pel=2, sharp=2)
  156.  
  157. # calculate the motion vectors
  158. #
  159. bvec3 = (Vectors == 3) ? MAnalyse(superfi, isb=true, delta=3, blksize=8, overlap=4, search=3, truemotion=true) : NullClip(clp)
  160. bvec2 = MAnalyse(superfi, isb=true, delta=2, blksize=8, overlap=4, search=3, truemotion=true)
  161. bvec1 = MAnalyse(superfi, isb=true, delta=1, blksize=8, overlap=4, search=3, truemotion=true)
  162. fvec1 = MAnalyse(superfi, isb=false, delta=1, blksize=8, overlap=4, search=3, truemotion=true)
  163. fvec2 = MAnalyse(superfi, isb=false, delta=2, blksize=8, overlap=4, search=3, truemotion=true)
  164. fvec3 = (Vectors == 3) ? MAnalyse(superfi, isb=false, delta=3, blksize=8, overlap=4, search=3, truemotion=true) : NullClip(clp)
  165.  
  166. # create 6 additional clips: two predicted backward and two predicted forward
  167. #
  168. backw3 = (Vectors == 3) ? MCompensate(clp, super, bvec3) : NullClip(clp)
  169. backw2 = (Vectors >= 2) ? MCompensate(clp, super, bvec2) : NullClip(clp)
  170. backw1 = MCompensate(clp, super, bvec1)
  171. forw1 = MCompensate(clp, super, fvec1)
  172. forw2 = (Vectors >= 2) ? MCompensate(clp, super, fvec2) : NullClip(clp)
  173. forw3 = (Vectors == 3) ? MCompensate(clp, super, fvec3) : NullClip(clp)
  174.  
  175. # clpdeg = (Vectors <= 2) ? MDegrain2(clp, superfi, bvec1, fvec1, bvec2, fvec2, plane=4, thsad=400) : \
  176. # MDegrain3(clp, superfi, bvec1, fvec1, bvec2, fvec2, bvec3, fvec3, plane=4, thsad=400)
  177. clpdeg = clp
  178.  
  179. # combine the 5 frames (2 + 1 + 2), the central one undergoes the degrain filter
  180. # combine the 3 frames (1 + 1 + 1), the central one undergoes the degrain filter
  181. # combine the 7 frames (3 + 1 + 3), the central one undergoes the degrain filter
  182. #
  183. clp = (Vectors == 1) ? interleave(backw1, clpdeg, ff1) : \
  184. (Vectors == 2) ? interleave(backw2, backw1, clpdeg, forw1, forw2) : \
  185. interleave(backw3, backw2, backw1, clpdeg, forw1, forw2, forw3)
  186.  
  187. # run SpotRemover over each block of 5 (3, 7) frames
  188. # removing spots only, no smoothing
  189. # !!! change to DSD:0 to turn the debug mode off
  190. # !!! change to DSD:1 to turn the debug mode on
  191. #
  192. # SSI - Smooth Strength Intensity
  193. # SSC - Smooth Strength Color
  194. # SKW - Smooth Kernel Width
  195. # SLI - Smooth Locking level for Intensity
  196. # SLC - Smooth Locking level for Color
  197. # SLD - Smooth Locking Debug
  198. # DLS - Detect Level for Spot detection
  199. # DLC - Detect Level for Clearance
  200. # DPC - Detect Perimeter Clearance
  201. # DSF - Detect Spot Fullness factor
  202. # DSD - Detect Spot Debug
  203. # MTX - Motion Table X (columns)
  204. # MTY - Motion Table Y (columns)
  205. # MTL - Motion Table Level to flag cells
  206. # MDX - Motion Distance X
  207. # MDY - Motion Distance Y
  208. # MIH - Motion Interrupted History
  209. # CBR - Color BRightness
  210. # CCO - Color COntrast
  211. # CSA - Color SAturation
  212. # CBA - Color Balance
  213. # CSR - Color Shift Red
  214. # CSB - Color Shift Blue
  215. # FCI - Frame Control Interlaced
  216.  
  217. clp = clp.ConvertToRGB32()
  218. clp = (type == 1) ? (show == false) ? \
  219. clp.SpotRemover("SSI:0 SSC:-5 SKW:3 SLI:2 SLC:2 SLD:0 DLS:24 DLC:16 DPC:16 DSF:0 DSD:0 MTX:16 MTY:12 MTL:25 MDX:1 MDY:1 MIH:0", "") : \
  220. clp.SpotRemover("SSI:0 SSC:-5 SKW:3 SLI:2 SLC:2 SLD:0 DLS:24 DLC:16 DPC:16 DSF:0 DSD:1 MTX:16 MTY:12 MTL:25 MDX:1 MDY:1 MIH:0", "") : clp
  221. clp = (type == 2) ? (show == false) ? \
  222. clp.SpotRemover("SSI:0 SSC:-5 SKW:3 SLI:2 SLC:2 SLD:0 DLS:24 DLC:15 DPC:14 DSF:1 DSD:0 MTX:16 MTY:12 MTL:22 MDX:1 MDY:1 MIH:0", "") : \
  223. clp.SpotRemover("SSI:0 SSC:-5 SKW:3 SLI:2 SLC:2 SLD:0 DLS:24 DLC:15 DPC:14 DSF:1 DSD:1 MTX:16 MTY:12 MTL:22 MDX:1 MDY:1 MIH:0", "") : clp
  224. clp = (type == 3) ? (show == false) ? \
  225. clp.SpotRemover("SSI:0 SSC:-5 SKW:3 SLI:2 SLC:2 SLD:0 DLS:26 DLC:18 DPC:10 DSF:2 DSD:0 MTX:16 MTY:12 MTL:22 MDX:1 MDY:1 MIH:0", "") : \
  226. clp.SpotRemover("SSI:0 SSC:-5 SKW:3 SLI:2 SLC:2 SLD:0 DLS:26 DLC:18 DPC:10 DSF:2 DSD:1 MTX:16 MTY:12 MTL:22 MDX:1 MDY:1 MIH:0", "") : clp
  227. clp = (type == 4) ? (show == false) ? \
  228. clp.SpotRemover( "SSI:7 SSC:0 SKW:5 SLI:2 SLC:2 SLD:0 DLS:26 DLC:18 DPC:16 DSF:2 DSD:0 MTX:16 MTY:12 MTL:22 MDX:1 MDY:1 MIH:0", "") : \
  229. clp.SpotRemover( "SSI:7 SSC:0 SKW:5 SLI:2 SLC:2 SLD:0 DLS:26 DLC:18 DPC:16 DSF:2 DSD:1 MTX:16 MTY:12 MTL:22 MDX:1 MDY:1 MIH:0", "") : clp
  230.  
  231. # clp = clp.ConvertBackToYUY2()
  232. clp = clp.ConvertToYV12()
  233.  
  234. # discard extra frames, keep only the central one
  235. #
  236. clp = (Vectors == 1) ? SelectEvery(clp, 3, 1) : \
  237. (Vectors == 2) ? SelectEvery(clp, 5, 2) : \
  238. SelectEvery(clp, 7, 3)
  239.  
  240. # compensate for the SpotRemover lag. We will loose the last frame in the movie, but the audio will be in sync
  241. #
  242. # clp = clp.Trim(1, 0) # Maybe not needed
  243.  
  244. # enhance the contrast (optional)
  245. #
  246. # clp = clp.ColorYUV(gain_y=0, off_y=10, gamma_y=0, cont_y=80, cont_u=0, cont_v=0)
  247.  
  248. return clp
  249. }
  250. global Width2 = 768
  251. global Height2 = 576
  252.  
  253. # =============================================================================
  254. #
  255. # DeSpot() function
  256. #
  257. function RemoveSpotsMC3(clip clp, int "Vectors", int "Show")
  258. {
  259. # Constants
  260. #
  261. _thSCD1 = 400
  262.  
  263. Vectors = Default(Vectors, 3)
  264. Show = Default(Show, 0)
  265.  
  266. Vectors = (Vectors < 1) ? 1 : (Vectors > 3) ? 3 : Vectors
  267. Show = (Show < 0) ? 0 : (Show > 2) ? 2 : Show
  268.  
  269. filter = DeFlicker(clp, border=150, percent=70, lmin=5, lmax=240)
  270.  
  271. super = MSuper(clp, pel=2, sharp=2)
  272. superfi = MSuper(filter, pel=2, sharp=2)
  273. bvec3 = (Vectors == 3) ? MAnalyse(superfi, isb=true, delta=3, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
  274. bvec2 = (Vectors >= 2) ? MAnalyse(superfi, isb=true, delta=2, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
  275. bvec1 = MAnalyse(superfi, isb=true, delta=1, blksize=8, overlap=4, truemotion=true)
  276. fvec1 = MAnalyse(superfi, isb=false, delta=1, blksize=8, overlap=4, truemotion=true)
  277. fvec2 = (Vectors >= 2) ? MAnalyse(superfi, isb=false, delta=2, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
  278. fvec3 = (Vectors == 3) ? MAnalyse(superfi, isb=false, delta=3, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
  279. backw3 = (Vectors == 3) ? MFlow(clp, super, bvec3, thSCD1=_thSCD1) : NullClip(clp)
  280. backw2 = (Vectors >= 2) ? MFlow(clp, super, bvec2, thSCD1=_thSCD1) : NullClip(clp)
  281. backw1 = MFlow(clp, super, bvec1, thSCD1=_thSCD1)
  282. forw1 = MFlow(clp, super, fvec1, thSCD1=_thSCD1)
  283. forw2 = (Vectors >= 2) ? MFlow(clp, super, fvec2, thSCD1=_thSCD1) : NullClip(clp)
  284. forw3 = (Vectors == 3) ? MFlow(clp, super, fvec3, thSCD1=_thSCD1) : NullClip(clp)
  285.  
  286. # clpdeg = (Vectors <= 2) ? MDegrain2(clp, superfi, bvec1, fvec1, bvec2, fvec2, plane=4, thsad=400) : \
  287. # MDegrain3(clp, superfi, bvec1, fvec1, bvec2, fvec2, bvec3, fvec3, plane=4, thsad=400)
  288. clpdeg = clp
  289.  
  290. clp = (Vectors == 1) ? Interleave(backw1, clpdeg, forw1) : \
  291. (Vectors == 2) ? Interleave(backw2, backw1, clpdeg, forw1, forw2) : \
  292. Interleave(backw3, backw2, backw1, clpdeg, forw1, forw2, forw3)
  293.  
  294. clp = clp.Deflicker(percent=99, lag=5, scene=15, info=false)
  295.  
  296.  
  297.  
  298. # ==== ??????? ?????? ????? ====
  299. clp = clp.DeSpot(mthres=8, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, p1=15, p2=8, \
  300. pwidth=50, pheight=50, ranked=true, sign=1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
  301. blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=2, color=true, mscene=40, minpts=0)
  302.  
  303. # ==== ??????? ????? ????? ====
  304. clp = clp.DeSpot(p1=10, mthres=8, p2=6, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, \
  305. pwidth=100, pheight=100, ranked=true, sign=-1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
  306. blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=0, color=true, mscene=40, minpts=0)
  307.  
  308. # ==== ????????? ????? ? ???? ====
  309. clp = clp.DeSpot(mthres=12, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, p1=15, p2=8, \
  310. pwidth=6, pheight=5, ranked=true, sign=0, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
  311. blur=1, tsmooth=2, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0)
  312.  
  313. clp = clp.DeSpot(mthres=8, mwidth=7, mheight=5, merode=25, interlaced=false, median=false, p1=10, p2=6, \
  314. pwidth=720, pheight=576, ranked=true, sign=2, maxpts=0, p1percent=2, dilate=1, fitluma=true, \
  315. blur=4, tsmooth=4, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0)
  316.  
  317. # ==== ????????? ?????????? ????? ====
  318. clp = clp.DeSpot(mthres=12, mwidth=7, mheight=5, merode=25, interlaced=false, median=false, p1=15, p2=8, \
  319. pwidth=10, pheight=10, ranked=true, sign=-1, maxpts=0, p1percent=2, dilate=1, fitluma=true, \
  320. blur=4, tsmooth=4, show=Show, mark_v=255, motpn=false, seg=2, color=true, mscene=40, minpts=0)
  321.  
  322. # ==== ?????, ???????? ? ??????? ? ?????????, ???????? ??????? ???????? ====
  323. clp = clp.DeSpot(mthres=13, mwidth=7, mheight=5, merode=16, interlaced=false, median=false, p1=15, p2=13, \
  324. pwidth=140, pheight=100, ranked=true, sign=-1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
  325. blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0)
  326.  
  327. # ====================================
  328. clp = clp.DeSpot(p1=20, p2=4, pwidth=200, pheight=150, mthres=22, merode=33, sign=2, show=Show, seg=0, color=false, \
  329. motpn=true, fitluma=true, mark_v=255)
  330.  
  331. clp = clp.DeSpot(p1=20, p2=12, pwidth=768, pheight=576, mthres=80, merode=33, sign=0, show=Show, seg=0, color=true, \
  332. motpn=true, mark_v=255)
  333.  
  334. clp = clp.DeSpot(p1=12, p2=22, pwidth=100, pheight=100, mthres=22, merode=25, p1percent=10, sign=0, show=Show, seg=1, \
  335. color=true, motpn=true, mark_v=255)
  336.  
  337. clp = clp.DeSpot(p1=15, p2=1, pwidth=40, pheight=40, mthres=4, merode=25, p1percent=10, sign=0, show=Show, seg=1, \
  338. color=true, motpn=true, mark_v=255)
  339.  
  340. clp = clp.DeSpot(p1=35, p2=11, pwidth=250, pheight=250, mthres=23, merode=40, p1percent=1, sign=1, show=Show, seg=2,\
  341. color=true, motpn=false, minpts=6, dilate=1, mscene=100, fitluma=true, blur=1, mark_v=255)
  342.  
  343. clp = clp.DeSpot(p1=22, p2=5, pwidth=100, pheight=140, mthres=11, merode=58, p1percent=25, sign=1, show=Show, seg=1, \
  344. color=true, motpn=false, minpts=6, maxpts=1200, mwidth=7, mheight=5, dilate=2, mscene=90, fitluma=true, \
  345. blur=2, ranked=true, interlaced=false, mark_v=255)
  346.  
  347. clp = clp.DeSpot(p1=30, p2=22, pwidth=400, pheight=300, mthres=20, merode=33, p1percent=10, sign=1, show=Show, seg=2, \
  348. color=true, motpn=true, mark_v=255)
  349.  
  350. clp = clp.DeSpot(sign=2, pwidth=Width2, pheight=Height2, p1=10, p2=6, mthres=8, tsmooth=4, seg=2, blur=4, p1percent=2, \
  351. show=Show, mark_v=255)
  352.  
  353. clp = clp.DeSpot(p1=30, p2=15, pwidth=Width2, pheight=Height2, mthres=20, motpn=true, dilate=1, seg=1, show=Show, mark_v=255)
  354.  
  355. clp = clp.DeSpot(p1=30, p2=10, mthres=45, pwidth=Width2, pheight=Height2, minpts=10, dilate=0, ranked=true, \
  356. p1percent=5, mscene=98, merode=35, mwidth=20, mheight=10, sign=2, show=Show, seg=0, color=true, \
  357. motpn=true, fitluma=true, blur=1, mark_v=255)
  358.  
  359. clp = clp.DeSpot(p1=25, p2=14, mthres=25, pwidth=Width2, pheight=Height2, minpts=3, dilate=3, p1percent=5, \
  360. mscene=98, merode=35, sign=-2, show=Show, seg=2, color=true, motpn=true, fitluma=true, blur=1, mark_v=255)
  361.  
  362. clp = clp.Despot(p1=28, p2=8, mthres=45, pwidth=850, pheight=850, minpts=10, dilate=0, ranked=true, p1percent=5, mscene=98, \
  363. merode=35, mwidth=20, mheight=10, sign=2, show=Show, seg=0, color=true, motpn=true, fitluma=true, \
  364. blur=1, mark_v=255)
  365.  
  366. clp = clp.Despot(p1=25, p2=14, mthres=25, pwidth=555, pheight=555, minpts=3, dilate=3, p1percent=5, mscene=98, \
  367. merode=35, sign=-2, show=Show, seg=2, color=true, motpn=true, fitluma=true, blur=1, mark_v=255)
  368.  
  369.  
  370.  
  371.  
  372.  
  373. # big black spots
  374. # clp = clp.DeSpot(sign=1, pwidth=45, pheight=45, p1=15, p2=8, mthres=8, color=true, show=Show, mark_v=255)
  375.  
  376. # thin white lines
  377. # clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=8, p2=1, mthres=5, show=Show, mark_v=255)
  378.  
  379. # thick hair lines (avoid real hair)
  380. # clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=15, p2=13, mthres=13, merode=24, show=Show, mark_v=255)
  381.  
  382. # lines contacting motion, avoid motion areas
  383. # clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=15, p2=13, mthres=13, merode=16, seg=1, show=Show, mark_v=255)
  384.  
  385. # small dots and dust
  386. # clp = clp.DeSpot(pwidth=6, pheight=5, p1=15, p2=8, mthres=12, tsmooth=2, show=Show, mark_v=255)
  387.  
  388. # Long horizontal scratches
  389. # clp = clp.DeSpot(sign=-1, pwidth=100, pheight=2, p1=15, p2=8, mthres=12, color=true, show=Show, mark_v=255)
  390.  
  391. # Small compact spots
  392. # clp = clp.DeSpot(sign=-1, pwidth=10, pheight=10, p1=15, p2=8, mthres=12, color=true, show=Show, mark_v=255)
  393.  
  394.  
  395.  
  396.  
  397.  
  398. clp = (Vectors == 1) ? SelectEvery(clp, 3, 1) : \
  399. (Vectors == 2) ? SelectEvery(clp, 5, 2) : \
  400. SelectEvery(clp, 7, 3)
  401.  
  402. return clp
  403. }
  404. # =============================================================================
  405. #
  406. # DeSpot() function
  407. #
  408. function RemoveSpotsMC4(clip clp, int "Vectors", int "Show")
  409. {
  410. # Constants
  411. #
  412. _thSCD1 = 400
  413. _ml = 100
  414.  
  415. Vectors = Default(Vectors, 1)
  416. Show = Default(Show, 0)
  417.  
  418. Vectors = (Vectors < 1) ? 1 : (Vectors > 3) ? 3 : Vectors
  419. Show = (Show < 0) ? 0 : (Show > 2) ? 2 : Show
  420.  
  421. filter = FFT3Dfilter(clp, sigma=6, plane=4, bw=32, bh=32, ow=8, oh=8, bt=3)
  422.  
  423. super = MSuper(clp, pel=2, sharp=2)
  424. superfi = MSuper(filter, pel=2, sharp=2)
  425. bvec3 = (Vectors == 3) ? MAnalyse(superfi, isb=true, delta=3, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
  426. bvec2 = (Vectors >= 2) ? MAnalyse(superfi, isb=true, delta=2, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
  427. bvec1 = MAnalyse(superfi, isb=true, delta=1, blksize=8, overlap=4, truemotion=true)
  428. fvec1 = MAnalyse(superfi, isb=false, delta=1, blksize=8, overlap=4, truemotion=true)
  429. fvec2 = (Vectors >= 2) ? MAnalyse(superfi, isb=false, delta=2, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
  430. fvec3 = (Vectors == 3) ? MAnalyse(superfi, isb=false, delta=3, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
  431. backw3 = (Vectors == 3) ? MFlow(clp, super, bvec3, thSCD1=_thSCD1) : NullClip(clp)
  432. backw2 = (Vectors >= 2) ? MFlow(clp, super, bvec2, thSCD1=_thSCD1) : NullClip(clp)
  433. backw1 = MFlow(clp, super, bvec1, thSCD1=_thSCD1)
  434. forw1 = MFlow(clp, super, fvec1, thSCD1=_thSCD1)
  435. forw2 = (Vectors >= 2) ? MFlow(clp, super, fvec2, thSCD1=_thSCD1) : NullClip(clp)
  436. forw3 = (Vectors == 3) ? MFlow(clp, super, fvec3, thSCD1=_thSCD1) : NullClip(clp)
  437.  
  438. sadb = MMask(clp, bvec1, ml=_ml, gamma=1, kind=1, thSCD1=_thSCD1)
  439. sadf = MMask(clp, fvec1, ml=_ml, gamma=1, kind=1, thSCD1=_thSCD1)
  440. msadb = MT_Binarize(sadb, 20, upper=true)
  441. msadf = MT_Binarize(sadf, 20, upper=true)
  442. msad = MT_Logic(msadf, msadb, "or")
  443. msad = MT_Expand(msad)
  444. msadi = Interleave(msad, msad, msad)
  445.  
  446. clp = (Vectors == 1) ? Interleave(backw1, clp, forw1) : \
  447. (Vectors == 2) ? Interleave(backw2, backw1, clp, forw1, forw2) : \
  448. Interleave(backw3, backw2, backw1, clp, forw1, forw2, forw3)
  449.  
  450.  
  451.  
  452. # ==== ??????? ?????? ????? ====
  453. clp = clp.DeSpot(mthres=8, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, p1=15, p2=8, \
  454. pwidth=50, pheight=50, ranked=true, sign=1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
  455. blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=2, color=true, mscene=40, minpts=0, extmask=msadi)
  456.  
  457. # ==== ??????? ????? ????? ====
  458. clp = clp.DeSpot(p1=10, mthres=8, p2=6, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, \
  459. pwidth=100, pheight=100, ranked=true, sign=-1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
  460. blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=0, color=true, mscene=40, minpts=0, extmask=msadi)
  461.  
  462. # ==== ??????? ????? ???? ????? (???????? ???????? ?????) ====
  463. clp = clp.DeSpot(mthres=13, mwidth=7, mheight=5, merode=24, interlaced=false, median=false, p1=15, p2=13, \
  464. pwidth=140, pheight=100, ranked=true, sign=-1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
  465. blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=2, color=true, mscene=40, minpts=0, extmask=msadi)
  466.  
  467. # ==== ?????, ???????? ? ??????? ? ?????????, ???????? ??????? ???????? ====
  468. clp = clp.DeSpot(mthres=13, mwidth=7, mheight=5, merode=16, interlaced=false, median=false, p1=15, p2=13, \
  469. pwidth=140, pheight=100, ranked=true, sign=-1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
  470. blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0, extmask=msadi)
  471.  
  472. # ==== ????????? ????? ? ???? ====
  473. clp = clp.DeSpot(mthres=12, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, p1=15, p2=8, \
  474. pwidth=6, pheight=5, ranked=true, sign=0, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
  475. blur=1, tsmooth=2, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0, extmask=msadi)
  476.  
  477. clp = clp.DeSpot(mthres=8, mwidth=7, mheight=5, merode=25, interlaced=false, median=false, p1=10, p2=6, \
  478. pwidth=720, pheight=576, ranked=true, sign=2, maxpts=0, p1percent=2, dilate=1, fitluma=true, \
  479. blur=4, tsmooth=4, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0, extmask=msadi)
  480.  
  481. # ==== ??????? ?????????????? ?????? ====
  482. clp = clp.DeSpot(mthres=12, mwidth=7, mheight=5, merode=25, interlaced=false, median=false, p1=15, p2=8, \
  483. pwidth=100, pheight=2, ranked=true, sign=-1, maxpts=0, p1percent=2, dilate=1, fitluma=true, \
  484. blur=4, tsmooth=4, show=Show, mark_v=255, motpn=false, seg=2, color=true, mscene=40, minpts=0, extmask=msadi)
  485.  
  486. # ==== ????????? ?????????? ????? ====
  487. clp = clp.DeSpot(mthres=12, mwidth=7, mheight=5, merode=25, interlaced=false, median=false, p1=15, p2=8, \
  488. pwidth=10, pheight=10, ranked=true, sign=-1, maxpts=0, p1percent=2, dilate=1, fitluma=true, \
  489. blur=4, tsmooth=4, show=Show, mark_v=255, motpn=false, seg=2, color=true, mscene=40, minpts=0, extmask=msadi)
  490.  
  491. # ====================================
  492. clp = clp.DeSpot(p1=20, p2=4, pwidth=200, pheight=150, mthres=22, merode=33, sign=2, show=Show, seg=0, color=false, \
  493. motpn=true, fitluma=true, extmask=msadi)
  494.  
  495. clp = clp.DeSpot(p1=20, p2=12, pwidth=768, pheight=576, mthres=80, merode=33, sign=0, show=Show, seg=0, color=true, \
  496. motpn=true, extmask=msadi)
  497.  
  498. clp = clp.DeSpot(p1=12, p2=22, pwidth=100, pheight=100, mthres=22, merode=25, p1percent=10, sign=0, show=Show, seg=1, \
  499. color=true, motpn=true, extmask=msadi)
  500.  
  501. clp = clp.DeSpot(p1=15, p2=1, pwidth=40, pheight=40, mthres=4, merode=25, p1percent=10, sign=0, show=Show, seg=1, \
  502. color=true, motpn=true, extmask=msadi)
  503.  
  504. clp = clp.DeSpot(p1=35, p2=11, pwidth=250, pheight=250, mthres=23, merode=40, p1percent=1, sign=1, show=Show, seg=2,\
  505. color=true, motpn=false, minpts=6, dilate=1, mscene=100, fitluma=true, blur=1, extmask=msadi)
  506.  
  507. clp = clp.DeSpot(p1=22, p2=5, pwidth=100, pheight=140, mthres=11, merode=58, p1percent=25, sign=1, show=Show, seg=1, \
  508. color=true, motpn=false, minpts=6, maxpts=1200, mwidth=7, mheight=5, dilate=2, mscene=90, fitluma=true, \
  509. blur=2, ranked=true, interlaced=false, extmask=msadi)
  510.  
  511. clp = clp.DeSpot(p1=30, p2=22, pwidth=400, pheight=300, mthres=20, merode=33, p1percent=10, sign=1, show=Show, seg=2, \
  512. color=true, motpn=true, extmask=msadi)
  513.  
  514. clp = clp.DeSpot(sign=2, pwidth=Width2, pheight=Height2, p1=10, p2=6, mthres=8, tsmooth=4, seg=2, blur=4, p1percent=2, \
  515. show=Show, extmask=msadi)
  516.  
  517. clp = clp.DeSpot(p1=30, p2=15, pwidth=Width2, pheight=Height2, mthres=20, motpn=true, dilate=1, seg=1, show=Show, \
  518. extmask=msadi)
  519.  
  520. clp = clp.DeSpot(p1=30, p2=10, mthres=45, pwidth=Width2, pheight=Height2, minpts=10, dilate=0, ranked=true, \
  521. p1percent=5, mscene=98, merode=35, mwidth=20, mheight=10, sign=2, show=Show, seg=0, color=true, \
  522. motpn=true, fitluma=true, blur=1, extmask=msadi)
  523.  
  524. clp = clp.DeSpot(p1=25, p2=14, mthres=25, pwidth=Width2, pheight=Height2, minpts=3, dilate=3, p1percent=5, \
  525. mscene=98, merode=35, sign=-2, show=Show, seg=2, color=true, motpn=true, fitluma=true, blur=1, \
  526. extmask=msadi)
  527.  
  528. clp = clp.Despot(p1=28, p2=8, mthres=45, pwidth=850, pheight=850, minpts=10, dilate=0, ranked=true, p1percent=5, mscene=98, \
  529. merode=35, mwidth=20, mheight=10, sign=2, show=Show, seg=0, color=true, motpn=true, fitluma=true, blur=1, \
  530. mark_v=255, extmask=msadi)
  531.  
  532. clp = clp.Despot(p1=25, p2=14, mthres=25, pwidth=555, pheight=555, minpts=3, dilate=3, p1percent=5, mscene=98, \
  533. merode=35, sign=-2, show=Show, seg=2, color=true, motpn=true, fitluma=true, blur=1, mark_v=255, \
  534. extmask=msadi)
  535.  
  536.  
  537.  
  538.  
  539.  
  540. # big black spots
  541. # clp = clp.DeSpot(sign=1, pwidth=45, pheight=45, p1=15, p2=8, mthres=8, color=true, show=Show, extmask=msadi)
  542.  
  543. # thin white lines
  544. # clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=8, p2=1, mthres=5, show=Show, extmask=msadi)
  545.  
  546. # thick hair lines (avoid real hair)
  547. # clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=15, p2=13, mthres=13, merode=24, show=Show, extmask=msadi)
  548.  
  549. # lines contacting motion, avoid motion areas
  550. # clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=15, p2=13, mthres=13, merode=16, seg=1, show=Show, extmask=msadi)
  551.  
  552. # small dots and dust
  553. # clp = clp.DeSpot(pwidth=6, pheight=5, p1=15, p2=8, mthres=12, tsmooth=2, show=Show, extmask=msadi)
  554.  
  555. # Long horizontal scratches
  556. # clp = clp.DeSpot(sign=-1, pwidth=100, pheight=2, p1=15, p2=8, mthres=12, color=true, show=Show, extmask=msadi)
  557.  
  558. # Small compact spots
  559. # clp = clp.DeSpot(sign=-1, pwidth=10, pheight=10, p1=15, p2=8, mthres=12, color=true, show=Show, extmask=msadi)
  560.  
  561.  
  562.  
  563.  
  564.  
  565. clp = (Vectors == 1) ? SelectEvery(clp, 3, 1) : \
  566. (Vectors == 2) ? SelectEvery(clp, 5, 2) : \
  567. SelectEvery(clp, 7, 3)
  568.  
  569. return clp
  570. }
  571. # =============================================================================
  572. #
  573. # DeSpot() function
  574. #
  575. function RemoveSpotsMC5(clip clp, int "Vectors", int "Show")
  576. {
  577. Vectors = Default(Vectors, 1)
  578. Show = Default(Show, 0)
  579.  
  580. Vectors = (Vectors < 1) ? 1 : (Vectors > 3) ? 3 : Vectors
  581. Show = (Show < 0) ? 0 : (Show > 2) ? 2 : Show
  582.  
  583. d = clp.DePanEstimate(trust=3, range=1)
  584. clp = clp.DePanInterleave(data=d, prev=Vectors, next=Vectors)
  585.  
  586.  
  587. # ==== ??????? ?????? ????? ====
  588. clp = clp.DeSpot(mthres=8, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, p1=15, p2=8, \
  589. pwidth=50, pheight=50, ranked=true, sign=1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
  590. blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=2, color=true, mscene=40, minpts=0)
  591.  
  592. # ==== ??????? ????? ????? ====
  593. clp = clp.DeSpot(p1=10, mthres=8, p2=6, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, \
  594. pwidth=100, pheight=100, ranked=true, sign=-1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
  595. blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=0, color=true, mscene=40, minpts=0)
  596.  
  597. # ==== ????????? ????? ? ???? ====
  598. clp = clp.DeSpot(mthres=12, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, p1=15, p2=8, \
  599. pwidth=6, pheight=5, ranked=true, sign=0, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
  600. blur=1, tsmooth=2, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0)
  601.  
  602. clp = clp.DeSpot(mthres=8, mwidth=7, mheight=5, merode=25, interlaced=false, median=false, p1=10, p2=6, \
  603. pwidth=720, pheight=576, ranked=true, sign=2, maxpts=0, p1percent=2, dilate=1, fitluma=true, \
  604. blur=4, tsmooth=4, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0)
  605.  
  606. # ==== ????????? ?????????? ????? ====
  607. clp = clp.DeSpot(mthres=12, mwidth=7, mheight=5, merode=25, interlaced=false, median=false, p1=15, p2=8, \
  608. pwidth=10, pheight=10, ranked=true, sign=-1, maxpts=0, p1percent=2, dilate=1, fitluma=true, \
  609. blur=4, tsmooth=4, show=Show, mark_v=255, motpn=false, seg=2, color=true, mscene=40, minpts=0)
  610.  
  611. # ==== ?????, ???????? ? ??????? ? ?????????, ???????? ??????? ???????? ====
  612. clp = clp.DeSpot(mthres=13, mwidth=7, mheight=5, merode=16, interlaced=false, median=false, p1=15, p2=13, \
  613. pwidth=140, pheight=100, ranked=true, sign=-1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
  614. blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0)
  615.  
  616.  
  617.  
  618. # ====================================
  619. clp = clp.DeSpot(p1=20, p2=4, pwidth=200, pheight=150, mthres=22, merode=33, sign=2, show=Show, seg=0, color=false, \
  620. motpn=true, fitluma=true, mark_v=255)
  621.  
  622. clp = clp.DeSpot(p1=20, p2=12, pwidth=768, pheight=576, mthres=80, merode=33, sign=0, show=Show, seg=0, color=true, \
  623. motpn=true, mark_v=255)
  624.  
  625. clp = clp.DeSpot(p1=12, p2=22, pwidth=100, pheight=100, mthres=22, merode=25, p1percent=10, sign=0, show=Show, seg=1, \
  626. color=true, motpn=true, mark_v=255)
  627.  
  628. clp = clp.DeSpot(p1=15, p2=1, pwidth=40, pheight=40, mthres=4, merode=25, p1percent=10, sign=0, show=Show, seg=1, \
  629. color=true, motpn=true, mark_v=255)
  630.  
  631. clp = clp.DeSpot(p1=35, p2=11, pwidth=250, pheight=250, mthres=23, merode=40, p1percent=1, sign=1, show=Show, seg=2,\
  632. color=true, motpn=false, minpts=6, dilate=1, mscene=100, fitluma=true, blur=1, mark_v=255)
  633.  
  634. clp = clp.DeSpot(p1=22, p2=5, pwidth=100, pheight=140, mthres=11, merode=58, p1percent=25, sign=1, show=Show, seg=1, \
  635. color=true, motpn=false, minpts=6, maxpts=1200, mwidth=7, mheight=5, dilate=2, mscene=90, fitluma=true, \
  636. blur=2, ranked=true, interlaced=false, mark_v=255)
  637.  
  638. clp = clp.DeSpot(p1=30, p2=22, pwidth=400, pheight=300, mthres=20, merode=33, p1percent=10, sign=1, show=Show, seg=2, \
  639. color=true, motpn=true, mark_v=255)
  640.  
  641. clp = clp.DeSpot(sign=2, pwidth=Width2, pheight=Height2, p1=10, p2=6, mthres=8, tsmooth=4, seg=2, blur=4, p1percent=2, \
  642. show=Show)
  643.  
  644. clp = clp.DeSpot(p1=30, p2=15, pwidth=Width2, pheight=Height2, mthres=20, motpn=true, dilate=1, seg=1, show=Show)
  645.  
  646. clp = clp.DeSpot(sign=2, pwidth=Width2, pheight=Height2, p1=10, p2=6, mthres=8, tsmooth=4, seg=2, blur=4, p1percent=2, \
  647. show=Show, mark_v=255)
  648.  
  649. clp = clp.DeSpot(p1=30, p2=15, pwidth=Width2, pheight=Height2, mthres=20, motpn=true, dilate=1, seg=1, show=Show, mark_v=255)
  650.  
  651. clp = clp.DeSpot(p1=30, p2=10, mthres=45, pwidth=Width2, pheight=Height2, minpts=10, dilate=0, ranked=true, \
  652. p1percent=5, mscene=98, merode=35, mwidth=20, mheight=10, sign=2, show=Show, seg=0, color=true, \
  653. motpn=true, fitluma=true, blur=1, mark_v=255)
  654.  
  655. clp = clp.DeSpot(p1=25, p2=14, mthres=25, pwidth=Width2, pheight=Height2, minpts=3, dilate=3, p1percent=5, \
  656. mscene=98, merode=35, sign=-2, show=Show, seg=2, color=true, motpn=true, fitluma=true, blur=1, mark_v=255)
  657.  
  658. clp = clp.Despot(p1=28, p2=8, mthres=45, pwidth=850, pheight=850, minpts=10, dilate=0, ranked=true, p1percent=5, mscene=98, \
  659. merode=35, mwidth=20, mheight=10, sign=2, show=Show, seg=0, color=true, motpn=true, fitluma=true, blur=1, \
  660. mark_v=255)
  661.  
  662. clp = clp.Despot(p1=25, p2=14, mthres=25, pwidth=555, pheight=555, minpts=3, dilate=3, p1percent=5, mscene=98, \
  663. merode=35, sign=-2, show=Show, seg=2, color=true, motpn=true, fitluma=true, blur=1, mark_v=255)
  664.  
  665.  
  666.  
  667.  
  668.  
  669. # big black spots
  670. # clp = clp.DeSpot(sign=1, pwidth=45, pheight=45, p1=15, p2=8, mthres=8, color=true, show=Show)
  671.  
  672. # thin white lines
  673. # clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=8, p2=1, mthres=5, show=Show)
  674.  
  675. # thick hair lines (avoid real hair)
  676. # clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=15, p2=13, mthres=13, merode=24, show=Show)
  677.  
  678. # lines contacting motion, avoid motion areas
  679. # clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=15, p2=13, mthres=13, merode=16, seg=1, show=Show)
  680.  
  681. # small dots and dust
  682. # clp = clp.DeSpot(pwidth=6, pheight=5, p1=15, p2=8, mthres=12, tsmooth=2, show=Show)
  683.  
  684. # Long horizontal scratches
  685. # clp = clp.DeSpot(sign=-1, pwidth=100, pheight=2, p1=15, p2=8, mthres=12, color=true, show=Show)
  686.  
  687. # Small compact spots
  688. # clp = clp.DeSpot(sign=-1, pwidth=10, pheight=10, p1=15, p2=8, mthres=12, color=true, show=Show)
  689.  
  690.  
  691.  
  692.  
  693.  
  694. clp = (Vectors == 1) ? SelectEvery(clp, 3, 1) : \
  695. (Vectors == 2) ? SelectEvery(clp, 5, 2) : \
  696. SelectEvery(clp, 7, 3)
  697.  
  698. return clp
  699. }
Advertisement
Add Comment
Please, Sign In to add comment