<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="__bimage__segment_8cpp">
<title>/Users/bernard/b20/bsoft/src/img/Bimage_segment.cpp File Reference</title>
<indexterm><primary>/Users/bernard/b20/bsoft/src/img/Bimage_segment.cpp</primary></indexterm>
<para>

<para>Methods for segmentation. </para>
 
</para>
<programlisting>#include &lt;math.h&gt;
#include &lt;time.h&gt;
#include &quot;Bimage.h&quot;
#include &quot;linked_list.h&quot;
#include &quot;utilities.h&quot;
</programlisting><simplesect>
    <title>Classes    </title>
        <itemizedlist>
            <listitem><para>struct <link linkend="_struct_g_sedge">GSedge</link></para>

<para>Graph segmentation edge structure. </para>
</listitem>
            <listitem><para>struct <link linkend="_struct_g_sregion">GSregion</link></para>

<para>Graph segmentation region structure. </para>
</listitem>
        </itemizedlist>
</simplesect>
<simplesect>
    <title>Functions    </title>
        <itemizedlist>
            <listitem><para>int <link linkend="__bimage__segment_8cpp_1a0ecdf8debef2991d1643ab7ce55d9bab">QsortSmallToLargeEdge</link> (const void *x, const void *y)</para>
</listitem>
            <listitem><para>long <link linkend="__bimage__segment_8cpp_1a5e7889f24062292d2b7d344a1346c7b9">region_find</link> (<link linkend="_struct_g_sregion">GSregion</link> *region, long i)</para>
</listitem>
            <listitem><para>int <link linkend="__bimage__segment_8cpp_1a58d3501eb4414e70cc0bfc80f431b12f">region_join</link> (<link linkend="_struct_g_sregion">GSregion</link> *region, long i, long j)</para>
</listitem>
            <listitem><para><link linkend="_struct_g_sregion">GSregion</link> * <link linkend="__bimage__segment_8cpp_1a465e5f32728ff222ee3bd04da541e059">region_setup</link> (<link linkend="_class_bimage">Bimage</link> *p, <link linkend="_class_bimage">Bimage</link> *pmask)</para>
</listitem>
            <listitem><para><link linkend="_struct_g_sedge">GSedge</link> * <link linkend="__bimage__segment_8cpp_1a095e0a31b8f4b1c4f3f81670e4571709">edge_setup</link> (<link linkend="_class_bimage">Bimage</link> *p, <link linkend="_class_bimage">Bimage</link> *pmask, int connect_type, long &amp;me, long &amp;ne)</para>
</listitem>
            <listitem><para>long <link linkend="__bimage__segment_8cpp_1a7540f37a6b7106f1898217c6b6c4d826">region_merging</link> (<link linkend="_struct_g_sregion">GSregion</link> *region, <link linkend="_struct_g_sedge">GSedge</link> *edge, long nrc, long ne, float threshold)</para>
</listitem>
            <listitem><para>long <link linkend="__bimage__segment_8cpp_1a17fd991e0a9ae84bd2c1099c72b4563e">statistical_region_merging</link> (<link linkend="_struct_g_sregion">GSregion</link> *region, <link linkend="_struct_g_sedge">GSedge</link> *edge, long nr, long ne, double fac)</para>
</listitem>
            <listitem><para>long <link linkend="__bimage__segment_8cpp_1a11dde90ef6489e4dedf82a03e1f98d1c">region_merge_small</link> (<link linkend="_struct_g_sregion">GSregion</link> *region, <link linkend="_struct_g_sedge">GSedge</link> *edge, long nrc, long ne, int min_size)</para>
</listitem>
            <listitem><para>int <link linkend="__bimage__segment_8cpp_1aab333b535c1fea79e43714df3b36085e">img_update_segment</link> (long i, <link linkend="_class_bimage">Bimage</link> *p, <link linkend="_class_bimage">Bimage</link> *pmask, vector&lt; long &gt; vstep, double colorweight, vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp;seg)</para>
</listitem>
            <listitem><para>int <link linkend="__bimage__segment_8cpp_1a462301f98c76520bb82bc76ce64ed422">img_assign_pixel</link> (long i, <link linkend="_class_bimage">Bimage</link> *p, <link linkend="_class_bimage">Bimage</link> *pmask, double wd, vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp;seg)</para>
