Multi Focus
1 개요
초점이 다른 이미지들을 초점이 통합된 하나의 이미지로 만드는 알고리즘
2 알고리즘 상세 설명
Source Image | Destination Image |
---|---|
![]() |
![]() |
Fig. Source and Destination images.
초점 측정치가 높은 페이지의 픽셀을 출력합니다.
- : focus measure 함수
- : p 번째 페이지 이미지의 i 번째 픽셀 벡터
- : i 번째 픽셀에 대하여 출력 시 선택될 페이지 인덱스
페이지 간 Alignment 가 맞지 않는 경우 이를 보정하기 위한 파라미터들이 있으며, 해당 옵션들은 내부에서 Perspective 알고리즘을 호출하는데 사용됩니다.
3 파라미터 설정 및 사용 방법
Page Alignment 보정
CResult SetFirstPageAlignment(const CFLFigure& flfFirstPageAlignment)
Perspective 알고리즘의 파라미터를 계산하기 위한 첫 번째 페이지의 alignment 도형을 설정합니다. Rect 또는 Quad 가 허용되며, 중간 페이지의 경우 두 도형 의 가중평균을 Perspective 알고리즘의 입력으로 사용합니다.
모든 페이지의 이미지에서 두 도형의 평균 도형을 타겟으로 변환됩니다.flfFirstPageAlignment
: 첫 번째 페이지의 alignment 도형
const CResult SetLastPageAlignment(const CFLFigure& flfLastPageAlignment)
Perspective 알고리즘의 파라미터를 계산하기 위한 마지막 페이지의 alignment 도형을 설정합니다. Rect 또는 Quad 가 허용되며, 중간 페이지의 경우 두 도형 의 가중평균을 Perspective 알고리즘의 입력으로 사용합니다.
모든 페이지의 이미지에서 두 도형의 평균 도형을 타겟으로 변환됩니다.flfLastPageAlignment
: 마지막 페이지의 alignment 도형
const CResult SetInterpolationMethod(EInterpolationMethod eMethod)
Perspective 알고리즘의 파라미터인 보간 방식을 결정합니다.eMethod
: 보간 방식- EInterpolationMethod_Bilinear
- EInterpolationMethod_NearestNeighbor
- EInterpolationMethod_Bicubic
- EInterpolationMethod_Lanczos
const CResult SetAccuracy(EFloatingPointAccuracy eAccuracy )
Perspective 알고리즘의 파라미터인 연산 정밀도를 설정합니다.eAccuracy
: 연산 정밀도- EFloatingPointAccuracy_Bit32
- EFloatingPointAccuracy_Bit64
지역성 커널 사이즈 설정
const CResult SetKernelHalfSize(int64_t i64KernelHalfSize)
Spatial 도메인의 커널 반지름 길이를 설정합니다.
입력 값이x
인 경우, 커널 한 변의 길이는2*x + 1
이 됩니다. 이 커널에 의해 지역성이 전파됩니다.i64KernelHalfSize
: 커널 반지름 길이
Default: 20, (0, ...)
4 예제 코드
CMultiFocus mf;
CFLImage fliSourceImage;
CFLImage fliDestinationImage;
mf.SetSourceImage(fliSourceImage);
mf.SetDestinationImage(fliDestinationImage);
mf.SetKernelHalfSize(20);
mf.Execute();
5 기타 사항
Supported Feature
- Image
- Source Image
- Destination Image
- ROI
- Source ROI
- Destination ROI
- Pivot
- Source Pivot
- Destination Pivot
- Blank Color
Supported Format
- Source
- Page
- Channel
- 1-10
- Combined, Separated
- Value Type & Depth
- Signed: 8, 9-16, 32, 64
- Unsigned: 8, 9-16, 32, 64
- Floating: 32, 64
- Page
- Destination
- Channel
- Source 와 일치하는 경우 지원
- Value Type & Depth
- Destination 이미지가 존재할 때, Source 와 일치하는 경우 지원
- Destination 이미지를 생성하는 경우, Source 추종
- Channel