Ask Your Question

luisruiz's profile - activity

2018-04-06 01:47:07 -0600 commented answer GPU API Call error, invalid configuration argument when using CUDA

I am compiling 3.4.1. Yes I already check transform.hpp and it seems that I have to configure something.

2018-04-06 01:45:12 -0600 edited question GPU API Call error, invalid configuration argument when using CUDA

GPU API Call error, invalid configuration argument when using CUDA I compiled OpenCV3 in Windows 10 with CUDA, the compi

2018-04-05 01:22:09 -0600 edited question GPU API Call error, invalid configuration argument when using CUDA

GPU API Call error, invalid configuration argument when using CUDA I compiled OpenCV3 in Windows 10 with CUDA, the compi

2018-04-05 00:09:06 -0600 commented question BIG gpu matrix division

Same problem here. How can you modify the Policy? I have not found a solution.

2018-04-02 20:12:14 -0600 asked a question GPU API Call error, invalid configuration argument when using CUDA

GPU API Call error, invalid configuration argument when using CUDA I compiled OpenCV3 in Windows 10 with CUDA, the compi

2018-02-08 08:45:07 -0600 received badge  Famous Question (source)
2017-06-13 01:56:42 -0600 received badge  Notable Question (source)
2017-01-09 03:52:59 -0600 received badge  Popular Question (source)
2016-09-05 17:39:18 -0600 received badge  Student (source)
2016-03-23 00:20:00 -0600 asked a question Update 2.4.11 to 2.4.12 error with gpu

I updated OpenCV, from 2.4.11 to 2.4.12. I am not using gpu. I am using the following instruction to build OpenCV:

sudo cmake -D WITH_GSTREAMER=ON -D BUILD_EXAMPLES=ON -D WITH_TBB=ON -D WITH_EIGEN=ON -D CMAKE_BUILD_TYPE=RELEASE -D WITH_OPENCL=OFF -D WITH_CUDA=OFF -D BUILD_opencv_gpu=OFF -D BUILD_opencv_gpuarithm=OFF -D BUILD_opencv_gpubgsegm=OFF -D BUILD_opencv_gpucodec=OFF -D BUILD_opencv_gpufeatures2d=OFF -D BUILD_opencv_gpufilters=OFF -D BUILD_opencv_gpuimgproc=OFF -D BUILD_opencv_gpulegacy=OFF -D BUILD_opencv_gpuoptflow=OFF -D BUILD_opencv_gpustereo=OFF -D BUILD_opencv_gpuwarping=OFF -D WITH_V4L=ON -D WITH_FFMPEG=ON ..

After the update, when I try to compile a program using cmake with OpenCV 2.4.12 I get this error:

CMake Error at /usr/share/cmake-2.8/Modules/FindOpenCV.cmake:299 (message):
  The following required OpenCV components were not found: gpu

If I go back to 2.4.11 using the same cmake instruction the program compiles without errors.

Is a new function related to gpu in 2.4.12? Do I have to set another flag to get rid of it?

2016-03-14 12:17:44 -0600 received badge  Famous Question (source)
2015-08-20 02:57:44 -0600 received badge  Scholar (source)
2015-08-20 02:57:40 -0600 received badge  Supporter (source)
2015-08-20 02:54:28 -0600 received badge  Enthusiast
2015-08-19 01:51:26 -0600 commented answer Can OpenCV2 and OpenCV3 be installed togheter?

Thanks!! I am on the part about setting the environment variables. I got the two installations (opencv 2 and 3) working but I was wondering if there is a way to set the environment variables automatically. Right now I change them in the .bashrc file depending on which version I will be using.

2015-08-18 22:31:05 -0600 asked a question Can OpenCV2 and OpenCV3 be installed togheter?

I have OpenCV 2.4.11 and now I am porting some of my codes to OpenCV3, in the meanwhile I still have to do work on 2.4.11. So I have been installing and uninstalling, going back and forth between 2.4.11 and 3. Is there a way to have both installed and select which one to use? e.g. at compilation time?, that will help me a lot. What has to be done? How to select them?

2015-08-02 02:55:22 -0600 commented question relations of fundamental matrices, projection matrices & reprojections from multiple views

I am having a similar issue but with a different code. My approach is similar:

  1. Get 5 random matched points
  2. Calculate the essential matrix, I am using RANSAC
  3. Get R and t, four possible solutions
  4. Triangulate and get 3D points
  5. Select the right R and t

From what I understand R should be very close to the real one and t is good up to a scale. So in this point an optimization algorithm like bundle adjustment has to be used. The reprojection error has to be minimized. sum( d( x, PX )^2 + d( x', P'X )^2 ). Here is where I am stuck. I do not understand how to apply this efficiently since I do not see any improvement. Is it there any examples of how to do this?

2015-07-14 18:51:26 -0600 received badge  Notable Question (source)
2015-06-22 23:43:21 -0600 commented question Change number format in output yaml files

