how can I install opencv to run .exe file in MATLAB by system command?

asked 2017-10-24 06:06:30 -0600

srl37 gravatar image

I have a "DenseTrack.exe" file in matlab which needs opencv. I used "system('DenseTrack.exe' 'input_path.avi' -o 'output_path.bin') " command in matlab to get the input videos and give me the outputs which are '.bin'. to access the opencv, I copied dll files of opencv 2.4.9 to the .exe folder. but, it dos not work and there is no output. I am using R2014b x64 matlab. and , visual studio 2012 is installed on my computer. how can i solve the problem? how can i install opencv?

edit retag flag offensive close merge delete

Comments

maybe system() is called in the wrong folder. if you type system('pwd') the current folder will be displayed. Instead of relative paths try out to call everthing with absolut paths e.g.: system('c:/mydir/DenseTrack.exe' 'c:/mydir/input_path.avi' -o 'c:/mydir/output_path.bin')

VxW gravatar imageVxW ( 2017-10-24 10:30:18 -0600 )edit

I did it, but yet there is same problem, I think the problem is because of opencv and system( .exe) cannot connect to opencv library, but i am not sure about this

srl37 gravatar imagesrl37 ( 2017-10-24 10:41:08 -0600 )edit

are you sure about the opencv version (2.4.9) ?

it must be exactly the same, aour exe was compiled against. check with dependancy walker or similar

berak gravatar imageberak ( 2017-10-24 10:42:38 -0600 )edit
1

yes, version of opencv should be 2.4.9. Actually, i am using a toolbox https://github.com/pengxj/MatAction which opencv 2.4.9 is one of its dependencies, and DenseTrackStab.exe is one part of its code which i have problem in its running

srl37 gravatar imagesrl37 ( 2017-10-24 11:12:37 -0600 )edit

what happens if you run your exe in the Matlab commant prompt like this: !DenseTrack.exe input_path.avi -o output_path.bin is there any output?

VxW gravatar imageVxW ( 2017-10-24 11:14:43 -0600 )edit

k,k. so we can at least rule that one out.

berak gravatar imageberak ( 2017-10-24 11:15:08 -0600 )edit

I tried " !DenseTrack.exe input_path.avi -o output_path.bin", but, still there is no output

srl37 gravatar imagesrl37 ( 2017-10-24 11:37:12 -0600 )edit

wait, "no output" != "crashed on dlls not found"

berak gravatar imageberak ( 2017-10-24 11:39:05 -0600 )edit

what is (wait, "no output" != "crashed on dlls not found")?, what should i do? I cannot understand this, please give me more explanation, thank you very much

srl37 gravatar imagesrl37 ( 2017-10-24 11:44:13 -0600 )edit

it means, you progressed from one problem (find the opencv dlls) to another (no idea)

berak gravatar imageberak ( 2017-10-24 11:52:22 -0600 )edit