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