編譯opencv2.4.11時出現錯誤:error: ‘NppiGraphcutState’ has not been declared

安裝cuda以後再安裝opencv時出現錯誤:
 /data/opencv-2.4.11/modules/gpu/src/graphcuts.cpp:120:54: error: ‘NppiGraphcutState’ has not been declared  
      typedef NppStatus (*init_func_t)(NppiSize oSize, NppiGraphcutState** ppStat ^ /data/opencv-2.4.11/modules/gpu/src/graphcuts.cpp:135:18: error: ‘NppiGraphcutState’ does not name a type operator NppiGraphcutState*() ^ /data/opencv-2.4.11/modules/gpu/src/graphcuts.cpp:141:9: error: ‘NppiGraphcutState’ does not name a type NppiGraphcutState* pState; 


cuda8.0較新,opencv-2.4.11較早,要編譯經過須要修改源碼:spa


修改/data/opencv-2.4.11/modules/gpu/src/graphcuts.cpp源碼

將  it

#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)   編譯

改成  opencv

#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) || (CUDART_VERSION >= 8000) class

從新編譯便可。module

相關文章
相關標籤/搜索