aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormorefigs <morefigs@gmail.com>2019-03-09 11:47:27 +1100
committermorefigs <morefigs@gmail.com>2019-03-09 11:47:27 +1100
commit91d599433c65a4b55864682131337ed29c2b8d9c (patch)
tree8dfab39b0efccbe91e96a85d4843646cdea8bb0e
parent6ee63831f3c0ed991fc9b617c1697ef91bc7100d (diff)
downloadpymba-91d599433c65a4b55864682131337ed29c2b8d9c.tar.gz
pymba-91d599433c65a4b55864682131337ed29c2b8d9c.zip
v0.3.2
-rw-r--r--CHANGELOG.md5
-rw-r--r--examples/camera/display_frame.py12
-rw-r--r--pymba/__init__.py2
3 files changed, 11 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4b9f1e8..f5a7ad5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
# Pymba change log
+## [0.3.2] - 2019/03/09
+### Added
+- Colour camera example.
+- Bug fix when attempting to open a USB camera.
+
## [0.3.1] - 2019/02/21
### Added
- Auto adjust packet size upon opening camera.
diff --git a/examples/camera/display_frame.py b/examples/camera/display_frame.py
index d0849c9..6dc3f84 100644
--- a/examples/camera/display_frame.py
+++ b/examples/camera/display_frame.py
@@ -4,16 +4,16 @@ from pymba import Frame
# todo add more colours
-PIXEL_FORMAT_MAPPING = {
+PIXEL_FORMATS_CONVERSIONS = {
'BayerRG8': cv2.COLOR_BAYER_RG2RGB,
}
def display_frame(frame: Frame, delay: Optional[int] = 1) -> None:
"""
- Processes the acquired frame.
- :param frame: The frame object to process.
- :param delay: Image display delay in milliseconds, use 0 for indefinite.
+ Displays the acquired frame.
+ :param frame: The frame object to display.
+ :param delay: Display delay in milliseconds, use 0 for indefinite.
"""
print(f'frame {frame.data.frameID}')
@@ -22,12 +22,10 @@ def display_frame(frame: Frame, delay: Optional[int] = 1) -> None:
# convert colour space if desired
try:
- image = cv2.cvtColor(image, PIXEL_FORMAT_MAPPING[frame.pixel_format])
+ image = cv2.cvtColor(image, PIXEL_FORMATS_CONVERSIONS[frame.pixel_format])
except KeyError:
pass
# display image
cv2.imshow('Image', image)
-
- # wait for user to close window
cv2.waitKey(delay)
diff --git a/pymba/__init__.py b/pymba/__init__.py
index 3ad7a40..a22cbb2 100644
--- a/pymba/__init__.py
+++ b/pymba/__init__.py
@@ -2,4 +2,4 @@ from .vimba import Vimba, VimbaException
from .frame import Frame
-PYMBA_VERSION = '0.3.1'
+PYMBA_VERSION = '0.3.2'