非常奇怪,采集速率确实是1s采集一次。但是cv2实时显示就是10s后才显示
# -*- coding: utf-8 -*-
# version:1.0.1905.9051
import cv2, sys
import gxipy as gx
device_manager = gx.DeviceManager()
dev_num, dev_info_list = device_manager.update_device_list()
if dev_num == 0:
sys.exit(1)
str_sn = dev_info_list[0].get("sn")
# 通过序列号打开设备
cam = device_manager.open_device_by_sn(str_sn)
cam.stream_on()
while True:
raw_image = cam.data_stream[0].get_image()
img = raw_image.get_numpy_array()
cv2.imshow("1",img)
c = cv2.waitKey(1000) & 0xff # 这tm是等10s?????
if c==27:
cam.stream_off()
break
cam.close_device()
cv2.destroyAllWindows()
到底是为什么