mirror of
https://github.com/opencv/opencv.git
synced 2025-01-19 06:53:50 +08:00
Merge pull request #23165 from labeeb-7z:optimizeDistanceTransform
This commit is contained in:
commit
52855a39ad
@ -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…
Reference in New Issue
Block a user