<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://avisynth.nl/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://avisynth.nl/index.php?action=history&amp;feed=atom&amp;title=MaskTools%2FDEdgeMask</id>
		<title>MaskTools/DEdgeMask - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://avisynth.nl/index.php?action=history&amp;feed=atom&amp;title=MaskTools%2FDEdgeMask"/>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=MaskTools/DEdgeMask&amp;action=history"/>
		<updated>2026-04-07T20:47:28Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.24</generator>

	<entry>
		<id>http://avisynth.nl/index.php?title=MaskTools/DEdgeMask&amp;diff=161&amp;oldid=prev</id>
		<title>Admin: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=MaskTools/DEdgeMask&amp;diff=161&amp;oldid=prev"/>
				<updated>2013-05-09T15:01:59Z</updated>
		
		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 15:01, 9 May 2013&lt;/td&gt;
			&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php?title=MaskTools/DEdgeMask&amp;diff=160&amp;oldid=prev</id>
		<title>Gzarkadas: New page: {{FilterCat|External_filters|Other_filters|Support_filters}}  {{Func2Def|DEdgeMask (clip[, int &quot;thY1&quot;[, int &quot;thY2&quot;[, int &quot;thC1&quot;[, int &quot;thC2&quot;[, string &quot;matrix&quot;[, float &quot;divisor&quot;[, bool &quot;set...</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=MaskTools/DEdgeMask&amp;diff=160&amp;oldid=prev"/>
				<updated>2008-02-28T13:58:18Z</updated>
		
		<summary type="html">&lt;p&gt;New page: {{FilterCat|External_filters|Other_filters|Support_filters}}  {{Func2Def|DEdgeMask (clip[, int &amp;quot;thY1&amp;quot;[, int &amp;quot;thY2&amp;quot;[, int &amp;quot;thC1&amp;quot;[, int &amp;quot;thC2&amp;quot;[, string &amp;quot;matrix&amp;quot;[, float &amp;quot;divisor&amp;quot;[, bool &amp;quot;set...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{FilterCat|External_filters|Other_filters|Support_filters}}&lt;br /&gt;
&lt;br /&gt;
{{Func2Def|DEdgeMask (clip[, int &amp;quot;thY1&amp;quot;[, int &amp;quot;thY2&amp;quot;[, int &amp;quot;thC1&amp;quot;[, int &amp;quot;thC2&amp;quot;[, string &amp;quot;matrix&amp;quot;[, float &amp;quot;divisor&amp;quot;[, bool &amp;quot;setdivisor&amp;quot;[, bool &amp;quot;vmode&amp;quot;]]]]]]]])&lt;br /&gt;
|DEdgeMask2 (clip source, clip low_thres, clip high_thres[, string &amp;quot;matrix&amp;quot;[, float &amp;quot;divisor&amp;quot;[, bool &amp;quot;setdivisor&amp;quot;[, bool &amp;quot;vmode&amp;quot;]]]])}}&lt;br /&gt;
&lt;br /&gt;
'''Plugin''': [[MaskTools]]&lt;br /&gt;
&lt;br /&gt;
'''DEdgeMask''' creates an edge mask of the picture. The edge-finding algorithm uses a convolution kernel, and the result of the convolution is then thresholded with &amp;lt;tt&amp;gt;thY1&amp;lt;/tt&amp;gt; and  &amp;lt;tt&amp;gt;thY2&amp;lt;/tt&amp;gt; (luma) and &amp;lt;tt&amp;gt;thC1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;thC2&amp;lt;/tt&amp;gt; (chroma). The thresholding happens like that (r is the result of the convolution):&lt;br /&gt;
&lt;br /&gt;
* r &amp;lt;= th1 gives 0.&lt;br /&gt;
* th1 &amp;lt; r &amp;lt;= th2 gives r.&lt;br /&gt;
* th2 &amp;lt; r gives 255.&lt;br /&gt;
&lt;br /&gt;
In order to create a binary mask, you just have to set th1=th2.&lt;br /&gt;
&lt;br /&gt;
The choice of the convolution kernel is done with &amp;lt;tt&amp;gt;matrix&amp;lt;/tt&amp;gt;. The &amp;lt;tt&amp;gt;matrix&amp;lt;/tt&amp;gt; must be a 3 by 3 matrix, whose coefficients are integers, separated by a single space. Hence, the strings &amp;quot;-1 -1 -1 -1 8 -1 -1 -1 -1&amp;quot; and &amp;quot;0 -1 0 -1 0 1 0 1 0&amp;quot; will respectively give the kernels &amp;quot;laplace&amp;quot; and &amp;quot;sobel&amp;quot; of the filter [[MaskTools/EdgeMask|EdgeMask]].&lt;br /&gt;
&lt;br /&gt;
As coefficients must be integers, &amp;lt;tt&amp;gt;divisor&amp;lt;/tt&amp;gt; is used to refine the result of the convolution. This result will simply be divided by &amp;lt;tt&amp;gt;divisor&amp;lt;/tt&amp;gt;. If &amp;lt;tt&amp;gt;divisor&amp;lt;/tt&amp;gt; isn't defined, it is defaulted to the sum of the positive coefficients of the matrix, thus allowing a classic normalization. It can be either a float or an integer, the later being the faster.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;setdivisor&amp;lt;/tt&amp;gt; is present only for backward compatibility. Do not use it.&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;tt&amp;gt;vmode&amp;lt;/tt&amp;gt; allows to output a mask centered to 128 instead of zero. &lt;br /&gt;
&lt;br /&gt;
Defaults are:&lt;br /&gt;
* &amp;lt;tt&amp;gt;thY1&amp;lt;/tt&amp;gt; = 0, &amp;lt;tt&amp;gt;thY2&amp;lt;/tt&amp;gt; = 20, &lt;br /&gt;
* &amp;lt;tt&amp;gt;thC1&amp;lt;/tt&amp;gt; = 0, &amp;lt;tt&amp;gt;thC2&amp;lt;/tt&amp;gt; = 20, &lt;br /&gt;
* &amp;lt;tt&amp;gt;matrix&amp;lt;/tt&amp;gt; = &amp;quot;-1 -1 -1 -1 8 -1 -1 -1 -1&amp;quot; &lt;br /&gt;
* &amp;lt;tt&amp;gt;vmode&amp;lt;/tt&amp;gt; = false.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''DEdgeMask2''' basically works like DEdgeMask, except that instead of 2 low / high thresholds, it takes 2 other clips. Each clip contains local thresholds for each pixel. &lt;br /&gt;
&lt;br /&gt;
Let's say you want adaptive thresholds taking local contrast into account. Well, local min &amp;amp; max can be obtained through [[MaskTools/Inpand|inpand()]] and [[MaskTools/Expand|expand()]]. Difference can be made with [[MaskTools/YV12LUTxy|YV12LUTxy]] or [[MaskTools/YV12Subtract|YV12Subtract]]. And voilΰ, you've got a threshold clip containing local contrasts.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Back to [[MaskTools]].&lt;/div&gt;</summary>
		<author><name>Gzarkadas</name></author>	</entry>

	</feed>