From 627e6a0447c3d8ab8e61e1f21f70f2c9d27f8695 Mon Sep 17 00:00:00 2001 From: Wanli Zhong <49567307+Zoom1111@users.noreply.github.com> Date: Wed, 11 May 2022 15:30:58 +0800 Subject: [PATCH] Modify randomSampling in point cloud --- modules/3d/src/ptcloud/sampling.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/3d/src/ptcloud/sampling.cpp b/modules/3d/src/ptcloud/sampling.cpp index eee25f6d4c..2ee1fa2167 100644 --- a/modules/3d/src/ptcloud/sampling.cpp +++ b/modules/3d/src/ptcloud/sampling.cpp @@ -163,7 +163,7 @@ randomSampling(OutputArray sampled_pts, InputArray input_pts, const int sampled_ for (int i = 0; i < ori_pts_size; ++i) pts_idxs[i] = i; randShuffle(pts_idxs, 1, rng); - int channels = input_pts.channels(); + int channels = sampled_pts.channels(); if (channels == 3 && sampled_pts.isVector()) { // std::vector @@ -365,4 +365,4 @@ int farthestPointSampling(OutputArray sampled_point_flags, InputArray input_pts, } // farthestPointSampling() //! @} _3d -} //end namespace cv \ No newline at end of file +} //end namespace cv