17.12.2018 Views

Image Acquisitionand Proces

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

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

<strong>Image</strong> <strong>Proces</strong>sing 89<br />

FIGURE 5.7 Oval ROI deÞnition.<br />

5.1.2.1 Rotated Rectangle<br />

As its name would suggest, rotated rectangles are similar to their simple counterparts,<br />

but with the added functionality of allowing the user to rotate them. When a rotated<br />

square or rectangle is deÞned, several extra construction lines are evident (Figure 5.8).<br />

The masked rotated rectangle ROI in Figure 5.8 was achieved with the code<br />

shown in Figure 5.9.<br />

5.1.2.2 Annulus Arc<br />

An annulus is deÞned as the Þgure bounded by and containing the area between<br />

two concentric circles and an annulus arc is, as you might expect, an arc component<br />

of that annulus (Figure 5.10).<br />

An annulus arc is very useful when unwrapping text, or any otherwise wrapped<br />

image data, for analysis. DeÞning an annulus arc takes place in four steps, as shown<br />

in Figure 5.11(a) deÞning the outer radius, Figure 5.11(b) the starting edge, Figure<br />

5.11(c) the ending edge and Figure 5.11(d) the inner radius.<br />

Using the Annulus Arc selection tool alone may seem of little or no use, if it is<br />

combined with an unwrapping routine (IMAQ Unwrap, for example) you can unwrap<br />

a semicircular portion of an image, distorting it to a rectangular shape, as shown in<br />

Figure 5.12. This example waits for a Draw Event on either of the IMAQ windows<br />

and once one is detected, that window’s ROI is returned, converted from a raw ROI<br />

to an annulus arc and then IMAQ Unwrap is called to unwrap the annulus arc into a<br />

rectangle.<br />

The unwrapped image (the ßoating window containing the text in Figure 5.13)<br />

can then be fed through optical character recognition (OCR) software, including the

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

Saved successfully!

Ooh no, something went wrong!