Can a program capture images even if it is not ran manually [closed]
I have a C++ program that is launched at boot as a service. It performs image processing on the output of a USB camera thanks to OpenCV. I would like to save images corresponding to what the camera captures before the image processing. To achieve this, I'm calling imwrite() in my code. Unfortunately I only get the screenshots when the program is ran manually in the terminal: as soon as I enable it as a service running at startup, the images are not generated anymore. Do you know why that occurs and how I could get rid of this problem?
EDIT - Problem solved
That was not a matter of OpenCV at all.
Actually I was specifying a relative path to imwrite() instead of an absolute one. I guess I thought that even though my program ran as a service, the working directory would still be the one where the executable is located. Hence the solution to my problem was to specify an absolute path to imwrite().
OS, opencv version and compiler ?
OS is Ubuntu MATE with kernel 3.10, OpenCV version is 3.1.0, compiler is CMake 3.5.
I don't know linux but cmake is not a compiler
My bad! Compiler is gcc 5.4.0.