-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
import time
import numpy as np
import matplotlib.pyplot as plt
from pyvcam import pvc
from pyvcam.camera import Camera
from pyvcam import constants
def main():
pvc.init_pvcam()
cam = next(Camera.detect_camera())
cam.open()
cam.reset_rois()
# cam.set_roi(2498, 1450, 60, 60)
NUM_FRAMES = 100
cnt = 0
stack = []
cam.start_seq(exp_time=2, num_frames=NUM_FRAMES)
while cnt < NUM_FRAMES:
frame, fps, frame_count = cam.poll_frame()
stack.append(frame['pixel_data'])
cnt += 1
cam.finish()
cam.close()
pvc.uninit_pvcam()
print('Total frames: {}\n'.format(cnt))
indices = [0, NUM_FRAMES//2, NUM_FRAMES-1]
plt.figure(figsize=(15, 5))
for i, idx in enumerate(indices):
plt.subplot(1, 3, i+1)
plt.imshow(stack[idx], cmap='gray')
plt.title(f"Frame {idx + 1}")
plt.axis('off')
plt.tight_layout()
plt.show()
if name == "main":
main()
The above is the code I run. This is an iris 15 camera. The code will be blocked at frame, fps, frame_count = cam.poll_frame() around 88th frame
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels