21.12.2013 Views

Lehrveranstaltungsinhalt aus - Institute for Computer Graphics and ...

Lehrveranstaltungsinhalt aus - Institute for Computer Graphics and ...

Lehrveranstaltungsinhalt aus - Institute for Computer Graphics and ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1.6. OPERATIONS ON BINARY RASTER IMAGES 43<br />

analogous chess movements of the springer etc.<br />

from the “Dame” game.<br />

Another diagonal neighborhood would derive<br />

We have neighborhoods of the first order, which are the neighbors of a pixel-x. The neighbors of<br />

the neighbors are “neighbors of second order” with respect to a pixel at x. We could increase the<br />

order by having neighbors of the neighbors of the neighbors.<br />

Definition 2 Connectivity<br />

2 Pixel haengen zusammen, wenn sie ein<strong>and</strong>ers Nachbarn sind und dieselbe Zusammenhangseigenschaft<br />

V besitzen.<br />

4-Zusammenhang:<br />

1: if q N4-Nachbar von p then {Def. 5}<br />

2: Pixel p und q haengen zusammen<br />

3: else<br />

4: Pixel p und q haengen nicht zusammen<br />

5: end if<br />

m-Zusammenhang:<br />

1: if (N4 (p) geschnitten N4 (q)) = 0 then {N4( x): Menge der x-N4-Nachbarn}<br />

2: if (q ist N4 -Nachbar von p)||(q ist ND-Nachbar von p) then {Def. 5}<br />

3: Pixel p und q haengen zusammen<br />

4: else<br />

5: Pixel p und q haengen nicht zusammen<br />

6: end if<br />

7: else<br />

8: Pixel p und q haengen nicht zusammen<br />

9: end if<br />

Connectivity is defined by two pixels belonging together: They are “connected” if they are one<br />

another’s neighbors. So we need to have a neighbor-relationship to define connectivity. Depending<br />

on a 4-neighborhood, an 8-neighborhood, a springer-neighborhood we can define various types of<br />

connectivities. We there<strong>for</strong>e say that two pixels p <strong>and</strong> q are one another’s neighbors if they are<br />

connected, if they are neighbors under a neighborhood-relationship.<br />

This becomes pretty interesting <strong>and</strong> useful once we start to do character-recognition <strong>and</strong> we need<br />

to figure out which pixels belong together <strong>and</strong> create certain shapes. We may have an example<br />

of three-by-three pixels of which four pixels are black <strong>and</strong> five pixels are white. We now can<br />

have connections established between those four black pixels under various connectivity rules. A<br />

connectivity with eight neighbors creates a more complex shape than a connectivity via so-called m-<br />

neighbors, where m-neighbors have been defined previously in Slide “Zusammenhaengende Pixel”.<br />

Definition 3 Distance<br />

Gegeben: Punkte p(x,y) und q(s,t)<br />

1: De(p,q) = 2√ (x − s) 2 + (y − t) 2 (Euklidische Distanz)<br />

2: D4-Distanz (City Block Distance)<br />

3: D8-Distanz (Schachbrett-Distanz)<br />

The neighborhood- <strong>and</strong> connectivity-relationships can be used to established distances between<br />

pixels, to define edges, lines <strong>and</strong> region in images, to define contours of objects, to find a path<br />

between any two locations in an image <strong>and</strong> to perhaps eliminate pixels as noise if they are not<br />

connected to any other pixels. A quick example of a distance addresses two pixels P <strong>and</strong> Q with

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!