From e8f1026560f579f1a9c6ffb5bc16537993b66e4a Mon Sep 17 00:00:00 2001 From: guanheng Date: Tue, 8 Jun 2021 09:39:39 +0800 Subject: [PATCH 1/3] normalize quantionion --- modules/surface_matching/src/ppf_match_3d.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/surface_matching/src/ppf_match_3d.cpp b/modules/surface_matching/src/ppf_match_3d.cpp index c5c25e27e8..9ceca7b48d 100644 --- a/modules/surface_matching/src/ppf_match_3d.cpp +++ b/modules/surface_matching/src/ppf_match_3d.cpp @@ -365,6 +365,12 @@ void PPF3DDetector::clusterPoses(std::vector& poseList, int numPoses, tAvg *= 1.0 / wSum; qAvg *= 1.0 / wSum; + // normalize quantonion + const double qNorm = cv::norm(qAvg); + if (qNorm > EPS) + { + qAvg *= 1.0 / qNorm; + } curPoses[0]->updatePoseQuat(qAvg, tAvg); curPoses[0]->numVotes=curCluster->numVotes; @@ -397,6 +403,13 @@ void PPF3DDetector::clusterPoses(std::vector& poseList, int numPoses, tAvg *= 1.0 / curSize; qAvg *= 1.0 / curSize; + // normalize quantonion + const double qNorm = cv::norm(qAvg); + if (qNorm > EPS) + { + qAvg *= 1.0 / qNorm; + } + curPoses[0]->updatePoseQuat(qAvg, tAvg); curPoses[0]->numVotes=curCluster->numVotes; From f41237257df591d4001b6c60c7b0f35930b7ca3f Mon Sep 17 00:00:00 2001 From: guanheng Date: Tue, 6 Jul 2021 14:23:51 +0800 Subject: [PATCH 2/3] keep master same as origin repository --- modules/surface_matching/src/ppf_match_3d.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/modules/surface_matching/src/ppf_match_3d.cpp b/modules/surface_matching/src/ppf_match_3d.cpp index 9ceca7b48d..c5c25e27e8 100644 --- a/modules/surface_matching/src/ppf_match_3d.cpp +++ b/modules/surface_matching/src/ppf_match_3d.cpp @@ -365,12 +365,6 @@ void PPF3DDetector::clusterPoses(std::vector& poseList, int numPoses, tAvg *= 1.0 / wSum; qAvg *= 1.0 / wSum; - // normalize quantonion - const double qNorm = cv::norm(qAvg); - if (qNorm > EPS) - { - qAvg *= 1.0 / qNorm; - } curPoses[0]->updatePoseQuat(qAvg, tAvg); curPoses[0]->numVotes=curCluster->numVotes; @@ -403,13 +397,6 @@ void PPF3DDetector::clusterPoses(std::vector& poseList, int numPoses, tAvg *= 1.0 / curSize; qAvg *= 1.0 / curSize; - // normalize quantonion - const double qNorm = cv::norm(qAvg); - if (qNorm > EPS) - { - qAvg *= 1.0 / qNorm; - } - curPoses[0]->updatePoseQuat(qAvg, tAvg); curPoses[0]->numVotes=curCluster->numVotes; From 2f49253d9370854ab50573738042d634113a77df Mon Sep 17 00:00:00 2001 From: guanheng Date: Tue, 6 Jul 2021 15:23:34 +0800 Subject: [PATCH 3/3] normalize quantonion --- modules/surface_matching/src/ppf_match_3d.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/surface_matching/src/ppf_match_3d.cpp b/modules/surface_matching/src/ppf_match_3d.cpp index c5c25e27e8..1c1a24729c 100644 --- a/modules/surface_matching/src/ppf_match_3d.cpp +++ b/modules/surface_matching/src/ppf_match_3d.cpp @@ -366,6 +366,13 @@ void PPF3DDetector::clusterPoses(std::vector& poseList, int numPoses, tAvg *= 1.0 / wSum; qAvg *= 1.0 / wSum; + // normalize quantonion + const double qNorm = cv::norm(qAvg); + if (qNorm > EPS) + { + qAvg *= 1.0 / qNorm; + } + curPoses[0]->updatePoseQuat(qAvg, tAvg); curPoses[0]->numVotes=curCluster->numVotes; @@ -397,6 +404,13 @@ void PPF3DDetector::clusterPoses(std::vector& poseList, int numPoses, tAvg *= 1.0 / curSize; qAvg *= 1.0 / curSize; + // normalize quantonion + const double qNorm = cv::norm(qAvg); + if (qNorm > EPS) + { + qAvg *= 1.0 / qNorm; + } + curPoses[0]->updatePoseQuat(qAvg, tAvg); curPoses[0]->numVotes=curCluster->numVotes;