Halcon--OCR遇到的问题

问题:在读取黑底白字的时候设置了“light_on_dark”分割出字符但是没有读到正确字符
C#和halcon两种实现:
1、在读取黑底白字符的时候除了设置运行参数:
HOperatorSet.SetTextModelParam(TextModel,”polarity”, “light_on_dark”);
<=>
set_text_model_param (TextModel, ‘polarity’, ‘light_on_dark’)

另外还要将图像的灰阶进行反转:
( g’= 255 - g)
HOperatorSet.InvertImage(imageReduced, out imageInvert);
<=>
invert_image (TmpObj_MonoReduced_OCR_01_0, TmpObj_MonoInverted_OCR_01_0)

最后在读取字符的算子中引用反转后的图像:
HOperatorSet.DoOcrMultiClassMlp(SymOCR, imageInvert, OCRHandle, out resuleString, out confidence1);
<=>
do_ocr_multi_class_mlp (Symbols_OCR_01_0, TmpObj_MonoInverted_OCR_01_0, OcrHandle, SymbolNames_OCR_01_0, Confidences_OCR_01_0)

你可能感兴趣的:(Halcon-学习笔)