1. 程式人生 > >未定義識別符號threshval

未定義識別符號threshval

下面這段程式碼報未定義識別符號threshval的錯誤

Mat bw = (threshval<128) ? (img<threshval) : (img>threshval);

解決辦法:不是標頭檔案的問題,在這段程式碼前面加上threshval的定義

int threshval = 160;
Mat bw = (threshval<128) ? (img<threshval) : (img>threshval);

這樣問題就得以解決了,哎……犯了個低階錯誤