Advertisement
Guest User

Untitled

a guest
Jan 17th, 2015
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. setmemorymax(512)
  2. setmtmode(5,6)
  3. ImageSource("raw.png",start=0,end=0)
  4. RatioResize(320.0,"adjust2w",kernel="point")
  5. r = ShowRed("YV12")
  6. g = ShowGreen("YV12")
  7. b = ShowBlue("YV12")
  8. interleave(r,g,b)
  9. raw=last
  10. ImageSource("Dogway approach.png",start=0,end=0)
  11. RatioResize(320.0,"adjust2w",kernel="point")
  12. r = ShowRed("YV12")
  13. g = ShowGreen("YV12")
  14. b = ShowBlue("YV12")
  15. interleave(r,g,b)
  16. blurred=last
  17. ImageSource("gdapt.png",start=0,end=0) # using settings as 0:2:1:0
  18. RatioResize(320.0,"adjust2w",kernel="point")
  19. r = ShowRed("YV12")
  20. g = ShowGreen("YV12")
  21. b = ShowBlue("YV12")
  22. interleave(r,g,b)
  23. gdapt=last
  24. setmtmode(2,6)
  25.  
  26. # get difference of both approaches
  27. mt_lutxy(blurred,gdapt," x y - abs",u=-128,v=-128)
  28. # ensure we always get the highest change regardless of plane
  29. mt_logic(mt_logic(SelectEvery (3, 0), SelectEvery (3, 1),"max"),SelectEvery (3, 2),"max")
  30. # cleaning 1px dots
  31. removegrain(1)
  32. # strengthen the mask
  33. mt_binarize(25,u=-128,v=-128) # sames as mt_lut(yexpr=" x 25 > 255 0 ?")
  34.  
  35. # mix my original approach with source using the diff of gdapt/blurred as a mask
  36. mt_merge(raw,blurred,last.invert,luma=true)
  37.  
  38. mergergb(SelectEvery (3, 0), SelectEvery (3, 1), SelectEvery (3, 2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement