Ask Your Question

bob h's profile - activity

2019-12-02 04:17:38 -0600 received badge  Notable Question (source)
2015-12-18 04:34:54 -0600 received badge  Popular Question (source)
2015-07-10 13:01:00 -0600 received badge  Student (source)
2014-09-26 07:55:46 -0600 commented question Building OpenCV 3.0.0 with MS Visual Studio 2012

My path to the the DLL was wrong. Thanks for the suggestion. Both C++ and Python libraries work OK now.

2014-09-25 17:02:08 -0600 commented question Building OpenCV 3.0.0 with MS Visual Studio 2012

Actually, I did miss that. The code will now compile, but when I run it I get an error: "The program can't start because opencv_core300.dll is missing from your computer." Again, I have the .dll files in the \bin\ directory and the .lib file in the \lib\ directory, and I have the Linker Additional Dependencies linking to both, so I'm not sure what the problem is. Also, I can't import the OpenCV 3.0.0 python library that was built (again when I replace with the 2.4.9 version I can import fine into python).

2014-09-25 15:28:06 -0600 asked a question Building OpenCV 3.0.0 with MS Visual Studio 2012

I am trying to compile OpenCV 3.0.0 (code build with CMake) using Microsoft Visual Studio 2012. I am following the tutorial: http://docs.opencv.org/trunk/doc/tutorials/introduction/windows_install/windows_install.html . By following the tutorial, I can build the libraries without errors to the directory: C\OpenCV300\build\install (.dlls in the ...\bin\ directory and .lib files in the ...\lib\ directory). However, when I make a new project in Visual Studio and and try to use these libraries for reading/writing images and utilizing my webcam, I get errors, such as the following:

1>OpenCV300_Webcam.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl cv::VideoCapture::read(class cv::_OutputArray const &)" (?read@VideoCapture@cv@@UEAA_NAEBV_OutputArray@2@@Z)

1>OpenCV300_Webcam.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl cv::VideoCapture::isOpened(void)const " (?isOpened@VideoCapture@cv@@UEBA_NXZ)

1>OpenCV300_Webcam.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl cv::VideoCapture::~VideoCapture(void)" (??1VideoCapture@cv@@UEAA@XZ)

1>OpenCV300_Webcam.obj : error LNK2001: unresolved external symbol "public: __cdecl cv::VideoCapture::VideoCapture(int)" (??0VideoCapture@cv@@QEAA@H@Z)

which seem to indicate the libraries are not working correctly. Note that I also downloaded a pre-compiled version of OpenCV 2.4.9 and am able to utilize those just fine. Thus, I would guess I am doing something wrong that is causing the library files to not compile correctly (I am not an expert programmer, and this is the first time I've tried to build a large library like this from the source code).

2014-06-26 19:21:50 -0600 asked a question Using Mat objects in OpenCV2.4.9 in MS VS 2008

Hello, I'm trying to utilize OpenCV 2.4.9 in MS Visual Studio 2008. The problem I have is that I cannot pass images into a Mat object (either from my camera or from files). For instance the following code returns "No image found. Check path!":

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace std;
using namespace cv;

int main( int argc, char** argv)
{
   cv::Mat baboon = cv::imread("C:\\OpenCV249\\sources\\samples\\cpp\\baboon.jpg",0);

   if (!baboon.data)
   {
      cout << "No image found! Check path." << endl;
      cv::waitKey(10000);
      return -1;
   }
   else
   {
      cv::namedWindow("Window",CV_WINDOW_AUTOSIZE);
      cv::imshow("Window",baboon);
      cv::waitKey();
      return 0;
   }

}

I am able to read images in using the older code:

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

using namespace std;
using namespace cv;

int main( int argc, char** argv)
{
    IplImage *img = cvLoadImage("C:\\OpenCV249\\sources\\samples\\cpp\\baboon.jpg"
,CV_LOAD_IMAGE_UNCHANGED);
    while(1)
    {
        cvNamedWindow("Window",CV_WINDOW_AUTOSIZE);
        cvShowImage("Window",img);
        cvWaitKey(10);
    }
}

Nevertheless, I would like to work with the newer classes. I have tried converting IplImage to Mat, but that also fails (i.e. nothing is passed). I get this error running both .jpg files and .png files. I have checked to ensure that this path leads me to the image. Also, I have tried running in both debug and release modes (and have made sure to change the linked .lib files as needed). Here is the entry for OpenCV in the PATH enviornmental variable: "C:\OpenCV249\build\x64\vc10\bin\;"

I'm wondering if the .dll's in the new version of OpenCV are not compatible with MS VS 2008? If so, is there any way around this? I would prefer to use the newer version.