-3

How can I change the path and permissions of cvSave in OpenCV?

I am doing a haartraining and after all stages are complete I receive an error:

OpenCV Error: Unspecified error (Could not open the file storage. Check the path and permissions) in cvSave, file /opt/local/var/macports/build/_opt_mports_dports_graphics_opencv/opencv/work/opencv-2.4.9/modules/core/src/persistence.cpp, line 5036

libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /opt/local/var/macports/build/_opt_mports_dports_graphics_opencv/opencv/work/opencv-2.4.9/modules/core/src/persistence.cpp:5036: error: (-2) Could not open the file storage. Check the path and permissions in function cvSave

The issue seems to be with the path and permissions in the function cvSave, but I am unsure how to change these, or what is wrong with them. Any help fixing this is appreciated.

josliber
  • 41,865
  • 12
  • 88
  • 126
  • Without the code showing oow cvSave() was called, it is difficult to guess what might be wrong. All I know is that cvOpenFileStorage() can't open the filename you supplied for writing. That could be because the filename you provided includes a path that does not exist, or the particular folder/directory does not have write permission. What platform is this? – Bull Jul 28 '14 at 15:46

1 Answers1

0

I fixed it by moving all of the intermediate files to a new directory and changed the command to use that directory instead. Seems that it had to do with write permission in that directory.