作者:
laladeer (laladeer)
2016-11-23 15:44:20開發平台(Platform): (Ex: Win10, Linux, ...)
VS2013
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
opencv
問題(Question):
測試opencv affine的程式,中間想取用計算出來的矩陣的數值,但取出後數值不正確
餵入的資料(Input):
[0.5009784735812133, -0.5009784735812133, 256;
0.5009784735812133, 0.5009784735812133, 0]
預期的正確結果(Expected Output):
0.500978
-0.500978
256
0.500978
0.500978
0
錯誤結果(Wrong Output):
9.47757e-038
1.75024
9.47757e-038
-1.75024
0
3.75
程式碼(Code):(請善用置底文網頁, 記得排版)
完整程式碼
http://codepad.org/EwDkpPJ2
問題點:
cout << warpMat << endl;
輸出如上面餵入資料
cout << ((float*)warpMat.data)[0 * warpMat.cols + 0] << endl;
應該是陣列的第一個值
想請問各位大大,warpMat是32位元的資料,為什麼用float取出來的值會不同?
改用double數值卻是正確的,不知道問題出在哪裡
補充說明(Supplement):