-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add in distance transform and watershed
Add in distance transform and watershed for Stephan
- Loading branch information
1 parent
fd0d65c
commit 47b2459
Showing
26 changed files
with
711 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ libgw* | |
Release/ | ||
jar/ | ||
2.0/ | ||
|
||
**/testing | ||
|
||
# ignore doc/notes.txt, but not doc/server/arch.txt | ||
#doc/*.txt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
* | ||
* This help file was generated from imdistransf.sci using help_from_sci(). | ||
* | ||
--> | ||
|
||
<refentry version="5.0-subset Scilab" xml:id="imdistransf" xml:lang="en" | ||
xmlns="http://docbook.org/ns/docbook" | ||
xmlns:xlink="http://www.w3.org/1999/xlink" | ||
xmlns:svg="http://www.w3.org/2000/svg" | ||
xmlns:ns3="http://www.w3.org/1999/xhtml" | ||
xmlns:mml="http://www.w3.org/1998/Math/MathML" | ||
xmlns:scilab="http://www.scilab.org" | ||
xmlns:db="http://docbook.org/ns/docbook"> | ||
|
||
<refnamediv> | ||
<refname>imdistransf</refname> | ||
<refpurpose>Distance Transform</refpurpose> | ||
</refnamediv> | ||
|
||
|
||
<refsynopsisdiv> | ||
<title>Syntax</title> | ||
<synopsis> | ||
imout = imdistransf(imin) | ||
|
||
</synopsis> | ||
</refsynopsisdiv> | ||
|
||
<refsection> | ||
<title>Parameters</title> | ||
<variablelist> | ||
<varlistentry> | ||
<term>imin :</term> | ||
<listitem><para> Input binary image or 8-bit, single-channel (binary)</para></listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term>method :</term> | ||
<listitem><para> Distance type, l1, l2, or c where the setting shall correspond to 1, 2 and 3 respectively:</para></listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term>l1 :</term> | ||
<listitem><para> distance = |x1-x2| + |y1-y2|, use 1</para></listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term>l2 :</term> | ||
<listitem><para> the simple euclidean distance, use 2</para></listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term>c :</term> | ||
<listitem><para> distance = max(|x1-x2|,|y1-y2|), use 3</para></listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term>imout :</term> | ||
<listitem><para> Output image with calculated distances. It is a double precision single-channel image of the same size as input</para></listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsection> | ||
|
||
<refsection> | ||
<title>Description</title> | ||
<para> | ||
This function used to calculates the distance to the closest zero pixel for each pixel of the source image. | ||
</para> | ||
<para> | ||
</para> | ||
</refsection> | ||
|
||
<refsection> | ||
<title>Examples</title> | ||
<programlisting role="example"><![CDATA[ | ||
S = imread(fullpath(getIPCVpath() + "/images/three_objects.png")); | ||
Sgray = rgb2gray(S); | ||
Sb = im2bw(Sgray,0.1); | ||
Sd = imdistransf(Sb); | ||
subplot(211);imshow(Sb);subplot(212);imshow(Sd); | ||
]]></programlisting> | ||
</refsection> | ||
|
||
<refsection role="see also"> | ||
<title>See also</title> | ||
<simplelist type="inline"> | ||
<member><link linkend="imwatershed">imwatershed</link></member> | ||
</simplelist> | ||
</refsection> | ||
|
||
<refsection> | ||
<title>Authors</title> | ||
<simplelist type="vert"> | ||
<member>Tan Chin Luh</member> | ||
</simplelist> | ||
</refsection> | ||
|
||
<refsection> | ||
<title>Bibliography</title> | ||
<para>1. OpenCV 4.1.2 Online Documentation</para> | ||
</refsection> | ||
</refentry> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
* | ||
* This help file was generated from imwatershed.sci using help_from_sci(). | ||
* | ||
--> | ||
|
||
<refentry version="5.0-subset Scilab" xml:id="imwatershed" xml:lang="en" | ||
xmlns="http://docbook.org/ns/docbook" | ||
xmlns:xlink="http://www.w3.org/1999/xlink" | ||
xmlns:svg="http://www.w3.org/2000/svg" | ||
xmlns:ns3="http://www.w3.org/1999/xhtml" | ||
xmlns:mml="http://www.w3.org/1998/Math/MathML" | ||
xmlns:scilab="http://www.scilab.org" | ||
xmlns:db="http://docbook.org/ns/docbook"> | ||
|
||
<refnamediv> | ||
<refname>imwatershed</refname> | ||
<refpurpose>Performs a marker-based image segmentation using the watershed algorithm.</refpurpose> | ||
</refnamediv> | ||
|
||
|
||
<refsynopsisdiv> | ||
<title>Syntax</title> | ||
<synopsis> | ||
imout = imwatershed(imin) | ||
|
||
</synopsis> | ||
</refsynopsisdiv> | ||
|
||
<refsection> | ||
<title>Parameters</title> | ||
<variablelist> | ||
<varlistentry> | ||
<term>imin :</term> | ||
<listitem><para> Input 8-bit 3-channel image.</para></listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term>markers :</term> | ||
<listitem><para> Double precision single-channel image (map) of markers. It should have the same size as image.</para></listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term>imout :</term> | ||
<listitem><para> Output labelled image</para></listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsection> | ||
|
||
<refsection> | ||
<title>Description</title> | ||
<para> | ||
The function implements one of the variants of watershed, non-parametric marker-based segmentation algorithm. | ||
</para> | ||
<para> | ||
</para> | ||
</refsection> | ||
|
||
<refsection> | ||
<title>Examples</title> | ||
<programlisting role="example"><![CDATA[ | ||
S = imread(fullpath(getIPCVpath() + "/images/three_objects.png")); | ||
Sgray = rgb2gray(S); | ||
Sb = im2bw(Sgray,0.1); | ||
Sd = imdistransf(Sb); | ||
dist = Sd > 0.4; | ||
[markers,n] = imlabel(dist); | ||
markers(1:5,1:5) = 255; | ||
Sw = imwatershed(S, markers); | ||
imshow(Sw,hsvcolormap(3)); | ||
]]></programlisting> | ||
</refsection> | ||
|
||
<refsection role="see also"> | ||
<title>See also</title> | ||
<simplelist type="inline"> | ||
<member><link linkend="imdistransf">imdistransf</link></member> | ||
</simplelist> | ||
</refsection> | ||
|
||
<refsection> | ||
<title>Authors</title> | ||
<simplelist type="vert"> | ||
<member>Tan Chin Luh</member> | ||
</simplelist> | ||
</refsection> | ||
|
||
<refsection> | ||
<title>Bibliography</title> | ||
<para>1. OpenCV 4.1.2 Online Documentation</para> | ||
</refsection> | ||
</refentry> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
JavaSearch 1.0 | ||
TMAP bs=2048 rt=1 fl=-1 id1=2163 id2=1 | ||
TMAP bs=2048 rt=1 fl=-1 id1=2189 id2=1 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<html><head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<title>imdistransf</title> | ||
<style type="text/css" media="all"> | ||
@import url("scilab_code.css"); | ||
@import url("xml_code.css"); | ||
@import url("c_code.css"); | ||
@import url("style.css"); | ||
</style> | ||
</head> | ||
<body> | ||
<div class="manualnavbar"> | ||
<table width="100%"><tr> | ||
<td width="30%"> | ||
<span class="previous"><a href="imdct.html"><< imdct</a></span> | ||
|
||
</td> | ||
<td width="40%" class="center"> | ||
<span class="top"><a href="section_8adb84d26782c1d3a5d34be202e5d52c.html">Image Transforms</a></span> | ||
|
||
</td> | ||
<td width="30%" class="next"> | ||
<span class="next"><a href="imhough.html">imhough >></a></span> | ||
|
||
</td> | ||
</tr></table> | ||
<hr /> | ||
</div> | ||
|
||
|
||
|
||
<span class="path" dir="ltr"><a href="index.html">IPCV</a> >> <a href="section_8adb84d26782c1d3a5d34be202e5d52c.html">Image Transforms</a> > imdistransf</span> | ||
|
||
<br /><br /> | ||
<div class="refnamediv"><h1 class="refname">imdistransf</h1> | ||
<p class="refpurpose">Distance Transform</p></div> | ||
|
||
|
||
<div class="refsynopsisdiv"><h3 class="title">Syntax</h3> | ||
<div class="synopsis"><pre><span class="default">imout</span><span class="default"> = </span><span class="functionid">imdistransf</span><span class="default">(</span><span class="default">imin</span><span class="default">)</span></pre></div></div> | ||
|
||
<div class="refsection"><h3 class="title">Parameters</h3> | ||
<dl><dt><span class="term">imin :</span> | ||
<dd><p class="para">Input binary image or 8-bit, single-channel (binary)</p></dd></dt> | ||
<dt><span class="term">method :</span> | ||
<dd><p class="para">Distance type, l1, l2, or c where the setting shall correspond to 1, 2 and 3 respectively:</p></dd></dt> | ||
<dt><span class="term">l1 :</span> | ||
<dd><p class="para">distance = |x1-x2| + |y1-y2|, use 1</p></dd></dt> | ||
<dt><span class="term">l2 :</span> | ||
<dd><p class="para">the simple euclidean distance, use 2</p></dd></dt> | ||
<dt><span class="term">c :</span> | ||
<dd><p class="para">distance = max(|x1-x2|,|y1-y2|), use 3</p></dd></dt> | ||
<dt><span class="term">imout :</span> | ||
<dd><p class="para">Output image with calculated distances. It is a double precision single-channel image of the same size as input</p></dd></dt></dl></div> | ||
|
||
<div class="refsection"><h3 class="title">Description</h3> | ||
<p class="para">This function used to calculates the distance to the closest zero pixel for each pixel of the source image.</p> | ||
<p class="para"></p></div> | ||
|
||
<div class="refsection"><h3 class="title">Examples</h3> | ||
<div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabid">S</span> <span class="scilaboperator">=</span> <span class="scilabid">imread</span><span class="scilabopenclose">(</span><a class="scilabcommand" href="scilab://fullpath">fullpath</a><span class="scilabopenclose">(</span><span class="scilabid">getIPCVpath</span><span class="scilabopenclose">(</span><span class="scilabopenclose">)</span> <span class="scilaboperator">+</span> <span class="scilabstring">"</span><span class="scilabstring">/images/three_objects.png</span><span class="scilabstring">"</span><span class="scilabopenclose">)</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span> | ||
<span class="scilabid">Sgray</span> <span class="scilaboperator">=</span> <span class="scilabid">rgb2gray</span><span class="scilabopenclose">(</span><span class="scilabid">S</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span> | ||
<span class="scilabid">Sb</span> <span class="scilaboperator">=</span> <span class="scilabid">im2bw</span><span class="scilabopenclose">(</span><span class="scilabid">Sgray</span><span class="scilabdefault">,</span><span class="scilabnumber">0.1</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span> | ||
<span class="scilabid">Sd</span> <span class="scilaboperator">=</span> <span class="scilabid">imdistransf</span><span class="scilabopenclose">(</span><span class="scilabid">Sb</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span> | ||
<a class="scilabmacro" href="scilab://subplot">subplot</a><span class="scilabopenclose">(</span><span class="scilabnumber">211</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span><span class="scilabid">imshow</span><span class="scilabopenclose">(</span><span class="scilabid">Sb</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span><a class="scilabmacro" href="scilab://subplot">subplot</a><span class="scilabopenclose">(</span><span class="scilabnumber">212</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span><span class="scilabid">imshow</span><span class="scilabopenclose">(</span><span class="scilabid">Sd</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span></pre></td><td valign="top"><a href="scilab://scilab.execexample/"><img src="ScilabExecute.png" border="0"/></a></td><td valign="top"><a href="scilab://scilab.editexample/"><img src="ScilabEdit.png" border="0"/></a></td><td></td></tr></table></div></div> | ||
|
||
<div class="refsection"><h3 class="title">See also</h3> | ||
<ul class="itemizedlist"><li class="member"><a href="imwatershed.html" class="link">imwatershed</a> — Performs a marker-based image segmentation using the watershed algorithm.</li></ul></div> | ||
|
||
<div class="refsection"><h3 class="title">Authors</h3> | ||
<ul class="itemizedlist"><li class="member">Tan Chin Luh</li></ul></div> | ||
|
||
<div class="refsection"><h3 class="title">Bibliography</h3> | ||
<p class="para">1. OpenCV 4.1.2 Online Documentation</p></div> | ||
<br /> | ||
|
||
<div class="manualnavbar"> | ||
<table width="100%"> | ||
<tr><td colspan="3" class="next"><a href="http://bugzilla.scilab.org/enter_bug.cgi?product=Scilab%20software&component=Documentation%20pages" class="ulink">Report an issue</a></td></tr> | ||
<tr> | ||
<td width="30%"> | ||
<span class="previous"><a href="imdct.html"><< imdct</a></span> | ||
|
||
</td> | ||
<td width="40%" class="center"> | ||
<span class="top"><a href="section_8adb84d26782c1d3a5d34be202e5d52c.html">Image Transforms</a></span> | ||
|
||
</td> | ||
<td width="30%" class="next"> | ||
<span class="next"><a href="imhough.html">imhough >></a></span> | ||
|
||
</td> | ||
</tr></table> | ||
<hr /> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.