You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am trying to capture with profiler but when doing "stream.pop_buffer ()" Stream says: "GVSTream object is not callable"
Here is the code:
import sys
import gi
import numpy as np
import ctypes
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from PIL import Image as im
import cv2
import time
gi.require_version('Aravis', '0.8')
from gi.repository import Aravis
Aravis.enable_interface ("Fake")
try:
if len(sys.argv) > 1:
camera = Aravis.Camera.new (sys.argv[1])
else:
camera = Aravis.Camera.new ('192.168.100.200')
except TypeError:
print ("No camera found")
exit ()
payload = camera.get_payload ()
[x,y,width,height] = camera.get_region ()
stream = camera.create_stream (None, None)
for i in range(0,1024):
stream.push_buffer (Aravis.Buffer.new_allocate (payload))
for i in range(0,filas):
inicio=time.time()
image = stream.pop_buffer ()
data=image.get_part_data(1)
f=image.get_part_pixel_format(1)
if f==17825795:
#arr2=np.ctypeslib.as_array(ctypes.cast(data, ctypes.POINTER(ctypes.c_int16)),(width,)).copy()
array_intensity[i]=np.ctypeslib.as_array(ctypes.cast(data, ctypes.POINTER(ctypes.c_short)),(width,)).copy()
#min_i=np.amin(array_intensity)
#max_i=np.amax(array_intensity)
Describe the bug
I am trying to capture with profiler but when doing "stream.pop_buffer ()" Stream says: "GVSTream object is not callable"
Here is the code:
import sys
import gi
import numpy as np
import ctypes
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from PIL import Image as im
import cv2
import time
gi.require_version('Aravis', '0.8')
from gi.repository import Aravis
Aravis.enable_interface ("Fake")
try:
if len(sys.argv) > 1:
camera = Aravis.Camera.new (sys.argv[1])
else:
camera = Aravis.Camera.new ('192.168.100.200')
except TypeError:
print ("No camera found")
exit ()
payload = camera.get_payload ()
[x,y,width,height] = camera.get_region ()
stream = camera.create_stream (None, None)
for i in range(0,1024):
stream.push_buffer (Aravis.Buffer.new_allocate (payload))
print ("Start acquisition")
camera.start_acquisition ()
filas=1024
array_intensity= np.empty((filas,2048))
print ("Acquisition")
for i in range(0,filas):
inicio=time.time()
image = stream.pop_buffer ()
data=image.get_part_data(1)
f=image.get_part_pixel_format(1)
if f==17825795:
#arr2=np.ctypeslib.as_array(ctypes.cast(data, ctypes.POINTER(ctypes.c_int16)),(width,)).copy()
array_intensity[i]=np.ctypeslib.as_array(ctypes.cast(data, ctypes.POINTER(ctypes.c_short)),(width,)).copy()
#min_i=np.amin(array_intensity)
#max_i=np.amax(array_intensity)
tiempo=fin-inicio
print('fps:', 1/tiempo)
#array_intensity=np.delete(array_intensity,0,0)
print('array:',array_intensity)
image_2D=im.fromarray(array_intensity)
image_2D.show()
print ("Stop acquisition")
camera.stop_acquisition ()
The text was updated successfully, but these errors were encountered: