<?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[Struckt probleme :(]]></title><description><![CDATA[<p>Hallo habe folgendes Problem:<br />
Ich möchte gerne die Funktion &quot;freistellen&quot; benutzen....</p>
<p>mein Ansatz:</p>
<pre><code>freistellen(bild,2048,2048,region[420, 231, 810, 1119]);
</code></pre>
<p>was mache ich falsch?<br />
Danke schonmal im voraus...</p>
<p>Die Programme:</p>
<pre><code>/*
 *  imgproc.h
 */

#ifndef PIXEL
#define PIXEL unsigned char 
#endif

/* Strukturtyp für die Beschreibung eines Bildausschnitts */
typedef struct
{
	int x;  /* x-Koordinate (Spaltenindex) der oberen linken Ecke */
	int y;  /* y-Koordinate (Zeilenindex) der oberen linken Ecke */
	int width;  /* Breite des Bildausschnitts (#Spalten) */
	int height; /* Höhe des Bildausschnitts (#Zeilen) */
} ImageBox;

/* Funktion für einen Histogrammausgleich (Kontrastverbesserung) */
void histequ(PIXEL **bild, /* Input und Output-Bild */
			 int lines,    /* Zeilenanzahl von bild */
			 int columns   /* Spaltenanzahl von bild */
			 );

/* Funktion zur Berechnung eines Grauwerthistogramms für einen Bildausschnitt */
void histo(PIXEL **bild,
		   ImageBox region,    /* Größe und Lage des Bildausschnitts */
	       long *buff1     /* Zeiger auf Ergebnis (Datenfeld mit Länge 256) */
		   );

/* Funktion zum Extrahieren eines Bildausschnitts.
   Das Ursprungsbild wird nicht verändert.
   Der Rückgabewert ist ein Zeiger auf ein neues Bild,
   das den Ausschnitt enthält.
*/
PIXEL **freistellen(PIXEL **bild, 
					int   anzahl_zeilen,  /* Zeilenanzahl von bild */
					int   anzahl_spalten, /* Spaltenanzahl von bild */
					ImageBox region    /* Größe und Lage des Bildausschnitts */					
					); /* Breite des Ausschnitts (#Spalten) */

/* Ausgabe eines vereinfachten Bild-Histogramms als ASCII-Text auf stdout */
void histogram_print( PIXEL **bild, int zeilenanzahl, int spaltenanzahl );

/* Berechnung des kleinsten Pixelwerts im Bild. */
/* Der Rückgabewert ist der Minimum-Wert.       */
PIXEL bild_minimum(PIXEL **bild, 
				   int   anzahl_zeilen,  /* Zeilenanzahl von bild */
				   int   anzahl_spalten /* Spaltenanzahl von bild */
                   );

/* Berechnung des größten Pixelwerts im Bild. */
/* Der Rückgabewert ist der Maximum-Wert.     */
PIXEL bild_maximum(PIXEL **bild, 
				   int   anzahl_zeilen,  /* Zeilenanzahl von bild */
				   int   anzahl_spalten /* Spaltenanzahl von bild */
                   );

/* Faltung eines Bildes mit einem 3x3 Filterkern. */
void filter3x3 (PIXEL **bild,         /* Input und Output-Bild */
				int   anzahl_zeilen,  /* Zeilenanzahl von bild */
				int   anzahl_spalten, /* Spaltenanzahl von bild */
				int   filter[3][3]    /* Matrix der Filterkoeffizienten */
				);
</code></pre>
<pre><code>/*
 *  imgproc.c
 */

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &quot;tinyjpeg.h&quot;
#include &quot;imgproc.h&quot;

/*                                                                         */
/* histequ Histogramm-Equalization                                         */
/*                                                                         */
/* Parameter:                                                              */
/* ==========                                                              */
/* matr,line,columns Bilddefinition                                        */
/*                                                                         */
/***************************************************************************/

void histequ(PIXEL **matr, int lines, int columns)
{
	extern void histo();

	long buff[256];
	int i;
	PIXEL kennli[256];
	double coeff;
	 PIXEL *frpt,*le;
	 PIXEL *kk;
	ImageBox region = {0, 0, columns, lines};

	coeff = 255.0 / ((double)lines * (double)columns);

	histo(matr,region,buff);

	kennli[0] = 0;

	for (i = 1; i &lt; 256; i++)
	{
		buff[i] += buff[i - 1];
		kennli[i] = (PIXEL)(coeff * (double)buff[i]);
	}

	kk = kennli;

	for (i = 0; i &lt; lines; i++)
	{
		frpt = matr[i];
		le = frpt + columns;

		while (frpt &lt; le)
		{
			*frpt = kk[*frpt];
			frpt++;
		}
	}
}

/* Funktion zur Berechnung eines Grauwerthistogramms für einen Bildausschnitt */
void histo(PIXEL **bild,
		   ImageBox region,    /* Größe und Lage des Bildausschnitts */
	       long *buff1  /* Zeiger auf Ergebnis (Datenfeld mit Länge 256) */
		   )
{
	int lines = region.height;
	int columns = region.width;
	int y_a = region.y;
	int x_a = region.x;
	int i;
	PIXEL *frpt;
	PIXEL *le;
	long *buff;
	long  val;

	buff = buff1;

	for (i = 0; i &lt; 256; i++) buff1[i] = 0;

	for (i = 0; i &lt; lines; i++)
	{
		frpt = bild[i + y_a] + x_a;
		le = frpt + columns;   

		while (frpt &lt; le)
		{
			val = (*frpt++);
			*((long*)(buff + val)) += 1;
		}
	}
}

/* Funktion zum Extrahieren eines Bildausschnitts.
 Das Ursprungsbild wird nicht verändert.
 Der Rückgabewert ist ein Zeiger auf ein neues Bild,
 das den Ausschnitt enthält.
 */
PIXEL **freistellen(PIXEL **bild, 
					int   anzahl_zeilen,  /* Zeilenanzahl von bild */
					int   anzahl_spalten, /* Spaltenanzahl von bild */
					ImageBox region    /* Größe und Lage des Bildausschnitts */					
					) 
{
	PIXEL **bildausschnitt;
	int   i, j;
	int   ia, ja;
	int hoehe = region.height;
	int breite = region.width;
	int erste_zeile = region.y;
	int erste_spalte = region.x;

	if (erste_zeile+hoehe &gt; anzahl_zeilen  ||
		erste_spalte+breite &gt; anzahl_spalten ||
		erste_zeile &lt; 0 || erste_spalte &lt; 0 )
		return NULL;

	bildausschnitt = (PIXEL **) 
		pointer_array( /* address of matrix element (0,0) */
					   malloc(hoehe*breite*sizeof(PIXEL)),
					   hoehe,      /* number of rows of the matrix  */
					   breite,   /* actual number of columns, ie the distance 
							      between two consecutive row beginnings specified in units of element size. */
					   sizeof(PIXEL) /* size of the matrix elements in bytes */
					) ;
	ia = ja = 0;
	if (bildausschnitt != NULL)
		for (i=erste_zeile, ia=0; i &lt; erste_zeile+hoehe; i++, ia++)
			for (j=erste_spalte, ja=0; j &lt; erste_spalte+breite; j++, ja++)
				bildausschnitt[ia][ja] = bild[i][j];

	return (bildausschnitt);
}

/* Ausgabe eines vereinfachten Bild-Histogramms als ASCII-Text auf stdout */
void histogram_print( PIXEL **bild, int zeilenanzahl, int spaltenanzahl )
{   long int histo[64] = {0};
	int  i, j;
	long int max=0;
	int  pix;
	const int histo_height=15;

	printf(&quot;\nNormiertes Histogramm - Klassenbreite 4: 0...255 --&gt; 0...63\n&quot;);
	for (j=0; j&lt;64; j++)
		printf(&quot;-&quot;);
	printf(&quot;\n&quot;);

	for (i=0; i &lt; zeilenanzahl; i++)
		for (j=0; j &lt; spaltenanzahl; j++)
		{
			pix = bild[i][j]/ 4;
			if (pix &lt; 64)
			{
			histo[pix] += 1;
			if (histo[pix] &gt; max)
				max = histo[pix];
			}
		}

	for (i=histo_height; i &gt;=1; i--)
	{
		for (j=0; j&lt;64; j++)
			if ((double)histo[j]/(double)max *histo_height &gt;= i)
				putchar('|');
	        else
		        putchar(' ');
		putchar('\n');
	}
	for (j=0; j&lt;64; j++)
		printf(&quot;%1i&quot;, j/10);
	putchar('\n');	
	for (j=0; j&lt;64; j++)
		printf(&quot;%1i&quot;, j%10);
	putchar('\n');	
}

/* Berechnung des kleinsten Pixelwerts im Bild. */
/* Der Rückgabewert ist der Minimum-Wert.       */
PIXEL bild_minimum(PIXEL **bild, 
				   int   anzahl_zeilen,  /* Zeilenanzahl von bild */
				   int   anzahl_spalten /* Spaltenanzahl von bild */
                   )
{
	int   i, j;
	PIXEL pix;

	pix = bild[0][0];
	for (i=0; i &lt; anzahl_zeilen; i++)
		for (j=0; j &lt; anzahl_spalten; j++)
			if (bild[i][j] &lt; pix)
				pix = bild[i][j];

	return (pix);
}

/* Berechnung des größten Pixelwerts im Bild. */
/* Der Rückgabewert ist der Maximum-Wert.     */
PIXEL bild_maximum(PIXEL **bild, 
				   int   anzahl_zeilen,  /* Zeilenanzahl von bild */
				   int   anzahl_spalten /* Spaltenanzahl von bild */
                   )
{
	int   i, j;
	PIXEL pix;

	pix = bild[0][0];
	for (i=0; i &lt; anzahl_zeilen; i++)
		for (j=0; j &lt; anzahl_spalten; j++)
			if (bild[i][j] &gt; pix)
				pix = bild[i][j];

	return (pix);
}

/* Faltung eines Bildes mit einem 3x3 Filterkern. */
void filter3x3 (PIXEL **bild,         /* Input und Output-Bild */
				int   anzahl_zeilen,  /* Zeilenanzahl von bild */
				int   anzahl_spalten, /* Spaltenanzahl von bild */
				int   filter[3][3]    /* Matrix der Filterkoeffizienten */
				)
{
	int   i, j;
	int   pix;
	int   filtersumme=0;
	PIXEL puffer[5000];

	for (i=0; i &lt; 3; i++)
		for (j=0; j &lt; 3; j++)
			filtersumme += filter[i][j];

	for (i=1; i &lt; anzahl_zeilen-1; i++)
	{
		for (j=1; j &lt; anzahl_spalten-1; j++)
		{
			pix = bild[i][j] * filter[1][1] +
			      bild[i-1][j] * filter[0][1] +
			      bild[i+1][j] * filter[2][1] +
			      bild[i][j-1] * filter[1][0] +
			      bild[i-1][j-1] * filter[0][0] +
			      bild[i+1][j-1] * filter[2][0] +
			      bild[i][j+1] * filter[1][2] +
				  bild[i-1][j+1] * filter[0][2] +
			      bild[i+1][j+1] * filter[2][2] ;

			if (filtersumme != 0)
			   pix = pix / filtersumme;
			if (pix &lt; 0)
				puffer[j] = 0;
			else
				puffer[j] =pix;
		}
	for (j=1; j &lt; anzahl_spalten-1; j++)	
		bild[i-1][j] = puffer[j];
	}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/324266/struckt-probleme</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Jul 2026 14:54:12 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/324266.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 09 Mar 2014 18:53:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 21:15:54 GMT]]></title><description><![CDATA[<p>Hallo habe folgendes Problem:<br />
Ich möchte gerne die Funktion &quot;freistellen&quot; benutzen....</p>
<p>mein Ansatz:</p>
<pre><code>freistellen(bild,2048,2048,region[420, 231, 810, 1119]);
</code></pre>
<p>was mache ich falsch?<br />
Danke schonmal im voraus...</p>
<p>Die Programme:</p>
<pre><code>/*
 *  imgproc.h
 */

#ifndef PIXEL
#define PIXEL unsigned char 
#endif

/* Strukturtyp für die Beschreibung eines Bildausschnitts */
typedef struct
{
	int x;  /* x-Koordinate (Spaltenindex) der oberen linken Ecke */
	int y;  /* y-Koordinate (Zeilenindex) der oberen linken Ecke */
	int width;  /* Breite des Bildausschnitts (#Spalten) */
	int height; /* Höhe des Bildausschnitts (#Zeilen) */
} ImageBox;

/* Funktion für einen Histogrammausgleich (Kontrastverbesserung) */
void histequ(PIXEL **bild, /* Input und Output-Bild */
			 int lines,    /* Zeilenanzahl von bild */
			 int columns   /* Spaltenanzahl von bild */
			 );

/* Funktion zur Berechnung eines Grauwerthistogramms für einen Bildausschnitt */
void histo(PIXEL **bild,
		   ImageBox region,    /* Größe und Lage des Bildausschnitts */
	       long *buff1     /* Zeiger auf Ergebnis (Datenfeld mit Länge 256) */
		   );

/* Funktion zum Extrahieren eines Bildausschnitts.
   Das Ursprungsbild wird nicht verändert.
   Der Rückgabewert ist ein Zeiger auf ein neues Bild,
   das den Ausschnitt enthält.
*/
PIXEL **freistellen(PIXEL **bild, 
					int   anzahl_zeilen,  /* Zeilenanzahl von bild */
					int   anzahl_spalten, /* Spaltenanzahl von bild */
					ImageBox region    /* Größe und Lage des Bildausschnitts */					
					); /* Breite des Ausschnitts (#Spalten) */

/* Ausgabe eines vereinfachten Bild-Histogramms als ASCII-Text auf stdout */
void histogram_print( PIXEL **bild, int zeilenanzahl, int spaltenanzahl );

/* Berechnung des kleinsten Pixelwerts im Bild. */
/* Der Rückgabewert ist der Minimum-Wert.       */
PIXEL bild_minimum(PIXEL **bild, 
				   int   anzahl_zeilen,  /* Zeilenanzahl von bild */
				   int   anzahl_spalten /* Spaltenanzahl von bild */
                   );

/* Berechnung des größten Pixelwerts im Bild. */
/* Der Rückgabewert ist der Maximum-Wert.     */
PIXEL bild_maximum(PIXEL **bild, 
				   int   anzahl_zeilen,  /* Zeilenanzahl von bild */
				   int   anzahl_spalten /* Spaltenanzahl von bild */
                   );

/* Faltung eines Bildes mit einem 3x3 Filterkern. */
void filter3x3 (PIXEL **bild,         /* Input und Output-Bild */
				int   anzahl_zeilen,  /* Zeilenanzahl von bild */
				int   anzahl_spalten, /* Spaltenanzahl von bild */
				int   filter[3][3]    /* Matrix der Filterkoeffizienten */
				);
</code></pre>
<pre><code>/*
 *  imgproc.c
 */

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &quot;tinyjpeg.h&quot;
#include &quot;imgproc.h&quot;

/*                                                                         */
/* histequ Histogramm-Equalization                                         */
/*                                                                         */
/* Parameter:                                                              */
/* ==========                                                              */
/* matr,line,columns Bilddefinition                                        */
/*                                                                         */
/***************************************************************************/

void histequ(PIXEL **matr, int lines, int columns)
{
	extern void histo();

	long buff[256];
	int i;
	PIXEL kennli[256];
	double coeff;
	 PIXEL *frpt,*le;
	 PIXEL *kk;
	ImageBox region = {0, 0, columns, lines};

	coeff = 255.0 / ((double)lines * (double)columns);

	histo(matr,region,buff);

	kennli[0] = 0;

	for (i = 1; i &lt; 256; i++)
	{
		buff[i] += buff[i - 1];
		kennli[i] = (PIXEL)(coeff * (double)buff[i]);
	}

	kk = kennli;

	for (i = 0; i &lt; lines; i++)
	{
		frpt = matr[i];
		le = frpt + columns;

		while (frpt &lt; le)
		{
			*frpt = kk[*frpt];
			frpt++;
		}
	}
}

/* Funktion zur Berechnung eines Grauwerthistogramms für einen Bildausschnitt */
void histo(PIXEL **bild,
		   ImageBox region,    /* Größe und Lage des Bildausschnitts */
	       long *buff1  /* Zeiger auf Ergebnis (Datenfeld mit Länge 256) */
		   )
{
	int lines = region.height;
	int columns = region.width;
	int y_a = region.y;
	int x_a = region.x;
	int i;
	PIXEL *frpt;
	PIXEL *le;
	long *buff;
	long  val;

	buff = buff1;

	for (i = 0; i &lt; 256; i++) buff1[i] = 0;

	for (i = 0; i &lt; lines; i++)
	{
		frpt = bild[i + y_a] + x_a;
		le = frpt + columns;   

		while (frpt &lt; le)
		{
			val = (*frpt++);
			*((long*)(buff + val)) += 1;
		}
	}
}

/* Funktion zum Extrahieren eines Bildausschnitts.
 Das Ursprungsbild wird nicht verändert.
 Der Rückgabewert ist ein Zeiger auf ein neues Bild,
 das den Ausschnitt enthält.
 */
PIXEL **freistellen(PIXEL **bild, 
					int   anzahl_zeilen,  /* Zeilenanzahl von bild */
					int   anzahl_spalten, /* Spaltenanzahl von bild */
					ImageBox region    /* Größe und Lage des Bildausschnitts */					
					) 
{
	PIXEL **bildausschnitt;
	int   i, j;
	int   ia, ja;
	int hoehe = region.height;
	int breite = region.width;
	int erste_zeile = region.y;
	int erste_spalte = region.x;

	if (erste_zeile+hoehe &gt; anzahl_zeilen  ||
		erste_spalte+breite &gt; anzahl_spalten ||
		erste_zeile &lt; 0 || erste_spalte &lt; 0 )
		return NULL;

	bildausschnitt = (PIXEL **) 
		pointer_array( /* address of matrix element (0,0) */
					   malloc(hoehe*breite*sizeof(PIXEL)),
					   hoehe,      /* number of rows of the matrix  */
					   breite,   /* actual number of columns, ie the distance 
							      between two consecutive row beginnings specified in units of element size. */
					   sizeof(PIXEL) /* size of the matrix elements in bytes */
					) ;
	ia = ja = 0;
	if (bildausschnitt != NULL)
		for (i=erste_zeile, ia=0; i &lt; erste_zeile+hoehe; i++, ia++)
			for (j=erste_spalte, ja=0; j &lt; erste_spalte+breite; j++, ja++)
				bildausschnitt[ia][ja] = bild[i][j];

	return (bildausschnitt);
}

/* Ausgabe eines vereinfachten Bild-Histogramms als ASCII-Text auf stdout */
void histogram_print( PIXEL **bild, int zeilenanzahl, int spaltenanzahl )
{   long int histo[64] = {0};
	int  i, j;
	long int max=0;
	int  pix;
	const int histo_height=15;

	printf(&quot;\nNormiertes Histogramm - Klassenbreite 4: 0...255 --&gt; 0...63\n&quot;);
	for (j=0; j&lt;64; j++)
		printf(&quot;-&quot;);
	printf(&quot;\n&quot;);

	for (i=0; i &lt; zeilenanzahl; i++)
		for (j=0; j &lt; spaltenanzahl; j++)
		{
			pix = bild[i][j]/ 4;
			if (pix &lt; 64)
			{
			histo[pix] += 1;
			if (histo[pix] &gt; max)
				max = histo[pix];
			}
		}

	for (i=histo_height; i &gt;=1; i--)
	{
		for (j=0; j&lt;64; j++)
			if ((double)histo[j]/(double)max *histo_height &gt;= i)
				putchar('|');
	        else
		        putchar(' ');
		putchar('\n');
	}
	for (j=0; j&lt;64; j++)
		printf(&quot;%1i&quot;, j/10);
	putchar('\n');	
	for (j=0; j&lt;64; j++)
		printf(&quot;%1i&quot;, j%10);
	putchar('\n');	
}

/* Berechnung des kleinsten Pixelwerts im Bild. */
/* Der Rückgabewert ist der Minimum-Wert.       */
PIXEL bild_minimum(PIXEL **bild, 
				   int   anzahl_zeilen,  /* Zeilenanzahl von bild */
				   int   anzahl_spalten /* Spaltenanzahl von bild */
                   )
{
	int   i, j;
	PIXEL pix;

	pix = bild[0][0];
	for (i=0; i &lt; anzahl_zeilen; i++)
		for (j=0; j &lt; anzahl_spalten; j++)
			if (bild[i][j] &lt; pix)
				pix = bild[i][j];

	return (pix);
}

/* Berechnung des größten Pixelwerts im Bild. */
/* Der Rückgabewert ist der Maximum-Wert.     */
PIXEL bild_maximum(PIXEL **bild, 
				   int   anzahl_zeilen,  /* Zeilenanzahl von bild */
				   int   anzahl_spalten /* Spaltenanzahl von bild */
                   )
{
	int   i, j;
	PIXEL pix;

	pix = bild[0][0];
	for (i=0; i &lt; anzahl_zeilen; i++)
		for (j=0; j &lt; anzahl_spalten; j++)
			if (bild[i][j] &gt; pix)
				pix = bild[i][j];

	return (pix);
}

/* Faltung eines Bildes mit einem 3x3 Filterkern. */
void filter3x3 (PIXEL **bild,         /* Input und Output-Bild */
				int   anzahl_zeilen,  /* Zeilenanzahl von bild */
				int   anzahl_spalten, /* Spaltenanzahl von bild */
				int   filter[3][3]    /* Matrix der Filterkoeffizienten */
				)
{
	int   i, j;
	int   pix;
	int   filtersumme=0;
	PIXEL puffer[5000];

	for (i=0; i &lt; 3; i++)
		for (j=0; j &lt; 3; j++)
			filtersumme += filter[i][j];

	for (i=1; i &lt; anzahl_zeilen-1; i++)
	{
		for (j=1; j &lt; anzahl_spalten-1; j++)
		{
			pix = bild[i][j] * filter[1][1] +
			      bild[i-1][j] * filter[0][1] +
			      bild[i+1][j] * filter[2][1] +
			      bild[i][j-1] * filter[1][0] +
			      bild[i-1][j-1] * filter[0][0] +
			      bild[i+1][j-1] * filter[2][0] +
			      bild[i][j+1] * filter[1][2] +
				  bild[i-1][j+1] * filter[0][2] +
			      bild[i+1][j+1] * filter[2][2] ;

			if (filtersumme != 0)
			   pix = pix / filtersumme;
			if (pix &lt; 0)
				puffer[j] = 0;
			else
				puffer[j] =pix;
		}
	for (j=1; j &lt; anzahl_spalten-1; j++)	
		bild[i-1][j] = puffer[j];
	}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2387904</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387904</guid><dc:creator><![CDATA[bizbo]]></dc:creator><pubDate>Sun, 09 Mar 2014 21:15:54 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 18:56:41 GMT]]></title><description><![CDATA[<p>region[420, 231, 810, 1119] macht sicher nicht das, was du willst</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2387906</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387906</guid><dc:creator><![CDATA[KN4CK3R]]></dc:creator><pubDate>Sun, 09 Mar 2014 18:56:41 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 19:06:52 GMT]]></title><description><![CDATA[<p>stimmt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>ich möchte gerne einen Bildausschnitt aus einem 2048 x 2048 Bild....<br />
das sind die Koordinaten:<br />
Rectangle Selection<br />
X: 420<br />
Y: 231<br />
Width: 810<br />
Height: 1119</p>
<p>was mach ich denn falsch? bzw wie geht das richtig?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2387909</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387909</guid><dc:creator><![CDATA[bizbo]]></dc:creator><pubDate>Sun, 09 Mar 2014 19:06:52 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 19:15:27 GMT]]></title><description><![CDATA[<p>Schau dir an, wie du <em>region</em> in <em>histequ</em> benutzt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2387911</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387911</guid><dc:creator><![CDATA[DirkB]]></dc:creator><pubDate>Sun, 09 Mar 2014 19:15:27 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 19:19:16 GMT]]></title><description><![CDATA[<pre><code>ImageBox region = {420, 231, 810, 1119};
freistellen(bild, 2048, 2048, region);
</code></pre>
<p>Wenn du</p>
<pre><code>region[420, 231, 810, 1119]
</code></pre>
<p>schreibst ist das AFAIK das selbe wie</p>
<pre><code>region[1119]
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2387913</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387913</guid><dc:creator><![CDATA[DarkShadow44]]></dc:creator><pubDate>Sun, 09 Mar 2014 19:19:16 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 19:22:55 GMT]]></title><description><![CDATA[<p>bei histequ geb ich einfach &quot;bild und größe&quot; an und es klappt,</p>
<pre><code>histequ(bild,2048,2048);
rcode = writeGIF( &quot;A&quot; Matrikelnummer GIF_Extension, bild, zeilenanzahl, spaltenanzahl);
</code></pre>
<p>beim &quot;freistellen&quot; komme ich einfach nicht drauf was ich für &quot;ImageBox region&quot; einsetzen soll...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2387914</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387914</guid><dc:creator><![CDATA[bizbo]]></dc:creator><pubDate>Sun, 09 Mar 2014 19:22:55 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 19:27:42 GMT]]></title><description><![CDATA[<p>@darkshadow</p>
<p>in der zweiten zeile wird &quot;region&quot; rot unterstrichen und der compiler sagt mir das es für &quot;region&quot; int keinen passenden Konstruktor unter &quot;ImageBox&quot; hat.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2387915</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387915</guid><dc:creator><![CDATA[bizbo]]></dc:creator><pubDate>Sun, 09 Mar 2014 19:27:42 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 19:38:02 GMT]]></title><description><![CDATA[<p>DirkB schrieb:</p>
<blockquote>
<p>Schau dir an, wie du <em>region</em> <strong>in</strong> <em>histequ</em> benutzt.</p>
</blockquote>
<p><strong>In</strong> deiner Funktion <em>histequ</em> rufst du <em>histo</em> auf. Dabei brauchst du auch eine Variable vom Typ <em>ImageBox</em>.<br />
Die Art und Weise wie du das da machst, sollst du dir ansehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2387920</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387920</guid><dc:creator><![CDATA[DirkB]]></dc:creator><pubDate>Sun, 09 Mar 2014 19:38:02 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 19:51:25 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/395">@dirk</a> danke dir aber ich kriege es leider immernoch nicht hin...</p>
<p>meinst du so`?</p>
<pre><code>freistellen(bild, 2048, 2048,region{420, 231, 810, 1119});
</code></pre>
<p>der sagt mir immernoch &quot;kein passender konstruktor vorhanden&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2387923</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387923</guid><dc:creator><![CDATA[bizbo]]></dc:creator><pubDate>Sun, 09 Mar 2014 19:51:25 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 19:58:41 GMT]]></title><description><![CDATA[<p>Machst du das so in histequ?</p>
<p>Nein!</p>
<p>Da benutzt du eine extra Variable, so wie DarkShadow44 es schon vorgeschlagen hat.</p>
<p>Machst du in deinem Programm (da wo du <em>freistellen</em> aufrufst) auch ein <em>#include &quot;imgproc.h&quot;</em>?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2387924</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387924</guid><dc:creator><![CDATA[DirkB]]></dc:creator><pubDate>Sun, 09 Mar 2014 19:58:41 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 20:54:05 GMT]]></title><description><![CDATA[<p>schaut aktuell so aus....</p>
<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

#include &quot;writeGIF.h&quot;     /* Deklarationen für die GIF-Routinen */
#include &quot;loadjpeg.h&quot;     /* Deklarationen für die JPEG-Routinen */
#include &quot;imgproc.h&quot;      /* Deklarationen für die Bildverarbeitungsroutinen */

/* Name für das Testbild */
#define TestBild       &quot;Foto&quot;
#define Matrikelnummer &quot;123456&quot;
#define JPG_Extension  &quot;.jpg&quot;
#define GIF_Extension  &quot;.gif&quot;
#define TestBild_In    TestBild JPG_Extension

	if ( rcode != 0 )
	{
		fprintf( stderr, &quot;Fehler beim Schreiben der GIF-Datei!\n&quot;);
		return (1);
	}
</code></pre>
<p>OK jetzt ist die fehlermeldung weg <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> der speichert mir immernoch nicht den &quot;ausschnitt&quot; den ich gern hätte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2387927</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387927</guid><dc:creator><![CDATA[bizbo]]></dc:creator><pubDate>Sun, 09 Mar 2014 20:54:05 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 20:21:47 GMT]]></title><description><![CDATA[<p>Ja weil du den Rückgabewert von freistellen nicht nutzt und das alte Bild abspeicherst...<br />
Schau dir nochmal die Funktion an:</p>
<pre><code>/* Funktion zum Extrahieren eines Bildausschnitts. 
   Das Ursprungsbild wird nicht verändert. 
   Der Rückgabewert ist ein Zeiger auf ein neues Bild, 
   das den Ausschnitt enthält. 
*/ 
PIXEL **freistellen(PIXEL **bild, 
                    int   anzahl_zeilen,  /* Zeilenanzahl von bild */ 
                    int   anzahl_spalten, /* Spaltenanzahl von bild */ 
                    ImageBox region    /* Größe und Lage des Bildausschnitts */                 
                    ); /* Breite des Ausschnitts (#Spalten) */
</code></pre>
<p>Außerdem müsstest du beim speichern die spalten und Zeilenanzahl des neuen Abschnitts angeben, nicht die des originals!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2387929</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387929</guid><dc:creator><![CDATA[DarkShadow44]]></dc:creator><pubDate>Sun, 09 Mar 2014 20:21:47 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 20:27:18 GMT]]></title><description><![CDATA[<p>bizbo schrieb:</p>
<blockquote>
<p>... der speichert mir immernoch nicht den &quot;ausschnitt&quot; den ich gern hätte.</p>
</blockquote>
<p>bizbo schrieb:</p>
<blockquote>
<pre><code>rcode = writeGIF( &quot;A&quot; Matrikelnummer GIF_Extension, bild, zeilenanzahl, spaltenanzahl);
 
   
 
    ImageBox gregion = {420, 231, 810, 1119};
    freistellen(bild, 2048, 2048,gregion);
    rcode = writeGIF( &quot;B&quot; Matrikelnummer GIF_Extension, bild, zeilenanzahl, spaltenanzahl);
</code></pre>
</blockquote>
<p>Schau dir da mal die erste und letzte Zeile an.<br />
Worin unterscheiden die sich?<br />
Nur in dem ersten Zeichen für den Dateinamen. Und da wunderst du dich, dass du das gleiche Bild bekommst.</p>
<p>Aus <strong>deiner</strong> imgproc.h:</p>
<p>imgproc.h schrieb:</p>
<blockquote>
<pre><code>/* Funktion zum Extrahieren eines Bildausschnitts.
   Das Ursprungsbild wird nicht verändert.
   Der Rückgabewert ist ein Zeiger auf ein neues Bild,
   das den Ausschnitt enthält.
*/
PIXEL **freistellen(PIXEL **bild,
                    int   anzahl_zeilen,  /* Zeilenanzahl von bild */
                    int   anzahl_spalten, /* Spaltenanzahl von bild */
                    ImageBox region    /* Größe und Lage des Bildausschnitts */                
                    ); /* Breite des Ausschnitts (#Spalten) */
</code></pre>
</blockquote>
<p>Der Kommentar vor der Funktionsdeklaration steht da nicht ohne Grund.</p>
<p>Und nach dem Freistellen hat das Bild auch ein andere Größe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2387932</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387932</guid><dc:creator><![CDATA[DirkB]]></dc:creator><pubDate>Sun, 09 Mar 2014 20:27:18 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 20:30:08 GMT]]></title><description><![CDATA[<p>Tja, da habe ich vieel zu lange geschrieben <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /><br />
(über fünf Minuten <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>
<p>Ach, und der Titel <strong>Pointer geht nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></strong> ist falsch. Du hast Probleme mit einer <code>struct</code> .<br />
Aber das wird noch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2387933</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387933</guid><dc:creator><![CDATA[DirkB]]></dc:creator><pubDate>Sun, 09 Mar 2014 20:30:08 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 21:14:44 GMT]]></title><description><![CDATA[<p>vielen Dank für eure Gedult mit mir, da ich jetzt schon einige Zeit daran sitze kann ich nicht mehr klar denken.</p>
<p>Könntet Ihr mir vielleicht anstatt Gedankenstupser einen Stoß verpassen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2387936</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387936</guid><dc:creator><![CDATA[bizbo]]></dc:creator><pubDate>Sun, 09 Mar 2014 21:14:44 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 21:20:51 GMT]]></title><description><![CDATA[<pre><code>PIXEL ** bildNeu = freistellen(/* ...*/);
writeGIF( &quot;A&quot; Matrikelnummer GIF_Extension, bildNeu, /*neue zeilenanzahl*/, /*neue spaltenanzahl*/);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2387938</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387938</guid><dc:creator><![CDATA[DarkShadow44]]></dc:creator><pubDate>Sun, 09 Mar 2014 21:20:51 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 21:58:44 GMT]]></title><description><![CDATA[<p>Vielen Dank <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> also der compiler zeigt keine Fehler, aber wenn ich auf debuggen gehe, stürzt das programm ab o.O ???</p>
<pre><code>ImageBox gregion = {1119, 810, 231, 420};
	PIXEL **bildneu=freistellen(bild, 2048, 2048,gregion);
	rcode = writeGIF( &quot;B&quot; Matrikelnummer GIF_Extension, bildneu, 1119, 810);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2387942</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387942</guid><dc:creator><![CDATA[bizbo]]></dc:creator><pubDate>Sun, 09 Mar 2014 21:58:44 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 22:17:26 GMT]]></title><description><![CDATA[<pre><code>ImageBox gregion = {/*x:*/ 1119, /*y:*/ 810, /*spaltenanzahl:*/ 231, /*zeilenanzahl:*/ 420};
// ...
rcode = writeGIF( &quot;B&quot; Matrikelnummer GIF_Extension, bildneu, /*zeilenanzahl:*/ 1119, /*spaltenanzahl:*/ 810);
</code></pre>
<p>Merkst du was ? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2387948</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387948</guid><dc:creator><![CDATA[DarkShadow44]]></dc:creator><pubDate>Sun, 09 Mar 2014 22:17:26 GMT</pubDate></item><item><title><![CDATA[Reply to Struckt probleme :( on Sun, 09 Mar 2014 22:35:50 GMT]]></title><description><![CDATA[<p>Alter schwede.... viiiiieeeeeelllen Dank Mann.....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2387949</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2387949</guid><dc:creator><![CDATA[bizbo]]></dc:creator><pubDate>Sun, 09 Mar 2014 22:35:50 GMT</pubDate></item></channel></rss>