</listitem>
            <listitem><para>int <link linkend="__bimage__segment_8cpp_1ab660c17b22f8df319309039251fcffaa">img_assign_segments</link> (<link linkend="_class_bimage">Bimage</link> *p, <link linkend="_class_bimage">Bimage</link> *pmask, vector&lt; long &gt; vstep, vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp;seg)</para>
</listitem>
            <listitem><para>int <link linkend="__bimage__segment_8cpp_1ac21d24c3c6704018144b1dc3067759a9">img_impose_segments</link> (<link linkend="_class_bimage">Bimage</link> *p, <link linkend="_class_bimage">Bimage</link> *pmask, vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp;seg)</para>
</listitem>
            <listitem><para>long <link linkend="__bimage__segment_8cpp_1aabb560baf943a58b27660b7dd9c0cb3c">segment_lowest_neighbor</link> (vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp;seg, long i, long cc)</para>
</listitem>
            <listitem><para>int <link linkend="__bimage__segment_8cpp_1a4ca8acc5f05286dd543e68b9fdab4038">img_impose_lowest_neighbor</link> (<link linkend="_class_bimage">Bimage</link> *p, <link linkend="_class_bimage">Bimage</link> *pmask, vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp;seg)</para>
</listitem>
            <listitem><para>long <link linkend="__bimage__segment_8cpp_1ad3027d9fbec9b653e7bdda84b4f7a62e">segment_highest_neighbor</link> (vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp;seg, long i, long cc)</para>
</listitem>
            <listitem><para>int <link linkend="__bimage__segment_8cpp_1abc348e57dc4adaa25d0cc279612d4de2">img_impose_highest_neighbor</link> (<link linkend="_class_bimage">Bimage</link> *p, <link linkend="_class_bimage">Bimage</link> *pmask, vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp;seg)</para>
</listitem>
            <listitem><para>int <link linkend="__bimage__segment_8cpp_1a0f5b830da82303d387dc41efc2f52553">img_impose_difference_from_highest_neighbor</link> (<link linkend="_class_bimage">Bimage</link> *p, <link linkend="_class_bimage">Bimage</link> *pmask, vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp;seg)</para>
</listitem>
            <listitem><para>long <link linkend="__bimage__segment_8cpp_1ad481dcdde35d9ce533020dea239eb183">segment_setup_neighbors</link> (long i, vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp;seg, double dmax)</para>
</listitem>
            <listitem><para>long <link linkend="__bimage__segment_8cpp_1a3b80db0686d3c12652f68f4ccbe3e800">segments_setup_neighbors</link> (vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp;seg, long step)</para>
</listitem>
        </itemizedlist>
</simplesect>
<simplesect>
    <title>Variables    </title>
        <itemizedlist>
            <listitem><para>int <link linkend="__bimage__segment_8cpp_1a0b2caeb4b6f130be43e5a2f0267dd453">verbose</link></para>
</listitem>
        </itemizedlist>
</simplesect>
<section>
<title>Detailed Description</title>

<para>Methods for segmentation. </para>

<para><formalpara><title>Author: </title>

<para>Bernard Heymann and Samuel Payne </para>
</formalpara>
<formalpara><title>Date: </title>

<para>Created: 20010516 </para>

<para>Modified: 20190314 (BH) </para>
</formalpara>
</para>
</section>
<section>
<title>Function Documentation</title>
<anchor xml:id="__bimage__segment_8cpp_1a095e0a31b8f4b1c4f3f81670e4571709"/>    <section>
    <title>edge_setup()</title>
<indexterm><primary>edge_setup</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>edge_setup</secondary></indexterm>
<para><computeroutput><link linkend="_struct_g_sedge">GSedge</link>* edge_setup (<link linkend="_class_bimage">Bimage</link> * p, <link linkend="_class_bimage">Bimage</link> * pmask, int connect_type, long &amp; me, long &amp; ne)</computeroutput></para><para>
Definition at line 1223 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1a462301f98c76520bb82bc76ce64ed422"/>    <section>
    <title>img_assign_pixel()</title>
