Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Assuming that you have OpenCV installed from Pre-built Libraries as explained here: installation and OpenCV enviroment variable set as explained here: setting path you have to add additional path entry to your PATH variable: %OPENCV_DIR%\lib

If you use cmake for creating Qt projects, your CMakeLists.txt file should contain following entries:

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") find_package(OpenCV REQUIRED) include_directories(${OpenCV_INCLUDE_DIRS}) target_link_libraries(YourProjectName ${OpenCV_LIBRARIES})

Assuming that you have OpenCV installed from Pre-built Libraries as explained here: installation and OpenCV enviroment variable set as explained here: setting path you have to add additional path entry to your PATH variable: %OPENCV_DIR%\lib

If you use cmake for creating Qt projects, your CMakeLists.txt file should contain following entries:

entries:

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") find_package(OpenCV REQUIRED) include_directories(${OpenCV_INCLUDE_DIRS}) target_link_libraries(YourProjectName target_link_libraries(YourProjectName ${OpenCV_LIBRARIES})

Assuming that you have OpenCV installed from Pre-built Libraries as explained here: installation and OpenCV enviroment variable set as explained here: setting path you have to add additional path entry to your PATH variable: variable: %OPENCV_DIR%\lib

If you use cmake for creating Qt projects, your project folder should contain file FindOpenCV.cmake in cmake\Modules subfolder from here and your CMakeLists.txt file should contain following entries: set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") find_package(OpenCV REQUIRED) include_directories(${OpenCV_INCLUDE_DIRS}) target_link_libraries(YourProjectName ${OpenCV_LIBRARIES})

Assuming that you have OpenCV installed from Pre-built Libraries as (as explained here: installationhere ) and OpenCV enviroment variable set as (as explained here: setting pathhere ) you have to add additional path entry to your PATH variable: %OPENCV_DIR%\lib

If you use cmake for creating Qt projects, your project folder should contain file FindOpenCV.cmake in cmake\Modules subfolder from (which you can find here ) and your CMakeLists.txt file should contain following entries: set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") find_package(OpenCV REQUIRED) include_directories(${OpenCV_INCLUDE_DIRS}) target_link_libraries(YourProjectName ${OpenCV_LIBRARIES})

Assuming that you have OpenCV installed from Pre-built Libraries (as explained here) and OpenCV enviroment variable set (as explained here) you have to add additional path entry to your PATH variable: %OPENCV_DIR%\libvariable:

%OPENCV_DIR%\lib

If you use cmake for creating Qt projects, your project folder should contain file FindOpenCV.cmake in cmake\Modules subfolder (which you can find here) and your CMakeLists.txt file should contain following entries: entries:

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
 find_package(OpenCV REQUIRED)
 include_directories(${OpenCV_INCLUDE_DIRS})
 target_link_libraries(YourProjectName ${OpenCV_LIBRARIES})

${OpenCV_LIBRARIES})
click to hide/show revision 6
Patch for bug in OpenCVConfig.cmake

Assuming that you have OpenCV installed from Pre-built Libraries (as explained here) and OpenCV enviroment variable set (as explained here) you have to add additional path entry to your PATH variable:

%OPENCV_DIR%\lib

If you use cmake for creating Qt projects, your project folder should contain file FindOpenCV.cmake in cmake\Modules subfolder (which you can find here) and your CMakeLists.txt file should contain following entries:

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(YourProjectName ${OpenCV_LIBRARIES})

Moreover there is bug in OpenCV-2.4.5.exe binary in file OpenCVConfig.cmake in opencv\build\x86\mingw\lib directory. I don't know if it is fixed in current gti version of openCV. To manually fix it You have to replace line:

set(OpenCV_INCLUDE_DIRS "${OpenCV_CONFIG_PATH}/include" "${OpenCV_CONFIG_PATH}/include/opencv")

with

set(OpenCV_INCLUDE_DIRS "${OpenCV_CONFIG_PATH}/../../../include" "${OpenCV_CONFIG_PATH}/../../../include/opencv")

And you have to find line beginning with:

if(NOT WIN32 OR OpenCV_ANDROID_NATIVE_API_LEVEL GREATER 0)

and before closing endif() you have to add following lines:

