
C H A P T E R 1 5
T H E R A S P B E R R Y P I C A M E R A M O D U L E
241
TIP
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.
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
Summary of Contents for A
Page 1: ......
Page 2: ......
Page 3: ...Raspberry Pi User Guide 2nd Edition...
Page 4: ......
Page 5: ...Raspberry Pi User Guide 2nd Edition Eben Upton and Gareth Halfacree...
Page 10: ......
Page 26: ...R A S P B E R R Y P I U S E R G U I D E S E C O N D E D I T I O N 10...
Page 28: ......
Page 29: ...Chapter 1 Meet the Raspberry Pi...
Page 37: ...Chapter 2 Getting Started with the Raspberry Pi...
Page 56: ......
Page 57: ...Chapter 3 Linux System Administration...
Page 79: ...Chapter 4 Troubleshooting...
Page 89: ...Chapter 5 Network Configuration...
Page 109: ...Chapter 6 The Raspberry Pi Software Configuration Tool...
Page 122: ......
Page 123: ...Chapter 7 Advanced Raspberry Pi Configuration...
Page 140: ......
Page 141: ...Chapter 8 The Pi as a Home Theatre PC...
Page 151: ...Chapter 9 The Pi as a Productivity Machine...
Page 160: ......
Page 161: ...Chapter 10 The Pi as a Web Server...
Page 172: ......
Page 173: ...Chapter 11 An Introduction to Scratch...
Page 189: ...Chapter 12 An Introduction to Python...
Page 216: ......
Page 218: ......
Page 219: ...Chapter 13 Learning to Hack Hardware...
Page 234: ......
Page 235: ...Chapter 14 The GPIO Port...
Page 249: ...Chapter 15 The Raspberry Pi Camera Module...
Page 265: ...Chapter 16 Add on Boards...
Page 280: ......
Page 281: ...Appendix A Python Recipes...
Page 287: ...Appendix B Raspberry Pi Camera Module Quick Reference...
Page 293: ...Appendix C HDMI Display Modes...