Skip to content

protect_ocr_trainfProtectOcrTrainfProtectOcrTrainfprotect_ocr_trainfprotect_ocr_trainf🔗

説明🔗

protect_ocr_trainfProtectOcrTrainfProtectOcrTrainfprotect_ocr_trainfprotect_ocr_trainf — トレーニングデータを保護する。

書式🔗

protect_ocr_trainf( filename.read TrainingFile, string Password, filename.write TrainingFileProtected )void ProtectOcrTrainf( const HTuple& TrainingFile, const HTuple& Password, const HTuple& TrainingFileProtected )static void HOperatorSet.ProtectOcrTrainf( HTuple trainingFile, HTuple password, HTuple trainingFileProtected )def protect_ocr_trainf( training_file: str, password: MaybeSequence[str], training_file_protected: str ) -> None

Herror protect_ocr_trainf( const char* TrainingFile, const char* Password, const char* TrainingFileProtected )

Herror T_protect_ocr_trainf( 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)

static void HRegion.ProtectOcrTrainf( string trainingFile, HTuple password, string trainingFileProtected )

static void HRegion.ProtectOcrTrainf( string trainingFile, string password, string trainingFileProtected )

説明🔗

OCR 識別子のトレーニングデータの作成は、複雑で時間がかかる作業 になることがあります。このように、トレーニングデータは貴重であり、 使用を保護するとよい場合があります。一般的には、OCR トレーニング データをまったく確認または変更できないように保護するため、その 使用(OCR 識別子のトレーニング)をユーザーパスワードで制限します。

HALCON では通常、OCR トレーニングデータを作成してから、 write_ocr_trainfWriteOcrTrainf などを使用して、保護されていない OCR トレーニングファイルにデータを書き込みます。その後、ユーザー パスワードで保護された新しいファイルを作成し、そこに OCR トレーニングデータを格納するという方法をとります。保護された トレーニングファイルを使用するには、いくつかの特殊なオペレーターを 使用します。これらのオペレーターでデータを処理する(OCR 識別子を トレーニングする)には、やはり正しいパスワードが必要となります。

保護された OCR トレーニングファイル内のデータは、まったく確認 または変更できないため、元の保護されていないトレーニングデータ ファイルを維持しておくことが重要です。

保護された OCR トレーニングデータは、MLP(多層パーセプトロン) 識別子や SVM(サポートベクトルマシン)識別子のトレーニングに 使用できます。

protect_ocr_trainfProtectOcrTrainf は、ファイル TrainingFiletrainingFiletraining_file に 格納されている OCR トレーニングデータを保護し、それを保護された トレーニングデータファイル TrainingFileProtectedtrainingFileProtectedtraining_file_protected に書き込みます。 保護はユーザーパスワード Passwordpasswordpassword によって行われます。 後で trainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtected、 read_ocr_trainf_names_protectedReadOcrTrainfNamesProtected などのオペレーターで、 保護された OCR トレーニングデータを使用するには、同じパスワードを 使用する必要があります。空のパスワード(空文字列を含むパスワード) は許可されません。パスワード Passwordpasswordpassword の数が 1 の場合は、 すべての出力ファイル TrainingFileProtectedtrainingFileProtectedtraining_file_protected がそのパスワードで 保護されます。そうでない場合、パスワードの数は入力ファイルおよび 出力ファイルの数と同じである必要があり、n 番目の出力ファイルが n 番目のパスワードで保護されます。

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • 並列演算処理には未対応

パラメーター🔗

TrainingFiletrainingFiletraining_file (input_control) filename.read → (string)HTuple (HString)HTuple (string)strHtuple (char*)

トレーニングファイルの名前

初期値: ''""
ファイル拡張子: .trf, .otr

Passwordpasswordpassword (input_control) string(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

トレーニングファイルを保護するためのパスワード

TrainingFileProtectedtrainingFileProtectedtraining_file_protected (input_control) filename.write → (string)HTuple (HString)HTuple (string)strHtuple (char*)

保護されたトレーニングファイルの名前

ファイル拡張子: .trf

結果🔗

パラメーターが正しい場合、オペレーター protect_ocr_trainfProtectOcrTrainf は値 2 (H_MSG_TRUE) を返します。 そうでない場合は、例外処理が発生します。

他のオペレーターとの組み合わせ🔗

組み合わせ

前処理の候補

write_ocr_trainfWriteOcrTrainf, append_ocr_trainfAppendOcrTrainf, concat_ocr_trainfConcatOcrTrainf

後処理の候補

read_ocr_trainf_names_protectedReadOcrTrainfNamesProtected, trainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtected, trainf_ocr_class_svm_protectedTrainfOcrClassSvmProtected, select_feature_set_trainf_mlp_protectedSelectFeatureSetTrainfMlpProtected, select_feature_set_trainf_svm_protectedSelectFeatureSetTrainfSvmProtected

関連項目

select_feature_set_trainf_mlpSelectFeatureSetTrainfMlp

モジュール🔗

OCR/OCV