Depth Image Reconstruction 3D
1 개요
초점거리가 선형적으로 변화하는 이미지 페이지들의 초점 측정치를 기반으로 대상의 높이를 추정하는 알고리즘
2 알고리즘 상세 설명
Source Images | Destination Texture Image | Destination Height Map Image |
---|---|---|
![]() |
![]() |
![]() |
Fig. Source, Destination Texture and Destination Height Map image.
초점 측정치가 높은 페이지의 인덱스를 출력합니다.
부산물로써 함께 출력되는 텍스쳐 이미지는 Multi Focus 알고리즘의 출력 이미지와 유사합니다.
- : focus measure 함수
- : p 번째 페이지 이미지의 i 번째 픽셀 벡터
- : i 번째 픽셀에 대하여 Result Height 출력 값인 페이지 인덱스
소스 페이지 간 Alignment 가 맞지 않는 경우 이를 보정하기 위한 파라미터들이 있으며, 해당 옵션들은 내부에서 Perspective 알고리즘을 호출하는데 사용됩니다.
Destination 3D Object |
---|
![]() |
Fig. Destination 3D Object.
Result Height 이미지는 3D View 로 쉽게 표시할 수 있도록 float 타입 이미지로 고정됩니다.
해당 Height 이미지의 높이 배율이 필요한 경우 파라미터를 통해 설정할 수 있습니다.
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 SetDirection(EDirection eDirection)
입력 이미지의 페이지 인덱스가 순차적으로 정렬된 방식 설정eDirection
: 페이지의 포커스 거리 정렬 방식
Default: EDirection_BottomToTop- EDirection_BottomToTop: 카메라와 먼 곳(Bottom) 부터 가까운 곳(Top)이 포커스된 이미지 순서로 정렬된 경우
- EDirection_TopToBottom: 카메라와 가까운 곳(Top) 부터 먼 곳(Bottom)이 포커스된 이미지 순서로 정렬된 경우
Focus Measure 방식 설정
const CResult SetDifferentialMethod(EDifferentialMethod eDifferentialMethod)
포커스 측정 방식을 설정합니다.eDifferentialMethod
: 포커스 측정 방식
Default: EDifferentialMethod_Auto- EDifferentialMethod_Auto: Laplacian8
- EDifferentialMethod_Sobel
- EDifferentialMethod_Laplacian4
- EDifferentialMethod_Laplacian8
- EDifferentialMethod_Gradient
- EDifferentialMethod_Roberts
- EDifferentialMethod_Kirsch
Focus Measure 최고점 인덱스 측정 방식 설정
const CResult EnableGaussianInterpolation(bool bGaussianInterpolation)
포커스 최고점 측정 시 가우시안 보간을 사용할 것인지 설정합니다.
활성화 된 경우 최고점 양쪽 두 지점의 Focus Measure 값을 함께 고려하여 세 점이 가우시안 그래프 상에 있다고 가정하고 실수 범위에서 최고점 인덱스를 추정합니다.
활성화 시 정수 인덱스에 의한 양자화 효과를 보정할 수 있습니다.bGaussianInterpolation
: 가우시안 보간 활성화 여부
노이즈 후처리 필터 설정
const CResult SetFilter(EFilter eFilter)
입력 이미지의 노이즈 또는 표면의 질감이 없거나, 질감이 있더라도 색상 대비가 질감의 정도 보다 강하여 Defocus 에 의한 영향으로 정상적인 포커스 측정이 힘든 경우 노이즈 및 아티펙트가 발생할 수 있습니다.
이를 제거하기 위해 Destination 이미지에 노이즈 후처리 필터를 사용할 것인지 설정합니다.eFilter
: 노이즈 후처리 필터
Default: EFilter_Guided- EFilter_None
- EFilter_Bilateral: 해당 필터 사용 시 Sigma Spatial, Sigma Range 의 추가 파라미터를 설정할 수 있습니다.
- EFilter_Guided: 해당 필터 사용 시 Sigma Spatial, Sigma Range 의 추가 파라미터를 설정할 수 있습니다.
- EFilter_FLDenoisingType1: 해당 필터 사용 시 Kernel, Sigma, Amplitude 의 추가 파라미터를 설정할 수 있습니다.
출력 이미지 높이 배율 설정
const CResult SetPixelAccuracy(double f64PixelAccuracyMM)
픽셀 당 실제 거리를 의미할 수 있으며, Result Height Map 인 Destination 이미지에 곱해질 배율을 설정하는 데 사용됩니다.f64PixelAccuracyMM
: 높이 배율의 분모
const CResult SetDepthPitch(double f64DepthPitchMM)
페이지 당 변화되는 초점 거리 변화를 의미할 수 있으며, Result Height Map 인 Destination 이미지에 곱해질 배율을 설정하는 데 사용됩니다.f64DepthPitchMM
: 높이 배율의 분자
4 예제 코드
CDepthImageReconstruction3D depthImageReconstruction3D;
CFLImage fliSourceImage;
CFLImage fliDestinationTextureImage;
CFLImage fliDestinationHeightMapImage;
CFL3DObjectHeightMap fl3DOHM;
depthImageReconstruction3D.SetSourceImage(fliSourceImage);
depthImageReconstruction3D.SetDestinationTextureImage(fliDestinationTextureImage);
depthImageReconstruction3D.SetDestinationHeightMapImage(fliDestinationHeightMapImage);
depthImageReconstruction3D.SetDestinationObject(fl3DOHM);
depthImageReconstruction3D.SetDirection(CDepthImageReconstruction3D::EDirection_BottomToTop);
depthImageReconstruction3D.SetDifferentialMethod(CDepthImageReconstruction3D::EDifferentialMethod_Auto);
depthImageReconstruction3D.EnableGaussianInterpolation(true);
depthImageReconstruction3D.SetFilter(CDepthImageReconstruction3D::EFilter_FLDenoisingType1);
depthImageReconstruction3D.SetFLDenoisingKernel(3.0);
depthImageReconstruction3D.SetFLDenoisingSigma(2.0);
depthImageReconstruction3D.SetFLDenoisingAmplitue(30.0);
depthImageReconstruction3D.SetPixelAccuracy(1.0);
depthImageReconstruction3D.SetDepthPitch(1.0);
depthImageReconstruction3D.Execute();
5 기타 사항
Supported Feature
- Image
- Source Image
- Destination Texture Image
- Destination Height Map Image
- 3D
- Destination 3D Object
Supported Format
- Source
[in]
- Page
- 1
- Channel
- 1-10
- Combined, Separated
- Value Type & Depth
- Signed: 8, 9-16, 32
- Unsigned: 8, 9-16, 32
- Floating: 32, 64
- Page
- Destination Texture
[out]
- Channel
- Source 와 일치하는 경우 지원
- Value Type & Depth
- Texture 이미지가 있는 경우, Source 와 일치하는 경우 지원
- Texture 이미지를 생성하는 경우, Source 추종
- Channel
- **Destination Height Map **
[out]
- Channel
- 1
- Value Type & Depth
- Floating: 32
- Channel
6 관련 알고리즘
Perspective
Bilateral Filter
Guided Filter
Multi Focus
Depth Image Reconstruction MAP Based 3D