Ask Your Question

Cross22's profile - activity

2018-11-15 02:06:08 -0600 received badge  Popular Question (source)
2015-12-13 01:24:35 -0600 asked a question Fisheye support in Java / Android ?

I see support for the fisheye undistort methods in C++ but not in OpenCV Java. Is this really missing or is there an add-on module for it anywhere?

2014-09-24 23:15:14 -0600 commented question Crash when deallocating HoughLines (OCV2.4.9)

Not sure what the concern is. Using the same Mat as input & output could be an issue, but why should dereferencing an object pointer be causing problems?

2014-09-22 05:49:02 -0600 received badge  Teacher (source)
2014-09-21 21:21:09 -0600 received badge  Scholar (source)
2014-09-21 21:21:00 -0600 commented answer Crash when deallocating HoughLines (OCV2.4.9)

There are a couple of questions on answers.opencv.org regarding DbgHeap assertions that look very similar. I do think that the OutputArray code makes some assumptions about the std::vector memory layout that are not true for Visual Studio's STL. The Debug lib asserts because the heap guards have been modified and the Release build just crashes. Since I want to get something going within the next 24h I ended up passing in a Mat instead of an std::vector and that is working fine.

2014-09-21 20:36:29 -0600 commented answer Crash when deallocating HoughLines (OCV2.4.9)

Thank you very much! I ended up recompiling the 2.4.9 source with VS2013 in various configurations, but the crash persists. Looking at the implementation I am very suspicious of the cvCvtSeqToArray() function which performs some pointer magic, treating my passed in std::vector<Vec4i> as a uchar*. I will try passing in a Mat as output instead.

2014-09-21 16:00:43 -0600 received badge  Supporter (source)
2014-09-21 15:49:21 -0600 answered a question how to resolves this ??? have installed visual studio c++ 2010 and opencv 2.4.9

It's a bug in Visual Studio 2010 that I just ran into. Disabling incremental linking did not resolve it. After installing the VS 2010 SP1 update the linker worked.

2014-09-21 15:45:07 -0600 commented question HoughLines Debug Assertion Failed

Does it assert when lines goes out of scope?

Try moving the vector<vec2f> lines; declaration and HoughLines call into its own scope/function and see where the assertion happens.

2014-09-21 15:44:32 -0600 answered a question HoughLines Debug Assertion Failed

Does it assert when lines goes out of scope?

Try moving the vector<vec2f> lines; declaration and HoughLines call into its own scope/function and see where the assertion happens.

2014-09-21 15:29:49 -0600 asked a question Crash when deallocating HoughLines (OCV2.4.9)

I am consistently seeing a crash after calling HoughLines or HoughLinesP. Oddly enough the crash is not happening inside those functions, but whenever the lines vector is being deallocated. (Moving the lines vector to global scope means the crash will happen later.) If I just push my own Vec4i items into the vector it works. If I do not call HoughLines/P it works too. But with HoughLines/P I get a crash / dbgheap error on Windows (using Visual Studio 2010/2013).

What might be causing this ?

// discard color
cvtColor(*pImg, *pImg, CV_RGBA2GRAY);
// turn into black/white with threshold
Rect bounds(100,100,400,400);
Mat center(*pImg, bounds);
threshold(center, center, 80, 255, THRESH_BINARY);
Canny(center, center, 50, 200, 3);
{
    std::vector<cv::Vec4i> lines;
    if (!pImg->empty()) {       
        const int MIN_LENGTH = 180;
        HoughLinesP(center, lines, 1, CV_PI / 180,
            80, MIN_LENGTH, 30);
    }
    // Still okay..
}
// This is where things go bad..