<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://wiki.hshl.de/wiki/index.php?action=history&amp;feed=atom&amp;title=Image_Processing%3A_Model_based_segmentation</id>
	<title>Image Processing: Model based segmentation - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.hshl.de/wiki/index.php?action=history&amp;feed=atom&amp;title=Image_Processing%3A_Model_based_segmentation"/>
	<link rel="alternate" type="text/html" href="https://wiki.hshl.de/wiki/index.php?title=Image_Processing:_Model_based_segmentation&amp;action=history"/>
	<updated>2026-04-19T19:57:48Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in HSHL Mechatronik</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.hshl.de/wiki/index.php?title=Image_Processing:_Model_based_segmentation&amp;diff=147081&amp;oldid=prev</id>
		<title>Ajay.paul@stud.hshl.de am 5. März 2026 um 13:23 Uhr</title>
		<link rel="alternate" type="text/html" href="https://wiki.hshl.de/wiki/index.php?title=Image_Processing:_Model_based_segmentation&amp;diff=147081&amp;oldid=prev"/>
		<updated>2026-03-05T13:23:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 5. März 2026, 13:23 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l99&quot;&gt;Zeile 99:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 99:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** &amp;lt;code&amp;gt;method&amp;lt;/code&amp;gt;: &amp;#039;Chan-Vese&amp;#039; (region-based) or &amp;#039;edge&amp;#039; (gradient-based).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** &amp;lt;code&amp;gt;method&amp;lt;/code&amp;gt;: &amp;#039;Chan-Vese&amp;#039; (region-based) or &amp;#039;edge&amp;#039; (gradient-based).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;visboundaries&amp;lt;/code&amp;gt;: A helper function to overlay binary mask boundaries onto the original image for visualization.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;visboundaries&amp;lt;/code&amp;gt;: A helper function to overlay binary mask boundaries onto the original image for visualization.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;SVN Repository:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;https://svn.hshl.de/svn/MATLAB_Vorkurs/trunk/Signalverarbeitung_mit_Kuenstlicher_Intelligenz/Image%20Processing%20with%20MATLAB%20and%20AI/image_processing_matlab/5_Model_Based%20segemenation/&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ajay.paul@stud.hshl.de</name></author>
	</entry>
	<entry>
		<id>https://wiki.hshl.de/wiki/index.php?title=Image_Processing:_Model_based_segmentation&amp;diff=146827&amp;oldid=prev</id>
		<title>Ajay.paul@stud.hshl.de: Die Seite wurde neu angelegt: „= Model-Based Segmentation: Active Contours =  &#039;&#039;&#039;Model-Based Segmentation&#039;&#039;&#039; is a top-down approach where a geometric model or a mathematical energy function evolves to fit the objects in an image. Unlike data-based methods (like thresholding) which look at pixels individually, model-based methods consider the connectivity and smoothness of the object&#039;s boundary.  This article explores the &#039;&#039;&#039;Active Contours&#039;&#039;&#039; (or &quot;Snakes&quot;) algorithm, specifically using…“</title>
		<link rel="alternate" type="text/html" href="https://wiki.hshl.de/wiki/index.php?title=Image_Processing:_Model_based_segmentation&amp;diff=146827&amp;oldid=prev"/>
		<updated>2026-02-04T18:56:22Z</updated>

		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: „= Model-Based Segmentation: Active Contours =  &amp;#039;&amp;#039;&amp;#039;Model-Based Segmentation&amp;#039;&amp;#039;&amp;#039; is a top-down approach where a geometric model or a mathematical energy function evolves to fit the objects in an image. Unlike data-based methods (like thresholding) which look at pixels individually, model-based methods consider the connectivity and smoothness of the object&amp;#039;s boundary.  This article explores the &amp;#039;&amp;#039;&amp;#039;Active Contours&amp;#039;&amp;#039;&amp;#039; (or &amp;quot;Snakes&amp;quot;) algorithm, specifically using…“&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Model-Based Segmentation: Active Contours =&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Model-Based Segmentation&amp;#039;&amp;#039;&amp;#039; is a top-down approach where a geometric model or a mathematical energy function evolves to fit the objects in an image. Unlike data-based methods (like thresholding) which look at pixels individually, model-based methods consider the connectivity and smoothness of the object&amp;#039;s boundary.&lt;br /&gt;
