久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

OPENCV:Calibratecamera 2 重投影錯誤和自定義計算的不

OPENCV: Calibratecamera 2 reprojection error and custom computed one not agree(OPENCV:Calibratecamera 2 重投影錯誤和自定義計算的不同意)
本文介紹了OPENCV:Calibratecamera 2 重投影錯誤和自定義計算的不同意的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個 python 腳本,它使用 calibratecamera2 方法從棋盤的幾個視圖中校準相機.成功校準后,我會追蹤所有原始點并繪制一些圖并再次計算重投影誤差.令我驚訝的是,opencv 計算的重投影誤差和我的有點不同.我覺得很奇怪.我是否以錯誤的方式計算它?

I have a python script that uses the calibratecamera2 method to calibrate a camera from a few views of a checker board. After a successful calibration I go after all original points and do some plots and compute again the re-projection error. My surprise is that the reprojection error computed by opencv and mine are a bit different. I found it strange. Am I computing it in a wrong way?

obj_points = []# 3d point in real world space. List of arrays
img_points = []# 2d points in image plane. List of arrays

...

ret, camera_matrix, dist_coeffs, rvecs, tvecs = cv2.calibrateCamera(obj_points, img_points, (w, h), camera_matrix, dist_coeffs, rvecs, tvecs, calib_flags +cv2.CALIB_USE_INTRINSIC_GUESS, criteria)
print "Final reprojection error opencv: ", ret   #Compute mean of reprojection error
tot_mean_error=0
mean_error_image = 0
for i in xrange(len(obj_points)):
    reprojected_points, _ = cv2.projectPoints(obj_points[i], rvecs[i], tvecs[i], camera_matrix, dist_coeffs)
    reprojected_points=reprojected_points.reshape(-1,2)
    mean_error_image=np.sum(np.sum(np.abs(img_points[i]-reprojected_points)**2,axis=-1)**(1./2))/np.alen(reprojected_points)
    tot_mean_error +=mean_error_image

mean_error=tot_mean_error/len(obj_points)
print "Mean reprojection error: ", mean_error

最終重投影錯誤opencv:0.571030279037

Final reprojection error opencv: 0.571030279037

平均重投影誤差:0.438696960449

Mean reprojection error: 0.438696960449

推薦答案

我計算錯誤/不同.我正在使用這種公式:

I was computing it wrong/differently. I was using this kind of formula:

但是opencv用的是這個:

But opencv uses this one:

所以,如果有人感興趣,代碼現在看起來像:

So, if anyone is interested the code looks now like:

#Compute mean of reprojection error
tot_error=0
total_points=0
for i in xrange(len(obj_points)):
    reprojected_points, _ = cv2.projectPoints(obj_points[i], rvecs[i], tvecs[i], camera_matrix, dist_coeffs)
    reprojected_points=reprojected_points.reshape(-1,2)
    tot_error+=np.sum(np.abs(img_points[i]-reprojected_points)**2)
    total_points+=len(obj_points[i])

mean_error=np.sqrt(tot_error/total_points)
print "Mean reprojection error: ", mean_error

最終重投影錯誤opencv:0.571030279037

Final reprojection error opencv: 0.571030279037

平均重投影誤差:0.571030718956

Mean reprojection error:0.571030718956

這篇關于OPENCV:Calibratecamera 2 重投影錯誤和自定義計算的不同意的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How should I verify a log message when testing Python code under nose?(在鼻子下測試 Python 代碼時,我應該如何驗證日志消息?)
Patch __call__ of a function(修補函數的 __call__)
How to call self in a mock method of an object in Python?(如何在 Python 中對象的模擬方法中調用 self?)
Mocking only a single method on an object(僅模擬對象上的單個方法)
Mocking a subprocess call in Python(在 Python 中模擬子進程調用)
Checking call order across multiple mocks(檢查多個模擬的調用順序)
主站蜘蛛池模板: 在线看黄色片 | 国产www在线观看 | 久久久久久亚洲精品 | 国产一区二区三区免费播放 | 不卡av在线播放 | 97精品国产97久久久久久免费 | 综合久久久久 | 久久综合99 | 成人激情在线 | 国产欧美精品 | 亚洲日本视频 | 欧美一区二区三 | www.久久久| 亚洲欧美国产高清va在线播放 | 国产日韩精品一区二区 | 亚洲国产第一页 | 一级片黄色片 | 国产精品tv | 天天综合天天 | 日韩精品视频在线 | 激情五月综合网 | 久久久国产一区二区三区 | 日韩视频免费大全中文字幕 | 欧美成人高清 | 九九久久久 | 国产三级在线免费观看 | 欧美性受xxxx黑人xyx性爽 | www黄色片 | 日日骚av | 狠狠干美女 | 天天撸夜夜操 | 一级片免费播放 | 中日韩毛片 | 午夜视频网站 | 国产精品视频免费 | 成人午夜在线观看 | 亚洲一区二区欧美 | 综合久 | 国产毛片毛片 | 久久免费高清视频 | 亚洲欧美精品一区二区 |