I have a large matrix. I am writting data to the yaml file on each iteration. I want to know if the number format can be changed so the matrix can be represented in a more "user friendly" way and to reduce the file size.

2015-06-22 23:33:13 -0600 asked a question Change number format in output yaml files

I am writting data to a yaml file, but I noticed that when I write a matrix of floats, (or doubles) if some value is e.g. 0.01, it writes 1.0000000000000000e-02. Is there a way to set the output format to 0.01 or to shorten the output number?

2015-02-26 03:02:35 -0600 received badge  Popular Question (source)
2014-07-30 01:32:44 -0600 asked a question OpenCV Problems after upgrading UBUNTU


I updated Ubuntu from 13.04 to 14.04.

I am using OpenCV 2.4.9 installed from source with:


I am using one of the sample programs: video_dmtx.cpp. I am using it with a camera.

I can see a video but before the program starts to stream the video I get the following error:

CvCapture_OpenNI::CvCapture_OpenNI : Failed to open input file (0): Bad file extension

I think the program is trying to use the OpenNI function instead of the normal one (if there is a normal one :P). Is there a way to tell the program not to use OpenNI unless specified??? or that is the expected behavior????


Also when I tried to set video properties the program crashes, I am defining the video as:

VideoCapture capture;

And then to set the properties:

capture.set(CV_CAP_PROP_FRAME_WIDTH,  640 );
capture.set(CV_CAP_PROP_FRAME_HEIGHT, 480 );
capture.set(CV_CAP_PROP_FPS,          30 );

Edit 2

I reinstalled OpenCV with

sudo cmake -D BUILD_DOCS=ON -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local/opencv-2.4.9 ..

The program still crashes when setting properties so I commented that out.

Now I have this whenever I try to capture a frame from video:

GStreamer Plugin: Embedded video playback halted; module source reported: Could not read from resource.

Edit 3

Now it seems to be working.

My PC only has USB 3.0 ports (is a GIGABYTE BRIX) which were working OK before the upgrade, now I am using the camera through a USB 2.0 hub.

Also, before the upgrade I was using OpenCV from ROS, but now in 14.04 with ROS Indigo that is not possible.

When calling a video I had to input:


But now with the OpenCV installation from source I only HAVE/MUST give the number 0, why???

Thanks!! --Luis

2014-06-24 07:43:21 -0600 received badge  Editor (source)
2014-06-16 05:40:27 -0600 asked a question cmake linking error OpenCV_FOUND to FALSE UBUNTU 13.04


I was following the tutorials, but then I noticed that I was using the ROS OpenCV installation instead of the local OpenCV which was installed manually. After a long web search I managed to use the local version. I am using OpenCV 2.4.9 which is OK. If I run:

import cv2
print cv2.__version__

I get:


I was getting 2.4.6 I have a code in a folder, to build it I am using cmake. The CMakeLists file is:

cmake_minimum_required(VERSION 2.8)
project( Tutorials ) to 
find_package( OpenCV REQUIRED )

add_executable( bin/findContours_demo src/findContours_demo.cpp )
target_link_libraries( bin/findContours_demo ${OpenCV_LIBS} )


Which was working fine. Now with OpenCV 2.4.9 installed from source, when I execute cmake I get this:

  CMake Warning at /usr/local/opencv-2.4.9/cmake/OpenCVConfig.cmake:161 (message):
  Found OpenCV Windows Pack but it has not binaries compatible with your

   You should manually point CMake variable OpenCV_DIR to your build of OpenCV
Call Stack (most recent call first):
  CMakeLists.txt:3 (find_package)

CMake Error at CMakeLists.txt:3 (find_package):
  Found package configuration file:


  but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be

-- Configuring incomplete, errors occurred!

I alredy went back to the ROS OpenCV and I can get it done, but if I change to 2.4.9 from source I get the same error. I am using UBUNTU 13.04 with ROS hydro. Is this error telling me I am using Windows??? I already search the web but the solutions posted are for Windows. I think something is broken with my cmake but I have no idea what is it.



I already tried everything I could possibly imagine but nothing happens, I am still getting the same error. Has somebody tried to do this and got it done? Using ROS with the OpenCV from source?


The problem was not the OpenCV installation, but the cmake instruction. It did not have the rules to find the OpenCV package, what I did was:

Get OpenCV from source.

Unzip it, I am doing it in /usr/local, so I have /usr/local/opencv-2.4.9.

In /usr/local/opencv-2.4.9 do:

sudo mkdir build
cd build

Compile OpenCV, e.g. I am using this cmake instruction:

sudo make
sudo make install

Add to the file /etc/



sudo ldconfig

Add the paths to OpenCV to your .bashrc, for me was:

source /opt/ros/hydro/setup.bash
LD_LIBRARY_PATH=/usr/local/opencv-2.4.9/lib:$LD_LIBRARY_PATH ...