protect_ocr_trainfprotect_ocr_trainfProtectOcrTrainfProtectOcrTrainfprotect_ocr_trainf (算子名称)
名称
protect_ocr_trainfprotect_ocr_trainfProtectOcrTrainfProtectOcrTrainfprotect_ocr_trainf — Protection of training data.
参数签名
void ProtectOcrTrainf(const HTuple& TrainingFile, const HTuple& Password, const HTuple& TrainingFileProtected)
static void HRegion::ProtectOcrTrainf(const HString& TrainingFile, const HTuple& Password, const HString& TrainingFileProtected)
static void HRegion::ProtectOcrTrainf(const HString& TrainingFile, const HString& Password, const HString& TrainingFileProtected)
static void HRegion::ProtectOcrTrainf(const char* TrainingFile, const char* Password, const char* TrainingFileProtected)
static void HRegion::ProtectOcrTrainf(const wchar_t* TrainingFile, const wchar_t* Password, const wchar_t* TrainingFileProtected)
(
Windows only)
描述
Obtaining training data for an OCR classifier can be a complicated and
time consuming activity. Thus, training data is valuable and there
might be the necessity to protect its usage. The general idea
is to prevent protected OCR training data from being
reviewed or modified in any way and to ensure that its usage, e.g.,
training an OCR classifier, is restricted by a user password.
The approach in HALCON is to obtain OCR training data in the usual way,
then write it to an unprotected OCR training file using, e.g.,
write_ocr_trainfwrite_ocr_trainfWriteOcrTrainfWriteOcrTrainfWriteOcrTrainfwrite_ocr_trainf, and afterwards create a new file containing
the OCR training data protected with a user password. Protected training
files can be used with a set of special operators
that also require the correct password in order to be able to process the
data, e.g., for training an OCR classifier.
It is important to keep in mind that data in a protected OCR training
file cannot be reviewed or modified in any way, thus it is important to
keep the original, unprotected, training data files.
Protected OCR training data can be used for training of multilayer
perceptron (MLP) classifiers and support vector machine (SVM) classifiers.
protect_ocr_trainfprotect_ocr_trainfProtectOcrTrainfProtectOcrTrainfProtectOcrTrainfprotect_ocr_trainf protects the OCR training data contained
in the file TrainingFileTrainingFileTrainingFileTrainingFiletrainingFiletraining_file and writes it to
the protected training data file TrainingFileProtectedTrainingFileProtectedTrainingFileProtectedTrainingFileProtectedtrainingFileProtectedtraining_file_protected.
The protection is done with the user password PasswordPasswordPasswordPasswordpasswordpassword. The
same password has to be used afterwards in order to use the protected
OCR training data, e.g., by 该算子s
trainf_ocr_class_mlp_protectedtrainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtectedtrainf_ocr_class_mlp_protected or
read_ocr_trainf_names_protectedread_ocr_trainf_names_protectedReadOcrTrainfNamesProtectedReadOcrTrainfNamesProtectedReadOcrTrainfNamesProtectedread_ocr_trainf_names_protected. Empty passwords (or passwords
containing the empty string) are not allowed. If the number of passwords
PasswordPasswordPasswordPasswordpasswordpassword equals 1, then every output file
TrainingFileProtectedTrainingFileProtectedTrainingFileProtectedTrainingFileProtectedtrainingFileProtectedtraining_file_protected is protected with that password,
otherwise the number of passwords has to be equal to the number of
input and output files and the output file at position n is protected
with the password at position n.
运行信息
- 多线程类型:可重入(与非独占操作符并行运行)。
- 多线程作用域:全局(可以从任何线程调用)。
- 未经并行化处理。
参数表
TrainingFileTrainingFileTrainingFileTrainingFiletrainingFiletraining_file (input_control) filename.read → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Names of the training files.
Default:
''
""
""
""
""
""
File extension:
.trf, .otr
PasswordPasswordPasswordPasswordpasswordpassword (input_control) string(-array) → HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Passwords for protecting the training files.
TrainingFileProtectedTrainingFileProtectedTrainingFileProtectedTrainingFileProtectedtrainingFileProtectedtraining_file_protected (input_control) filename.write → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Names of the protected training files.
File extension:
.trf
结果
If the parameters are correct, 该算子
protect_ocr_trainfprotect_ocr_trainfProtectOcrTrainfProtectOcrTrainfProtectOcrTrainfprotect_ocr_trainf 返回值 2 (
H_MSG_TRUE)
.
Otherwise an exception will be raised.
可能的前置算子
write_ocr_trainfwrite_ocr_trainfWriteOcrTrainfWriteOcrTrainfWriteOcrTrainfwrite_ocr_trainf,
append_ocr_trainfappend_ocr_trainfAppendOcrTrainfAppendOcrTrainfAppendOcrTrainfappend_ocr_trainf,
concat_ocr_trainfconcat_ocr_trainfConcatOcrTrainfConcatOcrTrainfConcatOcrTrainfconcat_ocr_trainf
可能的后置算子
read_ocr_trainf_names_protectedread_ocr_trainf_names_protectedReadOcrTrainfNamesProtectedReadOcrTrainfNamesProtectedReadOcrTrainfNamesProtectedread_ocr_trainf_names_protected,
trainf_ocr_class_mlp_protectedtrainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtectedtrainf_ocr_class_mlp_protected,
trainf_ocr_class_svm_protectedtrainf_ocr_class_svm_protectedTrainfOcrClassSvmProtectedTrainfOcrClassSvmProtectedTrainfOcrClassSvmProtectedtrainf_ocr_class_svm_protected,
select_feature_set_trainf_mlp_protectedselect_feature_set_trainf_mlp_protectedSelectFeatureSetTrainfMlpProtectedSelectFeatureSetTrainfMlpProtectedSelectFeatureSetTrainfMlpProtectedselect_feature_set_trainf_mlp_protected,
select_feature_set_trainf_svm_protectedselect_feature_set_trainf_svm_protectedSelectFeatureSetTrainfSvmProtectedSelectFeatureSetTrainfSvmProtectedSelectFeatureSetTrainfSvmProtectedselect_feature_set_trainf_svm_protected
参考其它
select_feature_set_trainf_mlpselect_feature_set_trainf_mlpSelectFeatureSetTrainfMlpSelectFeatureSetTrainfMlpSelectFeatureSetTrainfMlpselect_feature_set_trainf_mlp
模块
OCR/OCV