Skip to content

Commit

Permalink
Updated OpenCV example to use Python 2.x
Browse files Browse the repository at this point in the history
Because OpenCV isn't packaged for Python 3.x under Raspbian at the time
of writing (!)
  • Loading branch information
waveform80 committed Jan 13, 2017
1 parent dc94cfb commit 445b050
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion docs/examples/opencv_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
camera.resolution = (320, 240)
camera.framerate = 24
time.sleep(2)
image = np.empty((240, 320, 3), dtype=np.uint8)
image = np.empty((240 * 320 * 3,), dtype=np.uint8)
camera.capture(image, 'bgr')
image = image.reshape((240, 320, 3))
8 changes: 4 additions & 4 deletions docs/recipes1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,10 @@ contrast with the :attr:`~PiCamera.annotate_background` attribute):
Controlling the LED
===================

In certain circumstances, you may find the camera module's red LED a hindrance.
For example, in the case of automated close-up wild-life photography, the LED
may scare off animals. It can also cause unwanted reflected red glare with
close-up subjects.
In certain circumstances, you may find the V1 camera module's red LED a
hindrance (the V2 camera module lacks an LED). For example, in the case of
automated close-up wild-life photography, the LED may scare off animals. It can
also cause unwanted reflected red glare with close-up subjects.

One trivial way to deal with this is simply to place some opaque covering on
the LED (e.g. blue-tack or electricians tape). Another method is to use the
Expand Down
2 changes: 1 addition & 1 deletion docs/recipes2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Capturing to an OpenCV object

This is a variation on :ref:`array_capture`. `OpenCV`_ uses numpy arrays as
images and defaults to colors in planar BGR. Hence, the following is all that's
required to capture an OpenCV compatible image (under Python 3.x):
required to capture an OpenCV compatible image:

.. literalinclude:: examples/opencv_capture.py

Expand Down

0 comments on commit 445b050

Please sign in to comment.