You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Chapter 5<br />
Program Examples<br />
This chapter contains examples that illustrate how to program with <strong>HDevelop</strong>. To understand<br />
the examples you should have a basic knowledge of image analysis.<br />
The user interface is described in chapters 1.2 and 2. Language details are explained in chapter<br />
3. The examples of this chapter are also available as program code in the directory<br />
±ÀÄÇÆÊÇÇ̱ÜÑÔÐ×ÚÐÓÔÅÒÙÐ×ÀÚÐÓÔ<br />
To experiment with these examples we recommend to create a private copy in your working<br />
directory.<br />
More detailed information on HALCON operators is available in the reference manuals.<br />
5.1 Stamp Segmentation<br />
File name: ×ØÑÔ׺Ú<br />
The first example performs a document analysis task.Figure 5.1 shows a part of a stamp catalog<br />
page. It contains two types of information about stamps: a graphical presentation and a textual<br />
description of the stamp.<br />
In this example you have to transform the textual information into a representation that can<br />
be processed by a computer with little effort. You might use an OCR program for this task,<br />
but you will soon recognize that most of the available products create many errors due to the<br />
graphical presentation of the stamps. Thus another task has to be preprocessed: the elimination<br />
of all stamps (i.e., changing stamps to the gray value of the paper). After this preprocessing it<br />
is possible to process the remaining text using an OCR program.<br />
When creating an application to solve this kind of problem, it is helpful to describe characteristic<br />
attributes of the objects to be searched (here: stamps). This task can be solved by a novice with<br />
some experience, too. In this case, a characterization might look as follows:<br />
¯ Stamps are darker than paper.<br />
¯ Stamps are connected image areas that do not overlap.<br />
¯ Stamps have a minimum and maximum size.<br />
93