Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Raspberry Pi: Camera
(edit)
Revision as of 19:02, 9 April 2015
1,088 bytes added
,
19:02, 9 April 2015
no edit summary
Line 1:
Line 1:
== Camera setup ==
== Camera setup ==
−
[
[https://www.raspberrypi.org/help/camera-module-setup/
|
Setup]
]
+
[https://www.raspberrypi.org/help/camera-module-setup/ Setup]
+
== Bash ==
== Bash ==
{| class="wikitable"
{| class="wikitable"
Line 14:
Line 15:
| raspiyuv || Capturing still photographs and generating raw unprocessed image files
| raspiyuv || Capturing still photographs and generating raw unprocessed image files
|}
|}
+
+
== Python ==
+
First install the python-picamera
+
<nowiki>
+
sudo apt-get update
+
sudo apt-get install python-picamera</nowiki>
+
+
== Usage ==
+
<source lang="python">
+
# Import module
+
import picamera
+
+
# Create an instance
+
camera = picamera.PiCamera()
+
+
# Take a picture
+
camera.capture('image.jpg')
+
+
# Horizontal/Vertical flip
+
camera.hflip = True
+
camera.vflip = True
+
+
# Start/Stop preview
+
camera.start_preview()
+
camera.stop_preview()
+
+
# Camera Settings
+
camera.brightness = 70 #Defoult is 50
+
+
# Other settings default values:
+
camera.sharpness = 0
+
camera.contrast = 0
+
camera.brightness = 50
+
camera.saturation = 0
+
camera.ISO = 0
+
camera.video_stabilization = False
+
camera.exposure_compensation = 0
+
camera.exposure_mode = 'auto'
+
camera.meter_mode = 'average'
+
camera.awb_mode = 'auto'
+
camera.image_effect = 'none'
+
camera.color_effects = None
+
camera.rotation = 0
+
camera.hflip = False
+
camera.vflip = False
+
camera.crop = (0.0, 0.0, 1.0, 1.0)
+
+
+
# Video recording
+
camera.start_recording('video.h264')
+
sleep(5)
+
camera.stop_recording()
+
</source>
+
+
[http://picamera.readthedocs.org/ python-picamera documentation]
Rafahsolis
Bureaucrats
,
Administrators
2,306
edits
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
Variants
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
Special pages
Printable version