暖茶网
WarmTea.com
当前位置: 主页 > 免费发布 >

OpenCV python 相片修正 一起帮忙解决难题,拯救 IT 人的一天

好评:7257 次

https://github.com/linghugoogle/CarND-Advanced-Lane-Lines
小兄弟於本网站地址中学习培训行车道识别
但是在一开始的照相机校准中没法一切正常运行
参照很多文章内容後依然没法处理
劳烦高手指导

import cv2 import numpy as np img=cv2.imread('C:/Users/humaolin/PycharmProjects/pythonProject/camera_cal/calibration1.jpg') gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) objpoints=[] imgpoints=[] img_size=gray.shape[1::-1] ret, corners = cv2.findChessboardCorners(gray, (9,6),None) ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objpoints, imgpoints, img_size,None,None) undistort_img = cv2.undistort(img, mtx, dist, None, mtx) cv2.imshow('gq',undistort_img) cv2.waitKey()``` 之上就是我的程式码 下边为出错信息 C:\Users\humaolin\PycharmProjects\pythonProject\venv\Scripts\python.exe C:/Users/humaolin/PycharmProjects/pythonProject/123.py Traceback (most recent call last): File "C:/Users/humaolin/PycharmProjects/pythonProject/123.py", line 12, in <module> ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objpoints, imgpoints, img_size,None,None) cv2.error: OpenCV(4.5.2) C:\Users\runneradmin\appData\Local\Temp\pip-req-build-_8k9tw8n\opencv\modules\calib3d\src\calibration.cpp:3694: error: (-215:Assertion failed) nimages > 0 in function 'cv::calibrateCameraRO' Process finished with exit code 1
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
表情:
用户名: 验证码:点击我更换图片
最新评论
推荐内容