<?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=MaskTools2%2Fmt_hysteresis</id>
		<title>MaskTools2/mt hysteresis - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://avisynth.nl/index.php?action=history&amp;feed=atom&amp;title=MaskTools2%2Fmt_hysteresis"/>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=MaskTools2/mt_hysteresis&amp;action=history"/>
		<updated>2026-04-25T12:46:48Z</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=MaskTools2/mt_hysteresis&amp;diff=12477&amp;oldid=prev</id>
		<title>Reel.Deal: mt_hysteresis: add docs</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=MaskTools2/mt_hysteresis&amp;diff=12477&amp;oldid=prev"/>
				<updated>2021-12-07T22:17:36Z</updated>
		
		<summary type="html">&lt;p&gt;mt_hysteresis: add docs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{FilterCat4|External_filters|Plugin_functions|Other_filters|Support_filters}}&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[MaskTools2#Filters|MaskTools2]] &amp;amp;larr;'''&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Description ==&lt;br /&gt;
'''mt_hysteresis''' combines masks by growing the small mask into the big mask by connecting components. This makes it possible to build more robust edge masks.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== [[Script variables|Syntax and Parameters]] ==&lt;br /&gt;
:{{Template:FuncDef|mt_hysteresis (clip, clip, float &amp;quot;Y&amp;quot;, float &amp;quot;U&amp;quot;, float &amp;quot;V&amp;quot;, string &amp;quot;chroma&amp;quot;, int &amp;quot;offX&amp;quot;, int &amp;quot;offY&amp;quot;, int &amp;quot;w&amp;quot;, int &amp;quot;h&amp;quot;, int &amp;quot;sse2&amp;quot;, bool &amp;quot;sse3&amp;quot;, bool &amp;quot;ssse3&amp;quot;, bool &amp;quot;sse4&amp;quot;, bool &amp;quot;avx&amp;quot;, bool &amp;quot;avx2&amp;quot;, float &amp;quot;A&amp;quot;, string &amp;quot;alpha&amp;quot;)}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
:::Input clip one.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
:::Input clip two.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|Y|float|3}}&lt;br /&gt;
::{{Par2|U|float|1}}&lt;br /&gt;
::{{Par2|V|float|1}}&lt;br /&gt;
::{{Par2|A|float|1}}&lt;br /&gt;
:::These three values describe the actual processing mode that is to be used on each plane / channel. Here is how the modes are coded :&lt;br /&gt;
::::*x = -255...0 : all the pixels of the plane will be set to -x.&lt;br /&gt;
::::*x = 1 : the plane will not be processed. That means the content of the plane after the filter is pure garbage.&lt;br /&gt;
::::*x = 2 : the plane of the first input clip will be copied.&lt;br /&gt;
::::*x = 3 : the plane will be processed with the processing the filter is designed to do.&lt;br /&gt;
::::*x = 4 : the plane of the second input clip will be copied.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|chroma|string|&amp;quot;&amp;quot;}}&lt;br /&gt;
::{{Par2|alpha|string|&amp;quot;&amp;quot;}}&lt;br /&gt;
:::When defined, the value contained in this string will overwrite the {{Template:FuncDef3|U}} and {{Template:FuncDef3|V}} processing modes.&lt;br /&gt;
:::This is a nice addition proposed by mg262 that makes the filter more user friendly. Allowed values for chroma are:&lt;br /&gt;
::::*&amp;quot;process&amp;quot; : set u = v = 3.&lt;br /&gt;
::::*&amp;quot;copy&amp;quot; or &amp;quot;copy first&amp;quot; : set u = v = 2.&lt;br /&gt;
::::*&amp;quot;copy second&amp;quot; : set u = v = 4.&lt;br /&gt;
::::*&amp;quot;xxx&amp;quot;, where xxx is a number : set u = v = -xxx.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|offX|int|0}}&lt;br /&gt;
::{{Par2|offY|int|0}}&lt;br /&gt;
:::{{Template:FuncDef3|offX}} and {{Template:FuncDef3|offY}} are the top left coordinates of the box where the actual processing shall occur. Everything outside that box will be garbage.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|w|int|-1}}&lt;br /&gt;
::{{Par2|h|int|-1}}&lt;br /&gt;
:::{{Template:FuncDef3|w}} and {{Template:FuncDef3|h}} are the width and height of the processed box. -1 means that the box extends to the lower right corner of the video. That also means that default settings are meant to process the whole picture.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Examples ==&lt;br /&gt;
mt_hysteresis  with default settings:&lt;br /&gt;
 mask1 = last.mt_edge(thY1=30, thY2=30)&lt;br /&gt;
 mask2 = last.mt_edge(thY1=5, thY2=5)&amp;lt;br&amp;gt;&lt;br /&gt;
 mt_hysteresis(mask1, mask2, Y=3, U=1, V=1, chroma=&amp;quot;&amp;quot;, w=-1, h=-1)&lt;br /&gt;
See these threads for more examples:&lt;br /&gt;
*[https://forum.doom9.org/showthread.php?t=163516 Remove isolated dots in a mask] &lt;br /&gt;
*[https://forum.doom9.org/showthread.php?t=128458 Use spots from one mask to select spots on another mask]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[MaskTools2#Filters|MaskTools2]] &amp;amp;larr;'''&lt;br /&gt;
-----------------------------------------------&lt;/div&gt;</summary>
		<author><name>Reel.Deal</name></author>	</entry>

	</feed>