Ask Your Question

abhiguru's profile - activity

2019-11-14 21:00:16 -0600 received badge  Popular Question (source)
2018-10-29 04:53:21 -0600 received badge  Popular Question (source)
2017-08-20 16:19:09 -0600 received badge  Famous Question (source)
2016-03-04 06:57:56 -0600 received badge  Notable Question (source)
2016-03-04 06:57:56 -0600 received badge  Popular Question (source)
2015-07-12 05:28:28 -0600 asked a question OpenCV3.0 Thread errors in facial detection sample with little mod

App Source is mostly the sample code for face detection in OpenCV : http://pastebin.com/SFersac9

Valgrind output showing TBB issues : http://pastebin.com/a4Nfy4MR

Error message : OpenCV Error: Assertion failed (stateThread==STATE_THREAD_WORKING_SLEEPING) in workcycleObjectDetector, file /home/ubuntu/opencv/modules/objdetect/src/detection_based_tracker.cpp, line 349 workcycleObjectDetectorFunction: ERROR: OpenCV Exception caught: '/home/ubuntu/opencv/modules/objdetect/src/detection_based_tracker.cpp:349: error: (-215) stateThread==STATE_THREAD_WORKING_SLEEPING in function workcycleObjectDetector ' In general I have seen some code using CUDA and TBB will throw error about thread issues randomly and will work some other times.

2015-06-13 03:30:23 -0600 asked a question Error on vector<cuda::HostMem> host_src_pl(768, 1024, CV_8UC1, cuda::HostMem::PAGE_LOCKED)

When I try to create a vector of HostMem I get an error

 vector<cuda::HostMem> host_src_pl(768, 1024, CV_8UC1, cuda::HostMem::PAGE_LOCKED)

no matching function for call to ‘std::vector<cv::cuda::hostmem>::vector(int, int, int, cv::cuda::HostMem::AllocType)’

Is it not allowed to have a vector of HostMem ?

2015-06-12 05:20:56 -0600 commented question Best practice for CUDA streams --> How to get OpenCV GPU module to work asynchronously??

+1 would like to know.

2015-06-11 08:24:51 -0600 commented question OpenCV uses an older version of FFMPEG despite the latest being installed in bin

1) Building it on ubuntu server so using command line. Would rather not use gui. 2) The folder 3rdpart/ffmpeg does not exist in the version of CV3.0 I got from web.

2015-06-11 08:05:30 -0600 asked a question OpenCV uses an older version of FFMPEG despite the latest being installed in bin

CMAKE

sudo cmake -D WITH_NVCUVID=ON -D BUILD_DOCS=ON -D WITH_XINE=ON -D WITH_CUDA=ON -D WITH_OPENGL=ON -D WITH_TBB=ON -D WITH_OPENNI=OFF -D BUILD_EXAMPLES=ON -D WITH_OPENCL=ON -D CMAKE_BUILD_TYPE=RELEASE -D OPENCV_EXTRA_MODULES_PATH=../modules/opencv_contrib-master/modules/ -D ENABLE_FAST_MATH=1 -D WITH_QT=ON -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 -D CMAKE_INSTALL_PREFIX=/usr/local/ ..

Output

--   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  YES (ver 2.2.1)
--     FFMPEG:                      YES
--       codec:                     YES (ver 54.35.0)
--       format:                    YES (ver 54.20.4)
--       util:                      YES (ver 52.3.0)
--       swscale:                   YES (ver 2.1.1)
--       resample:                  NO
--       gentoo-style:              YES

ffmpeg -version

