Ask Your Question

mjepson's profile - activity

2018-12-15 01:01:42 -0500 received badge  Student (source)
2018-12-13 05:32:43 -0500 received badge  Nice Answer (source)
2016-12-07 06:04:51 -0500 received badge  Taxonomist
2016-12-05 01:14:42 -0500 received badge  Famous Question (source)
2014-02-17 12:40:29 -0500 received badge  Notable Question (source)
2013-06-15 19:02:13 -0500 received badge  Popular Question (source)
2013-06-02 15:54:06 -0500 received badge  Notable Question (source)
2013-02-12 18:07:23 -0500 received badge  Teacher (source)
2013-01-23 17:18:00 -0500 received badge  Popular Question (source)
2012-12-04 14:16:51 -0500 received badge  Necromancer (source)
2012-12-03 14:27:52 -0500 answered a question Problem Reading PNG with Transparency layer

The implementation of highgui's imshow fails to show any transparent images correctly. I place the (semi) transparent image over another (possibly a checkerboard or something) to show how it actually looks. See this post for a method to do so easily. You can display the resulting image (which is a 3 channel BGR image) correctly with imshow.

2012-11-23 04:28:35 -0500 answered a question i want to make face detection based login system

You might want to give use some more information?

For starters, you could take a look at the CascadeClassifier, which you can use with the haarcascades supplied with OpenCV. That will take care of the face detection for you.

2012-11-23 04:18:50 -0500 received badge  Scholar (source)
2012-08-23 15:21:48 -0500 commented answer OpenCV on Mac OS X 10.8 Mountain Lion

Still the question remains ... where do you add .c_str() ? If I change params.h and make it read: std::cout << it->first.c_str() << .... I get an error saying that cvflann::any has not member named c_str. If I completely remove the lines (comment them out), I get the same error in another Qt file, and another, etc. So there really is something I have to fix, but cannot find it.

Never mind. Somehow the mac-min-version trick did it this time ... Must have done something wrong last time. /facepalm Thanks for your message though!

2012-08-12 11:49:30 -0500 commented question findchessboardcorners produces an error in debug builds

I have found this bug report: and It states the problem was fixed in version 2.4. Qt Creator uses the dynamic runtime libraries of VS, so that cannot be the problem for me. Also, like I said, it only happens in a debug build, not in a release build. I'm really stuck on this now, as I want to create a program for calibrating our stereo camera setup, but cannot continue, because I can't debug my code.

2012-08-10 09:33:29 -0500 asked a question findchessboardcorners produces an error in debug builds


I'm trying to calibrate my camera, using findChessBoardCorners, but I come along a problem. When I use this code (the image img (cv::Mat) comes from my camera):

cv::Size boardSize(6,8);
vector<cv::Point2f> corners;
bool cornersFound = cv::findChessboardCorners(img, boardSize, corners, cv::CALIB_CB_NORMALIZE_IMAGE | cv::CALIB_CB_ADAPTIVE_THRESH | cv::CALIB_CB_FAST_CHECK);

My code fails on the call to findChessboardCorners, but only in a debug build, it runs perfectly normal in a release build. If I exchange the vector<cv::Point2f> corners with cv::Mat corners, everything works, even in a debug build.

I want to be able to debug my code, so I need a debug build, but for the corners to be useful, they need to be in a vector<cv::Point2f>, so I'm stuck now.

My configuration:

  • OS: Windows XP SP3, 32 bit
  • IDE: Qt - Creator 2.4.1
  • Compiler: MSVC++ 2010


2012-08-09 14:04:35 -0500 commented answer OpenCV on Mac OS X 10.8 Mountain Lion

Hi tvdev, please let me know if you find a solution. Where did you add "cout<< myString.c_str();" to make it compile and run?

2012-08-09 09:20:02 -0500 commented answer OpenCV on Mac OS X 10.8 Mountain Lion

