Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
picamera [2014/07/22 23:50]
admin
picamera [2016/12/11 14:23] (current)
admin [Funktions for the Camera Preview:]
Line 1: Line 1:
----- +===== PiCamera=====
-**PiCamera**\\ +
-----+
  
 [[http://picamera.readthedocs.org/en/release-1.4/]]\\ [[http://picamera.readthedocs.org/en/release-1.4/]]\\
  
----- +==== Installation ====
-**Install:**\\+
   $ sudo apt-get update   $ sudo apt-get update
   $ sudo apt-get install python-picamera   $ sudo apt-get install python-picamera
  
----- +==== Example ==== 
-**Funktion for Camera Preview:**\\ + 
-  * color_effects    camera.color_effects = (u, v+  >>> import picamera 
-  * contrast +  >>> camera = picamera.PiCamera() 
-  * crop +  >>> camera.start_preview() 
-  * framerate +  >>> camera.stop_preview()
-  * hflip +
-  * image_effect +
-  * preview_alpha +
-  * preview_fullscreen +
-  * preview_window +
-  * rotation +
-  * saturation +
-  * vflip +
-  * led+
  
 ---- ----
-**Example:**\\+====Funktions for the Camera Preview:==== 
 +__brightness__ (0<u<100)\\ 
 +  camera.brightness = u 
 + 
 +__color effects__ (0 < u < 255 and 0 < v < 255)\\ 
 +The default value is //None//\\ 
 +  camera.color_effects = (u, v) 
 +  
 + 
 +__contrast__ (-100 < u < 100) 
 +  camera.contrast = -i 
 + 
 +__crop__ (0.0 - 1.0) 
 +  for i in range(100): 
 +    zoom = i / 100.0 
 +    zoom1 = 1.0 - zoom 
 +    camera.crop = (zoom, zoom, zoom1, zoom1) 
 +     
 +__framerate__ 
 + 
 +__hflip__ (False, True) 
 +  camera.vflip = False 
 + 
 +__image_effect__\\ 
 +Image effect mode options:\\   
 +none, negative, sketch, denoise, emboss, hatch, gpen, pastel, film, blur, saturation, washedout, posterise, cartoon\\  
 +These effects don't work:\\ 
 +solarise, oilpaint, watercolour, colourswap, colourpoint, colourbalance\\ 
 +  camera.image_effect = 'posterise' 
 +   
 +__preview_alpha__ 
 +  camera.preview_alpha = 100 
 +   
 +__preview_fullscreen__ (False, True) 
 +  camera.preview_fullscreen = True 
 +   
 +__preview_window__ (X,Y,width,hight) 
 +  camera.preview_fullscreen = False 
 +  camera.preview_window = (100, 100, 1000, 500) 
 +   
 +__rotation__ (0, 90, 180, 270) 
 +  camera.rotation = 90 
 +   
 +__saturation__ (-100 < u < 100) 
 +  camera.saturation = u 
 + 
 +__sharpness__ (-100 < u < 100) 
 +  camera.sharpness = u 
 +   
 +__vflip__  (False, True) 
 +  camera.vflip = False 
 + 
 +__exposure__ 
 +  cam.exposure_mode = 'off' 
 +   
 +__AWB__ 
 +  cam.awb_mode = 'auto'  
  
-  import time 
-  import picamera 
-  with picamera.PiCamera() as camera: 
-    camera.start_preview() 
-    try: 
-        for j in range(100): 
-            camera.preview_fullscreen = False 
-            camera.preview_window = (100-j, 100-j, 1000, 500) 
-            time.sleep(0.2) 
-    finally: 
-        camera.stop_preview() 
  
 ---- ----