Raspistill: Some pictures are black

269 views Asked by At

I have a raspberry pi on which I am executing a python script. This script has a while loop with the following statement in it

os.system('sudo raspistill -o img' + str(counter) +'.jpg')

This loop executes a 100 times and is supposed to take a hundred pictures (the counter number is incremented each time a picture is taken). I have verified that this code is working perfectly and the folder contains 100 pictures.

I added a background thread to execute in parallel. As soon as the main program snaps a picture and puts it in a folder, this thread copies this picture into another directory using the following command

os.system('sudo cp ' + sourceFilePath + ' ' + destinationFilepath)

However, with this copying thread on, some of the pictures seem to be completely black (and the size is really small, around 150kb). Does anyone know what is going on?

NOTE: Due to some reason, I have to use the os.system('sudo raspistill -o ') command. I can not use the picamera library

0

There are 0 answers