Aha, but this is with XCode. I am using Qt Creator and using code I wrote on a Windows Machine. Also, it seems to only produce errors with the gcc compiler. If I choose the Clang compiler, it compiles as it should, but I want to use the gcc compiler. I think the .m files are also XCode only. Weird thing though, that they all include opencv.hpp first, while I have always just includded <cv.hpp>. I will try adding that include when I get home this afternoon (I don't have a Mac at work).

2012-08-08 15:34:33 -0500 answered a question Problems with OpenCV and VC++

See a guide for installing 2.4.2 with VC++ 2010 here:

2012-08-08 12:30:43 -0500 commented question OpenCV on Mac OS X 10.8 Mountain Lion

Well, this is code from OpenCV itself, which worked in Mac OS X 10.7. It works as it is on Windows too, so I don't think there's really anything wrong with it. Also, the error complains about the explicit instantiation of std::basic_ostream(etc.), which would be cout I guess. The file has an #include <iostream>, so it should be able to use std::cout.

2012-08-08 12:18:13 -0500 commented answer OpenCV on Mac OS X 10.8 Mountain Lion

Are you sure you're talking about C++? I only have .hpp and .cpp files, also, I have #include lines, not #import ...

2012-08-06 13:40:24 -0500 asked a question OpenCV on Mac OS X 10.8 Mountain Lion

I have used OpenCV with Qt Creator on Windows, but now wanted to use it on Mac OS X too. So I installed 2.4.2, used CMake to make and build (install) the whole, which went without any problems. But, when I add #include <cv.hpp> to one of my files, I get the following error 5 times:

/usr/local/include/opencv2/flann/params.h:87: error: explicit instantiation of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]' but no definition available

The code around the error is this:

inline void print_params(const IndexParams& params)
    IndexParams::const_iterator it;

    for(it=params.begin(); it!=params.end(); ++it) {
        std::cout << it->first << " : " << it->second << std::endl;

with the error occurring in the line with std::cout << it->first ...

I can't figure out why this is happening. Any help is greatly appreciated!

2012-07-28 04:28:45 -0500 answered a question CascadeClasifier detectMultiScale arguments

When I look at your code:

body.detectMultiScale( gray, bodies, 1.1, 2, 0|CV_HAAR_SCALE_IMAGE, cv::Size(30, 30),cv::Size(0,0),cv::Size(5,13),cv::Size(45,80));

I can see that you pass 4 cv::Size objects? The docs state that you can pass 2, the minSize and maxSize. I'm not sure what the sizes (30,30) and (0,0) represent, but I think you should leave them out. That is of course, considering that the (5,13) and (45,80) are your min and max sizes.

2012-07-27 14:18:59 -0500 edited question Cannot display image loaded from disk in release build

Hi everyone,

I have been unable to find a solution for my problem, where

cv::Mat image =  cv::imread("path/to/file.jpg");

works in debug, but not in release build.

I am using Visual C++ on Windows and OpenCV 2.4.2. My code just finds a file on disk and reads it using cv::imread. When in Debug mode, I can use cv::imshow to show the loaded image and it will. When in a release build, it won't. I have discovered that for some reason the loaded image in the release build has 1 channel, while the same image in a debug build has three.

The exception is:

OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in unknown function, file ......\src\opencv\modules\core\src\array.cpp, line 2482

The include, and lib folders are the same for my release build as my debug build. I don't understand what's going wrong, but I would like to be able to create a release build of my program for the production environment.

2012-07-27 13:26:20 -0500 received badge  Supporter (source)
2012-07-27 09:40:27 -0500 received badge  Self-Learner (source)
2012-07-27 09:37:54 -0500 edited answer Cannot display image loaded from disk in release build

I have finally figured it out.

In my configuration under Linker, I have added Additional Library Dependencies: opencv_core242d.lib opencv_imgproc242d.lib opencv_highgui242d.lib opencv_ml242d.lib opencv_video242d.lib opencv_features2d242d.lib opencv_calib3d242d.lib opencv_objdetect242d.lib opencv_contrib242d.lib opencv_legacy242d.lib opencv_flann242d.lib

It took me a while to notice that they all end with "*d.lib" and that there might be a chance that this d means "debug". Removing the d in all these files for the release build solved it!

Thank you all for your help!

2012-07-27 07:17:26 -0500 received badge  Autobiographer
2012-07-27 07:09:29 -0500 received badge  Editor (source)