Ask Your Question

How to Train a Structured Forest for Edge Detection?

asked 2018-07-23 03:59:16 -0500

ask_opencv gravatar image

I followed this link and able to perform Edge Detection using a pre-trained model.

Now, I would like to train my own model and I found the guideline here. But I do not know how to perform step 3:

3. Add both directory and their subdirectories to Matlab path.

And I wonder if I need to install Matlab to train my own Structured Forest model? Since I am using OpenCV in C++, is it possible to train the model in C++ as well?


edit retag flag offensive close merge delete


In step 8 they state: "Place compiled mex file into root dir and run edgesDemo. You will need to wait a couple of hours after that the new model will appear inside models/forest/."

So reading this tutorial - i would say - no you dont need matlab to get the model- just follow the tutorial steps.

Greetings, Holger

holger gravatar imageholger ( 2018-07-23 04:38:10 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2018-07-23 07:06:54 -0500

@holger that is sadly incorrect. Mex files are a way of running C++ code from Matlab and vice versa. However since they are wrappers you do need Matlab installed on your system or it will not work. Basically the mex acts as an interpreter to the Matlab code and provides it with the correct parameters for you.

edit flag offensive delete link more


About item 3, Matlab uses a path variable. You have to add the content of the toolbox to its path in order to ensure that Matlab actually finds the code.

StevenPuttemans gravatar imageStevenPuttemans ( 2018-07-23 07:09:01 -0500 )edit

Thanks. But can the open source Octave do the same thing as Matlab?

ask_opencv gravatar imageask_opencv ( 2018-07-23 22:06:15 -0500 )edit

No it can not. Many of the dedicated libraries of Matlab are not available in Octave. But for a IT student, it should not be that hard to get your hands on a Matlab copy right?

StevenPuttemans gravatar imageStevenPuttemans ( 2018-07-24 02:09:40 -0500 )edit

Question Tools

1 follower


Asked: 2018-07-23 03:59:16 -0500

Seen: 103 times

Last updated: Jul 23 '18