該類允許載入和匹配 3D 模型。典型用法:更多...
#include <opencv2/surface_matching/ppf_match_3d.hpp>
|
| | PPF3DDetector () |
| | 空建構函式。設定預設引數。
|
| |
| | PPF3DDetector (const double relativeSamplingStep, const double relativeDistanceStep=0.05, const double numAngles=30) |
| |
| virtual | ~PPF3DDetector () |
| |
| void | match (const Mat &scene, std::vector< Pose3DPtr > &results, const double relativeSceneSampleStep=1.0/5.0, const double relativeSceneDistance=0.03) |
| | 在提供的場景中匹配訓練好的模型。
|
| |
| void | read (const FileNode &fn) |
| |
| void | setSearchParams (const double positionThreshold=-1, const double rotationThreshold=-1, const bool useWeightedClustering=false) |
| |
| void | trainModel (const Mat &Model) |
| | 訓練新模型。
|
| |
| void | write (FileStorage &fs) const |
| |
允許載入和匹配3D模型的類。典型用法
cout << "Poses: " << endl;
detector.match(pcTest, results, 1.0/5.0,0.05);
允許載入和匹配3D模型的類。典型用法
定義 ppf_match_3d.hpp:98
匹配過程以姿態的獲得而結束。然而,由於多個匹配點、錯誤假設、姿態平均等因素,這樣的姿態非常容易受到噪聲影響,並且很多時候遠非完美。儘管在該階段獲得的視覺結果令人滿意,但定量評估顯示存在約 \(10\) 度的變化(誤差),這是一個可接受的匹配水平。很多時候,要求可能會遠遠超出這個範圍,因此需要對計算出的姿態進行細化。
◆ PPF3DDetector() [1/2]
| cv::ppf_match_3d::PPF3DDetector::PPF3DDetector |
( |
| ) |
|
| Python |
|---|
| cv.ppf_match_3d.PPF3DDetector( | | ) -> | <ppf_match_3d_PPF3DDetector object> |
| cv.ppf_match_3d.PPF3DDetector( | relativeSamplingStep[, relativeDistanceStep[, numAngles]] | ) -> | <ppf_match_3d_PPF3DDetector object> |
◆ PPF3DDetector() [2/2]
| cv::ppf_match_3d::PPF3DDetector::PPF3DDetector |
( |
const double | relativeSamplingStep, |
|
|
const double | relativeDistanceStep = 0.05, |
|
|
const double | numAngles = 30 ) |
| Python |
|---|
| cv.ppf_match_3d.PPF3DDetector( | | ) -> | <ppf_match_3d_PPF3DDetector object> |
| cv.ppf_match_3d.PPF3DDetector( | relativeSamplingStep[, relativeDistanceStep[, numAngles]] | ) -> | <ppf_match_3d_PPF3DDetector object> |
帶引數的建構函式
- 引數
-
| [輸入] | relativeSamplingStep | 相對於物件直徑的取樣距離。首先均勻取樣模型以提高效率。減小此值會導致更密集的模型和更準確的姿勢估計,但模型越大,訓練速度越慢。增加該值會導致姿勢計算不太準確,但模型更小,模型生成和匹配速度更快。使用小值時請注意記憶體消耗。 |
| [輸入] | relativeDistanceStep | 點對距離相對於模型直徑的離散距離。該值對雜湊表有直接影響。使用小值會導致過於精細的離散化,從而導致雜湊表 bin 中的歧義。太大的值會導致特徵向量沒有區分度,並且不同的點對特徵將被分配到同一個 bin 中。此引數預設為 RelativeSamplingStep 的值。對於嘈雜的場景,可以增加該值以提高匹配對嘈雜點的魯棒性。 |
| [輸入] | numAngles | 將點對方向的離散化設定為角度的細分數量。該值相當於方向的 RelativeDistanceStep。增加該值會提高匹配的精度,但會降低對不正確法線方向的魯棒性。減小該值會降低匹配的精度,但會提高對不正確法線方向的魯棒性。對於法線方向無法準確計算的非常嘈雜的場景,該值可以設定為 25 或 20。 |
◆ ~PPF3DDetector()
| virtual cv::ppf_match_3d::PPF3DDetector::~PPF3DDetector |
( |
| ) |
|
|
virtual |
◆ clearTrainingModels()
| void cv::ppf_match_3d::PPF3DDetector::clearTrainingModels |
( |
| ) |
|
|
保護 |
◆ match()
| void cv::ppf_match_3d::PPF3DDetector::match |
( |
const Mat & | scene, |
|
|
std::vector< Pose3DPtr > & | 結果, |
|
|
const double | relativeSceneSampleStep = 1.0/5.0, |
|
|
const double | relativeSceneDistance = 0.03 ) |
| Python |
|---|
| cv.ppf_match_3d.PPF3DDetector.match( | scene[, relativeSceneSampleStep[, relativeSceneDistance]] | ) -> | 結果 |
在提供的場景中匹配訓練好的模型。
- 引數
-
| [輸入] | scene | 場景的點雲 |
| [輸出] | 結果 | 輸出姿勢列表 |
| [輸入] | relativeSceneSampleStep | 在以 relativeSceneDistance 取樣後用於匹配的場景點數的比率。例如,如果此值設定為 1.0/5.0,則場景中每 5 個點用於姿勢估計。此引數允許在匹配的速度和精度之間輕鬆權衡。增加該值會導致使用較少的點,從而導致姿勢計算更快但不太準確。減小該值具有相反的效果。 |
| [輸入] | relativeSceneDistance | 設定相對於模型直徑的距離閾值。此引數等效於訓練階段的 relativeSamplingStep 引數。此引數的作用類似於使用 relativeSceneSampleStep 引數進行先驗取樣。 |
◆ read()
| void cv::ppf_match_3d::PPF3DDetector::read |
( |
const FileNode & | fn | ) |
|
◆ setSearchParams()
| void cv::ppf_match_3d::PPF3DDetector::setSearchParams |
( |
const double | positionThreshold = -1, |
|
|
const double | rotationThreshold = -1, |
|
|
const bool | useWeightedClustering = false ) |
設定搜尋引數
- 引數
-
| [輸入] | positionThreshold | 控制平移相似性的位置閾值。取決於校準/模型的單位。 |
| [輸入] | rotationThreshold | 控制旋轉相似性的位置閾值。此引數可以被視為角度差的閾值 |
| [輸入] | useWeightedClustering | 該演算法預設情況下對姿勢進行聚類而不進行加權。非零值表示姿勢聚類應將票數作為權重,並執行加權平均而不是簡單平均。 |
◆ trainModel()
| void cv::ppf_match_3d::PPF3DDetector::trainModel |
( |
const Mat & | Model (模型) | ) |
|
| Python |
|---|
| cv.ppf_match_3d.PPF3DDetector.trainModel( | Model (模型) | ) -> | 無 |
訓練新模型。
- 引數
-
| [輸入] | Model (模型) | 具有法線的輸入點雲 (Nx6) |
使用建構函式中設定的引數來降取樣並學習新模型。當模型被學習後,例項就可以呼叫 "match" 了。
◆ write()
| void cv::ppf_match_3d::PPF3DDetector::write |
( |
FileStorage & | fs | ) |
const |
◆ angle_step
| double cv::ppf_match_3d::PPF3DDetector::angle_step |
|
保護 |
◆ angle_step_radians
| double cv::ppf_match_3d::PPF3DDetector::angle_step_radians |
|
保護 |
◆ angle_step_relative
| double cv::ppf_match_3d::PPF3DDetector::angle_step_relative |
|
保護 |
◆ distance_step
| double cv::ppf_match_3d::PPF3DDetector::distance_step |
|
保護 |
◆ distance_step_relative
| double cv::ppf_match_3d::PPF3DDetector::distance_step_relative |
|
保護 |
◆ hash_nodes
| THash* cv::ppf_match_3d::PPF3DDetector::hash_nodes |
|
保護 |
◆ hash_table
◆ num_ref_points
| int cv::ppf_match_3d::PPF3DDetector::num_ref_points |
|
保護 |
◆ position_threshold
| double cv::ppf_match_3d::PPF3DDetector::position_threshold |
|
保護 |
◆ ppf
| Mat cv::ppf_match_3d::PPF3DDetector::ppf |
|
保護 |
◆ rotation_threshold
| double cv::ppf_match_3d::PPF3DDetector::rotation_threshold |
|
保護 |
◆ sampled_pc
| Mat cv::ppf_match_3d::PPF3DDetector::sampled_pc |
|
保護 |
◆ sampling_step_relative
| double cv::ppf_match_3d::PPF3DDetector::sampling_step_relative |
|
保護 |
◆ scene_sample_step
| int cv::ppf_match_3d::PPF3DDetector::scene_sample_step |
|
保護 |
◆ use_weighted_avg
| bool cv::ppf_match_3d::PPF3DDetector::use_weighted_avg |
|
保護 |
此類文件由以下檔案生成