Segmentation Region Extractor DL
1 개요
Segmentation 라벨 이미지에서 같은 라벨끼리 묶어 Blob 동작을 하는 알고리즘 입니다.
입력 이미지에서 정수단위로 객체가 나누어 집니다.
CBlob
참고
2 알고리즘 상세 설명
Source Image | Result Image |
---|---|
![]() |
![]() |
![]() |
Fig. Blob
정수 단위로 같은 픽셀 값들을 하나의 객체로 묶어줍니다.Blob의 기능인 Filter 및 Sort도 사용 가능합니다.
3 파라미터 설정 및 사용 방법
SetRangesToInclude
- 탐색할 Segmentation 시작, 끝값을 설정합니다.
- 기본 값은 모든 값을 객체로 만들어줍니다.
4 예제 코드
CSegmentationRegionExtractorDL sgExractor;
//////////////////////////////////
// 공통 파라미터 설정
//////////////////////////////////
//////////////////////////////////
// 추가 옵션 설정
//////////////////////////////////
// 10~50까지의 픽셀 값만 처리
sgExractor.SetRangesToInclude(10, 50);
sgExractor.Execute();
// 넓이가 100 이하인 객체 제거
sgExractor.Filter(CBlob::EFilterItem_Area, 100., ELogicalCondition_LessEqual);
// 둘레를 기준으로 정렬
sgExractor.Sort(CBlob::EFilterItem_Perimeter, CBlob::EOrder_Ascending);
// 결과를 경계 사각형으로 얻어오기
CFLFigureArray boundaryRects;
sgExractor.GetResultBoundaryRects(boundaryRects);
// 결과를 윤곽 도형으로 얻어오기
CFLFigureArray boundaryContours;
sgExractor.GetResultContours(boundaryContours);