@@ -109,6 +109,7 @@ class EdgeDrawingImpl : public EdgeDrawing
109
109
void getGradientImage (OutputArray dst) CV_OVERRIDE;
110
110
111
111
vector<vector<Point > > getSegments () CV_OVERRIDE;
112
+ vector<int > getSegmentIndicesOfLines () const CV_OVERRIDE;
112
113
void detectLines (OutputArray lines) CV_OVERRIDE;
113
114
void detectEllipses (OutputArray ellipses) CV_OVERRIDE;
114
115
@@ -120,6 +121,7 @@ class EdgeDrawingImpl : public EdgeDrawing
120
121
int height; // height of source image
121
122
uchar *srcImg;
122
123
vector<vector<Point > > segmentPoints;
124
+ vector<int > segmentIndicesOfLines;
123
125
Mat smoothImage;
124
126
uchar *edgeImg; // pointer to edge image data
125
127
uchar *smoothImg; // pointer to smoothed image data
@@ -440,6 +442,11 @@ std::vector<std::vector<Point> > EdgeDrawingImpl::getSegments()
440
442
return segmentPoints;
441
443
}
442
444
445
+ std::vector<int > EdgeDrawingImpl::getSegmentIndicesOfLines () const
446
+ {
447
+ return segmentIndicesOfLines;
448
+ }
449
+
443
450
void EdgeDrawingImpl::ComputeGradient ()
444
451
{
445
452
for (int j = 0 ; j < width; j++)
@@ -1312,12 +1319,15 @@ void EdgeDrawingImpl::detectLines(OutputArray _lines)
1312
1319
for (int i = 1 ; i <= size - linesNo; i++)
1313
1320
lines.pop_back ();
1314
1321
1322
+ segmentIndicesOfLines.clear ();
1315
1323
for (int i = 0 ; i < linesNo; i++)
1316
1324
{
1317
1325
Vec4f line ((float )lines[i].sx , (float )lines[i].sy , (float )lines[i].ex , (float )lines[i].ey );
1318
1326
linePoints.push_back (line);
1327
+ segmentIndicesOfLines.push_back (lines[i].segmentNo );
1319
1328
}
1320
1329
Mat (linePoints).copyTo (_lines);
1330
+
1321
1331
delete[] x;
1322
1332
delete[] y;
1323
1333
}
0 commit comments