Data Matrix Decoder

1 개요

2D 바코드 중 하나인 Data Matrix 코드를 인식하는 알고리즘입니다.
코드의 형태를 학습하여 같은 형상의 코드를 인식하는 알고리즘입니다.

2 알고리즘 상세 설명

Learn Image Result Image
Learn Image Result Image
Fig. Data Matrix Decoder

인식이 가능한 형태의 코드를 학습합니다. 학습에 성공하면 코드 심볼의 종류 및 크기, 색상, flip 여부 등이 학습 데이터로 기록됩니다.
학습된 데이터와 같은 형태의 코드를 찾아서 디코딩합니다. 학습 이미지의 코드가 여러개라도 1개의 코드만 학습합니다.

3 파라미터 설정 및 사용 방법

4 예제 코드

CModelBasedDataMatrixDecoder modelBasedDataMatrixDecoder;
//////////////////////////////////
// 공통 파라미터 설정
//////////////////////////////////

//////////////////////////////////
// 추가 옵션 설정
//////////////////////////////////

modelBasedDataMatrixDecoder.SetSymbolType(EDataMatrixSymbolTypeECCOld_Symbol_Decoding_All, EDataMatrixSymbolTypeECC200_Symbol_Decoding_All);
modelBasedDataMatrixDecoder.Learn();

modelBasedDataMatrixDecoder.SetDetectingCount(EDataCodeDecoderDetectingCount_All);
modelBasedDataMatrixDecoder.Execute();

// 인식에 성공한 코드 결과를 가져옵니다.
int resultCount = modelBasedDataMatrixDecoder.GetResultCount();

for(int i = 0; i < resultCount; ++i)
{
    CDataMatrixDecoder::CDataMatrixInformation codeResult;
    modelBasedDataMatrixDecoder.GetResultDataMatrix(i, codeResult);
}
CModelBasedDataMatrixDecoder modelBasedDataMatrixDecoder = new CModelBasedDataMatrixDecoder();
//////////////////////////////////
// 공통 파라미터 설정
//////////////////////////////////

//////////////////////////////////
// 추가 옵션 설정
//////////////////////////////////

modelBasedDataMatrixDecoder.SetSymbolType(EDataMatrixSymbolTypeECCOld.Symbol_Decoding_All, EDataMatrixSymbolTypeECC200.Symbol_Decoding_All);
modelBasedDataMatrixDecoder.Learn();

modelBasedDataMatrixDecoder.SetDetectingCount(EDataCodeDecoderDetectingCount.All);
modelBasedDataMatrixDecoder.Execute();

// 인식에 성공한 코드 결과를 가져옵니다.
long resultCount = modelBasedDataMatrixDecoder.GetResultCount();

for(long i = 0; i < resultCount; ++i)
{
    CDataMatrixDecoder.CDataMatrixInformation codeResult = new CDataMatrixDecoder.CDataMatrixInformation();
    modelBasedDataMatrixDecoder.GetResultDataMatrix(i, ref codeResult);
}
modelBasedDataMatrixDecoder = CModelBasedDataMatrixDecoder()
######################
# 공통 파라미터 설정
######################

######################
# 추가 옵션 설정
######################

modelBasedDataMatrixDecoder.SetSymbolType(EDataMatrixSymbolTypeECCOld.Symbol_Decoding_All, EDataMatrixSymbolTypeECC200.Symbol_Decoding_All)
modelBasedDataMatrixDecoder.Learn()

modelBasedDataMatrixDecoder.SetDetectingCount(EDataCodeDecoderDetectingCount.All)
modelBasedDataMatrixDecoder.Execute()

// 인식에 성공한 코드 결과를 가져옵니다.
resultCount = modelBasedDataMatrixDecoder.GetResultCount()

for i in range(resultCount):
    codeResult = CDataMatrixDecoder.CDataMatrixInformation()
    modelBasedDataMatrixDecoder.GetResultDataMatrix(i, codeResult)

5 관련 알고리즘

CBarcodeDecoder, CBarcodeEncoder, CDataMatrixDecoder, CDataMatrixEncoder, CDataMatrixVerifier, CQRCCodeDecoder, CQRCCodeEncoder, CQRCCodeVerifier, CMicroQRCodeDecoder, CMicroQRCodeEncoder, CMicroQRCodeVerifier, CUnifiedDataCodeDecoder,