read_class_knnT_read_class_knnReadClassKnnReadClassKnnread_class_knn (Operator)
Name
read_class_knnT_read_class_knnReadClassKnnReadClassKnnread_class_knn
— Read the k-NN classifier from a file.
Signature
def read_class_knn(file_name: str) -> HHandle
Description
read_class_knnread_class_knnReadClassKnnReadClassKnnReadClassKnnread_class_knn
reads the saved classifier from the file
FileNameFileNameFileNameFileNamefileNamefile_name
(see write_class_knnwrite_class_knnWriteClassKnnWriteClassKnnWriteClassKnnwrite_class_knn
).
The values of the current classifier are overwritten.
The default HALCON file extension for the k-NN classifier is 'gnc'.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.
Parameters
FileNameFileNameFileNameFileNamefileNamefile_name
(input_control) filename.read →
HTuplestrHTupleHtuple (string) (string) (HString) (char*)
File name of the classifier.
File extension: .gnc
KNNHandleKNNHandleKNNHandleKNNHandleKNNHandleknnhandle
(output_control) class_knn →
HClassKnn, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of the k-NN classifier.
Result
read_class_knnread_class_knnReadClassKnnReadClassKnnReadClassKnnread_class_knn
returns TRUE.
An exception is raised if it was not possible to open the file
FileNameFileNameFileNameFileNamefileNamefile_name
or the file has the wrong format.
Possible Successors
classify_class_knnclassify_class_knnClassifyClassKnnClassifyClassKnnClassifyClassKnnclassify_class_knn
See also
create_class_knncreate_class_knnCreateClassKnnCreateClassKnnCreateClassKnncreate_class_knn
References
Marius Muja, David G. Lowe: “Fast Approximate Nearest Neighbors with
Automatic Algorithm Configuration”;
International Conference on Computer Vision Theory
and Applications (VISAPP 09); 2009.
Module
Foundation