ffmpeg version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2000-2014 the FFmpeg developers
built on Nov 22 2014 17:07:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --prefix=/usr --extra-version='1ubuntu1~trusty6' --build-suffix=-ffmpeg --toolchain=hardened --extra-cflags= --extra-cxxflags= --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-fontconfig --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-opengl --enable-x11grab --enable-libxvid --enable-libx265 --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libx264 --enable-libsoxr --enable-openal --enable-libopencv
libavutil      54.  7.100 / 54.  7.100
libavcodec     56.  1.100 / 56.  1.100
libavformat    56.  4.101 / 56.  4.101
libavdevice    56.  0.100 / 56.  0.100
libavfilter     5.  1.100 /  5.  1.100
libavresample   2.  1.  0 /  2.  1.  0
libswscale      3.  0.100 /  3.  0.100
libswresample   1.  1.100 /  1.  1.100
libpostproc    53.  0.100 / 53.  0.100

Notice :

codec is 54.35.0 instead of 56.1.100
format is 54.20.4 instead of 56.4.101
util is 52.3.0 instead of 54.7.100

Is there a way to force opencv to use the latest version ? I tried uninstalling ffmpeg, reinstalling and rebuilding CV but it keeps finding the older version

2015-06-11 07:43:17 -0600 commented answer OpenCV 3.0 won't compile with FFMPEG support?

Can you elaborate this part a little ".. and then had to edit a particular option in my OpenCV build. I used ccmake to set CMAKE_SHARED_LINKER_FLAGS to a value of -Wl,-Bsymbolic, as described by the ffmpeg website." Which option did you edit particularly ? In my case OpenCV is picking up an older version of FFMPEG (libavcodec -54.35 instead of 56.1...) is there some setting to force OpenCV to force using another version ?

2015-06-11 07:15:56 -0600 commented question too many thread_release_buffer calls!

I am getting the similar error when I run code on AWS (Quad GPU, 32 CPU) instance with OpenCV3.0 + Cuda 7.0 and FFMPEG: YES -- codec: YES (ver 54.35.0) -- format: YES (ver 54.20.4) -- util: YES (ver 52.3.0) -- swscale: YES (ver 2.1.1) -- resample: NO -- gentoo-style: YES

Google searches suggest I should upgrade my FFMPEG which I did but still getting the error any suggestions ?

2015-06-10 06:25:21 -0600 commented answer GPU SIFT and dealing with GPU pointers

I am trying to compile CV3.0 code with Thrust but I get a bunch or errors about undefined

/usr/local/cuda-7.0/include/thrust/system/cuda/detail/error.inl:63: undefined reference to cudaGetErrorString' /usr/local/cuda-7.0/include/thrust/system/cuda/detail/trivial_copy.inl:44: undefined reference tocudaMemcpyAsync'

I did some search and seems that i am missing -lcudaart during compilation, is that needed when compiling thru opencv ? any suggestions on how I can do it ?

2015-06-09 15:50:45 -0600 commented question OpenCV Error: Gpu API call (invalid device ordinal) in allocate when running on AWS GPU Instance

I am seem to be having issues with the setGlDevice instead of setDevice. I think it might be somehow related to the fact that I am running the code on a Ubuntu server edition and trying to view the GL display window over X11 on my ubuntu desktop. any other suggestions welcome.

2015-06-09 04:00:21 -0600 asked a question the launch timed out and was terminated in function icvCalcLayerDetAndTrace_gpu
 OpenCV Error: Gpu API call (the launch timed out and was terminated) in icvCalcLayerDetAndTrace_gpu, file /home/ubuntu/cv/modules/opencv_contrib-master/modules/xfeatures2d/src/cuda/surf.cu, line 250
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/ubuntu/cv/modules/opencv_contrib-master/modules/xfeatures2d/src/cuda/surf.cu:250: error: (-217) the launch timed out and was terminated in function icvCalcLayerDetAndTrace_gpu

Anyone seen the error before ?

2015-06-08 04:17:13 -0600 commented question Error on cv::cuda::DescriptorMatcher::knnMatch

Matches for knnMatch need to be

 std::vector< std::vector< DMatch > > & matches,

and NOT

std::vector< DMatch > &
2015-06-06 04:21:29 -0600 asked a question OpenCV Error: Gpu API call (invalid device ordinal) in allocate when running on AWS GPU Instance

