Skip to content

The codes are blocked when set a big frame number #55

@zhouht2000

Description

@zhouht2000

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions