1.1 Hough Transform Line

1 개요

Hough Transform Line 알고리즘은 허프 변환을 통해 직선을 검출하는 알고리즘 입니다.

2 알고리즘 상세 설명

알고리즘 동작 결과
원본원본 이미지 결과검사 결과
검출된 직선 결과

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

4 예제 코드

CHoughTransform houghLine; // 알고리즘 객체 생성

CFLImage fliSourceImage; // 이미지 객체 생성
fliSourceImage.Load(L"C:/Sudoku.flif"); // 이미지 파일 로드

houghLine.SetSourceImage(fliSourceImage); // 이미지 설정
houghLine.SetHoughShape(CHoughTransform::EHoughShape_Line);	// 검출할 타입 설정
houghLine.SetPixelThreshold(128.0); // 검출 기준 임계값 설정
houghLine.SetLogicalCondition(ELogicalCondition_Less); // 논리 조건 설정
houghLine.SetAngleResolution(1); // 선분 각 해상도 설정
houghLine.SetMinPixelCount(300); // 최소 누적 픽셀 기준 설정
houghLine.SetNearbyLineFilter(20); // 인접 거리 필터 설정
houghLine.SetMaxCount(1000); // 최대 결과 출력 갯수
houghLine.Execute();

CFLFigureArray flfaLines; // 결과를 받을 객체 생성

houghLine.GetResultLines(flfaLines); // 결과 반환
CHoughTransform houghLine = new CHoughTransform(); // 알고리즘 객체 생성

CFLImage fliSourceImage = new CFLImage(); // 이미지 객체 생성
fliSourceImage.Load("C:/Sudoku.flif"); // 이미지 파일 로드

houghLine.SetSourceImage(ref fliSourceImage); // 이미지 설정
houghLine.SetHoughShape(CHoughTransform.EHoughShape.Line); // 검출할 타입 설정
houghLine.SetPixelThreshold(128.0); // 검출 기준 임계값 설정
houghLine.SetLogicalCondition(ELogicalCondition.Less); // 논리 조건 설정
houghLine.SetAngleResolution(1); // 선분 각 해상도 설정
houghLine.SetMinPixelCount(300); // 최소 누적 픽셀 기준 설정
houghLine.SetNearbyLineFilter(20); // 인접 거리 필터 설정
houghLine.SetMaxCount(1000); // 최대 결과 출력 갯수
houghLine.Execute();

CFLFigureArray flfaLines; // 결과를 받을 객체 생성

houghLine.GetResultLines(out flfaLines); // 결과 반환