Ask Your Question

wagp11's profile - activity

2019-05-23 17:57:56 -0600 received badge  Popular Question (source)
2015-03-17 16:41:34 -0600 commented question Simple OpenCV program crashes

I had initially openCV 2.4.9 along with qt4 . I deinstalled both and installed afterwards (in the following order) cuda 6.5, qt 5.4 and openCV 2.4.10-1. (In cmake build directory) cmake - D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D WITH_CUBLAS=ON -D WITH_CUFFT=ON -D WITH_EIGEN=ON -D WITH_OPENGL=ON -D WITH_QT=ON -D WITH_TBB=ON -D BUILD_DOCS=ON -D BUILD_EXAMPLES=ON -D BUILD_TESTS=ON -D CUDA_ARCH_BIN="3.0" ..

2015-03-16 16:59:31 -0600 commented question Simple OpenCV program crashes

Yes, the path is correct and also tried your suggestion. The console ouput give me a "realloc(): invalid pointer" I have also tried to run it in another machine with opencv 2.4.8 an Qt 4 same problem there.

2015-03-16 16:52:27 -0600 commented question Simple OpenCV program crashes

Yes, the original code does no use the second parameter. Both variants generate the same problem. The code compiles, but I get a direct crash.

2015-03-16 15:44:01 -0600 commented question Simple OpenCV program crashes

The code compiles in qt creator. The problem is during the execution SIGSEGV. I compiled the same code under qt creator using cmake to build it and the program executes without a problem.

I tried what you recommended and I got this output: g

++ `pkg-config --libs --cflags opencv` -o test main.cpp
/usr/bin/ld: cannot find -lcufft
/usr/bin/ld: cannot find -lcublas
/usr/bin/ld: cannot find -lnpps
/usr/bin/ld: cannot find -lnppi
/usr/bin/ld: cannot find -lnppc
/usr/bin/ld: cannot find -lcudart
collect2: error: ld returned 1 exit status

Which I can also not understad, because I installed OpenCV WITH_CUDA=ON after installing cuda 6.5. I checked my opencv.pc file and the flags mentioned in the output don't point where the .so file actually are.

2015-03-16 14:59:59 -0600 asked a question Simple OpenCV program crashes

Hello community,

I am currently having a problem. I am following the instructions given in this book "OpenCV 2 Computer Vison Application Programming Cookbook" for creating a simple image display program in OpenCV (2.4.10-1) using Qt 5.4, QtCreator in Ubuntu 14.04.

The code is as follows:

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>

int main() {
    // read an image
    cv::Mat image = cv::imread("${PATH_TO_HOME}/Pictures/bottle_label.jpg");

    if ( image.data == NULL )    {
        std::cout << "no data loaded" << std::endl;
        return -1;
    }
    else {
        // create image window named "My image"
        cv::namedWindow("My Image", 1);
        // show the image on window
        std::cout << "Image loaded" << std::endl;
        cv::imshow("My Image", image);
        // wait key for 5000 ms
        cv::waitKey(5000);

        return 0;
    }
}

And the contents in the .pro file are

# Standard .pro content for qt console application #
INCLUDEPATH += /usr/local/include/

LIBS += -L/usr/local/lib \
        -lopencv_core  -lopencv_highgui -lopencv_imgproc -lopencv_features2d -lopencv_calib3d

The code compiles, but when I run it the program crashes immediately. The debuger points a SIGSEGV occurring in line 17: cv::namedWindow("My Image", 1) I don't know what to do. I have other programs that use qt and opencv libraries in the same computer but used cmake to build them and they run fine. Could someone please point out where the problem is?

Thank you in advance

2015-03-12 06:35:39 -0600 received badge  Supporter (source)
2015-02-27 06:28:49 -0600 commented answer Is there a FindOpenCV.cmake that works?

I know it is almost a year from your answer, but the link you provided is no longer working. Could you please post another link to the aforementioned FindOpenCV.cmake? Thank you.

2015-02-26 11:09:40 -0600 commented question OpenCV - 2.4.10.1: error: undefined reference to `vtable for cv::SURF'

If I add manully "opencv_nonfree" I still can not build because I get the following error: /usr/local/lib/libopencv_nonfree.so:-1: error: undefined reference tocv::ocl::integral(cv::ocl::oclMat const&, cv::ocl::oclMat&)'`

2015-02-26 09:07:43 -0600 received badge  Editor (source)
2015-02-26 09:01:43 -0600 asked a question OpenCV - 2.4.10.1: error: undefined reference to `vtable for cv::SURF'

Hi,

I upgraded from opencv-2.4.9 to opencv-2.4.9.10.1, because I was missing the CUDA support, that I didn't setup in my previous installation. I test some programs I wrote with my previous installation and everything seemed to be fine until I tried the features2D tutorial code from: Features2D + Homography to find a known object

I get the errors:

 error: undefined reference to `cv::SURF::SURF(double, int, int, bool, bool)'
 error: undefined reference to `cv::SURF::SURF()'
 error: undefined reference to `vtable for cv::SURF'

The includes are those of the example code. I use cmake to build all together and my CMakeLists.txt Looks like follows:

project(testSurf)
        cmake_minimum_required(VERSION 2.8)

        set( CMAKE_BUILD_TYPE Debug )

        set( CMAKE_CXX_FLAGS "-Wall" )
       # OpenCV Handling
        find_package( OpenCV REQUIRED )

        include_directories( ${CMAKE_CURRENT_BINARY_DIR} )

        # General
        set( testSurf_SRC
            main.cpp
           )

        set( testSurf_LIB
            ${OpenCV_LIBS}
            )

        add_executable( ${PROJECT_NAME} ${testSurf_SRC} )
        target_link_libraries( ${PROJECT_NAME} ${testSurf_LIB} )

It is a problem with the linker, but I can't see where the problem is, given that I setup the libraries im my Cmake file correctly. In fact the same CMakeLists worked before the upgrade. Thank you for helping community.

Follow up: I used message("OpenCV_LIBS=${OpenCV_LIBS}")to print out the result of find_package(OpenCV REQUIRED) and the result was:

OpenCV_LIBS=opencv_videostab;opencv_video;opencv_ts;opencv_superres;opencv_stitching;opencv_photo;opencv_ocl;opencv_objdetect;opencv_ml;opencv_legacy;opencv_imgproc;opencv_highgui;opencv_gpu;opencv_flann;opencv_features2d;opencv_core;opencv_contrib;opencv_calib3d

No opencv_nonfree shows up. I am trying to figure out why opencv_nonfree does not show up. I printed the value of ${OpenCV_LIBS} from a project I build before the reinstallation and there ${OpenCV_LIBS} contains the opencv_nonfree part.

2015-01-27 07:56:35 -0600 received badge  Enthusiast
2015-01-22 10:34:01 -0600 commented question Problems using Stitcher::stich

I have the same problem. I tried the opencv-2.4.10/build/bin/cpp-example-stitching_detailed example and it only works with small images (ca. 800x600) With bigger images it only writes empty panos and the exits with the code 255. But interestingly a few weeks ago with the same example I could stitch around 10 images (2704x1440 in size).