Trying to run gpu-example-video_reader example on and AWS GPU instance Quad GPU running Ubuntu server 14.04, OpenCV 3.0, CUDA 7.0. I get the following message

ubuntu@ip-10-51-184-206:~/cv/build/bin$ ./gpu-example-video_reader def.mp4 
libdc1394 error: Failed to initialize libdc1394
init done 
opengl support available 
OpenCV Error: Gpu API call (invalid device ordinal) in allocate, file /home/ubuntu/cv/modules/core/src/cuda/gpu_mat.cu, line 76
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/ubuntu/cv/modules/core/src/cuda/gpu_mat.cu:76: error: (-217) invalid device ordinal in function allocate

The example works fine on my local machine. Any suggestions ?

2015-06-05 13:45:55 -0600 commented question make[2]: *** No rule to make target `/usr/lib/x86_64-linux-gnu/libGL.so', needed by `lib/libopencv_cudev.so.3.0.0'. Stop.

Found the solution in the link in case anyone runs into the same issue http://techtidings.blogspot.in/2012/0...

2015-06-05 13:00:17 -0600 asked a question make[2]: *** No rule to make target `/usr/lib/x86_64-linux-gnu/libGL.so', needed by `lib/libopencv_cudev.so.3.0.0'. Stop.

Error during [make]: make[2]: * No rule to make target /usr/lib/x86_64-linux-gnu/libGL.so', needed bylib/libopencv_cudev.so.3.0.0'. Stop. make[2]: Waiting for unfinished jobs.... [ 28%] Building CXX object modules/cudev/CMakeFiles/opencv_cudev.dir/src/stub.cpp.o make[1]: [modules/cudev/CMakeFiles/opencv_cudev.dir/all] Error 2 make[1]: * Waiting for unfinished jobs....

Configuration: 1) Ubuntu 14.04 2) OpenCV3.0.0 3) CUDA 7.0 Running on AWS G2.8xLarge - 32 CPU and Quad Nvidia Grid GPU

Cmake; sudo cmake -D WITH_NVCUVID=ON -D BUILD_DOCS=ON -D WITH_XINE=ON -D WITH_CUDA=ON -D WITH_OPENGL=ON -D WITH_TBB=ON -D WITH_OPENNI=ON -D BUILD_EXAMPLES=ON -D WITH_OPENCL=ON -D CMAKE_BUILD_TYPE=RELEASE -D OPENCV_EXTRA_MODULES_PATH=../modules/opencv_contrib-master/modules/ -D ENABLE_FAST_MATH=1 -D WITH_QT=ON -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 -D CMAKE_INSTALL_PREFIX=/home/ubuntu/cv ..

Verified CUDA Sample works ok independent of OpenCV. Tried sudo make clean, OpenCV3.0.0 and OpenCV3.0.0rc1

2015-06-05 12:53:06 -0600 commented question No rule to make target `/usr/lib/libnvcuvid.so', needed by `lib/libopencv_gpu.so.2.

Actually I have additional details as my build is on AWS instance running Grid GPU will post a seperate question. Hoping you can take a look at it

2015-06-05 10:54:30 -0600 commented question No rule to make target `/usr/lib/libnvcuvid.so', needed by `lib/libopencv_gpu.so.2.

Steve, I am getting the same error. my Cmake is sudo cmake -D WITH_NVCUVID=ON -D BUILD_DOCS=ON -D WITH_XINE=ON -D WITH_CUDA=ON -D WITH_OPENGL=ON -D WITH_TBB=ON -D WITH_OPENNI=ON -D BUILD_EXAMPLES=ON -D WITH_OPENCL=ON -D CMAKE_BUILD_TYPE=RELEASE -D OPENCV_EXTRA_MODULES_PATH=../modules/opencv_contrib-master/modules/ -D ENABLE_FAST_MATH=1 -D WITH_QT=ON -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 -D CMAKE_INSTALL_PREFIX=/home/ubuntu/cv ..

I tried make clean and then make again but It keeps failing at that point.

