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?