python - Imaging Source Gige camera taking lots of memory for processing in Aravis -


imaging source gige camera running continuously in python code. using software triggering. gradually increasing memory possessing , after sometime stuck due low memory.

here python code capture frame.

import cv2 random import sample,randint aravis import camera  cap = camera("camera_1") cap.cam.set_frame_rate(110) cap.cam.set_exposure_time(1000) cap.cam.set_trigger("software") cap.start_acquisition()  def getvideo():     cap.cam.software_trigger()     camphoto = cap.pop()     return camphoto 

how solve ?

the wrapper library seem using, suggest alternative method capture frames (your getvideo takes single frames, not return time-series of images, it's bit of misnomer):

def get_frame(cam):     cam.start_acquisition()     frame = cam.pop_frame()     cam.stop_acquisition()     return frame 

remark starts , stops acquisition each time. inspecting stop_acquisition method, notice redirects call aravis library, memory buffers correctly torn-down.

in current implementation, notice each time call getvideo, memory increases same amount size (in mb) of single image. guess using of more specific methods available cap.cam (an instance of aravis.camera), able set "ring" structure, typical streaming video. however, if want snapshots, use code above.


Comments