Hardware Reference
In-Depth Information
Sometimes the position of the Camera Module's cable makes it difficult to place the camera
the right way up. If your preview appears upside-down, use the -vf (vertical flip) option to
correct the image. Just add the option to the command line along with any other options you
are using.
TIP
When the preview has finished, the -o (output) option will save a JPEG file with the name test-
capture.jpg . When using the -o option, you can change the type of file saved with -e.
Currently supported file types include bitmap (BMP) , Portable Network Graphics (PNG) and Graphic
Interchange Format (GIF) images. To save a PNG, for example, use the following command:
raspistill -o testcapture.png -e png
Altering png to read bmp , gif or jpg allows access to the other supported formats. If you
forget the -e option, a file will still be saved but regardless of its extension the content will
be JPEG data.
Another pair of commonly used options adjusts the width and height of the captured image.
This is good for capturing low-resolution stills as part of a computer vision project, or simply
to save space.
The width of the captured image is adjusted with the -w option, while the height is adjusted
with -h . These options are most commonly used together, to set the overall resolution of the
image. To capture an image of 1,920 pixels wide by 1,080 pixels high—the same resolution
as a Full HD high-definition TV or Blu-ray film—type the following command:
raspistill -w 1920 -h 1080 -o fullhdcapture.jpg
The final basic option to know is -t , which controls the preview time-out. By default,
raspistill shows a five-second live preview before capturing an image; the -t option
overrides this default. The required delay should be specified in milliseconds. To capture an
image after a 10-second delay, use the following command:
raspistill -t 10000 -o tensecondcapture.jpg
To disable the delay and capture immediately—a useful trick if you're running the software
from a shell script , as demonstrated later in this chapter—use a value of 0 as in the following
command:
raspistill -t 0 -o instantcapture.jpg
 
Search WWH ::




Custom Search