Ask Your Question

drtaglia's profile - activity

2016-11-15 09:49:23 -0500 received badge  Nice Answer (source)
2016-10-25 04:57:00 -0500 received badge  Teacher (source)
2015-03-09 05:11:47 -0500 asked a question [Win8,CMake,OpenCV2] helloworld runtime errors when running in *Debug*

Hello guys,

I am configuring a simple helloworld application in OpenCV under windows. I am using QtCreator with the NMAKE build system. When I specify "CMAKE_BUILD_TYPE=Release" in my CMakeLists.txt this little application works just fine:

#include <iostream>
#include <fstream>
#include "stdlib.h"
#include "opencv2/core/core.hpp"
#include "opencv2/core/types_c.h" ///< CV_RGB2GRAY
#include "opencv2/imgproc/imgproc.hpp" ///< cvtColor
#include "opencv2/highgui/highgui.hpp"

int main(int, char **) {
    cv::Mat image = cv::imread("input.png");
    std::cout << "image size: " << image.rows << " " << image.cols << std::endl;
    assert(image.rows > 0);
    assert(image.cols > 0);
    cv::cvtColor(image, image, CV_RGB2GRAY);
    cv::imshow("input", image);

But when I specify CMAKE_BUILD_TYPE=Debug I get the following error:

Starting C:\Users\tagliasa\Developer\htrack\apps\helloworld_opencv-build\helloworld_opencv.exe...
image size: 0 0
Assertion failed: image.rows > 0, file C:\Users\tagliasa\Developer\htrack\apps\helloworld_opencv\main.cpp, line 12
C:\Users\tagliasa\Developer\htrack\apps\helloworld_opencv-build\helloworld_opencv.exe exited with code 3

In other OS's (Mac and Linux) everything works perfectly, but Win8+VS13 is giving me huge headaches.

Do you have any idea what might be causing this problem? Let me know if you need more information to help narrow down the issue.

Thanks for your help!

2014-10-29 05:24:36 -0500 received badge  Necromancer (source)
2014-10-28 09:59:25 -0500 answered a question Per pixel labeling in distanceTransform?

I COMPLETELY agree. Especially as the function doesn't even expose the mapping from the indexes it generates to the pixel coordinates in the source image. The function as it is right now, it's useful for little more than just computing a voronoi (where you don't really care about who was the seed as much as that to identify its watershed).

And now it's 2014 and the opencv website is still down... lol

Anyhow, this will invert your mapping if cannot edit the source

std::vector<cv::Vec2i> label_to_index;
    for (int row = 0; row < background.rows; ++row)
        for (int col = 0; col < background.cols; ++col)
2014-04-28 13:50:42 -0500 received badge  Editor (source)
2014-04-28 13:48:11 -0500 answered a question failed to make opencv.git with gcc48 on macosx mavericks

I have spent half an afternoon fixing this, this is what I got

What I did was using Qt4 from homebrew instead of the native Objective-C COCOA stuff from HighGui. As reported, I had to hack the cmake files in a number of places to have a clean build too.

2014-04-28 07:58:31 -0500 received badge  Critic (source)
2014-04-28 07:47:30 -0500 commented question failed to make opencv.git with gcc48 on macosx mavericks

Same problem for me:

I keep finding mentions about highgui needing to be compiled by "clang":

"You have to compile the CUDA components using GCC 4.5, while compiling the rest of OpenCV with Clang, otherwise you cannot get the HighGui module to work. HighGui will only compile with the Apple installed compilers because it uses Cocoa. If you do not need HighGui, you can compile OpenCV with GCC. You can specify the proper compilers quite easily with cmake."


2013-10-01 12:39:32 -0500 received badge  Supporter (source)