genicam / harvesters

Image Acquisition Library for GenICam-based Machine Vision System
Apache License 2.0
500 stars 86 forks source link

Buffer size and data type change during Image Acquisition #444

Open savassif opened 4 months ago

savassif commented 4 months ago

Describe the Issue I have been trying to implement a data acquisition pipeline for the SPECIM FX series cameras, using the harvesters API. By utilizing the Matrix Vision GenTL producer, I was able to connect to the camera (FX-17), set parameters like FPS, Exposure, etc and capture one scan.

The expected output for the buffer is 640x224, as the spatial resolution of the camera is 640pixel and the specrtal resolution is 224 bands (which are encoded as columns by the camera). When I try to create a while loop to capture multiple frames, the first 198 frames are captured as expected, and the buffer is of size 640x224 with PixelFormat Mono12Packed. However, after that and for the rest of the loop the buffer size changes to 463x463 and the PixelFormat also changes to Mono8

Sample Code

h = Harvester()
h.add_file(r'C:\Users\savvas\Baluff\bin\x64\mvGenTLProducer.cti')
h.update()

ia = h..create()
ia.start()
for i in range(300):
  with ia.fetch() as buffer:
     print(i, ' : ', buffer)
ia.stop()

Configuration

yaraslau-neolithics commented 3 months ago

Hello, @savassif. What mvGenTLProducer version are using? I had the same problem with 3.0.0 version. Rollbacked to 2.46.2 and it worked. Try it out as well

upd: 2.50.1 version works as well.

eli-osherovich commented 3 months ago

Can this explain the behavior?

jeffwitz commented 3 months ago

Can this explain the behavior?

Yes it is the issue #451 I just raised.

I will try with Stemmer in order to see if it works without licence.