Shape Match Cross

1 개요

이미지 내에서 사용자가 설정한 크기의 십자가를 검출하는 알고리즘입니다.

2 알고리즘 상세 설명

Result
Detect Result
Fig. Shape Match Cross

크기 및 두께를 설정하여 십자가의 특성을 학습합니다.
이후 객체의 색상을 설정하여 학습한 도형의 크기와 형태가 유사한 객체를 검출합니다.

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

4 예제 코드

CShapeMatchCross shapeMatchCross;
//////////////////////////////////
// 공통 파라미터 설정
//////////////////////////////////

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

// 길이 및 두께 설정
shapeMatchCross.SetHalfLength(40);
shapeMatchCross.SetHalfThickness(15);
// 해당 도형 학습
shapeMatchCross.Learn();

// 도형 검출
shapeMatchCross.Execute();

// 검출 결과를 가져옵니다.
int resultCount = shapeMatchCross.GetResultCount();

for(int i = 0; i < resultCount; ++i)
{
    CShapeMatchCrossResult matchResult;
    shapeMatchCross.GetResult(i, matchResult);
}
CShapeMatchCross shapeMatchCross = new CShapeMatchCross();
//////////////////////////////////
// 공통 파라미터 설정
//////////////////////////////////

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

// 길이 및 두께 설정
shapeMatchCross.SetHalfLength(40);
shapeMatchCross.SetHalfThickness(15);
// 해당 도형 학습
shapeMatchCross.Learn();

// 도형 검출
shapeMatchCross.Execute();

// 검출 결과를 가져옵니다.
long resultCount = shapeMatchCross.GetResultCount();

for(long i = 0; i < resultCount; ++i)
{
    CShapeMatchCrossResult matchResult = new CShapeMatchCrossResult();
    shapeMatchCross.GetResult(i, ref matchResult);
}
shapeMatchCross = CShapeMatchCross()
######################
# 공통 파라미터 설정
######################

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

# 길이 및 두께 설정
shapeMatchCross.SetHalfLength(40)
shapeMatchCross.SetHalfThickness(15)
# 해당 도형 학습
shapeMatchCross.Learn()

# 도형 검출
shapeMatchCross.Execute()

# 검출 결과를 가져옵니다.
resultCount = shapeMatchCross.GetResultCount()

for i in range(resultCount):
    matchResult = CShapeMatchCrossResult()
    shapeMatchCross.GetResult(i, matchResult)

5 관련 알고리즘

CShapeMatchCircle, CShapeMatchEllipse, CShapeMatchLine, CShapeMatchFigure, CShapeMatchRectangle