I use the following code to capture an image from PiCamera:
from picamera import PiCamera
from time import sleep
camera = PiCamera()
camera.start_preview()
sleep(5)
camera.capture('/home/pi/Desktop/image.jpg')
camera.stop_preview()
When I run the code, an image file is created on desktop but its size is 0KB. What am I doing wrong?
raspistill
command?