Non Maximum Suppression, NMS
1 개요
Non Maximum Suppression 알고리즘을 이용하여 이미지의 윤곽을 찾아내는 알고리즘입니다.
2 알고리즘 상세 설명
Sobel 또는 Prewitt 미분 필터링 후, 활성화된 경계의 방향을 고려하여 국소적인 극대값만을 유지해 이미지의 윤곽을 찾아내는 알고리즘입니다.
Grayscale 옵션을 통해 회색조 방식의 출력 여부를 설정할 수 있습니다.
다른 Edge Detector 알고리즘과 달리 임계값(Threshold) 처리를 수행하지 않으므로, 이진화되지 않은 연속적인 수치가 출력됩니다.
Source Image | Destination Image |
---|---|
![]() |
![]() |
3 파라미터 설정 및 사용 방법
동작을 위한 최소한의 기본 설정 파라미터는 아래와 같습니다.
-
const CResult SetFilter(CNonMaximumSuppression::EFilter eFilter)
Edge detection 용 필터를 설정합니다.eFilter
: Edge detection 용 필터
EFilter_Sobel: Sobel 필터
EFilter_Prewitt: Prewitt 필터
Default: EFilter_Sobel
-
const CResult SetConflictHandlingMethod(CNonMaximumSuppression::EConflictHandlingMethod eMethod)
Conflict Handling Method 설정을 통해 극대값인 픽셀이 중심 픽셀 외에도 존재하는 경우의 처리 방식을 지정할 수 있습니다.eMethod
: 극대값인 픽셀이 중심 픽셀 외에도 존재하는 경우의 처리 방식
EConflictHandlingMethod_Discard: 중심 픽셀이 유일한 극대값 픽셀인 경우에만 유지합니다.
EConflictHandlingMethod_KeepEdge: 두 이웃 중 하나 이하의 픽셀이 극대값과 동일하더라도 유지합니다.
EConflictHandlingMethod_KeepAll: 두 이웃 중 둘 이하의 픽셀이 극대값과 동일하더라도 유지합니다.
Default: EConflictHandlingMethod_KeepAll
-
const CResult SetNMSInterpolationMethod(CNonMaximumSuppression::ENMSInterpolationMethod eMethod)
NMS Interpolation Method 설정을 통해 방향 세분화 방식을 조정할 수 있습니다.eMethod
: 방향 세분화 방식
ENMSInterpolationMethod_NearestNeighbor: 8방향으로 세분화합니다. ENMSInterpolationMethod_Linear: 이웃 픽셀을 선형 보간하여 32방향 세분화를 지원합니다.
Default: ENMSInterpolationMethod_NearestNeighbor
-
const CResult EnableGrayscale(bool bGrayscale)
Grayscale 옵션 설정을 통해 다채널 입력 이미지에 대한 출력 이미지를 회색조로 출력할 수 있습니다.bGrayscale
: 회색조 출력 옵션 활성화 여부
Default: false
4 예제 코드
CNonMaximumSuppression nms;
CFLImage fliSourceImage;
CFLImage fliDestinationImage;
nms.SetSourceImage(fliSourceImage);
nms.SetDestinationImage(fliDestinationImage);
nms.SetFilter(CNonMaximumSuppression::EFilter_Sobel);
nms.SetNMSInterpolationMethod(CNonMaximumSuppression::ENMSInterpolationMethod_NearestNeighbor);
nms.SetConflictHandlingMethod(CNonMaximumSuppression::EConflictHandlingMethod_KeepAll);
nms.EnableGrayscale(false);
nms.Execute();
5 기타 사항
Supported Feature
- Image
- Source Image
- Destination Image
- ROI
- Source ROI
- Destination ROI
- Pivot
- Source Pivot
- Destination Pivot
- Blank Color
- Figure Transform
- Batch Processing
Supported Format
- Source
- Channel
- 1-10
- Combined, Separated
- Value Type & Depth
- Signed: 8, 9-16, 32
- Unsigned: 8, 9-16, 32
- Floating: 32, 64
- Channel
- Destination
- Channel
- Source 와 일치하는 경우 지원
- Value Type & Depth
- Destination 이미지가 존재할 때, Source 와 일치하는 경우 지원
- Destination 이미지를 생성하는 경우, Source 추종
- Channel