Skip to content

Commit e3cd185

Browse files
authored
Merge pull request #2995 from hengguan:ppf_matching
surface matching * normalize quantionion * keep master same as origin repository * normalize quantonion
1 parent d78fbf8 commit e3cd185

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

modules/surface_matching/src/ppf_match_3d.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,13 @@ void PPF3DDetector::clusterPoses(std::vector<Pose3DPtr>& poseList, int numPoses,
366366
tAvg *= 1.0 / wSum;
367367
qAvg *= 1.0 / wSum;
368368

369+
// normalize quantonion
370+
const double qNorm = cv::norm(qAvg);
371+
if (qNorm > EPS)
372+
{
373+
qAvg *= 1.0 / qNorm;
374+
}
375+
369376
curPoses[0]->updatePoseQuat(qAvg, tAvg);
370377
curPoses[0]->numVotes=curCluster->numVotes;
371378

@@ -397,6 +404,13 @@ void PPF3DDetector::clusterPoses(std::vector<Pose3DPtr>& poseList, int numPoses,
397404
tAvg *= 1.0 / curSize;
398405
qAvg *= 1.0 / curSize;
399406

407+
// normalize quantonion
408+
const double qNorm = cv::norm(qAvg);
409+
if (qNorm > EPS)
410+
{
411+
qAvg *= 1.0 / qNorm;
412+
}
413+
400414
curPoses[0]->updatePoseQuat(qAvg, tAvg);
401415
curPoses[0]->numVotes=curCluster->numVotes;
402416

0 commit comments

Comments
 (0)