<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Dilatation]]></title><description><![CDATA[<p>Hi,</p>
<p>ich möchte ein Programm schreiben, dass eine Dilatation durchführt. Ich hoffe ihr wisst was das ist.<br />
Ich versuch es mal kurz zu erklären.<br />
Ein Pixel bleibt schwarz gefärbt, falls ein Nachbarpixel schwarz ist.<br />
Ein schwarzes Pixel wird weiß gefärbt, sobald es kein schwarzes Nachbarpixel hat.<br />
Weiße Pixel bleiben weiß.</p>
<pre><code>/*------------------------------------------------------------------------------
Dilatation
------------------------------------------------------------------------------*/

bool ByteImage::Dilatation(ByteImage* TMPImage){

	unsigned char GWA[9] = {0};

	for(unsigned int cols = 0; cols &lt; this-&gt;_NCols; cols++){
		for(unsigned int rows = 0; rows &lt; this-&gt;_NRows; rows++){

		//X**
		GWA[0] = this-&gt;GetPixel(rows - 1, cols - 1);
		GWA[3] = this-&gt;GetPixel(rows , cols - 1);
		GWA[6] = this-&gt;GetPixel(rows + 1, cols -1);

		//*X*
		GWA[1] = this-&gt;GetPixel(rows - 1, cols);
		GWA[4] = this-&gt;GetPixel(rows, cols);
		GWA[7] = this-&gt;GetPixel(rows + 1, cols);

		//**X
		GWA[2] = this-&gt;GetPixel(rows  -1 , cols + 1);
		GWA[5] = this-&gt;GetPixel(rows, cols + 1);
		GWA[8] = this-&gt;GetPixel(rows + 1, cols + 1);

		this-&gt;sortFeld(GWA);

		if(GWA[0]==0){

			printf(&quot;Pixel ist schwarz \n&quot;);
			TMPImage-&gt;SetPixel(rows, cols, GWA[0]);
		}

		else
			printf(&quot;Pixel ist weiss \n&quot;);

		}
	}

	return true;
}
</code></pre>
<p>Ich hoffe ihr könnt mir helfen, da ich grad keinen Plan hab, wie ich da vorgehen muss.<br />
DANKE.</p>
<p>Gruß<br />
schmitti81</p>
<p>P.S.: Ich bin mir auch nicht sicher ob die Textausgabe stimmt. In meinem Testbild ist das Pixel 0 schwarz. Der Rest ist weiß.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/159488/dilatation</link><generator>RSS for Node</generator><lastBuildDate>Thu, 10 Sep 2026 14:51:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/159488.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 15 Sep 2006 16:01:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dilatation on Fri, 15 Sep 2006 16:01:03 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich möchte ein Programm schreiben, dass eine Dilatation durchführt. Ich hoffe ihr wisst was das ist.<br />
Ich versuch es mal kurz zu erklären.<br />
Ein Pixel bleibt schwarz gefärbt, falls ein Nachbarpixel schwarz ist.<br />
Ein schwarzes Pixel wird weiß gefärbt, sobald es kein schwarzes Nachbarpixel hat.<br />
Weiße Pixel bleiben weiß.</p>
<pre><code>/*------------------------------------------------------------------------------
Dilatation
------------------------------------------------------------------------------*/

bool ByteImage::Dilatation(ByteImage* TMPImage){

	unsigned char GWA[9] = {0};

	for(unsigned int cols = 0; cols &lt; this-&gt;_NCols; cols++){
		for(unsigned int rows = 0; rows &lt; this-&gt;_NRows; rows++){

		//X**
		GWA[0] = this-&gt;GetPixel(rows - 1, cols - 1);
		GWA[3] = this-&gt;GetPixel(rows , cols - 1);
		GWA[6] = this-&gt;GetPixel(rows + 1, cols -1);

		//*X*
		GWA[1] = this-&gt;GetPixel(rows - 1, cols);
		GWA[4] = this-&gt;GetPixel(rows, cols);
		GWA[7] = this-&gt;GetPixel(rows + 1, cols);

		//**X
		GWA[2] = this-&gt;GetPixel(rows  -1 , cols + 1);
		GWA[5] = this-&gt;GetPixel(rows, cols + 1);
		GWA[8] = this-&gt;GetPixel(rows + 1, cols + 1);

		this-&gt;sortFeld(GWA);

		if(GWA[0]==0){

			printf(&quot;Pixel ist schwarz \n&quot;);
			TMPImage-&gt;SetPixel(rows, cols, GWA[0]);
		}

		else
			printf(&quot;Pixel ist weiss \n&quot;);

		}
	}

	return true;
}
</code></pre>
<p>Ich hoffe ihr könnt mir helfen, da ich grad keinen Plan hab, wie ich da vorgehen muss.<br />
DANKE.</p>
<p>Gruß<br />
schmitti81</p>
<p>P.S.: Ich bin mir auch nicht sicher ob die Textausgabe stimmt. In meinem Testbild ist das Pixel 0 schwarz. Der Rest ist weiß.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1138056</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1138056</guid><dc:creator><![CDATA[schmitti81]]></dc:creator><pubDate>Fri, 15 Sep 2006 16:01:03 GMT</pubDate></item><item><title><![CDATA[Reply to Dilatation on Fri, 15 Sep 2006 16:02:47 GMT]]></title><description><![CDATA[<p>irgendwie hast du die frage vergessen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1138057</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1138057</guid><dc:creator><![CDATA[Dilatation]]></dc:creator><pubDate>Fri, 15 Sep 2006 16:02:47 GMT</pubDate></item><item><title><![CDATA[Reply to Dilatation on Fri, 15 Sep 2006 16:04:20 GMT]]></title><description><![CDATA[<p>Die Frage lautet. Kann mir jemand helfen, wie ich weiter vorgehen muss, damit mein Programm eine Dilatation durchführt.</p>
<p>Gruß<br />
schmitti81</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1138059</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1138059</guid><dc:creator><![CDATA[schmitti81]]></dc:creator><pubDate>Fri, 15 Sep 2006 16:04:20 GMT</pubDate></item><item><title><![CDATA[Reply to Dilatation on Fri, 15 Sep 2006 16:41:43 GMT]]></title><description><![CDATA[<p>1. Erstell dir ein zweites Array der gleichen Größe.<br />
2. Durchlaufe jedes Element<br />
3. Untersuche für dein Element den aktuellen Werte und die der (bis zu <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--smiling_face_with_sunglasses"
      title="8)"
      alt="😎"
    /> Nachbarn<br />
und setzt den neuen Wert entsprechend.<br />
4. Gebe dein neues Array zurück.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1138076</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1138076</guid><dc:creator><![CDATA[Javaner]]></dc:creator><pubDate>Fri, 15 Sep 2006 16:41:43 GMT</pubDate></item><item><title><![CDATA[Reply to Dilatation on Fri, 15 Sep 2006 17:08:49 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Aber nicht zu oft durchlaufen :).</p>
<p>MFG winexec*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1138095</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1138095</guid><dc:creator><![CDATA[winexec*]]></dc:creator><pubDate>Fri, 15 Sep 2006 17:08:49 GMT</pubDate></item><item><title><![CDATA[Reply to Dilatation on Fri, 15 Sep 2006 17:54:35 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/12170">@Javaner</a>: Danke. Das mit dem Werte abfragen hat bei mir irgendwie nicht geklappt. Irgendwie hat der mir keine Werte ausgegeben.<br />
Kannst du mir nicht mal schreiben wie du das gedacht hast.<br />
Dankeschön.</p>
<p>Gruß<br />
schmitti81</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1138117</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1138117</guid><dc:creator><![CDATA[schmitti81]]></dc:creator><pubDate>Fri, 15 Sep 2006 17:54:35 GMT</pubDate></item></channel></rss>