<indexterm><primary>img_assign_pixel</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>img_assign_pixel</secondary></indexterm>
<para><computeroutput>int img_assign_pixel (long i, <link linkend="_class_bimage">Bimage</link> * p, <link linkend="_class_bimage">Bimage</link> * pmask, double wd, vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp; seg)</computeroutput></para><para>
Definition at line 1575 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1ab660c17b22f8df319309039251fcffaa"/>    <section>
    <title>img_assign_segments()</title>
<indexterm><primary>img_assign_segments</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>img_assign_segments</secondary></indexterm>
<para><computeroutput>int img_assign_segments (<link linkend="_class_bimage">Bimage</link> * p, <link linkend="_class_bimage">Bimage</link> * pmask, vector&lt; long &gt; vstep, vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp; seg)</computeroutput></para><para>
Definition at line 1603 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1a0f5b830da82303d387dc41efc2f52553"/>    <section>
    <title>img_impose_difference_from_highest_neighbor()</title>
<indexterm><primary>img_impose_difference_from_highest_neighbor</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>img_impose_difference_from_highest_neighbor</secondary></indexterm>
<para><computeroutput>int img_impose_difference_from_highest_neighbor (<link linkend="_class_bimage">Bimage</link> * p, <link linkend="_class_bimage">Bimage</link> * pmask, vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp; seg)</computeroutput></para><para>
Definition at line 1691 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1abc348e57dc4adaa25d0cc279612d4de2"/>    <section>
    <title>img_impose_highest_neighbor()</title>
<indexterm><primary>img_impose_highest_neighbor</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>img_impose_highest_neighbor</secondary></indexterm>
<para><computeroutput>int img_impose_highest_neighbor (<link linkend="_class_bimage">Bimage</link> * p, <link linkend="_class_bimage">Bimage</link> * pmask, vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp; seg)</computeroutput></para><para>
Definition at line 1678 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1a4ca8acc5f05286dd543e68b9fdab4038"/>    <section>
    <title>img_impose_lowest_neighbor()</title>
<indexterm><primary>img_impose_lowest_neighbor</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>img_impose_lowest_neighbor</secondary></indexterm>
<para><computeroutput>int img_impose_lowest_neighbor (<link linkend="_class_bimage">Bimage</link> * p, <link linkend="_class_bimage">Bimage</link> * pmask, vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp; seg)</computeroutput></para><para>
Definition at line 1652 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1ac21d24c3c6704018144b1dc3067759a9"/>    <section>
    <title>img_impose_segments()</title>
<indexterm><primary>img_impose_segments</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>img_impose_segments</secondary></indexterm>
<para><computeroutput>int img_impose_segments (<link linkend="_class_bimage">Bimage</link> * p, <link linkend="_class_bimage">Bimage</link> * pmask, vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp; seg)</computeroutput></para><para>
Definition at line 1628 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1aab333b535c1fea79e43714df3b36085e"/>    <section>
    <title>img_update_segment()</title>
<indexterm><primary>img_update_segment</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>img_update_segment</secondary></indexterm>
<para><computeroutput>int img_update_segment (long i, <link linkend="_class_bimage">Bimage</link> * p, <link linkend="_class_bimage">Bimage</link> * pmask, vector&lt; long &gt; vstep, double colorweight, vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp; seg)</computeroutput></para><para>
Definition at line 1495 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1a0ecdf8debef2991d1643ab7ce55d9bab"/>    <section>
    <title>QsortSmallToLargeEdge()</title>
<indexterm><primary>QsortSmallToLargeEdge</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>QsortSmallToLargeEdge</secondary></indexterm>
<para><computeroutput>int QsortSmallToLargeEdge (const void * x, const void * y)</computeroutput></para><para>
Definition at line 1156 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1a5e7889f24062292d2b7d344a1346c7b9"/>    <section>
    <title>region_find()</title>
<indexterm><primary>region_find</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>region_find</secondary></indexterm>
<para><computeroutput>long region_find (<link linkend="_struct_g_sregion">GSregion</link> * region, long i)</computeroutput></para><para>
Definition at line 1164 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1a58d3501eb4414e70cc0bfc80f431b12f"/>    <section>
    <title>region_join()</title>
