01.11.2014 Views

Reference Manual HALCON/C

Reference Manual HALCON/C

Reference Manual HALCON/C

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6 CHAPTER 1. CLASSIFICATION<br />

Result<br />

T learn class box returns H MSG TRUE for a normal case. An exception handling is raised if there are<br />

memory allocation problems. The number of classes is constrained. If this limit is passed, an exception handling<br />

is raised, too.<br />

Parallelization Information<br />

T learn class box is local and processed completely exclusively without parallelization.<br />

Possible Predecessor Functions<br />

create class box, T enquire class box<br />

Possible Successor Functions<br />

test sampset box, T learn class box, T enquire class box, write class box,<br />

close class box, clear sampset<br />

See Also<br />

test sampset box, close class box, create class box, T enquire class box,<br />

learn sampset box<br />

Module<br />

Tools<br />

learn sampset box ( long ClassifHandle, long SampKey,<br />

const char *Outfile, long NSamples, double StopError, long ErrorN )<br />

Train the classificator with one data set.<br />

learn sampset box trains the classificator with data for the key SampKey (see read sampset). The training<br />

sequence is terminated at least after NSamples examples. If NSamples is bigger than the number of examples<br />

in SampKey, then a cyclic start at the beginning occurs. If the error underpasses the value StopError,<br />

then the training sequence is prematurely terminated. StopError is calculated with N / ErrorN. Whereby N<br />

significates the number of examples which were wrong classified during the last ErrorN training examples. Typically<br />

ErrorN is the number of examples in SampKey and NSamples is a multiple of it. If you want a data set<br />

with 100 examples to run 5 times at most and if you want it to terminate with an error lower than 5%, then the<br />

corresponding values are NSamples = 500, ErrorN = 100 and StopError = 0.05. A protocol of the training<br />

activity is going to be written in file Outfile.<br />

Parameter<br />

º ClassifHandle (input control) ...................................................class box long<br />

Classificator’s handle number.<br />

º SampKey (input control) ..........................................................featureset long<br />

Number of the data set to train.<br />

º Outfile (input control) .....................................................filename const char *<br />

Name of the protocol file.<br />

Default Value : ’training prot’<br />

º NSamples (input control) ............................................................integer long<br />

Number of arrays of attributes to learn.<br />

Default Value : 500<br />

º StopError (input control) ...........................................................real double<br />

Classification error for termination.<br />

Default Value : 0.05<br />

º ErrorN (input control) ...............................................................integer long<br />

Error during the assignment.<br />

Default Value : 100<br />

Result<br />

learn sampset box returns H MSG TRUE. An exception handling is raised if key SampKey does not exist<br />

or there are problems while opening the file.<br />

Parallelization Information<br />

learn sampset box is local and processed completely exclusively without parallelization.<br />

create class box<br />

Possible Predecessor Functions<br />

<strong>HALCON</strong>/C <strong>Reference</strong> <strong>Manual</strong> / 2000-11-15

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

Saved successfully!

Ooh no, something went wrong!