2017-02-19 79 views
0

我從OpenCV下載了性別檢測項目,但我在函數highgui.CV_LOAD_IMAGE_GRAYSCALE中遇到問題。我已經將highgui更改爲imgproc,但現在它顯示CV_LOAD_IMAGE_GRAYSCALE無法解析或不是字段。下面是從性別檢測OpenCV的程序代碼片段:.CV_LOAD_IMAGE_GRAYSCALE無法解析或不是字段

for(int i=0; i<types; i++) 
{ 
    standardImages[i] = new Mat(size, Imgproc.CV_LOAD_IMAGE_GRAYSCALE); 
} 

回答

0

通過

standardImages[i] = new Mat(size, Imgcodecs.CV_LOAD_IMAGE_GRAYSCALE); 
+0

更換

standardImages[i] = new Mat(size, Imgproc.CV_LOAD_IMAGE_GRAYSCALE); 

值得一提的是,這種變化是因爲從OpenCV的2.4過渡的必要3.0引入了[許多更改](http://docs.opencv.org/3.1.0/db/dfa/tutorial_transition_guide.html#gsc.tab=0)。 – beaker