morefigs / pymba

Python wrapper for Allied Vision's Vimba C API
MIT License
105 stars 84 forks source link

Feature range is to broad #113

Open adam-urbanczyk opened 5 years ago

adam-urbanczyk commented 5 years ago

I'm using the following camera: Mako G-503C and when I query the camera object for possible PixelFormat values I get:

In[6]:
f = cam.feature('PixelFormat')
f.range

Out[7]: 
['Mono8',
 'Mono10',
 'Mono12',
 'Mono12Packed',
 'Mono14',
 'BayerGR8',
 'BayerRG8',
 'BayerGB8',
 'BayerBG8',
 'BayerBG10',
 'BayerGR12',
 'BayerRG12',
 'BayerGB12',
 'BayerGR12Packed',
 'BayerRG12Packed',
 'BayerGB12Packed',
 'RGB8Packed',
 'BGR8Packed',
 'RGBA8Packed',
 'BGRA8Packed',
 'RGB10Packed',
 'RGB12Packed',
 'YUV411Packed',
 'YUV422Packed',
 'YUV444Packed']

It is however not possible to set all of those values, only some of them work:

['Mono8',
 'BayerGR8',
 'BayerGR12',
 'BayerGR12Packed',
 'RGB8Packed',
 'YUV411Packed',
 'YUV422Packed',
 'YUV444Packed']

Any clue what might go wrong?

adam-urbanczyk commented 5 years ago

I see this in the code: https://github.com/morefigs/pymba/blob/72d800f992c251d5334ee44fe30f0367ed397f4d/pymba/vimba_c.py#L328 Porbably this is the answer - one should call VmbFeatureEnumIsAvailable() on the whole range to filter it, do I get it correctly?