File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ int gradThresh;
23
23
int op;
24
24
bool SumFlag;
25
25
int * grads;
26
+ bool PFmode;
26
27
};
27
28
28
29
void ComputeGradientBody::operator () (const Range& range) const
@@ -78,7 +79,7 @@ void ComputeGradientBody::operator() (const Range& range) const
78
79
79
80
gradRow[x] = (short )sum;
80
81
81
- if (op == EdgeDrawing::PREWITT )
82
+ if (PFmode )
82
83
grads[(int )sum]++;
83
84
84
85
if (sum >= gradThresh)
@@ -351,13 +352,6 @@ void EdgeDrawingImpl::detectEdges(InputArray src)
351
352
anchorThresh = params.AnchorThresholdValue ;
352
353
op = params.EdgeDetectionOperator ;
353
354
354
- if (params.PFmode )
355
- {
356
- op = PREWITT;
357
- gradThresh = 11 ;
358
- anchorThresh = 3 ;
359
- }
360
-
361
355
// Check parameters for sanity
362
356
if (op < 0 || op > 3 )
363
357
op = 0 ;
@@ -444,7 +438,7 @@ void EdgeDrawingImpl::getEdgeImage(OutputArray _dst)
444
438
void EdgeDrawingImpl::getGradientImage (OutputArray _dst)
445
439
{
446
440
if (!gradImage.empty ())
447
- convertScaleAbs ( gradImage, _dst);
441
+ gradImage. copyTo ( _dst);
448
442
}
449
443
450
444
std::vector<std::vector<Point> > EdgeDrawingImpl::getSegments ()
@@ -473,6 +467,7 @@ void EdgeDrawingImpl::ComputeGradient()
473
467
body.SumFlag = params.SumFlag ;
474
468
body.op = op;
475
469
body.grads = grads;
470
+ body.PFmode = params.PFmode ;
476
471
477
472
parallel_for_ (Range (1 , smoothImage.rows - 1 ), body);
478
473
}
You can’t perform that action at this time.
0 commit comments