<?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[Polarkoordinaten Verformungstool Kann mir da niemand Helfen???]]></title><description><![CDATA[<p>Hi,</p>
<p>ich versuche darauf basierend <a href="http://de.wikipedia.org/wiki/Polarkoordinaten" rel="nofollow">http://de.wikipedia.org/wiki/Polarkoordinaten</a> ein Verformungstool zu schreiben.</p>
<p>Das ein Bild einliest und mir dann eine Verformte Version davon abscheichert.</p>
<p>Das Quell Bild wird im Ziel Bild in einen Kreis Verformt dessen Mittelpunkt 0,0 im Quell Bild entspricht.</p>
<p>Mein Ansatz:</p>
<pre><code>for(int y= 0; y &lt;dHeightDst;y++)
    {    
      for(int x= 0; x &lt;dWidthDst;x++)
      {     
        int k = dWidthDst * y + x;

        double x2 = x - nRadius;

        double y2=  y - nRadius;

        double radius = sqrt(double(x2*x2 + y2*y2));     

        if (radius&lt;= nRadius)
        {
          pxMap[k] = radius;  

          pyMap[k]  = atan2(y2,x2)* 50;

          if(pyMap[k] &lt; 0)
          {
           pyMap[k]  =  pyMap[k] + 2 * M_PI;
          }
        }
        else
        {
          pxMap[k] = -1;

          pyMap[k] = -1;    
        }
      }  
    }
</code></pre>
<p>Mit dieser Schleife laufe ich alle Punkte ab und setze sie in den Beiden Arrays pyMap und pxMap.</p>
<p>Mit der Version bekomme ich einen Halb Kreis meines eingespeicherten Bildes nur fehlt die Hälfte. Und ich kann mir nicht erklären warum.</p>
<p>Für Hilfe wäre ich sehr verbunden.</p>
<p>Gruß</p>
<p>GT</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/212444/polarkoordinaten-verformungstool-kann-mir-da-niemand-helfen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 14 Oct 2026 21:21:39 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/212444.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 06 May 2008 14:11:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Polarkoordinaten Verformungstool Kann mir da niemand Helfen??? on Thu, 08 May 2008 06:42:01 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich versuche darauf basierend <a href="http://de.wikipedia.org/wiki/Polarkoordinaten" rel="nofollow">http://de.wikipedia.org/wiki/Polarkoordinaten</a> ein Verformungstool zu schreiben.</p>
<p>Das ein Bild einliest und mir dann eine Verformte Version davon abscheichert.</p>
<p>Das Quell Bild wird im Ziel Bild in einen Kreis Verformt dessen Mittelpunkt 0,0 im Quell Bild entspricht.</p>
<p>Mein Ansatz:</p>
<pre><code>for(int y= 0; y &lt;dHeightDst;y++)
    {    
      for(int x= 0; x &lt;dWidthDst;x++)
      {     
        int k = dWidthDst * y + x;

        double x2 = x - nRadius;

        double y2=  y - nRadius;

        double radius = sqrt(double(x2*x2 + y2*y2));     

        if (radius&lt;= nRadius)
        {
          pxMap[k] = radius;  

          pyMap[k]  = atan2(y2,x2)* 50;

          if(pyMap[k] &lt; 0)
          {
           pyMap[k]  =  pyMap[k] + 2 * M_PI;
          }
        }
        else
        {
          pxMap[k] = -1;

          pyMap[k] = -1;    
        }
      }  
    }
</code></pre>
<p>Mit dieser Schleife laufe ich alle Punkte ab und setze sie in den Beiden Arrays pyMap und pxMap.</p>
<p>Mit der Version bekomme ich einen Halb Kreis meines eingespeicherten Bildes nur fehlt die Hälfte. Und ich kann mir nicht erklären warum.</p>
<p>Für Hilfe wäre ich sehr verbunden.</p>
<p>Gruß</p>
<p>GT</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1504251</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1504251</guid><dc:creator><![CDATA[GT]]></dc:creator><pubDate>Thu, 08 May 2008 06:42:01 GMT</pubDate></item><item><title><![CDATA[Reply to Polarkoordinaten Verformungstool Kann mir da niemand Helfen??? on Tue, 06 May 2008 20:09:12 GMT]]></title><description><![CDATA[<p>Hmm. Da noch niemand gepostet hat, kann ich nur einen Allgemeinen Debug Tipp geben.</p>
<p>Mach ein möglichst überschauliches Bild und dann gehe Schritt für Schritt mit dem Debugger durch, überlege dir, was er für Daten haben müsste und überprüfe das.</p>
<p>Ansonsten, was ist nRadius?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1504501</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1504501</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Tue, 06 May 2008 20:09:12 GMT</pubDate></item><item><title><![CDATA[Reply to Polarkoordinaten Verformungstool Kann mir da niemand Helfen??? on Thu, 08 May 2008 06:45:10 GMT]]></title><description><![CDATA[<p>Das die aktuelle version vom Program:</p>
<pre><code>if (imgResult.width() &lt; imgResult.height())
    {
      nRadius = imgResult.width() /2.0;
    }

    else if (imgResult.width() &gt;= imgResult.height())
    {
      nRadius = imgResult.height()/2.0;
    }

    for(int x= 0; x &lt;dWidthDst;x++)
    {  
      for(int y= 0; y &lt;dHeightDst;y++)
      {    

        int k = dWidthDst * y + x;

        double x2 = x - nRadius;

        double y2=  y - nRadius;

        double radius = sqrt(double(x2*x2 + y2*y2));     

        if (radius&lt;= nRadius)
        {
          pxMap[k] = radius;  

          Ipp32f aTan  = atan2(y2,x2);

          if(aTan &lt; 0)
          {
            pyMap[k]  =  aTan + dTwoPi;
          }
          else if(aTan &gt; dTwoPi)
          {
            pyMap[k] = aTan - dTwoPi;
          }
          else
          {
            pyMap[k] = aTan;
          }
        }
        else
        {
          pxMap[k] = -1;

          pyMap[k] = -1;    
        }
      }  
    }
</code></pre>
<p>Das Problem ist jetzt das ich nur die ersten 5 Pixel nach unten dargestellt bekomme. Einen Kreis krieg ich schon hin durch das ausschließen per if abfrage aller Punkte die größer als der Radius sind und Positive Werte die zu Groß sind oder Negative Werte werden auch abgefangen.</p>
<p>Ich find jetzt nur den fehler nicht ;_; das zum verzeifeln...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1504610</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1504610</guid><dc:creator><![CDATA[GT]]></dc:creator><pubDate>Thu, 08 May 2008 06:45:10 GMT</pubDate></item></channel></rss>