From cb05c25e830d7798384706e82d8cb5aec06ea172 Mon Sep 17 00:00:00 2001 From: yarglawaldeg Date: Thu, 15 Mar 2018 13:32:24 +0100 Subject: [PATCH 1/3] update structured_edge_detection update structured_edge_detection to read models from updated p. dollar toolbox --- modules/ximgproc/src/structured_edge_detection.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/ximgproc/src/structured_edge_detection.cpp b/modules/ximgproc/src/structured_edge_detection.cpp index f8d3cd6b882..6c893467025 100644 --- a/modules/ximgproc/src/structured_edge_detection.cpp +++ b/modules/ximgproc/src/structured_edge_detection.cpp @@ -801,9 +801,11 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection {// for j,k in [0;width)x[0;nTreesEval) int currentNode = pIndex[j*nTreesEval + k]; + + const int nBnds = (__rf.edgeBoundaries.size() - 1) / (nTreesNodes * nTrees); - int start = __rf.edgeBoundaries[currentNode]; - int finish = __rf.edgeBoundaries[currentNode + 1]; + int start = __rf.edgeBoundaries[currentNode * nBnds]; + int finish = __rf.edgeBoundaries[currentNode * nBnds + 1]; if (start == finish) continue; From e7effe2917a0f67831b7171ba267eb45df290d27 Mon Sep 17 00:00:00 2001 From: yarglawaldeg Date: Tue, 20 Mar 2018 15:21:08 +0100 Subject: [PATCH 2/3] Update structured_edge_detection.cpp --- modules/ximgproc/src/structured_edge_detection.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/ximgproc/src/structured_edge_detection.cpp b/modules/ximgproc/src/structured_edge_detection.cpp index 6c893467025..ca10842981b 100644 --- a/modules/ximgproc/src/structured_edge_detection.cpp +++ b/modules/ximgproc/src/structured_edge_detection.cpp @@ -801,9 +801,7 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection {// for j,k in [0;width)x[0;nTreesEval) int currentNode = pIndex[j*nTreesEval + k]; - const int nBnds = (__rf.edgeBoundaries.size() - 1) / (nTreesNodes * nTrees); - int start = __rf.edgeBoundaries[currentNode * nBnds]; int finish = __rf.edgeBoundaries[currentNode * nBnds + 1]; From 7d55187d71c3581d02a007ab4f8221f67d1980bc Mon Sep 17 00:00:00 2001 From: yarglawaldeg Date: Tue, 20 Mar 2018 15:52:03 +0100 Subject: [PATCH 3/3] Update structured_edge_detection.cpp casting size_t to int --- modules/ximgproc/src/structured_edge_detection.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ximgproc/src/structured_edge_detection.cpp b/modules/ximgproc/src/structured_edge_detection.cpp index ca10842981b..7d07e67117f 100644 --- a/modules/ximgproc/src/structured_edge_detection.cpp +++ b/modules/ximgproc/src/structured_edge_detection.cpp @@ -801,7 +801,9 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection {// for j,k in [0;width)x[0;nTreesEval) int currentNode = pIndex[j*nTreesEval + k]; - const int nBnds = (__rf.edgeBoundaries.size() - 1) / (nTreesNodes * nTrees); + size_t sizeBoundaries = __rf.edgeBoundaries.size(); + int convertedBoundaries = static_cast(sizeBoundaries); + int nBnds = (convertedBoundaries - 1) / (nTreesNodes * nTrees); int start = __rf.edgeBoundaries[currentNode * nBnds]; int finish = __rf.edgeBoundaries[currentNode * nBnds + 1];