Skip to content

create_lexiconCreateLexiconCreateLexiconcreate_lexiconT_create_lexicon🔗

Short description🔗

create_lexiconCreateLexiconCreateLexiconcreate_lexiconT_create_lexicon — Create a lexicon from a tuple of words.

Signature🔗

create_lexicon( string Name, string Words, out lexicon LexiconHandle )void CreateLexicon( const HTuple& Name, const HTuple& Words, HTuple* LexiconHandle )static void HOperatorSet.CreateLexicon( HTuple name, HTuple words, out HTuple lexiconHandle )def create_lexicon( name: str, words: Sequence[str] ) -> HHandle

Herror T_create_lexicon( const Htuple Name, const Htuple Words, Htuple* LexiconHandle )

void HLexicon::HLexicon( const HString& Name, const HTuple& Words )

void HLexicon::HLexicon( const char* Name, const HTuple& Words )

void HLexicon::HLexicon( const wchar_t* Name, const HTuple& Words ) (Windows only)

public HLexicon( string name, HTuple words )

void HLexicon::CreateLexicon( const HString& Name, const HTuple& Words )

void HLexicon::CreateLexicon( const char* Name, const HTuple& Words )

void HLexicon::CreateLexicon( const wchar_t* Name, const HTuple& Words ) (Windows only)

void HLexicon.CreateLexicon( string name, HTuple words )

Description🔗

create_lexiconCreateLexicon creates a new lexicon based on a tuple of Wordswordswords. By specifying a unique textual Namenamename, you can later refer to the lexicon from syntax expressions like those used, e.g., by do_ocr_word_mlpDoOcrWordMlp.

Note that lexicon support in HALCON is currently not aimed at natural languages. Rather, it is intended as a post-processing step in OCR applications that only need to distinguish between a limited set of not more than a few thousand valid words, e.g., country or product names. MVTec itself does not provide any lexica.

Execution information🔗

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🔗

Namenamename (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Unique name for the new lexicon.

Default: 'lex1'"lex1"

Wordswordswords (input_control) string-array → (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

Word list for the new lexicon.

Default: ['word1', 'word2', 'word3']["word1", "word2", "word3"]

LexiconHandlelexiconHandlelexicon_handle (output_control) lexicon → (handle)HTuple (HHandle)HLexicon, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the lexicon.

Combinations with other operators🔗

Combinations

Possible successors

do_ocr_word_mlpDoOcrWordMlp, do_ocr_word_svmDoOcrWordSvm

Alternatives

import_lexiconImportLexicon

See also

lookup_lexiconLookupLexicon, suggest_lexiconSuggestLexicon

Module🔗

OCR/OCV