Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Although Cocoa Touch provides excellent resolution-independent tools for working with many images, there are times you need to reach down to the bits that underlie a picture and access data on a bit-by-bit basis. For example, you might apply edge-detection or blurring routines that calculate their results by convolving matrices against actual byte values.
Figure 7-8 shows the result of Canny edge detection on an iPhone image. The Canny operator in its most basic form is one of the first algorithms taught in image processing classes. Canny edge detection combines a smoothing filter with a search for maximal changes. Edges, where adjacent pixels demonstrate the greatest difference in intensity, produce the highest response to the mask. The version used to produce the image shown here uses a hardwired 3×3 mask—that is, the simplest possible version of the effect.