Laplacian Filter

1 개요

이미지의 경계선을 감지 및 변화율을 계산하는데 사용되는 필터입니다. 입력 이미지에 Laplacian 합성곱을 수행하는 알고리즘입니다.

2 알고리즘 상세 설명

Source Image Destination Image
Source Image Destination Image
Fig. Laplacian Filter (Laplacian8, Saturated)

결과 이미지의 값이 큰 경우는 변화율이 큰 것을 의미합니다. 해당 부분으로 경계선 확인 및 객체 인식에 사용됩니다.

해당 알고리즘은 여러 Kernel을 지원하며 SetKernelMethod 함수를 사용하여 Kernel의 선택이 가능합니다.

LX=(000121000)L_X = \left(\begin{array}{cc} 0 & 0 & 0\\ 1 & -2 & 1\\ 0 & 0 & 0 \end{array}\right)

LY=(010020010)L_Y = \left(\begin{array}{cc} 0 & 1 & 0\\ 0 & -2 & 0\\ 0 & 1 & 0 \end{array}\right)

L4=(010141010)L_4 = \left(\begin{array}{cc} 0 & 1 & 0\\ 1 & -4 & 1\\ 0 & 1 & 0 \end{array}\right)

L8=(111181111)L_8 = \left(\begin{array}{cc} 1 & 1 & 1\\ 1 & -8 & 1\\ 1 & 1 & 1 \end{array}\right)

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

4 예제 코드

이미지 및 ROI 설정 방법(ImageProcessing_Common 항목 참고)
패딩 영역 처리 예제 코드

CLaplacianFilter LaplacianFilter;
//////////////////////////////////
// 공통 파라미터 설정
//////////////////////////////////

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

LaplacianFilter.SetKernelMethod(CLaplacianFilter::EKernel_Laplacian8);
LaplacianFilter.SetOperationMode(CLaplacianFilter::EOperationMode_Absolute);

// 알고리즘 실행
LaplacianFilter.Execute();
CLaplacianFilter LaplacianFilter = new CLaplacianFilter();
//////////////////////////////////
// 공통 파라미터 설정
//////////////////////////////////

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

LaplacianFilter.SetKernelMethod(CLaplacianFilter.EKernel.Laplacian8);
LaplacianFilter.SetOperationMode(CLaplacianFilter.EOperationMode.Absolute);

// 알고리즘 실행
LaplacianFilter.Execute();
LaplacianFilter = CLaplacianFilter()
##################################
## 공통 파라미터 설정
##################################

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

LaplacianFilter.SetKernelMethod(CLaplacianFilter.EKernel.Laplacian8)
LaplacianFilter.SetOperationMode(CLaplacianFilter.EOperationMode.Absolute)

## 알고리즘 실행
LaplacianFilter.Execute()