<indexterm><primary>region_join</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>region_join</secondary></indexterm>
<para><computeroutput>int region_join (<link linkend="_struct_g_sregion">GSregion</link> * region, long i, long j)</computeroutput></para><para>
Definition at line 1172 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1a11dde90ef6489e4dedf82a03e1f98d1c"/>    <section>
    <title>region_merge_small()</title>
<indexterm><primary>region_merge_small</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>region_merge_small</secondary></indexterm>
<para><computeroutput>long region_merge_small (<link linkend="_struct_g_sregion">GSregion</link> * region, <link linkend="_struct_g_sedge">GSedge</link> * edge, long nrc, long ne, int min_size)</computeroutput></para><para>
Definition at line 1341 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1a7540f37a6b7106f1898217c6b6c4d826"/>    <section>
    <title>region_merging()</title>
<indexterm><primary>region_merging</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>region_merging</secondary></indexterm>
<para><computeroutput>long region_merging (<link linkend="_struct_g_sregion">GSregion</link> * region, <link linkend="_struct_g_sedge">GSedge</link> * edge, long nrc, long ne, float threshold)</computeroutput></para><para>
Definition at line 1291 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1a465e5f32728ff222ee3bd04da541e059"/>    <section>
    <title>region_setup()</title>
<indexterm><primary>region_setup</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>region_setup</secondary></indexterm>
<para><computeroutput><link linkend="_struct_g_sregion">GSregion</link>* region_setup (<link linkend="_class_bimage">Bimage</link> * p, <link linkend="_class_bimage">Bimage</link> * pmask)</computeroutput></para><para>
Definition at line 1196 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1ad3027d9fbec9b653e7bdda84b4f7a62e"/>    <section>
    <title>segment_highest_neighbor()</title>
<indexterm><primary>segment_highest_neighbor</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>segment_highest_neighbor</secondary></indexterm>
<para><computeroutput>long segment_highest_neighbor (vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp; seg, long i, long cc)</computeroutput></para><para>
Definition at line 1665 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1aabb560baf943a58b27660b7dd9c0cb3c"/>    <section>
    <title>segment_lowest_neighbor()</title>
<indexterm><primary>segment_lowest_neighbor</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>segment_lowest_neighbor</secondary></indexterm>
<para><computeroutput>long segment_lowest_neighbor (vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp; seg, long i, long cc)</computeroutput></para><para>
Definition at line 1639 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1ad481dcdde35d9ce533020dea239eb183"/>    <section>
    <title>segment_setup_neighbors()</title>
<indexterm><primary>segment_setup_neighbors</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>segment_setup_neighbors</secondary></indexterm>
<para><computeroutput>long segment_setup_neighbors (long i, vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp; seg, double dmax)</computeroutput></para><para>
Definition at line 1706 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1a3b80db0686d3c12652f68f4ccbe3e800"/>    <section>
    <title>segments_setup_neighbors()</title>
<indexterm><primary>segments_setup_neighbors</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>segments_setup_neighbors</secondary></indexterm>
<para><computeroutput>long segments_setup_neighbors (vector&lt; <link linkend="_class_bsuperpixel">Bsuperpixel</link> &gt; &amp; seg, long step)</computeroutput></para><para>
Definition at line 1723 of file Bimage_segment.cpp.</para>
    </section><anchor xml:id="__bimage__segment_8cpp_1a17fd991e0a9ae84bd2c1099c72b4563e"/>    <section>
    <title>statistical_region_merging()</title>
<indexterm><primary>statistical_region_merging</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>statistical_region_merging</secondary></indexterm>
<para><computeroutput>long statistical_region_merging (<link linkend="_struct_g_sregion">GSregion</link> * region, <link linkend="_struct_g_sedge">GSedge</link> * edge, long nr, long ne, double fac)</computeroutput></para><para>
Definition at line 1314 of file Bimage_segment.cpp.</para>
</section>
</section>
<section>
<title>Variable Documentation</title>
<anchor xml:id="__bimage__segment_8cpp_1a0b2caeb4b6f130be43e5a2f0267dd453"/>    <section>
    <title>verbose</title>
<indexterm><primary>verbose</primary><secondary>Bimage_segment.cpp</secondary></indexterm>
<indexterm><primary>Bimage_segment.cpp</primary><secondary>verbose</secondary></indexterm>
<para><computeroutput>int verbose</computeroutput></para></section>
</section>
</section>
