1 | initial version |
The reason that the model from Pdollar github doesn't work is the sharpen parameter. You can try either setting the sharpen parameter to 0 and then retrain a new model based on BSDS or whatever data set you like or you can try correct the following lines in OPENCV structured_edge_detection.cpp source file:
int start = __rf.edgeBoundaries[currentNode * (__rf.edgeBoundaries.size() - 1) / (nTreesNodes * nTrees)]; int finish = __rf.edgeBoundaries[currentNode * (__rf.edgeBoundaries.size() - 1) / (nTreesNodes * nTrees) + 1];
(or you better keep the the multiple factor at a side variable such as: const int nBnds = (__rf.edgeBoundaries.size() - 1) / (nTreesNodes * nTrees)
Cheers, Ohad