Die Präsentation wird geladen. Bitte warten

Die Präsentation wird geladen. Bitte warten

Softwaretechnologie für Fortgeschrittene Teil Thaller Stunde III: Bildverarbeitung III Köln 8. Januar 2015.

Ähnliche Präsentationen


Präsentation zum Thema: "Softwaretechnologie für Fortgeschrittene Teil Thaller Stunde III: Bildverarbeitung III Köln 8. Januar 2015."—  Präsentation transkript:

1 Softwaretechnologie für Fortgeschrittene Teil Thaller Stunde III: Bildverarbeitung III Köln 8. Januar 2015

2 Nachbarschaftstransformationen 2 Basisvorgehen: for (int y=1;y<result.height()-1;y++) { baseline=image.scanLine(y); for (int x=1;x<result.width()-1;x++) *(result.scanLine(y) + x) = TIneighbour8(image,x,type,baseline); }

3 Nachbarschaftstransformationen 3 Beispiel für eine Nachbarschaftstransformation: static int Xoffset[] = { -1, 0, 1, -1, 0, 1, -1, 0, 1}; static int Yoffset[] = { -1, -1, -1, 0, 0, 0, 1, 1, 1}; width=image.width(); switch(action) { case TINMinimum: result=255; for (int i=0;i < 9; i++) { candidate = *(baseline + (width*Yoffset[i]) + x + Xoffset[i]); if (candidate < result) result=candidate; } break;

4 Nachbarschaftstransformationen 4 Hervorheben von Intensitätsänderungen – X Differenz for (int y=0;y<result.height();y++) for (int x=1;x<result.width();x++) { collect = *(image.scanLine(y) + x) – *(image.scanLine(y) + x-1); *(result.scanLine(y) + x) = (collect<0) ? collect * -1 : collect; }

5 Nachbarschaftstransformationen 5 NB: Partielle Transformationen können in Bilder „eingeschrieben“ werden – Übergangsbetonung durch Einrechnen XY Differenz: step1=TIcontrastS(TIXYdifference(image)); for (int y=0;y<result.height();y++) for (int x=0;x<result.width();x++) *(result.scanLine(y) + x) = (*(step1.scanLine(y) + x) >= 128) ? 0 : *(image.scanLine(y) + x);

6 Filteroperationen : Nachbarschaften 6 Auf der operativen – nicht mathematischen – Ebene können Filter als multiplikative Nachbarschaftstransformationen verstanden werden.

7 Filteroperationen : Nachbarschaften 7 Filteranwendung 1 / 2: static int filter[4][9]= { 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0 = low pass 1 */ 0, 1, 0, 1, 1, 1, 0, 1, 0, /* 1 = low pass 2 */ 0,-1, 0,-1, 5,-1, 0,-1, 0, /* 2 = high pass 1 */ -1,-1,-1,-1, 9,-1,-1,-1,-1 /* 3 = high pass 2 */ }; static int divisor[4] = {9,5,1,1}; unsigned char *baseline; for (int y=1;y<result.height()-1;y++) { baseline=image.scanLine(y); for (int x=1;x<result.width()-1;x++) *(result.scanLine(y) + x) = TIfilter8(image,x,filter[type],divisor[type],baseline);

8 Filteroperationen : Nachbarschaften 8 Wobei gilt (Filteranwendung 2 / 2): int Xoffset[] = { -1, 0, 1, -1, 0, 1, -1, 0, 1}; int Yoffset[] = { -1, -1, -1, 0, 0, 0, 1, 1, 1}; width=image.width(); collect=0; for (int i=0;i < 9; i++) collect += *(baseline + (width*Yoffset[i]) + x + Xoffset[i]) *filter[i]; result = collect / divisor;

9 Filter: 9 Dementsprechend, die wichtigsten Filter: static int filter[15][9]= { 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0 = low pass 1 */ 0, 1, 0, 1, 1, 1, 0, 1, 0, /* 1 = low pass 2 */ 0,-1, 0,-1, 5,-1, 0,-1, 0, /* 2 = high pass 1 */ -1,-1,-1,-1, 9,-1,-1,-1,-1, /* 3 = high pass 2 */ 1, 2, 1, 2, 4, 2, 1, 2, 1, /* 4 = W.Mean 1 */ 0, 1, 0, 1, 2, 1, 0, 1, 0, /* 5 = W.Mean 2 */ 0, 1, 0, 1,-4, 1, 0, 1, 0, /* 6 = Laplace 1 */ -1,-1,-1,-1, 8,-1,-1,-1,-1, /* 7 = Laplace 2 */ 0,-1, 0,-1, 7,-1, 0,-1, 0, /* 8 = Laplace 3 */ -1,-1,-1, 0, 0, 0, 1, 1, 1, /* 9 = Prewitt A */ -1, 0, 0, 0, 0, 0, 0, 0, 1, /* 10 = Roberts A */ -1,-2,-1, 0, 0, 0, 1, 2, 1, /* 11 = Sobel A */ 1, 0,-1, 1, 0,-1, 1, 0,-1, /* 12 = Prewitt B */ 0, 0,-1, 0, 0, 0, 1, 0, 0, /* 13 = Roberts B */ -1, 0, 1,-2, 0, 2,-1, 0, 1 /* 14 = Sobel B */ }; static int divisor[15] = {9,5,1,1,16,6,1,1,3,1,1,1,1,1,1}; static int absolute[15] = {0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1};

10 Danke für heute! 10


Herunterladen ppt "Softwaretechnologie für Fortgeschrittene Teil Thaller Stunde III: Bildverarbeitung III Köln 8. Januar 2015."

Ähnliche Präsentationen


Google-Anzeigen