Hallo,
I have test this cod with my acA2040-90uc Basler.
It works well.
what I have done is:
set assert image_format.startswith('Mono'), 'Only mono images allowed at this point' in factory.pyx as comment.
install with python
change the plot method in the Simple usage example
from : import matplotlib.pyplot as plt for image in cam.grab_images(1): plt.imshow(image) plt.show()
to import cv2 while True: for image in cam.grab_images(1): image = cv2.cvtColor(image, cv2.COLOR_BAYER_BG2RGB) cv2.imshow('Image', image) if cv2.waitKey(300) & 0xFF == 27: break
I have only tried it in Ubuntu 14.04. PixelFormat of the camera is BayerBG8 .
I think, if I want to use BayerBG12, I must change the code by the buffer reading:
img_data = np.frombuffer((<char*>img.GetBuffer())[:img.GetImageSize()], dtype='uint'+bits_per_pixel_prop[3:]) in the factory.pyx
Hallo, I have test this cod with my acA2040-90uc Basler.
It works well.
what I have done is:
change the plot method in the Simple usage example from :
import matplotlib.pyplot as plt for image in cam.grab_images(1): plt.imshow(image) plt.show()
to
import cv2 while True: for image in cam.grab_images(1): image = cv2.cvtColor(image, cv2.COLOR_BAYER_BG2RGB) cv2.imshow('Image', image) if cv2.waitKey(300) & 0xFF == 27: break
I have only tried it in Ubuntu 14.04. PixelFormat of the camera is BayerBG8 .
I think, if I want to use BayerBG12, I must change the code by the buffer reading:
img_data = np.frombuffer((<char*>img.GetBuffer())[:img.GetImageSize()], dtype='uint'+bits_per_pixel_prop[3:])
in the factory.pyxBR