elseif(WIN32)
set(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../..")

Assuming that you have OpenCV installed from Pre-built Libraries (as explained here) and OpenCV enviroment variable set (as explained here) you have to add additional path entry to your PATH variable:

%OPENCV_DIR%\lib

If you use cmake for creating Qt projects, your project folder should contain file FindOpenCV.cmake in cmake\Modules subfolder (which you can find here) and your CMakeLists.txt file should contain following entries:

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(YourProjectName ${OpenCV_LIBRARIES})

Moreover there is bug in OpenCV-2.4.5.exe binary in file OpenCVConfig.cmake in opencv\build\x86\mingw\lib directory. I don't know if it is fixed in current gti git version of openCV. OpenCV. To manually fix it You have to replace line:

set(OpenCV_INCLUDE_DIRS "${OpenCV_CONFIG_PATH}/include" "${OpenCV_CONFIG_PATH}/include/opencv")

with

set(OpenCV_INCLUDE_DIRS "${OpenCV_CONFIG_PATH}/../../../include" "${OpenCV_CONFIG_PATH}/../../../include/opencv")

And you have to find line beginning with:

if(NOT WIN32 OR OpenCV_ANDROID_NATIVE_API_LEVEL GREATER 0)

and before closing endif() you have to add following lines:

elseif(WIN32)
elseif(WIN32 GREATER 0)
set(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../..")
click to hide/show revision 8
Script was correct. Patch instructions removed.

Assuming that you have OpenCV installed from Pre-built Libraries (as explained here) and OpenCV enviroment variable set (as explained here) you have to change OPENCV_DIR value to path to "build" subdirectory of directory where opencv was extracted i.e. :

C:\opencv\build

And add additional path entry to your PATH variable:

%OPENCV_DIR%\lib
%OPENCV_DIR%

If you use cmake for creating Qt projects, your project folder should contain file FindOpenCV.cmake in cmake\Modules subfolder (which you can find here) and your CMakeLists.txt file should contain following entries:

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(YourProjectName ${OpenCV_LIBRARIES})

Moreover there is bug in OpenCV-2.4.5.exe binary in file OpenCVConfig.cmake in opencv\build\x86\mingw\lib directory. I don't know if it is fixed in current git version of OpenCV. To manually fix it You have to replace line:

set(OpenCV_INCLUDE_DIRS "${OpenCV_CONFIG_PATH}/include" "${OpenCV_CONFIG_PATH}/include/opencv")

with

set(OpenCV_INCLUDE_DIRS "${OpenCV_CONFIG_PATH}/../../../include" "${OpenCV_CONFIG_PATH}/../../../include/opencv")

And you have to find line beginning with:

if(NOT WIN32 OR OpenCV_ANDROID_NATIVE_API_LEVEL GREATER 0)

and before closing endif() you have to add following lines:

elseif(WIN32 GREATER 0)
set(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../..")
click to hide/show revision 9
Added instruction to remove no longer valid entry in PATH

Assuming that you have OpenCV installed from Pre-built Libraries (as explained here) and OpenCV enviroment variable set (as explained here) you have to change OPENCV_DIR value to path to "build" subdirectory of directory where opencv was extracted i.e. :

C:\opencv\build

And add to your Remove from PATH variable:variable (because it is not longer valid):

%OPENCV_DIR%
%OPENCV_DIR%\bin

and add:

%OPENCV_DIR%;%OPENCV_DIR%/x86/mingw/bin

If you use cmake for creating Qt projects, your project folder should contain file FindOpenCV.cmake in cmake\Modules subfolder (which you can find here) and your CMakeLists.txt file should contain following entries:

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(YourProjectName ${OpenCV_LIBRARIES})

Assuming that you have OpenCV installed from Pre-built Libraries (as explained here) and OpenCV enviroment variable set (as explained here) you have to change OPENCV_DIR value to path to "build" subdirectory of directory where opencv was extracted i.e. :

C:\opencv\build

Remove from PATH variable entry (because it is not longer valid):

%OPENCV_DIR%\bin

and add:

%OPENCV_DIR%;%OPENCV_DIR%/x86/mingw/bin

If you use cmake for creating Qt projects, your project folder should contain file FindOpenCV.cmake in cmake\Modules subfolder (which you can find here) and your CMakeLists.txt file should contain following entries:

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(YourProjectName ${OpenCV_LIBRARIES})
click to hide/show revision 11
Removing unnecessary script entries

Assuming that you have OpenCV installed from Pre-built Libraries (as explained here) and OpenCV enviroment variable set (as explained here) you have to change OPENCV_DIR value to path to "build" subdirectory of directory where opencv was extracted i.e. :

C:\opencv\build

Remove from PATH entry (because it is not longer valid):

%OPENCV_DIR%\bin

and add:

%OPENCV_DIR%;%OPENCV_DIR%/x86/mingw/bin

If you use cmake for creating Qt projects, your project folder should contain file FindOpenCV.cmake in cmake\Modules subfolder (which you can find here) and your CMakeLists.txt file which should contain following entries:

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(YourProjectName ${OpenCV_LIBRARIES})