]> granicus.if.org Git - imagemagick/blob - www/api/morphology.html
(no commit message)
[imagemagick] / www / api / morphology.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
2   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html version="-//W3C//DTD XHTML 1.1//EN"
4       xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
5       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6       xsi:schemaLocation="http://www.w3.org/1999/xhtml
7                           http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
8 <head>
9   <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
10   <meta name="google-site-verification" content="MxsMq6bdLOx0KSuz1MY6yG9ZTIJ7_7DVRfl5NCAT5Yg"/>
11   <title>ImageMagick: MagickCore, C API for ImageMagick: Morphological Erosions, Dilations, Openings, and Closings</title>
12   <meta http-equiv="content-language" content="en-US"/>
13   <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
14   <meta http-equiv="reply-to" content="magick-users@imagemagick.org"/>
15   <meta name="application-name" content="ImageMagick"/>
16   <meta name="description" content="Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats.  In addition resize, rotate, shear, distort and transform images automagically."/>
17   <meta name="application-url" content="http://www.imagemagick.org"/>
18   <meta name="generator" content="PHP"/>
19   <meta name="keywords" content="magickcore, c, api, for, imagemagick:, morphological, erosions, dilations, openings, closings, ImageMagick, PerlMagick, image processing, OpenMP, software development library, image, photo, software, Magick++, MagickWand"/>
20   <meta name="rating" content="GENERAL"/>
21   <meta name="robots" content="INDEX, FOLLOW"/>
22   <meta name="generator" content="ImageMagick Studio LLC"/>
23   <meta name="author" content="ImageMagick Studio LLC"/>
24   <meta name="revisit-after" content="2 DAYS"/>
25   <meta name="resource-type" content="document"/>
26   <meta name="copyright" content="Copyright (c) 1999-2013 ImageMagick Studio LLC"/>
27   <meta name="distribution" content="Global"/>
28   <link rel="icon" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../images/wand.png"/>
29   <link rel="shortcut icon" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../images/wand.ico"  type="images/x-icon"/>
30   <link rel="canonical" href="http://www.imagemagick.org" />
31   <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"/>
32   <!-- Add jQuery library -->
33   <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
34   
35   <!-- Optionaly include easing and/or mousewheel plugins -->
36   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/jquery.easing-1.3.pack.js"></script>
37   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/jquery.mousewheel-3.0.6.pack.js"></script>
38   
39   <!-- Add fancyBox -->
40   <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/jquery.fancybox.css?v=2.0.4" type="text/css" media="screen" />
41   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/jquery.fancybox.pack.js?v=2.0.4"></script>
42   
43   <!-- Optionaly include button and/or thumbnail helpers -->
44   <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/helpers/jquery.fancybox-buttons.css?v=2.0.4" type="text/css" media="screen" />
45   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/helpers/jquery.fancybox-buttons.js?v=2.0.4"></script>
46   
47   <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/helpers/jquery.fancybox-thumbs.css?v=2.0.4" type="text/css" media="screen" />
48   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/helpers/jquery.fancybox-thumbs.js?v=2.0.4"></script>
49   <script type="text/javascript">
50         $(document).ready(function() {
51                 $(".fancybox").fancybox();
52         });
53   </script>
54   <!-- ImageMagick style -->
55   <link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css" />
56   <style type="text/css" media="all">
57     @import url("../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/magick.css");
58   </style>
59 </head>
60
61 <body id="www-imagemagick-org">
62 <div class="titlebar">
63 <div style="margin: 17px auto; float: left;">
64   <script type="text/javascript">
65   <!--
66     google_ad_client = "pub-3129977114552745";
67     google_ad_slot = "5439289906";
68     google_ad_width = 728;
69     google_ad_height = 90;
70   //-->
71   </script>
72   <script type="text/javascript"
73     src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
74   </script>
75 </div>
76 <a href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../discourse-server">
77   <img src="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../images/logo.jpg"
78   alt="ImageMagick Logo"
79   style="width: 123px; height: 118px; border: 0px; float: right;" /></a>
80 <a href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../index.html">
81   <img src="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../images/sprite.jpg"
82   alt="ImageMagick Sprite"
83   style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
84 </div>
85
86 <div class="westbar">
87
88 <div class="menu">
89   <a title="About ImageMagick" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../index.html">About ImageMagick</a>
90 </div>
91 <div class="menu">
92   <a title="Binary Releases" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/binary-releases.html">Binary Releases</a>
93 </div>
94 <div class="sub">
95     <a title="Binary Release: Unix" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/binary-releases.html#unix">Unix</a>
96 </div>
97 <div class="sub">
98     <a title="Binary Release: MacOS X" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/binary-releases.html#macosx">Mac OS X</a>
99 </div>
100 <div class="sub">
101     <a title="Binary Release: iOS" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/binary-releases.html#iOS">iOS</a>
102 </div>
103 <div class="sub">
104     <a title="Binary Release: Windows" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/binary-releases.html#windows">Windows</a>
105 </div>
106 <div class="sep"></div>
107 <div class="menu">
108   <a title="Command-line Tools" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/command-line-tools.html">Command-line Tools</a>
109 </div>
110 <div class="sub">
111     <a title="Command-line Tools: Processing" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/command-line-processing.html">Processing</a>
112 </div>
113 <div class="sub">
114     <a title="Command-line Tools: Options" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/command-line-options.html">Options</a>
115 </div>
116 <div class="sub">
117     <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
118 </div>
119 <div class="menu">
120   <a title="Program Interfaces" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/api.html">Program Interfaces</a>
121 </div>
122 <div class="sub">
123     <a title="Program Interface: MagickWand" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/magick-wand.html">MagickWand</a>
124 </div>
125 <div class="sub">
126     <a title="Program Interface: MagickCore" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/magick-core.html">MagickCore</a>
127 </div>
128 <div class="sub">
129     <a title="Program Interface: PerlMagick" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/perl-magick.html">PerlMagick</a>
130 </div>
131 <div class="sub">
132     <a title="Program Interface: Magick++" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/magick++.html">Magick++</a>
133 </div>
134 <div class="sep"></div>
135 <div  class="menu">
136    <a title="Install from Source" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/install-source.html">Install from Source</a>
137 </div>
138 <div class="sub">
139     <a title="Install from Source: Unix" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/install-source.html#unix">Unix</a>
140 </div>
141 <div class="sub">
142     <a title="Install from Source: Windows" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/install-source.html#windows">Windows</a>
143  </div>
144 <div class="menu">
145   <a title="Resources" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/resources.html">Resources</a>
146 </div>
147 <div class="menu">
148   <a title="Architecture" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/architecture.html">Architecture</a>
149 </div>
150 <div class="menu">
151   <a title="Download" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/download.html">Download</a>
152 </div>
153 <div class="sep"></div>
154 <div class="menu">
155   <a title="Search" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/search.html">Search</a>
156 </div>
157 <div class="sep"></div>
158 <div class="menu">
159   <a title="Site Map" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/sitemap.html">Site Map</a>
160 </div>
161 <div  class="sub">
162   <a title="Site Map: Links" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/links.html">Links</a>
163 </div>
164 <div class="sep"></div>
165 <div class="menu">
166   <a rel="follow" title="Sponsors" href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../www/sponsors.html">Sponsors:</a>
167
168   <a href="http://www.networkredux.com"> <img src="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../images/networkredux.png" width="140" height="31" alt="[sponsor]" style="margin-top: 4px; margin-left: 4px; border: 0px; float: left;" /></a>
169   <a href="http://www.dinodirect.com/ipads-tablets/"> <img src="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../images/dino-direct.jpg" width="140" height="90" alt="[sponsor]" style="margin-top: 4px; margin-left: 4px; border: 0px; float: left;" /></a><!-- 201208010120 mickey@163... -->
170 <div class="sponsbox">
171 <div class="sponsor">
172   <a rel="follow" title="Sponsor: The Fastest &amp; Easiest Way to Find Images" href="http://www.graphicsfactory.com">The Fastest &amp; Easiest Way to Find Images</a><!-- 201210010270 graphicsfac... -->
173 </div>
174 <div class="sponsor">
175   <a rel="follow" title="Sponsor: VPS" href="http://www.interdominios.com/vps">VPS</a><!-- 201209010090 barsh@inter... -->
176 </div>
177 <div class="sponsor">
178   <a rel="follow" title="Werbebanner Werbeplane" href="http://www.allesbanner.de">Werbebanner Werbeplane</a><!-- 201212010450 info@druck... -->
179 </div>
180 <div class="sponsor">
181   <a rel="follow" title="Entertainment News &amp; Photos" href="http://www.zimbio.com">Entertainment News &amp; Photos</a><!-- 201211010540 bd@zimb... -->
182 </div>
183 <div class="sponsor">
184   <a rel="follow" title="Sponsor: LED24" href="http://led24.de/">LED24</a><!-- 201207010270 info@led24... -->
185 </div>
186 <div class="sponsor">
187   <a rel="follow" title="Sponsor: Best Website Hosting" href="http://www.top-cheap-web-hosting.com">Best Website Hosting</a><!-- 201304010090 eunge.liu-->
188 </div>
189 <div class="sponsor">
190   <a rel="follow" title="Android Tablet" href="http://www.dinodirect.com/ipads-tablets/">Android Tablet</a><!-- 201208010120 mickey@163... -->
191 </div>
192 <div class="sponsor">
193   <a rel="follow" title="Sponsor: Web Site Hosting" href="http://webhostinggeeks.com">Web Site Hosting</a><!-- 201302010900 funds@enmob... -->
194 </div>
195 <div class="sponsor">
196    <a rel="follow" title="Sponsor: Premium Quality Stock Photos" href="http://www.f1online.pro/en/">Premium Quality Stock Photos</a><!-- 2012080100540 ... -->
197 </div>
198 <div class="sponsor">
199    <a rel="follow" title="Sponsor: Druckerei" href="http://print24.com/de/">Druckerei</a><!-- 2012070100250 ... -->
200 </div>
201 <div class="sponsor">
202   <a rel="follow" title="Sponsor: Managed Server" href="http://www.robhost.de">Managed Server</a><!-- 201210010720 klikics... -->
203 </div>
204 <div class="sponsor">
205   <a rel="follow" title="Sponsor: Druckerei" href="http://www.allesdruck.de">Druckerei</a><!-- 201303011500 r.leo -->
206 </div>
207 <div class="sponsor">
208    <a rel="follow" title="Sponsor: Notebook Reparatur" href="http://www.notebook-reparaturen-berlin.de">Notebook Reparatur</a><!-- 2012080100300 atlas-multimedia-->
209 </div>
210 <div class="sponsor">
211    <a rel="follow" title="Sponsor: Web Hosting" href="http://www.hostucan.com">Web Hosting</a><!-- 2012120100150 racent marketing@webhosting...-->
212 </div>
213 </div>
214 </div>
215 </div>
216
217 <div class="eastbar">
218   <div class="g-plusone" id="gplusone"></div>
219   <script type="text/javascript">
220     window.___gcfg = {
221       lang: 'en-US'
222     };
223
224     (function() {
225       var po = document.createElement('script');
226       po.type = 'text/javascript'; po.async = true;
227       po.src = 'https://apis.google.com/js/plusone.js';
228       var script = document.getElementsByTagName('script')[0];
229       script.parentNode.insertBefore(po, script);
230     })();
231     var gplusone = document.getElementById("gplusone");
232     gplusone.setAttribute("data-size","medium");
233     gplusone.setAttribute("data-count","false");
234   </script>
235 </div>
236
237 <div class="main">
238
239 <h1>Module morphology Methods</h1>
240 <p class="navigation-index">[<a href="morphology.html#** This macro  IsNaN">** This macro  IsNaN</a> &bull; <a href="morphology.html#AcquireKernelInfo">AcquireKernelInfo</a> &bull; <a href="morphology.html#AcquireKernelBuiltIn">AcquireKernelBuiltIn</a> &bull; <a href="morphology.html#CloneKernelInfo">CloneKernelInfo</a> &bull; <a href="morphology.html#DestroyKernelInfo">DestroyKernelInfo</a> &bull; <a href="morphology.html#MorphologyApply">MorphologyApply</a> &bull; <a href="morphology.html#MorphologyImageChannel">MorphologyImageChannel</a> &bull; <a href="morphology.html#ScaleGeometryKernelInfo">ScaleGeometryKernelInfo</a> &bull; <a href="morphology.html#ScaleKernelInfo">ScaleKernelInfo</a> &bull; <a href="morphology.html#ShowKernelInfo">ShowKernelInfo</a> &bull; <a href="morphology.html#UnityAddKernelInfo">UnityAddKernelInfo</a> &bull; <a href="morphology.html#ZeroKernelNans">ZeroKernelNans</a>]</p>
241
242 <h2><a href="http://www.imagemagick.org/api/MagickCore/morphology_8c.html" id="**_This macro  IsNaN">** This macro  IsNaN</a></h2>
243 <div class="doc-section">
244
245 <p>** This macro  IsNaN() is thus is only true if the value given is NaN. </p>
246  </div>
247 <h2><a href="http://www.imagemagick.org/api/MagickCore/morphology_8c.html" id="AcquireKernelInfo">AcquireKernelInfo</a></h2>
248 <div class="doc-section">
249
250 <p>AcquireKernelInfo() takes the given string (generally supplied by the user) and converts it into a Morphology/Convolution Kernel.  This allows users to specify a kernel from a number of pre-defined kernels, or to fully specify their own kernel for a specific Convolution or Morphology Operation.</p>
251
252 <p>The kernel so generated can be any rectangular array of floating point values (doubles) with the 'control point' or 'pixel being affected' anywhere within that array of values.</p>
253
254 <p>Previously IM was restricted to a square of odd size using the exact center as origin, this is no longer the case, and any rectangular kernel with any value being declared the origin. This in turn allows the use of highly asymmetrical kernels.</p>
255
256 <p>The floating point values in the kernel can also include a special value known as 'nan' or 'not a number' to indicate that this value is not part of the kernel array. This allows you to shaped the kernel within its rectangular area. That is 'nan' values provide a 'mask' for the kernel shape.  However at least one non-nan value must be provided for correct working of a kernel.</p>
257
258 <p>The returned kernel should be freed using the DestroyKernelInfo() when you are finished with it.  Do not free this memory yourself.</p>
259
260 <p>Input kernel defintion strings can consist of any of three types.</p>
261
262 <p>"name:args[[@><]" Select from one of the built in kernels, using the name and geometry arguments supplied.  See AcquireKernelBuiltIn()</p>
263
264 <p>"WxH[+X+Y][@><]:num, num, num ..." a kernel of size W by H, with W*H floating point numbers following. the 'center' can be optionally be defined at +X+Y (such that +0+0 is top left corner). If not defined the pixel in the center, for odd sizes, or to the immediate top or left of center for even sizes is automatically selected.</p>
265
266 <p>"num, num, num, num, ..." list of floating point numbers defining an 'old style' odd sized square kernel.  At least 9 values should be provided for a 3x3 square kernel, 25 for a 5x5 square kernel, 49 for 7x7, etc. Values can be space or comma separated.  This is not recommended.</p>
267
268 <p>You can define a 'list of kernels' which can be used by some morphology operators A list is defined as a semi-colon separated list kernels.</p>
269
270 <p>" kernel ; kernel ; kernel ; "</p>
271
272 <p>Any extra ';' characters, at start, end or between kernel defintions are simply ignored.</p>
273
274 <p>The special flags will expand a single kernel, into a list of rotated kernels. A '@' flag will expand a 3x3 kernel into a list of 45-degree cyclic rotations, while a '>' will generate a list of 90-degree rotations. The '<' also exands using 90-degree rotates, but giving a 180-degree reflected kernel before the +/- 90-degree rotations, which can be important for Thinning operations.</p>
275
276 <p>Note that 'name' kernels will start with an alphabetic character while the new kernel specification has a ':' character in its specification string. If neither is the case, it is assumed an old style of a simple list of numbers generating a odd-sized square kernel has been given.</p>
277
278 <p>The format of the AcquireKernal method is:</p>
279
280 <pre class="code">
281   KernelInfo *AcquireKernelInfo(const char *kernel_string)
282 </pre>
283
284 <p>A description of each parameter follows:</p>
285
286 <h5>kernel_string</h5>
287 <p>the Morphology/Convolution kernel wanted.</p>
288
289  </div>
290 <h2><a href="http://www.imagemagick.org/api/MagickCore/morphology_8c.html" id="AcquireKernelBuiltIn">AcquireKernelBuiltIn</a></h2>
291 <div class="doc-section">
292
293 <p>AcquireKernelBuiltIn() returned one of the 'named' built-in types of kernels used for special purposes such as gaussian blurring, skeleton pruning, and edge distance determination.</p>
294
295 <p>They take a KernelType, and a set of geometry style arguments, which were typically decoded from a user supplied string, or from a more complex Morphology Method that was requested.</p>
296
297 <p>The format of the AcquireKernalBuiltIn method is:</p>
298
299 <pre class="code">
300   KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type,
301        const GeometryInfo args)
302 </pre>
303
304 <p>A description of each parameter follows:</p>
305
306 <h5>type</h5>
307 <p>the pre-defined type of kernel wanted</p>
308
309 <h5>args</h5>
310 <p>arguments defining or modifying the kernel</p>
311
312 <p>Convolution Kernels</p>
313
314 <p>Unity The a No-Op or Scaling single element kernel.</p>
315
316 <p>Gaussian:{radius},{sigma} Generate a two-dimensional gaussian kernel, as used by -gaussian. The sigma for the curve is required.  The resulting kernel is normalized,</p>
317
318 <p>If 'sigma' is zero, you get a single pixel on a field of zeros.</p>
319
320 <p>NOTE: that the 'radius' is optional, but if provided can limit (clip) the final size of the resulting kernel to a square 2*radius+1 in size. The radius should be at least 2 times that of the sigma value, or sever clipping and aliasing may result.  If not given or set to 0 the radius will be determined so as to produce the best minimal error result, which is usally much larger than is normally needed.</p>
321
322 <p>LoG:{radius},{sigma} "Laplacian of a Gaussian" or "Mexician Hat" Kernel. The supposed ideal edge detection, zero-summing kernel.</p>
323
324 <p>An alturnative to this kernel is to use a "DoG" with a sigma ratio of approx 1.6 (according to wikipedia).</p>
325
326 <p>DoG:{radius},{sigma1},{sigma2} "Difference of Gaussians" Kernel. As "Gaussian" but with a gaussian produced by 'sigma2' subtracted from the gaussian produced by 'sigma1'. Typically sigma2 > sigma1. The result is a zero-summing kernel.</p>
327
328 <p>Blur:{radius},{sigma}[,{angle}] Generates a 1 dimensional or linear gaussian blur, at the angle given (current restricted to orthogonal angles).  If a 'radius' is given the kernel is clipped to a width of 2*radius+1.  Kernel can be rotated by a 90 degree angle.</p>
329
330 <p>If 'sigma' is zero, you get a single pixel on a field of zeros.</p>
331
332 <p>Note that two convolutions with two "Blur" kernels perpendicular to each other, is equivalent to a far larger "Gaussian" kernel with the same sigma value, However it is much faster to apply. This is how the "-blur" operator actually works.</p>
333
334 <p>Comet:{width},{sigma},{angle} Blur in one direction only, much like how a bright object leaves a comet like trail.  The Kernel is actually half a gaussian curve, Adding two such blurs in opposite directions produces a Blur Kernel. Angle can be rotated in multiples of 90 degrees.</p>
335
336 <p>Note that the first argument is the width of the kernel and not the radius of the kernel.</p>
337
338 <p># Still to be implemented... # # Filter2D # Filter1D #    Set kernel values using a resize filter, and given scale (sigma) #    Cylindrical or Linear.   Is this possible with an image? #</p>
339
340 <p>Named Constant Convolution Kernels</p>
341
342 <p>All these are unscaled, zero-summing kernels by default. As such for non-HDRI version of ImageMagick some form of normalization, user scaling, and biasing the results is recommended, to prevent the resulting image being 'clipped'.</p>
343
344 <p>The 3x3 kernels (most of these) can be circularly rotated in multiples of 45 degrees to generate the 8 angled varients of each of the kernels.</p>
345
346 <p>Laplacian:{type} Discrete Lapacian Kernels, (without normalization) Type 0 :  3x3 with center:8 surounded by -1  (8 neighbourhood) Type 1 :  3x3 with center:4 edge:-1 corner:0 (4 neighbourhood) Type 2 :  3x3 with center:4 edge:1 corner:-2 Type 3 :  3x3 with center:4 edge:-2 corner:1 Type 5 :  5x5 laplacian Type 7 :  7x7 laplacian Type 15 : 5x5 LoG (sigma approx 1.4) Type 19 : 9x9 LoG (sigma approx 1.4)</p>
347
348 <p>Sobel:{angle} Sobel 'Edge' convolution kernel (3x3) | -1, 0, 1 | | -2, 0,-2 | | -1, 0, 1 |</p>
349
350 <p>Roberts:{angle} Roberts convolution kernel (3x3) |  0, 0, 0 | | -1, 1, 0 | |  0, 0, 0 |</p>
351
352 <p>Prewitt:{angle} Prewitt Edge convolution kernel (3x3) | -1, 0, 1 | | -1, 0, 1 | | -1, 0, 1 |</p>
353
354 <p>Compass:{angle} Prewitt's "Compass" convolution kernel (3x3) | -1, 1, 1 | | -1,-2, 1 | | -1, 1, 1 |</p>
355
356 <p>Kirsch:{angle} Kirsch's "Compass" convolution kernel (3x3) | -3,-3, 5 | | -3, 0, 5 | | -3,-3, 5 |</p>
357
358 <p>FreiChen:{angle} Frei-Chen Edge Detector is based on a kernel that is similar to the Sobel Kernel, but is designed to be isotropic. That is it takes into account the distance of the diagonal in the kernel.</p>
359
360 <p>|   1,     0,   -1     | | sqrt(2), 0, -sqrt(2) | |   1,     0,   -1     |</p>
361
362 <p>FreiChen:{type},{angle}</p>
363
364 <p>Frei-Chen Pre-weighted kernels...</p>
365
366 <p>Type 0:  default un-nomalized version shown above.</p>
367
368 <p>Type 1: Orthogonal Kernel (same as type 11 below) |   1,     0,   -1     | | sqrt(2), 0, -sqrt(2) | / 2*sqrt(2) |   1,     0,   -1     |</p>
369
370 <p>Type 2: Diagonal form of Kernel... |   1,     sqrt(2),    0     | | sqrt(2),   0,     -sqrt(2) | / 2*sqrt(2) |   0,    -sqrt(2)    -1     |</p>
371
372 <p>However this kernel is als at the heart of the FreiChen Edge Detection Process which uses a set of 9 specially weighted kernel.  These 9 kernels not be normalized, but directly applied to the image. The results is then added together, to produce the intensity of an edge in a specific direction.  The square root of the pixel value can then be taken as the cosine of the edge, and at least 2 such runs at 90 degrees from each other, both the direction and the strength of the edge can be determined.</p>
373
374 <p>Type 10: All 9 of the following pre-weighted kernels...</p>
375
376 <p>Type 11: |   1,     0,   -1     | | sqrt(2), 0, -sqrt(2) | / 2*sqrt(2) |   1,     0,   -1     |</p>
377
378 <p>Type 12: | 1, sqrt(2), 1 | | 0,   0,     0 | / 2*sqrt(2) | 1, sqrt(2), 1 |</p>
379
380 <p>Type 13: | sqrt(2), -1,    0     | |  -1,      0,    1     | / 2*sqrt(2) |   0,      1, -sqrt(2) |</p>
381
382 <p>Type 14: |    0,     1, -sqrt(2) | |   -1,     0,     1    | / 2*sqrt(2) | sqrt(2), -1,     0    |</p>
383
384 <p>Type 15: | 0, -1, 0 | | 1,  0, 1 | / 2 | 0, -1, 0 |</p>
385
386 <p>Type 16: |  1, 0, -1 | |  0, 0,  0 | / 2 | -1, 0,  1 |</p>
387
388 <p>Type 17: |  1, -2,  1 | | -2,  4, -2 | / 6 | -1, -2,  1 |</p>
389
390 <p>Type 18: | -2, 1, -2 | |  1, 4,  1 | / 6 | -2, 1, -2 |</p>
391
392 <p>Type 19: | 1, 1, 1 | | 1, 1, 1 | / 3 | 1, 1, 1 |</p>
393
394 <p>The first 4 are for edge detection, the next 4 are for line detection and the last is to add a average component to the results.</p>
395
396 <p>Using a special type of '-1' will return all 9 pre-weighted kernels as a multi-kernel list, so that you can use them directly (without normalization) with the special "-set option:morphology:compose Plus" setting to apply the full FreiChen Edge Detection Technique.</p>
397
398 <p>If 'type' is large it will be taken to be an actual rotation angle for the default FreiChen (type 0) kernel.  As such  FreiChen:45  will look like a  Sobel:45  but with 'sqrt(2)' instead of '2' values.</p>
399
400 <p>WARNING: The above was layed out as per http://www.math.tau.ac.il/~turkel/notes/edge_detectors.pdf But rotated 90 degrees so direction is from left rather than the top. I have yet to find any secondary confirmation of the above. The only other source found was actual source code at http://ltswww.epfl.ch/~courstiv/exos_labos/sol3.pdf Neigher paper defineds the kernels in a way that looks locical or correct when taken as a whole.</p>
401
402 <p>Boolean Kernels</p>
403
404 <p>Diamond:[{radius}[,{scale}]] Generate a diamond shaped kernel with given radius to the points. Kernel size will again be radius*2+1 square and defaults to radius 1, generating a 3x3 kernel that is slightly larger than a square.</p>
405
406 <p>Square:[{radius}[,{scale}]] Generate a square shaped kernel of size radius*2+1, and defaulting to a 3x3 (radius 1).</p>
407
408 <p>Octagon:[{radius}[,{scale}]] Generate octagonal shaped kernel of given radius and constant scale. Default radius is 3 producing a 7x7 kernel. A radius of 1 will result in "Diamond" kernel.</p>
409
410 <p>Disk:[{radius}[,{scale}]] Generate a binary disk, thresholded at the radius given, the radius may be a float-point value. Final Kernel size is floor(radius)*2+1 square. A radius of 5.3 is the default.</p>
411
412 <p>NOTE: That a low radii Disk kernels produce the same results as many of the previously defined kernels, but differ greatly at larger radii.  Here is a table of equivalences... "Disk:1"    => "Diamond", "Octagon:1", or "Cross:1" "Disk:1.5"  => "Square" "Disk:2"    => "Diamond:2" "Disk:2.5"  => "Octagon" "Disk:2.9"  => "Square:2" "Disk:3.5"  => "Octagon:3" "Disk:4.5"  => "Octagon:4" "Disk:5.4"  => "Octagon:5" "Disk:6.4"  => "Octagon:6" All other Disk shapes are unique to this kernel, but because a "Disk" is more circular when using a larger radius, using a larger radius is preferred over iterating the morphological operation.</p>
413
414 <p>Rectangle:{geometry} Simply generate a rectangle of 1's with the size given. You can also specify the location of the 'control point', otherwise the closest pixel to the center of the rectangle is selected.</p>
415
416 <p>Properly centered and odd sized rectangles work the best.</p>
417
418 <p>Symbol Dilation Kernels</p>
419
420 <p>These kernel is not a good general morphological kernel, but is used more for highlighting and marking any single pixels in an image using, a "Dilate" method as appropriate.</p>
421
422 <p>For the same reasons iterating these kernels does not produce the same result as using a larger radius for the symbol.</p>
423
424 <p>Plus:[{radius}[,{scale}]] Cross:[{radius}[,{scale}]] Generate a kernel in the shape of a 'plus' or a 'cross' with a each arm the length of the given radius (default 2).</p>
425
426 <p>NOTE: "plus:1" is equivalent to a "Diamond" kernel.</p>
427
428 <p>Ring:{radius1},{radius2}[,{scale}] A ring of the values given that falls between the two radii. Defaults to a ring of approximataly 3 radius in a 7x7 kernel. This is the 'edge' pixels of the default "Disk" kernel, More specifically, "Ring" -> "Ring:2.5,3.5,1.0"</p>
429
430 <p>Hit and Miss Kernels</p>
431
432 <p>Peak:radius1,radius2 Find any peak larger than the pixels the fall between the two radii. The default ring of pixels is as per "Ring". Edges Find flat orthogonal edges of a binary shape Corners Find 90 degree corners of a binary shape Diagonals:type A special kernel to thin the 'outside' of diagonals LineEnds:type Find end points of lines (for pruning a skeletion) Two types of lines ends (default to both) can be searched for Type 0: All line ends Type 1: single kernel for 4-conneected line ends Type 2: single kernel for simple line ends LineJunctions Find three line junctions (within a skeletion) Type 0: all line junctions Type 1: Y Junction kernel Type 2: Diagonal T Junction kernel Type 3: Orthogonal T Junction kernel Type 4: Diagonal X Junction kernel Type 5: Orthogonal + Junction kernel Ridges:type Find single pixel ridges or thin lines Type 1: Fine single pixel thick lines and ridges Type 2: Find two pixel thick lines and ridges ConvexHull Octagonal Thickening Kernel, to generate convex hulls of 45 degrees Skeleton:type Traditional skeleton generating kernels. Type 1: Tradional Skeleton kernel (4 connected skeleton) Type 2: HIPR2 Skeleton kernel (8 connected skeleton) Type 3: Thinning skeleton based on a ressearch paper by Dan S. Bloomberg (Default Type) ThinSE:type A huge variety of Thinning Kernels designed to preserve conectivity. many other kernel sets use these kernels as source definitions. Type numbers are 41-49, 81-89, 481, and 482 which are based on the super and sub notations used in the source research paper.</p>
433
434 <p>Distance Measuring Kernels</p>
435
436 <p>Different types of distance measuring methods, which are used with the a 'Distance' morphology method for generating a gradient based on distance from an edge of a binary shape, though there is a technique for handling a anti-aliased shape.</p>
437
438 <p>See the 'Distance' Morphological Method, for information of how it is applied.</p>
439
440 <p>Chebyshev:[{radius}][x{scale}[!]] Chebyshev Distance (also known as Tchebychev or Chessboard distance) is a value of one to any neighbour, orthogonal or diagonal. One why of thinking of it is the number of squares a 'King' or 'Queen' in chess needs to traverse reach any other position on a chess board. It results in a 'square' like distance function, but one where diagonals are given a value that is closer than expected.</p>
441
442 <p>Manhattan:[{radius}][x{scale}[!]] Manhattan Distance (also known as Rectilinear, City Block, or the Taxi Cab distance metric), it is the distance needed when you can only travel in horizontal or vertical directions only.  It is the distance a 'Rook' in chess would have to travel, and results in a diamond like distances, where diagonals are further than expected.</p>
443
444 <p>Octagonal:[{radius}][x{scale}[!]] An interleving of Manhatten and Chebyshev metrics producing an increasing octagonally shaped distance.  Distances matches those of the "Octagon" shaped kernel of the same radius.  The minimum radius and default is 2, producing a 5x5 kernel.</p>
445
446 <p>Euclidean:[{radius}][x{scale}[!]] Euclidean distance is the 'direct' or 'as the crow flys' distance. However by default the kernel size only has a radius of 1, which limits the distance to 'Knight' like moves, with only orthogonal and diagonal measurements being correct.  As such for the default kernel you will get octagonal like distance function.</p>
447
448 <p>However using a larger radius such as "Euclidean:4" you will get a much smoother distance gradient from the edge of the shape. Especially if the image is pre-processed to include any anti-aliasing pixels. Of course a larger kernel is slower to use, and not always needed.</p>
449
450 <p>The first three Distance Measuring Kernels will only generate distances of exact multiples of {scale} in binary images. As such you can use a scale of 1 without loosing any information.  However you also need some scaling when handling non-binary anti-aliased shapes.</p>
451
452 <p>The "Euclidean" Distance Kernel however does generate a non-integer fractional results, and as such scaling is vital even for binary shapes.</p>
453
454  </div>
455 <h2><a href="http://www.imagemagick.org/api/MagickCore/morphology_8c.html" id="CloneKernelInfo">CloneKernelInfo</a></h2>
456 <div class="doc-section">
457
458 <p>CloneKernelInfo() creates a new clone of the given Kernel List so that its can be modified without effecting the original.  The cloned kernel should be destroyed using DestoryKernelInfo() when no longer needed.</p>
459
460 <p>The format of the CloneKernelInfo method is:</p>
461
462 <pre class="code">
463   KernelInfo *CloneKernelInfo(const KernelInfo *kernel)
464 </pre>
465
466 <p>A description of each parameter follows:</p>
467
468 <h5>kernel</h5>
469 <p>the Morphology/Convolution kernel to be cloned</p>
470
471  </div>
472 <h2><a href="http://www.imagemagick.org/api/MagickCore/morphology_8c.html" id="DestroyKernelInfo">DestroyKernelInfo</a></h2>
473 <div class="doc-section">
474
475 <p>DestroyKernelInfo() frees the memory used by a Convolution/Morphology kernel.</p>
476
477 <p>The format of the DestroyKernelInfo method is:</p>
478
479 <pre class="code">
480   KernelInfo *DestroyKernelInfo(KernelInfo *kernel)
481 </pre>
482
483 <p>A description of each parameter follows:</p>
484
485 <h5>kernel</h5>
486 <p>the Morphology/Convolution kernel to be destroyed</p>
487
488  </div>
489 <h2><a href="http://www.imagemagick.org/api/MagickCore/morphology_8c.html" id="MorphologyApply">MorphologyApply</a></h2>
490 <div class="doc-section">
491
492 <p>MorphologyApply() applies a morphological method, multiple times using a list of multiple kernels.  This is the method that should be called by other 'operators' that internally use morphology operations as part of their processing.</p>
493
494 <p>It is basically equivalent to as MorphologyImage() (see below) but without any user controls.  This allows internel programs to use this function, to actually perform a specific task without possible interference by any API user supplied settings.</p>
495
496 <p>It is MorphologyImage() task to extract any such user controls, and pass them to this function for processing.</p>
497
498 <p>More specifically all given kernels should already be scaled, normalised, and blended appropriatally before being parred to this routine. The appropriate bias, and compose (typically 'UndefinedComposeOp') given.</p>
499
500 <p>The format of the MorphologyApply method is:</p>
501
502 <pre class="code">
503   Image *MorphologyApply(const Image *image,MorphologyMethod method,
504     const ChannelType channel, const ssize_t iterations,
505     const KernelInfo *kernel, const CompositeMethod compose,
506     const double bias, ExceptionInfo *exception)
507 </pre>
508
509 <p>A description of each parameter follows:</p>
510
511 <h5>image</h5>
512 <p>the source image</p>
513
514 <h5>method</h5>
515 <p>the morphology method to be applied.</p>
516
517 <h5>channel</h5>
518 <p>the channels to which the operations are applied The channel 'sync' flag determines if 'alpha weighting' is applied for convolution style operations.</p>
519
520 <h5>iterations</h5>
521 <p>apply the operation this many times (or no change). A value of -1 means loop until no change found. How this is applied may depend on the morphology method. Typically this is a value of 1.</p>
522
523 <h5>channel</h5>
524 <p>the channel type.</p>
525
526 <h5>kernel</h5>
527 <p>An array of double representing the morphology kernel.</p>
528
529 <h5>compose</h5>
530 <p>How to handle or merge multi-kernel results. If 'UndefinedCompositeOp' use default for the Morphology method. If 'NoCompositeOp' force image to be re-iterated by each kernel. Otherwise merge the results using the compose method given.</p>
531
532 <h5>bias</h5>
533 <p>Convolution Output Bias.</p>
534
535 <h5>exception</h5>
536 <p>return any errors or warnings in this structure.</p>
537
538  </div>
539 <h2><a href="http://www.imagemagick.org/api/MagickCore/morphology_8c.html" id="MorphologyImageChannel">MorphologyImageChannel</a></h2>
540 <div class="doc-section">
541
542 <p>MorphologyImageChannel() applies a user supplied kernel to the image according to the given mophology method.</p>
543
544 <p>This function applies any and all user defined settings before calling the above internal function MorphologyApply().</p>
545
546 <p>User defined settings include... * Output Bias for Convolution and correlation   ("-bias") * Kernel Scale/normalize settings     ("-set 'option:convolve:scale'") This can also includes the addition of a scaled unity kernel. * Show Kernel being applied           ("-set option:showkernel 1")</p>
547
548 <p>The format of the MorphologyImage method is:</p>
549
550 <pre class="code">
551   Image *MorphologyImage(const Image *image,MorphologyMethod method,
552     const ssize_t iterations,KernelInfo *kernel,ExceptionInfo *exception)
553 </pre>
554
555 <p>Image *MorphologyImageChannel(const Image *image, const ChannelType channel,MorphologyMethod method,const ssize_t iterations, KernelInfo *kernel,ExceptionInfo *exception)</p>
556
557 <p>A description of each parameter follows:</p>
558
559 <h5>image</h5>
560 <p>the image.</p>
561
562 <h5>method</h5>
563 <p>the morphology method to be applied.</p>
564
565 <h5>iterations</h5>
566 <p>apply the operation this many times (or no change). A value of -1 means loop until no change found. How this is applied may depend on the morphology method. Typically this is a value of 1.</p>
567
568 <h5>channel</h5>
569 <p>the channel type.</p>
570
571 <h5>kernel</h5>
572 <p>An array of double representing the morphology kernel. Warning: kernel may be normalized for the Convolve method.</p>
573
574 <h5>exception</h5>
575 <p>return any errors or warnings in this structure.</p>
576
577  </div>
578 <h2><a href="http://www.imagemagick.org/api/MagickCore/morphology_8c.html" id="ScaleGeometryKernelInfo">ScaleGeometryKernelInfo</a></h2>
579 <div class="doc-section">
580
581 <p>ScaleGeometryKernelInfo() takes a geometry argument string, typically provided as a  "-set option:convolve:scale {geometry}" user setting, and modifies the kernel according to the parsed arguments of that setting.</p>
582
583 <p>The first argument (and any normalization flags) are passed to ScaleKernelInfo() to scale/normalize the kernel.  The second argument is then passed to UnityAddKernelInfo() to add a scled unity kernel into the scaled/normalized kernel.</p>
584
585 <p>The format of the ScaleGeometryKernelInfo method is:</p>
586
587 <pre class="code">
588   void ScaleGeometryKernelInfo(KernelInfo *kernel,
589     const double scaling_factor,const MagickStatusType normalize_flags)
590 </pre>
591
592 <p>A description of each parameter follows:</p>
593
594 <h5>kernel</h5>
595 <p>the Morphology/Convolution kernel to modify</p>
596
597 <p>o geometry:</p>
598
599 <pre class="text">
600          "-set option:convolve:scale {geometry}" setting.
601 </pre>
602
603  </div>
604 <h2><a href="http://www.imagemagick.org/api/MagickCore/morphology_8c.html" id="ScaleKernelInfo">ScaleKernelInfo</a></h2>
605 <div class="doc-section">
606
607 <p>ScaleKernelInfo() scales the given kernel list by the given amount, with or without normalization of the sum of the kernel values (as per given flags).</p>
608
609 <p>By default (no flags given) the values within the kernel is scaled directly using given scaling factor without change.</p>
610
611 <p>If either of the two 'normalize_flags' are given the kernel will first be normalized and then further scaled by the scaling factor value given.</p>
612
613 <p>Kernel normalization ('normalize_flags' given) is designed to ensure that any use of the kernel scaling factor with 'Convolve' or 'Correlate' morphology methods will fall into -1.0 to +1.0 range.  Note that for non-HDRI versions of IM this may cause images to have any negative results clipped, unless some 'bias' is used.</p>
614
615 <p>More specifically.  Kernels which only contain positive values (such as a 'Gaussian' kernel) will be scaled so that those values sum to +1.0, ensuring a 0.0 to +1.0 output range for non-HDRI images.</p>
616
617 <p>For Kernels that contain some negative values, (such as 'Sharpen' kernels) the kernel will be scaled by the absolute of the sum of kernel values, so that it will generally fall within the +/- 1.0 range.</p>
618
619 <p>For kernels whose values sum to zero, (such as 'Laplician' kernels) kernel will be scaled by just the sum of the postive values, so that its output range will again fall into the  +/- 1.0 range.</p>
620
621 <p>For special kernels designed for locating shapes using 'Correlate', (often only containing +1 and -1 values, representing foreground/brackground matching) a special normalization method is provided to scale the positive values separately to those of the negative values, so the kernel will be forced to become a zero-sum kernel better suited to such searches.</p>
622
623 <p>WARNING: Correct normalization of the kernel assumes that the '*_range' attributes within the kernel structure have been correctly set during the kernels creation.</p>
624
625 <p>NOTE: The values used for 'normalize_flags' have been selected specifically to match the use of geometry options, so that '!' means NormalizeValue, '^' means CorrelateNormalizeValue.  All other GeometryFlags values are ignored.</p>
626
627 <p>The format of the ScaleKernelInfo method is:</p>
628
629 <pre class="code">
630   void ScaleKernelInfo(KernelInfo *kernel, const double scaling_factor,
631            const MagickStatusType normalize_flags )
632 </pre>
633
634 <p>A description of each parameter follows:</p>
635
636 <h5>kernel</h5>
637 <p>the Morphology/Convolution kernel</p>
638
639 <p>o scaling_factor:</p>
640
641 <pre class="text">
642          zero.  If the kernel is normalized regardless of any flags.
643 </pre>
644
645 <p>o normalize_flags:</p>
646
647 <pre class="text">
648          specifically: NormalizeValue, CorrelateNormalizeValue,
649                        and/or PercentValue
650 </pre>
651
652  </div>
653 <h2><a href="http://www.imagemagick.org/api/MagickCore/morphology_8c.html" id="ShowKernelInfo">ShowKernelInfo</a></h2>
654 <div class="doc-section">
655
656 <p>ShowKernelInfo() outputs the details of the given kernel defination to standard error, generally due to a users 'showkernel' option request.</p>
657
658 <p>The format of the ShowKernel method is:</p>
659
660 <pre class="code">
661   void ShowKernelInfo(const KernelInfo *kernel)
662 </pre>
663
664 <p>A description of each parameter follows:</p>
665
666 <h5>kernel</h5>
667 <p>the Morphology/Convolution kernel</p>
668
669  </div>
670 <h2><a href="http://www.imagemagick.org/api/MagickCore/morphology_8c.html" id="UnityAddKernelInfo">UnityAddKernelInfo</a></h2>
671 <div class="doc-section">
672
673 <p>UnityAddKernelInfo() Adds a given amount of the 'Unity' Convolution Kernel to the given pre-scaled and normalized Kernel.  This in effect adds that amount of the original image into the resulting convolution kernel.  This value is usually provided by the user as a percentage value in the 'convolve:scale' setting.</p>
674
675 <p>The resulting effect is to convert the defined kernels into blended soft-blurs, unsharp kernels or into sharpening kernels.</p>
676
677 <p>The format of the UnityAdditionKernelInfo method is:</p>
678
679 <pre class="code">
680   void UnityAdditionKernelInfo(KernelInfo *kernel, const double scale )
681 </pre>
682
683 <p>A description of each parameter follows:</p>
684
685 <h5>kernel</h5>
686 <p>the Morphology/Convolution kernel</p>
687
688 <p>o scale:</p>
689
690 <pre class="text">
691          the given kernel.
692 </pre>
693
694  </div>
695 <h2><a href="http://www.imagemagick.org/api/MagickCore/morphology_8c.html" id="ZeroKernelNans">ZeroKernelNans</a></h2>
696 <div class="doc-section">
697
698 <p>ZeroKernelNans() replaces any special 'nan' value that may be present in the kernel with a zero value.  This is typically done when the kernel will be used in special hardware (GPU) convolution processors, to simply matters.</p>
699
700 <p>The format of the ZeroKernelNans method is:</p>
701
702 <pre class="code">
703   void ZeroKernelNans (KernelInfo *kernel)
704 </pre>
705
706 <p>A description of each parameter follows:</p>
707
708 <h5>kernel</h5>
709 <p>the Morphology/Convolution kernel</p>
710
711  </div>
712
713 </div>
714
715 <div id="linkbar">
716     <span id="linkbar-west">&nbsp;</span>
717     <span id="linkbar-center">
718       <a href="../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../discourse-server">Discourse Server</a> &bull;
719       <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a>
720     </span>
721     <span id="linkbar-east">&nbsp;</span>
722   </div>
723   <div class="footer">
724     <span id="footer-west">&copy; 1999-2013 ImageMagick Studio LLC</span>
725     <span id="footer-east"> <a href="http://www.imagemagick.org/script/contact.php">Contact the Wizards</a></span>
726   </div>
727   <div style="clear: both; margin: 0; width: 100%; "></div>
728   <script type="text/javascript">
729     var _gaq = _gaq || [];
730     _gaq.push(['_setAccount', 'UA-17690367-1']);
731     _gaq.push(['_trackPageview']);
732
733     (function() {
734       var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
735       ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
736       var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
737     })();
738   </script>
739 </body>
740 </html>