我想使用的OpenCV的initUndistortRectifyMap()
函数来创建一个映射undistorts鱼眼图像,如this tutorial什么是OpenCV中的UndistortRectifyMap()m1type参数
教程中介绍了此行的代码:
mapx,mapy = cv2.initUndistortRectifyMap(mtx,dist,None,newcameramtx,(w,h),5)
但是,当我的脚本到达这条线,下面的错误被抛出:
OpenCV的errror:断言失败(m1type == CV_16SC2 || m1type == CV_32FC1 || m1type == CV32FC2)在initUndistortedRectifyMap,文件 /hdd/buildbot/slave_jetson_tx_3/35-04T-L4T-R24/opencv/modules/imgproc/src/undistort.cpp
的错误的来源看来是最后一个参数中的'5',根据documentation,这是'm1type - 第一个输出映射的类型,可以是CV_32FC1或CV_16SC2。“这些不同类型的含义是什么,我怎么知道我的程序的正确价值?
(注:我知道cv2.undistort()函数,但它不为我的目的使用。)