Depth Map To Point Cloud Converter 3D

1 개요

카메라의 내부 파라미터를 사용해 Depth Map Image에서 Point Cloud를 생성합니다.

X=z(xpx)fxY=z(ypy)fyZ=z\begin{aligned} X &= z \cdot \frac{(x - p_x)}{f_x} \\ Y &= z \cdot \frac{(y - p_y)}{f_y} \\ Z &= z \end{aligned}

기본적으로 위와 같은 Projection Model을 사용합니다.

2 알고리즘 상세 설명

Depth Map Image Texture Image Result Point Cloud
Depth Depth Result
Fig. Depth Map Image, Texture Image, ROI 설정 및 실행 결과

3 파라미터 설정

Depth Map Image Texture Image
Depth Texture

4 예제 코드

CDepthMapToPointCloudConverter3D DepthMapToPointCloud;

CFLImage fliSourceImage;
DepthMapToPointCloud.SetSourceImage(fliSourceImage);

CFLImage fliTextureImage;
DepthMapToPointCloud.SetTextureImage(fliTextureImage);

CFL3DObject floDestinationObject;
DepthMapToPointCloud.SetDestinationObject(floDestinationObject);
DepthMapToPointCloud.SetDirectionType(EDirectionType::EDirectionType_Increment);

CFLPoint<float> flpFocalLength;
CFLPoint<float> flpPrincipalPoint;

DepthMapToPointCloud.SetIntrinsicParameter(flpFocalLength, flpPrincipalPoint); // 카메라 내부 행렬 설정

CFLArray<double> flaDistortionCoef;
flaDistortionCoef.PushBack(0);
flaDistortionCoef.PushBack(0);
flaDistortionCoef.PushBack(0);
flaDistortionCoef.PushBack(0);
flaDistortionCoef.PushBack(0);
DepthMapToPointCloud.SetDistortionCoefficient(flaDistortionCoef); // 왜곡 계수 설정

DepthMapToPointCloud.Execute();


CDepthMapToPointCloudConverter3D DepthMapToPointCloud = new CDepthMapToPointCloudConverter3D();

CFLImage fliSourceImage = new CFLImage();
DepthMapToPointCloud.SetSourceImage(ref fliSourceImage);

CFLImage fliTextureImage = new CFLImage();
DepthMapToPointCloud.SetTextureImage(ref fliTextureImage);

CFL3DObject floDestinationObject = new CFL3DObject();
DepthMapToPointCloud.SetDestinationObject(ref floDestinationObject);
DepthMapToPointCloud.SetDirectionType(EDirectionType.Increment);

CFLPoint<float> flpFocalLength = new CFLPoint<float>();
CFLPoint<float> flpPrincipalPoint = new CFLPoint<float>();
	
DepthMapToPointCloud.SetIntrinsicParameter(flpFocalLength, flpPrincipalPoint); // 카메라 내부 행렬 설정

List<double> listDistortionCoef = new List<double>();

listDistortionCoef.Add(0);
listDistortionCoef.Add(0);
listDistortionCoef.Add(0);
listDistortionCoef.Add(0);
listDistortionCoef.Add(0);
DepthMapToPointCloud.SetDistortionCoefficient(listDistortionCoef); // 왜곡 계수 설정
DepthMapToPointCloud.Execute();


DepthMapToPointCloud = CDepthMapToPointCloudConverter3D()

fliSourceImage = CFLImage()
DepthMapToPointCloud.SetSourceImage(fliSourceImage)

fliTextureImage = CFLImage()
DepthMapToPointCloud.SetTextureImage(fliTextureImage)

floDestinationObject = CFL3DObject()
DepthMapToPointCloud.SetDestinationObject(floDestinationObject)
DepthMapToPointCloud.SetDirectionType(EDirectionType.Increment)

flpFocalLength = CFLPoint[Single]
flpPrincipalPoint = CFLPoint[Single]
	
DepthMapToPointCloud.SetIntrinsicParameter(flpFocalLength, flpPrincipalPoint) # 카메라 내부 행렬 설정

listDistortionCoef = List[Double]()

listDistortionCoef.Add(0)
listDistortionCoef.Add(0)
listDistortionCoef.Add(0)
listDistortionCoef.Add(0)
listDistortionCoef.Add(0)
DepthMapToPointCloud.SetDistortionCoefficient(listDistortionCoef)
DepthMapToPointCloud.Execute()