看板 C_and_CPP 關於我們 聯絡資訊
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) VC+++ 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) Opencv 問題(Question): 在讀取.avi影片時,圖片的像素值出現負數 餵入的資料(Input): 影片 預期的正確結果(Expected Output): RGB都大於0 錯誤結果(Wrong Output): 出現負值 程式碼(Code):(請善用置底文網頁, 記得排版) if(cvGrabFrame(capture)) { frame=cvRetrieveFrame(capture); for(int u=0;u<frame->imageSize;u++){ if(frame->imageData[u] < 0){ printf("error~~~~\n"); break; } } } 補充說明(Supplement): -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 175.98.120.30
deo2000:光用這樣來論斷frame->imageData[u]的大小風險很大 04/10 13:06
deo2000:還得看frame是什麼型別? 就算Mat也有很多種 04/10 13:10
dmlan1842:這個問題我也有 = = 你強制轉成double試試看 04/10 14:11
N91:沒記錯 型態要設定為正的 CV 裡面好像是-128~+127 04/10 15:24
hardman1110:我解決了 我是強制把他指標形態轉成(*unsigned char) 04/10 16:39
hardman1110:謝謝大家 04/10 16:39