Skip to content

Test on the color image #41

@felixi1986

Description

@felixi1986

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions