Merge pull request #23165 from labeeb-7z:optimizeDistanceTransform

pull/23168/head
Alexander Alekhin 2 years ago
commit 52855a39ad
  1. 6
      modules/imgproc/src/distransform.cpp

@ -740,10 +740,8 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe
if( maskSize != CV_DIST_MASK_3 && maskSize != CV_DIST_MASK_5 && maskSize != CV_DIST_MASK_PRECISE )
CV_Error( CV_StsBadSize, "Mask size should be 3 or 5 or 0 (precise)" );
if( distType == CV_DIST_C || distType == CV_DIST_L1 )
maskSize = !need_labels ? CV_DIST_MASK_3 : CV_DIST_MASK_5;
else if( distType == CV_DIST_L2 && need_labels )
maskSize = CV_DIST_MASK_5;
if ((distType == CV_DIST_C || distType == CV_DIST_L1) && !need_labels)
maskSize = CV_DIST_MASK_3;
if( maskSize == CV_DIST_MASK_PRECISE )
{

Loading…
Cancel
Save