I tried 3.0.0 and 3.0.0rc1 both are giving me same errors make[2]: * No rule to make target /usr/lib/libnvcuvid.so', needed bylib/libopencv_cudacodec.so.3.0.0'.

I tested CUDA samples independent of Opencv and they work fine.

2015-06-05 01:21:50 -0600 asked a question OpenCV Error: No OpenGL support (Library was built without OpenGL support). But OpenGL sample runs okay and CV was built using OpenGL.

Config : OpenCV 3.0 + Ubuntu 14.04 built with CUDA + OPENGL + NVCUID. The build/cvconfig.h content can be viewed at http://pastebin.com/eZGHn4ys which confirms that OpenGL was built successfully

1) I can successfully run the sample at build/bin/gpu-example-video_reader

2) I copied the /samples/gpu/video_reader.cpp sample into a new project and am trying to run it using a CMakeLists.txt below

PROJECT( Segmenter ) FIND_PACKAGE( OpenCV REQUIRED ) ADD_EXECUTABLE( segitb segitb.cpp ) TARGET_LINK_LIBRARIES( segitb ${OpenCV_LIBS} )

I get the following error message at runtime

OpenCV Error: No OpenGL support (Library was built without OpenGL support) in cvNamedWindow, file /home/ubuntu/cv/modules/highgui/src/window_gtk.cpp, line 1048 terminate called after throwing an instance of 'cv::Exception' what(): /home/ubuntu/cv/modules/highgui/src/window_gtk.cpp:1048: error: (-218) Library was built without OpenGL support in function cvNamedWindow

Am I missing something in my CMakeLists.txt ?

2015-06-04 03:37:21 -0600 commented question vidoeReadeR_GPU (function/feature is not implemented)

Hey did you figure this out ? I am getting the same in opencv3.0.0

2015-06-02 06:38:54 -0600 received badge  Citizen Patrol (source)
2015-06-01 23:39:17 -0600 commented question Cannot get OpenCV3.0 cuda::calcHist() to return correct values

There is no error in code compilation or at runtime, It is the Histogram values calculated by using cuda::calcHist are incorrect for some reason. Am i doing something wrong ?

2015-06-01 10:38:40 -0600 received badge  Editor (source)
2015-06-01 08:21:17 -0600 asked a question Cannot get OpenCV3.0 cuda::calcHist() to return correct values

Updated code paste. I was using cuda::normalize() instead of cv2::normalize() and feeding it GpuMat from cuda::calcHist() but the values returned from calcHist were b0rked. The calcHist() without CUDA works okay and so does multiple CUDA samples. Using OpenCV3.0rc1 with Cuda 7.0 on GTX470 and Ubuntu 14.04

void displayHist2(Mat b_hist, Mat g_hist, Mat r_hist){

int hist_w = 1024;
int hist_h = 800;
int bin_w = cvRound( (double) hist_w/256 );

Mat histImage(hist_h, hist_w, CV_8UC3, Scalar(0,0,0));
normalize(b_hist, b_hist, 0, histImage.rows, NORM_MINMAX, -1, Mat());
normalize(g_hist, g_hist, 0, histImage.rows, NORM_MINMAX, -1, Mat());
normalize(r_hist, r_hist, 0, histImage.rows, NORM_MINMAX, -1, Mat());

Size s = b_hist.size();
int rows = s.height;
int cols = s.width;

if(rows == 0 && cols == 0 ) return;

for( int i = 1; i < 256 ; i++ ){
    line( histImage, Point( bin_w*(i-1), hist_h - cvRound(b_hist.at<float>(i-1)) ) ,
                     Point( bin_w*(i), hist_h - cvRound(b_hist.at<float>(i)) ),
                     Scalar( 255, 0, 0), 2, 8, 0  );
    line( histImage, Point( bin_w*(i-1), hist_h - cvRound(g_hist.at<float>(i-1)) ) ,
                     Point( bin_w*(i), hist_h - cvRound(g_hist.at<float>(i)) ),
                     Scalar( 0, 255, 0), 2, 8, 0  );
    line( histImage, Point( bin_w*(i-1), hist_h - cvRound(r_hist.at<float>(i-1)) ) ,
                     Point( bin_w*(i), hist_h - cvRound(r_hist.at<float>(i)) ),
                     Scalar( 0, 0, 255), 2, 8, 0  );
}

namedWindow("calcHist Demo", CV_WINDOW_AUTOSIZE );
imshow("calcHist Demo", histImage );
waitKey(0);

}

