Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on the color image #41

Open
felixi1986 opened this issue Jan 26, 2018 · 0 comments
Open

Test on the color image #41

felixi1986 opened this issue Jan 26, 2018 · 0 comments

Comments

@felixi1986
Copy link

felixi1986 commented Jan 26, 2018

Hallo,
I have test this cod with my acA2040-90uc Basler.

It works well.

what I have done is:

  1. set assert image_format.startswith('Mono'), 'Only mono images allowed at this point' in factory.pyx as comment.
  2. install with python
  3. 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

BR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant