mirror of
https://github.com/esimov/pigo.git
synced 2025-10-06 00:26:50 +08:00
Small correction on epuploc examples
This commit is contained in:
@@ -11,7 +11,7 @@ pigo = cdll.LoadLibrary('./puploc.so')
|
||||
os.system('rm puploc.so')
|
||||
|
||||
MAX_NDETS = 2024
|
||||
ARRAY_DIM = 6
|
||||
ARRAY_DIM = 5
|
||||
|
||||
# define class GoPixelSlice to map to:
|
||||
# C type struct { void *data; GoInt len; GoInt cap; }
|
||||
@@ -36,7 +36,7 @@ def process_frame(pixs):
|
||||
|
||||
if data_pointer :
|
||||
buffarr = ((c_longlong * ARRAY_DIM) * MAX_NDETS).from_address(addressof(data_pointer.contents))
|
||||
res = np.ndarray(buffer=buffarr, dtype=c_longlong, shape=(MAX_NDETS, 5,))
|
||||
res = np.ndarray(buffer=buffarr, dtype=c_longlong, shape=(MAX_NDETS, ARRAY_DIM,))
|
||||
|
||||
# The first value of the buffer aray represents the buffer length.
|
||||
dets_len = res[0][0]
|
||||
@@ -44,7 +44,7 @@ def process_frame(pixs):
|
||||
|
||||
# We have to consider the pupil pair added into the list.
|
||||
# That's why we are multiplying the detection length with 3.
|
||||
dets = list(res.reshape(-1, 5))[0:dets_len*3]
|
||||
dets = list(res.reshape(-1, ARRAY_DIM))[0:dets_len*3]
|
||||
return dets
|
||||
|
||||
# initialize the camera
|
||||
|
Reference in New Issue
Block a user