int main(int argc, char* argv[]){

Mat h_edges;
namedWindow("edges", 1);

Mat h_frame, h_dstframe, h_result;
Mat b_hist, g_hist, r_hist;

string filename = "default.mp4";
if(argc > 1 && argv[1] != string("")) filename = argv[1];

VideoCapture h_cap(filename);
if(!h_cap.isOpened()) return -1;

while(1){

    h_cap >> h_frame;
    if( !h_frame.data ) { return -1; }

    cvtColor(h_frame, h_frame, CV_BGR2Lab);
    imshow("edges", h_frame);

    cuda::GpuMat d_bdst, d_gdst, d_rdst, d_src;
    cuda::GpuMat d_matarr[3];

    d_src.upload(h_frame);
    cuda::split(d_src,d_matarr);

    cuda::calcHist(d_matarr[0], d_bdst);
    cuda::calcHist(d_matarr[1], d_gdst);
    cuda::calcHist(d_matarr[2], d_rdst);

    d_bdst.download(b_hist);
    d_gdst.download(g_hist);
    d_rdst.download(r_hist);

    displayHist2(b_hist, g_hist, r_hist);
}

}

2015-05-30 09:47:26 -0600 received badge  Supporter (source)
2015-05-30 09:47:17 -0600 commented question gpu::calcHist()

I am trying the same histCalc on GPU using opencv3.0 so the namespace is cuda::calcHist() rest of the code is same as above but I am getting a runtime error OpenCV Error: The function/feature is not implemented (getGpuMat is available only for cuda::GpuMat and cuda::HostMem) in getGpuMat, file /home/ubuntu/cv/modules/core/src/matrix.cpp, line 1419 terminate called after throwing an instance of 'cv::Exception' what(): /home/ubuntu/cv/modules/core/src/matrix.cpp:1419: error: (-213) getGpuMat is available only for cuda::GpuMat and cuda::HostMem in function getGpuMat

2015-05-29 02:45:13 -0600 received badge  Student (source)
2015-05-29 00:49:53 -0600 asked a question BGR to HVC conversion with or without using CUDA in OpenCV 3.0

Trying to figure out how to convert a video frame from BGR to HVC preferably using CUDA Mat

Tried

1) cuda::cvtColor(src, dst, CV_BGR2HVC) but CV_BGR2HVC is not supported

2) Tried searching in http://docs.opencv.org/trunk/d1/d1e/g... but could not find any relevant function the closest I got was CV_CUDEV_RGB2HSV_INST(name, scn, dcn, bidx) Not sure how to use this method.

2015-05-17 04:20:00 -0600 commented answer OpenCV3.0 install on Ubuntu 14.04

OpenCV3.0 builds okay it is just that I get those missing files in the CMake list even after installing the packages above.

2015-05-17 02:37:06 -0600 received badge  Enthusiast
2015-05-09 01:54:54 -0600 asked a question OpenCV3.0 install on Ubuntu 14.04

I get the following when I do a Cmake http://pastebin.com/QTP9qqC1

It is missing
1) sys/videoio.h - For the life of me I can't seem to find this file.

2) ffmpeg/avformat.h - It is present at /home/ubuntu/ffmpeg_build/include/libavformat/avformat.h but for some reason OpenCV wont look there.

a) Should I update the CMakeLists.txt of OpenCV to include the ffmpeg build path ? Worried it will messup my openCV install as it already detects ffmpeg and forcing a build path include might cause that to break.

b) please suggest the right way to do it.