Search code examples
datamatrixhalcon

HALCON - How to read low resolution ECC200 datacode in halcon?


I have the need to read this low quality ECC code using halcon 20. I have tried all possible parameters but cannot find any combination that is able to read this code.

What seems strange to me is that if I have a look at the example codes, there are images that are even worse than this and those are read without problems.

here is my current code that is NOT able to read this:

create_data_code_2d_model ('Data Matrix ECC 200', ['default_parameters','small_modules_robustness','module_size_min'], ['maximum_recognition','high','1'], DataCodeHandleMaximum)
set_data_code_2d_param (DataCodeHandleMaximum,['symbol_cols','symbol_rows','slant_max','timeout'],[26,12,0.52,10000])

find_data_code_2d (ImageReduced, SymbolXLDs, DataCodeHandleMaximum, ['stop_after_result_num'], [200], ResultHandles, DecodedDataStrings)

enter image description here

any help appreciated


Solution

  • Image seems to be a bit out of focus, so it needs a bit of sharpening filter:

    create_data_code_2d_model ('Data Matrix ECC 200', 'default_parameters', 'maximum_recognition', DataCodeHandle)
    emphasize (Image, ImageEmphasize, 7, 7, 1)
    find_data_code_2d (ImageEmphasize, SymbolXLDs, DataCodeHandle, [], [], ResultHandles, DecodedDataStrings)
    

    enter image description here