&lt;br /&gt;
This article explores the &amp;#039;&amp;#039;&amp;#039;Active Contours&amp;#039;&amp;#039;&amp;#039; (or &amp;quot;Snakes&amp;quot;) algorithm, specifically using the Chan-Vese method to segment objects like coins.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Theoretical Background ==&lt;br /&gt;
&lt;br /&gt;
=== Active Contours (Snakes) ===&lt;br /&gt;
An Active Contour is a curve that moves through an image to minimize an energy function. The curve is influenced by two forces:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Internal Forces:&amp;#039;&amp;#039;&amp;#039; These keep the curve smooth and continuous (preventing it from becoming jagged or breaking).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;External Forces:&amp;#039;&amp;#039;&amp;#039; These pull the curve toward image features like edges or region boundaries.&lt;br /&gt;
&lt;br /&gt;
=== The Chan-Vese Method ===&lt;br /&gt;
The standard Active Contour relies on gradients (edges). However, the &amp;#039;&amp;#039;&amp;#039;Chan-Vese&amp;#039;&amp;#039;&amp;#039; model is a region-based active contour.&lt;br /&gt;
* It does not look for edges directly.&lt;br /&gt;
* Instead, it tries to separate the image into two regions (inside the curve and outside the curve) such that the pixel intensities inside are homogeneous and the pixel intensities outside are homogeneous.&lt;br /&gt;
* This makes it robust to noise and able to detect objects whose boundaries are not clearly defined by sharp gradients.&lt;br /&gt;
&lt;br /&gt;
== MATLAB Implementation ==&lt;br /&gt;
&lt;br /&gt;
The following MATLAB script demonstrates the evolution of an active contour over several iterations.&lt;br /&gt;
&lt;br /&gt;
=== Code Logic ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
% Model-Based Segmentation&lt;br /&gt;
% Algorithm: Active Contours&lt;br /&gt;
clc; clear; close all;&lt;br /&gt;
&lt;br /&gt;
% 1. Load Image&lt;br /&gt;
% &amp;#039;coins.png&amp;#039; is a standard MATLAB demo image&lt;br /&gt;
I = imread(&amp;#039;coins.png&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
% 2. Define Initial Mask&lt;br /&gt;
% The algorithm needs a starting point. We create a rectangle slightly &lt;br /&gt;
% smaller than the image border. The curve will shrink/expand from here.&lt;br /&gt;
mask = zeros(size(I));&lt;br /&gt;
mask(10:end-10, 10:end-10) = 1;&lt;br /&gt;
&lt;br /&gt;
% 3. Run Active Contours&lt;br /&gt;
% We run the algorithm for different numbers of iterations to visualize the process.&lt;br /&gt;
&lt;br /&gt;
% 100 Iterations: The curve starts shrinking but hasn&amp;#039;t separated objects yet.&lt;br /&gt;
bw_100 = activecontour(I, mask, 100, &amp;#039;Chan-Vese&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
% 300 Iterations: The curve begins to snap around individual objects.&lt;br /&gt;
bw_300 = activecontour(I, mask, 300, &amp;#039;Chan-Vese&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
% 500 Iterations: The curve has fully tightened around the coins.&lt;br /&gt;
bw_500 = activecontour(I, mask, 500, &amp;#039;Chan-Vese&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
% 4. Visualization&lt;br /&gt;
figure(&amp;#039;Name&amp;#039;, &amp;#039;Task 5: Active Contour Evolution (0-500)&amp;#039;, ...&lt;br /&gt;
       &amp;#039;NumberTitle&amp;#039;, &amp;#039;off&amp;#039;, ...&lt;br /&gt;
       &amp;#039;Position&amp;#039;, [50, 100, 1600, 400]);&lt;br /&gt;
&lt;br /&gt;
% --- Original + Initial Mask ---&lt;br /&gt;
subplot(1, 4, 1);&lt;br /&gt;
imshow(I); hold on;&lt;br /&gt;
visboundaries(mask, &amp;#039;Color&amp;#039;, &amp;#039;b&amp;#039;, &amp;#039;LineWidth&amp;#039;, 2);&lt;br /&gt;
title({&amp;#039;1. Start&amp;#039;, &amp;#039;(Initial Blue Mask)&amp;#039;}, &amp;#039;FontSize&amp;#039;, 11);&lt;br /&gt;
&lt;br /&gt;
% --- 100 Iterations ---&lt;br /&gt;
subplot(1, 4, 2);&lt;br /&gt;
imshow(I); hold on;&lt;br /&gt;
visboundaries(bw_100, &amp;#039;Color&amp;#039;, &amp;#039;y&amp;#039;, &amp;#039;LineWidth&amp;#039;, 2);&lt;br /&gt;
title({&amp;#039;2. 100 Iterations&amp;#039;, &amp;#039;(Under-segmented)&amp;#039;}, &amp;#039;FontSize&amp;#039;, 11);&lt;br /&gt;
&lt;br /&gt;
% --- 300 Iterations ---&lt;br /&gt;
subplot(1, 4, 3);&lt;br /&gt;
imshow(I); hold on;&lt;br /&gt;
visboundaries(bw_300, &amp;#039;Color&amp;#039;, &amp;#039;r&amp;#039;, &amp;#039;LineWidth&amp;#039;, 2);&lt;br /&gt;
title({&amp;#039;3. 300 Iterations&amp;#039;, &amp;#039;(Converged)&amp;#039;}, &amp;#039;FontSize&amp;#039;, 11, &amp;#039;FontWeight&amp;#039;, &amp;#039;bold&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
% --- 500 Iterations ---&lt;br /&gt;
subplot(1, 4, 4);&lt;br /&gt;
imshow(I); hold on;&lt;br /&gt;
visboundaries(bw_500, &amp;#039;Color&amp;#039;, &amp;#039;g&amp;#039;, &amp;#039;LineWidth&amp;#039;, 2);&lt;br /&gt;
title({&amp;#039;4. 500 Iterations&amp;#039;, &amp;#039;(Stable / Tight Fit)&amp;#039;}, &amp;#039;FontSize&amp;#039;, 11);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Analysis of Results ==&lt;br /&gt;
&lt;br /&gt;
The active contour is an iterative process.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Initialization:&amp;#039;&amp;#039;&amp;#039; We start with a generic box (blue). This is the initial guess.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Evolution:&amp;#039;&amp;#039;&amp;#039; As iterations proceed, the box shrinks.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Topology Change:&amp;#039;&amp;#039;&amp;#039; A key feature of the level-set implementation (used in Chan-Vese) is that the curve can split. Notice how the single blue box eventually splits into multiple separate circles (red/green) to wrap around each coin individually.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Convergence:&amp;#039;&amp;#039;&amp;#039; At 500 iterations, the contours stop moving because the energy function has reached a minimum—the regions inside the circles are bright (coins) and the region outside is dark (background).&lt;br /&gt;
&lt;br /&gt;
[[File:Model based segmentation.png|center|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Key MATLAB Functions ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;activecontour(I, mask, n, method)&amp;lt;/code&amp;gt;: Evolves the segmentation.&lt;br /&gt;
** &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;: Number of iterations.&lt;br /&gt;
** &amp;lt;code&amp;gt;method&amp;lt;/code&amp;gt;: &amp;#039;Chan-Vese&amp;#039; (region-based) or &amp;#039;edge&amp;#039; (gradient-based).&lt;br /&gt;
* &amp;lt;code&amp;gt;visboundaries&amp;lt;/code&amp;gt;: A helper function to overlay binary mask boundaries onto the original image for visualization.&lt;/div&gt;</summary>
		<author><name>Ajay.paul@stud.hshl.de</name></author>
	</entry>
</feed>