Quantcast Removeborders Filter for Avisynth [Readme] - digitalFAQ.com Forums [Archives]
  #1  
10-28-2012, 08:04 AM
kvcd.net Archives's Avatar
kvcd.net Archives kvcd.net Archives is offline
Free Member
 
Join Date: May 2012
Posts: 84
Thanks: 0
Thanked 1 Time in 1 Post
RemoveBorders - An Avisynth filter for removing black borders

By Ross Thomas <ross@grinfinity.com>

There is no copyright on this code, and there are no conditions on its distribution or use. Do with it what you will.

We all know (and, possibly, love) the AddBorders filter. Here's its conceptual opposite: instead of adding black borders to the clip, this filter removes existing black borders. It's as simple as that.

In order to more accurately determine what is a border and what isn't, RemoveBorders looks at a number of sample frames spread throughout the clip. It then uses the most common values it saw for each edge (i.e. the modal average) and crops the frame correspondingly.

Usage
Code:
RemoveBorders(clip clip, int luma_threshold, int samples, int round_width, int round_height)
ParameterMeaningDefault
clipSpecifies the clip to affect.last
luma_thresholdPixels on the edges of the frame within this threshold will be considered part of the border. Any pixel above this threshold means "the border ends here".60
samplesSpecifies the number of sample frames to inspect while determining border sizes. Since this is done upon initialization, using too high a number can cause a significant delay before the clip starts playing.5
round_width, round_heightThe filter will ensure that the final width and height of the frame are multiples of these values.4

Known Issues
- No Avisynth 2.5/YV12 version yet. That's coming next release.
- No MMX optimization. The YUY2 version doesn't really need it, but the YV12 version will.

To-Do
- A "show" mode to display pre- and post-processing frame size, detected borders, etc.
- Perhaps add FitCD-esque functionality.

History
- 0.1 - First release. Alpha code. Danger, Will Robinson!

Download here: SansGrip's Avisynth Filters [DOWNLOADS]
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
RangeInfo Filter for Avisynth [Readme] kvcd.net Archives Avisynth Scripting 0 11-25-2012 09:07 PM
LegalClip Filter for Avisynth [Readme] kvcd.net Archives Avisynth Scripting 0 11-25-2012 09:03 PM
Blockbuster Filter for Avisynth [Readme] kvcd.net Archives Avisynth Scripting 0 11-25-2012 07:38 PM
NoMoSmooth Filter for Avisynth [Readme] kvcd.net Archives Avisynth Scripting 0 11-25-2012 07:00 PM
Sampler filter for Avisynth [Readme] kvcd.net Archives Avisynth Scripting 0 11-25-2012 06:24 PM

Thread Tools



 
All times are GMT -5. The time now is 02:37 PM  —  vBulletin © Jelsoft Enterprises Ltd