Figure 1 This figure shows how to use edges to segment an image. The left side shows the output of an edge detector. The right side is the result of grouping the pixels "inside" the edges as objects — a triangle and rectangle.

00000000000000000000  --------------------
00000000000000000000  --------------------
00000001000000000000  --------------------
00000010100000000000  -------*------------
00000100010000000000  ------***-----------
00001000001000000000  -----*****----------
00010000000100000000  ----*******---------
00111111111110000000  --------------------
00000000000000000000  --------------------
00000000000000000000  --------------------
00000111111111111000  --------------------
00000100000000001000  -----**********-----
00000100000000001000  -----**********-----
00000100000000001000  -----**********-----
00000100000000001000  -----**********-----
00000100000000001000  -----**********-----
00000111111111111000  --------------------
00000000000000000000  --------------------
00000000000000000000  --------------------
00000000000000000000  --------------------