Smoothing 3D
1 개요
Moving Least Square(MLS) 방법을 사용하여 포인트 클라우드를 스무딩하는 알고리즘입니다.
2 알고리즘 상세 설명
Source Object | Result Object |
---|---|
![]() |
![]() |
Fig. 원본 포인트 클라우드 및 스무딩 적용 결과
3 파라미터 설정
-
SetAutoSigmaCoefficient(float f32Coef)
- h = 자동 계산된 내부 반경 값 * f32Coef
- h 값의 계수를 설정합니다.
- Default Value : 3
- Recommended Value : 2 ~ 5
-
SetNeighborCount(int32_t i32Count)
- 탐색할 이웃 점들의 개수를 설정합니다.
- Default Value : 40
- Recommended Value : 10, 20, 40, 60, 80, 100
-
SetPolynomialOrder(int32_t i32Order)
- 다항식 차수를 설정합니다.
- 1 : 1차 다항식(평면)
- 2 : 2차 다항식(포물면 등)
- 3 : 3차 이상(복잡한 곡면)
- Default Value : 2
- Recommended Value : 1, 2, 3
-
SetViewPoint(TPoint3<float> tp3ViewPoint)
- 법선 벡터 방향을 보정하기 위한 시점을 설정합니다.
- tp3ViewPoint : 시점 위치
- Default Value : (0, 0, 1)
- Recommended Value : (0, 0, 1), (0, 1, 0), (1, 0, 0)
-
SetPrecisionType(EPrecisionType eType)
- 정밀도 타입을 설정합니다.
- Float : Float 타입
- Double : Double 타입
- Default Value : EPrecisionType_Double
-
EnableIncludeNormalVector(bool bNormal)
- MLS 법선 벡터를 결과에 포함할지 여부를 설정합니다.
- true : MLS 결과 법선 벡터를 포함합니다.
- false : 법선 벡터를 포함하지 않으며, 원본 객체에 법선 벡터가 있는 경우 이를 보존합니다.
- Default Value : true
4 예제 코드
CSmoothing3D smoothing3D;
CFL3DObject floSource;
CFL3DObject floDestination;
floSource.Load(L"C:/Users/Public/Documents/FLImaging/ExampleImages/Smoothing3D/Smoothing3DExample.ply");
smoothing3D.SetSourceObject(floSource);
smoothing3D.SetDestinationObject(floDestination);
// Sigma 값 계수 설정
// 평균 거리 * Coefficient 값이 사용됩니다.
smoothing3D.SetAutoSigmaCoefficient(4.000000f);
// 탐색 이웃 수 설정
// 값이 클 수록 안정적인 결과를 얻을 수 있으나 성능이 하락합니다.
smoothing3D.SetNeighborCount(50);
smoothing3D.SetPolynomialOrder(3); // 다항식 차수 설정
TPoint3<float> tp3ViewPoint;
tp3ViewPoint.x = 0.000000f;
tp3ViewPoint.y = 0.000000f;
tp3ViewPoint.z = 1.000000f;
smoothing3D.SetViewPoint(tp3ViewPoint);
smoothing3D.EnableIncludeNormalVector(true);
smoothing3D.Execute();