diff --git a/modules/surface_matching/src/ppf_match_3d.cpp b/modules/surface_matching/src/ppf_match_3d.cpp index 5c6361c8a..a15863c57 100644 --- a/modules/surface_matching/src/ppf_match_3d.cpp +++ b/modules/surface_matching/src/ppf_match_3d.cpp @@ -645,7 +645,12 @@ void PPF3DDetector::match(const Mat& pc, std::vector& results, const Pose3DPtr pose(new Pose3D(alpha, refIndMax, maxVotes)); pose->updatePose(rawPose); - poseList.push_back(pose); + #if defined (_OPENMP) + #pragma omp critical + #endif + { + poseList.push_back(pose); + } #if defined (_OPENMP) free(accumulator);