Python 提高cv2.CalibleCamera的性能
我正在尝试制作一个实时校准工具,从网络摄像头读取实时图像,然后进行校准 我正在实时收集图像点,我并没有像许多人一样发现棋盘角的速度问题 但是,在收集实时数据并存储所有图像点和对象点之后,我调用了cv2.calibleCamera()函数 当我有来自50多幅图像的数据时,这种方法会产生严重的性能问题 我试过:Python 提高cv2.CalibleCamera的性能,python,opencv,image-processing,computer-vision,opencv-python,Python,Opencv,Image Processing,Computer Vision,Opencv Python,我正在尝试制作一个实时校准工具,从网络摄像头读取实时图像,然后进行校准 我正在实时收集图像点,我并没有像许多人一样发现棋盘角的速度问题 但是,在收集实时数据并存储所有图像点和对象点之后,我调用了cv2.calibleCamera()函数 当我有来自50多幅图像的数据时,这种方法会产生严重的性能问题 我试过: # loop: # read image # if pattern found: # calibrate the individual image and s
# loop:
# read image
# if pattern found:
# calibrate the individual image and store results in array
# calculate the average of the array (assuming this is the real result)
但是,从该方法获得的结果与收集所有数据然后调用cv2.calibleCamera()函数的传统方法有很大不同
我也尝试过:
with concurrent.futures.ThreadPoolExecutor() as executor:
future = executor.submit(self.camera.do_calibration())
ret, f_ret, images_used = future.result()
希望它能给我更好的结果,但没有运气
调用cv2.CalibleCamera()的方法:
我不想让我的例行程序给我立即的结果,但我也不想像一个小时等待它来计算结果
是否有其他解决方案可以帮助解决此问题,如充分使用线程或标志?首先,函数是否返回正确的校准结果?@YvesDaoust是的,它返回正确的校准结果。但是有哪些解决方案?@YvesDaoust与我在github上找到的其他项目相比,我的结果是相似的。所有的矩阵、失真和向量看起来都不错。
def do_calibration(self):
self.ret, self.mtx, self.dist, self.rvec, self.tvec = cv2.calibrateCamera(self.obj_points,
self.img_points,
(int(self.width), int(self.height)),
None, None)