Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14040

Harvesters (genicam) trigger issue at high line rate | Camera: Teledyne dalsa

$
0
0

I use a Teledyne Dalsa line scan camera. Sometimes when I increase the line rate of my Teledyne Dalsa line scan camera to 13000 or higher and trigger it with an Arduino at 3V3, the images are not consistently captured from the buffer for every trigger, unlike when the line rate is 10000 or lower.The trigger seems to be perfectly working in Sapera Software for increased line rate.

Attaching the code:

import platformimport osimport sysimport timefrom harvesters.core import Harvesterimport cv2import numpy as nph = Harvester()gentl_file = r"C:\Program Files\MATRIX VISION\mvIMPACT Acquire\bin\x64\mvGenTLProducer.cti"h.add_file(gentl_file)h.update()ia = h.create(0)ia.remote_device.node_map.Width.value = 2048ia.remote_device.node_map.Height.value = 2000ia.remote_device.node_map.PixelFormat.value = 'RGB8'ia.remote_device.node_map.AcquisitionLineRate.set_value(15000)ia.remote_device.node_map.ExposureTime.set_value(47)ia.remote_device.node_map.Gain.set_value(6)ia.remote_device.node_map.TriggerSelector.value = "FrameBurstStart"ia.remote_device.node_map.TriggerMode.value = "On"ia.remote_device.node_map.triggerFrameCount.set_value(1) # newia.remote_device.node_map.TriggerSource.value = "Line2"ia.remote_device.node_map.TriggerActivation.value = "RisingEdge"ia.remote_device.node_map.TriggerDelay.set_value(0.0) # newia.remote_device.node_map.triggerDelaySource.value = "lineTriggerSignal" # newia.remote_device.node_map.LineSelector.value = "Line2"ia.remote_device.node_map.LineFormat.value = "SingleEnded"ia.remote_device.node_map.lineDetectionLevel.value = "Threshold_for_3V3"ia.remote_device.node_map.LineInverter.value = False ia.remote_device.node_map.lineDebouncingPeriod.value = 0ia.remote_device.node_map.lineElectricalTermination.value = "Disabled"ia.start()start = time.time()ia.start()def image_capture():    global ia    print('Image capture started')    lst_app = []    with ia.fetch() as buffer:        component = buffer.payload.components[0]        _2d_new = component.data.reshape(component.height,component.width,int(component.num_components_per_pixel))        _2d_new = cv2.cvtColor(_2d_new , cv2.COLOR_RGB2BGR)        lst_app.append(_2d_new)    if len(lst_app) == 1:        print('Buffer is full')        arr = np.vstack(lst_app)        lst_app = []        return np.array(arr)count = 0while True:    image = image_capture()    print('captured', count)    count += 1

Thanks in Advance

Even after including all the parameters from the Sapera software, the image still doesn't get returned for certain triggers.


Viewing all articles
Browse latest Browse all 14040

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>