TCannyMod

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (GBlur: cosmetics)
(update documentation to coincide with v0.2.0)
Line 3: Line 3:
 
{{Filter3
 
{{Filter3
 
| {{Author/Chikuzen}}
 
| {{Author/Chikuzen}}
| v0.1.1
+
| v0.2.0
|[http://www.mediafire.com/download/47owuwpg5mgn6z2/tcannymod-0.1.1.zip tcannymod-0.1.1.zip]
+
|[http://github.com/chikuzen/TCannyMod/releases/download/0.2.0/tcannymod-0.2.0.zip tcannymod-0.2.0.zip]
 
| Edge Detection  
 
| Edge Detection  
 
| [http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
 
| [http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
Line 10: Line 10:
 
<br>
 
<br>
 
== Description ==
 
== Description ==
<tt>TCannyMod</tt> is a Canny edge detection filter. It's based on [[tcanny]] written by Kevin Stone (a.k.a. tritical) but rewritten from scratch exclusively for AviSynth 2.6.<br>
+
<tt>TCannyMod</tt> is a Canny edge detection filter. It's based on <tt>[[tcanny]]</tt> written by Kevin Stone (a.k.a. tritical) but rewritten from scratch exclusively for AviSynth 2.6.<br>
 
<br>
 
<br>
  
 
== Requirements ==
 
== Requirements ==
 
* [http://sourceforge.net/projects/avisynth2/ AviSynth 2.6.0] or greater
 
* [http://sourceforge.net/projects/avisynth2/ AviSynth 2.6.0] or greater
 +
* x64 version requires [http://forum.doom9.org/showthread.php?t=168856 AviSynth+ r1576] or greater
 
* Supported color formats: [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]
 
* Supported color formats: [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]
 
<br>
 
<br>
 
* [[SSE2]] capable CPU
 
* [[SSE2]] capable CPU
* [http://www.microsoft.com/en-us/download/details.aspx?id=8328 Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)]
+
* [http://www.microsoft.com/en-us/download/details.aspx?id=40784 Microsoft Visual C++ 2013 Redistributable Package (x86 / x64)]
 +
:<span style="color:red">***</span> <tt>vcredist_x86.exe</tt> required for <tt>TCannyMod-x86</tt>
 +
:<span style="color:red">***</span> <tt>vcredist_x64.exe</tt> required for <tt>TCannyMod-x64</tt>
 
<br>
 
<br>
  
Line 27: Line 30:
 
<br>
 
<br>
 
<br>
 
<br>
:{{Template:FuncDef|TCannyMod (clip, int "mode", float "sigma", float "t_h", float "t_l", bool "sobel", int "chroma")}}
+
:{{Template:FuncDef|TCannyMod (clip, int "mode", float "sigma", float "t_h", float "t_l", bool "sobel", int "chroma", float "gmmax")}}
 
<br>
 
<br>
 
::{{Par2| |clip| }}
 
::{{Par2| |clip| }}
Line 64: Line 67:
 
:::*2 : copy from input clip.
 
:::*2 : copy from input clip.
 
:::*3 : fill with 0x80(128), output is grayscale.
 
:::*3 : fill with 0x80(128), output is grayscale.
 +
<br>
 +
::{{Par2|gmmax|float|255.0}}
 +
:::Used for scaling gradient magnitude into [0,255] for {{Template:FuncDef3|mode}}=1.
 +
:::{{Template:FuncDef3|gmmax}} is internally set to 1.0 if you set it to < 1.0.
 
<br>
 
<br>
 
-------------
 
-------------
Line 93: Line 100:
 
{{Template:FuncDef3|TCannyMod}} with default settings:
 
{{Template:FuncDef3|TCannyMod}} with default settings:
 
  [[AviSource]]("blah.avi")
 
  [[AviSource]]("blah.avi")
  TCannyMod (mode=0, sigma=1.5, t_h=8.0, t_l=1.0, sobel=false, chroma=0)
+
  TCannyMod (mode=0, sigma=1.5, t_h=8.0, t_l=1.0, sobel=false, chroma=0, gmmax=255.0)
 
<br>
 
<br>
 
{{Template:FuncDef3|GBlur}} with default settings:
 
{{Template:FuncDef3|GBlur}} with default settings:
Line 101: Line 108:
 
== Changelog ==
 
== Changelog ==
 
  Version      Date            Changes<br>
 
  Version      Date            Changes<br>
 +
v0.2.0      09/13/2015      - add option "gmmax"
 +
                              - update avisynth.h
 +
                              - VS2010 to VS2013 and code cosmetics<br>
 
  v0.1.1      08/21/2013      - fix crash when sigma is too large
 
  v0.1.1      08/21/2013      - fix crash when sigma is too large
 
                               - add new argument 'sobel'
 
                               - add new argument 'sobel'
Line 114: Line 124:
 
!!width="150px"| Source code
 
!!width="150px"| Source code
 
!!width="150px"| Mirror
 
!!width="150px"| Mirror
 +
|-
 +
!v0.2.0
 +
|[http://github.com/chikuzen/TCannyMod/releases/download/0.2.0/tcannymod-0.2.0.zip tcannymod-0.2.0.zip]
 +
|
 
|-
 
|-
 
!v0.1.1
 
!v0.1.1
 
|[http://www.mediafire.com/download/47owuwpg5mgn6z2/tcannymod-0.1.1.zip tcannymod-0.1.1.zip]
 
|[http://www.mediafire.com/download/47owuwpg5mgn6z2/tcannymod-0.1.1.zip tcannymod-0.1.1.zip]
|[http://codeload.github.com/chikuzen/TCannyMod/zip/master TCannyMod-master.zip]
+
|
 
|
 
|
 
|}
 
|}

Revision as of 18:01, 13 September 2015


Abstract
Author Chikuzen
Version v0.2.0
Download tcannymod-0.2.0.zip
Category Edge Detection
License GPLv2
Discussion Doom9 Thread


Contents

Description

TCannyMod is a Canny edge detection filter. It's based on tcanny written by Kevin Stone (a.k.a. tritical) but rewritten from scratch exclusively for AviSynth 2.6.

Requirements


*** vcredist_x86.exe required for TCannyMod-x86
*** vcredist_x64.exe required for TCannyMod-x64


Syntax and Parameters


TCannyMod

Builds an edge map using Canny edge detection.

TCannyMod (clip, int "mode", float "sigma", float "t_h", float "t_l", bool "sobel", int "chroma", float "gmmax")


clip   =
Input clip; only planar formats are supported.


int  mode = 0
Sets the output format:
  • 0 : thresholded edge map (255 for edge, 0 for non-edge)
  • 1 : gradient magnitude map.
  • 2 : edge pixel only gradient direction map (non-edge pixels set to 0)
  • 3 : gradient direction map
Gradient direction are normalized to 1, 3, 7 and 15.
1 = horizontal
3 = 45' up
7 = vertical
15 = 45' down
  • 4 : Gaussian blurred frame.


float  sigma = 1.5
Standard deviation of Gaussian blur. 0 means no blurring before edge detection.
(0 <= sigma <= 2.83, default = 1.5)


float  t_h = 8.0
float  t_l = 1.0
High and low gradient magnitude threshold for hysteresis; t_h must be greater than t_l.


bool  sobel = false
If set to true, edge detection will use a Sobel operator instead of [1, 0, -1].


int  chroma = 0
Chroma processing:
  • 0 : do not process
  • 1 : process
  • 2 : copy from input clip.
  • 3 : fill with 0x80(128), output is grayscale.


float  gmmax = 255.0
Used for scaling gradient magnitude into [0,255] for mode=1.
gmmax is internally set to 1.0 if you set it to < 1.0.




GBlur

Gaussian blur filter. Just an alias for TCannyMod(mode=4).

GBlur (clip, float "sigma", int "chroma")


clip   =
Input clip; only planar formats are supported.


float  sigma = 0.5
Standard deviation of Gaussian blur. 0 means no blurring before edge detection.
(0 <= sigma <= 2.83, default = 0.5)


int  chroma = 1
Chroma processing:
  • 0 : do not process
  • 1 : process
  • 2 : copy from input clip.
  • 3 : fill with 0x80(128), output is grayscale.


Examples

TCannyMod with default settings:

AviSource("blah.avi")
TCannyMod (mode=0, sigma=1.5, t_h=8.0, t_l=1.0, sobel=false, chroma=0, gmmax=255.0)


GBlur with default settings:

AviSource("blah.avi")
GBlur (sigma=0.5, chroma=1)


Changelog

Version      Date            Changes
v0.2.0 09/13/2015 - add option "gmmax" - update avisynth.h - VS2010 to VS2013 and code cosmetics
v0.1.1 08/21/2013 - fix crash when sigma is too large - add new argument 'sobel' - add new function 'GBlur'
v0.1.0 08/017/2013 - Initial release


Archived Downloads

Version Download Source code Mirror
v0.2.0 tcannymod-0.2.0.zip
v0.1.1 tcannymod-0.1.1.zip


External Links




Back to External Filters

Personal tools