Ask Your Question

Trained model for OpenCV structured edge detection

asked 2015-10-12 15:48:25 -0500


Does anyone have a working trained model for this OpenCV implementation? I used the provided script to convert the model downloaded from, but it seems that it does not work.


edit retag flag offensive close merge delete


berak gravatar imageberak ( 2015-10-13 00:14:24 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2016-06-09 00:04:21 -0500

OhadV gravatar image

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

edit flag offensive delete link more

answered 2015-10-13 06:16:22 -0500

Thanks, this one works great. I guess the reason why the model from does not work is: they have updated their code according to the newer paper "Fast Edge Detection Using Structured Forests".

edit flag offensive delete link more
Login/Signup to Answer

Question Tools



Asked: 2015-10-12 15:48:25 -0500

Seen: 410 times

Last updated: Oct 12 '15