Ask Your Question

Antares's profile - activity

2020-11-27 08:12:55 -0500 received badge  Popular Question (source)
2018-12-19 05:56:41 -0500 received badge  Popular Question (source)
2017-01-05 13:58:20 -0500 received badge  Student (source)
2017-01-05 07:39:11 -0500 asked a question False memory leaks in MFC

Is there someone who uses OpenCV in the MFC application? I don't believe that I am the only person on the world who is using this combination. I have really annoying problem with false memory leaks. It is impossible to detect any real memory leak because false memory leak report is huge. I tried everything what I found on the internet but nothing works.

I tried:

  • OpenCV 2.4, 3.0, 3.1. 3.2
  • DLL, static libs
  • Delay Loaded Dlls
  • Load MFC maualy before OpenCV Dlls

Nothing works. Still the same result. I'm out of ideas what to try. It is impossible to debug my application with these false memory leaks.

Please, Is there someone who is using Opencv and MFC without problem?

For example:

Code:

   #include <opencv2/core.hpp>
    ...    
    void OCVLeakTestDlg::OnBnClickedButton1()
    {
             cv::Mat m1(100,100,CV_8U);
    }
    ...

Result:

Detected memory leaks!
Dumping objects ->
{84} normal block at 0x003A58A0, 28 bytes long.
 Data: < X:             > D8 58 3A 00 FF FF FF FF 00 00 00 00 00 00 00 00 
{83} normal block at 0x003A5860, 4 bytes long.
 Data: < X: > A0 58 3A 00 
Object dump complete.
The program '[4204] OCVLeakTest.exe' has exited with code 0 (0x0).
2016-12-05 14:01:59 -0500 received badge  Editor (source)
2016-12-05 12:20:35 -0500 asked a question Asymmetric Circles Grid - large images problem

Hi, I'm trying to calibrate a camera with Asymmetric Circles Grid. It works fine but only for very small images like 640x480. I need to calibrate with much bigger images but findCirclesGrid function cannot detect large circles. I found the problem is probably in SimpleBlobDetector settings. When I'm increased maxArea parameter to 50000. It's able to detect some of my source images but only those with ideally rounded circles. Images with perspective deformed circles aren't detected. How I must set other Blob detector parameters? Or the problem is elsewhere?

Example: Detected small image, Not detected large image

Edit: It seems that CALIB_CB_CLUSTERING flag solved my problem.

2016-12-03 04:06:46 -0500 received badge  Enthusiast
2016-12-01 10:52:08 -0500 asked a question Calibrate camera - reprojection error

Hi I'm trying to calibrate a camera for undistort and pose estimation. What is acceptable value of reprojection error? The best value I got is around 3 for 30 source images. When I use more images, like 70 or 100, the reprojection error is more than twice bigger and pose estimation is very inaccurate.

2016-11-04 06:54:36 -0500 commented question Weird memory leaks in MFC

I checked it and both are Multi-threaded Debug (/MTd)

2016-11-04 05:17:33 -0500 asked a question Weird memory leaks in MFC

I have a problem with weird memory leaks. When I create simple MFC Dialog based application and add some Opencv code I get memory leaks warning even the OpenCV code is never executed. (OpenCV 3.1, VS11)

I have added only this:

    #include <opencv2/core.hpp>
    ...    
    void OCVLeakTestDlg::OnBnClickedButton1()
    {
             cv::Mat m1(100,100,CV_8U);
    }
    ...

And the result is:

Detected memory leaks!
Dumping objects ->
{84} normal block at 0x003A58A0, 28 bytes long.
 Data: < X:             > D8 58 3A 00 FF FF FF FF 00 00 00 00 00 00 00 00 
{83} normal block at 0x003A5860, 4 bytes long.
 Data: < X: > A0 58 3A 00 
Object dump complete.
The program '[4204] OCVLeakTest.exe' has exited with code 0 (0x0).

The code inside OnBnClickedButton1 function is never executed but it causing memory leaks. When I remove this code, it's ok without any memory leaks. I tried everything. Shared DLLs, Static libs, but still the same result. Maybe I forgot some settings, because I build OpenCV by myself.

2015-03-22 16:26:35 -0500 asked a question findContours Assertion Failed

Hello, I have really annoying problem with this error:

image description

This error occurs when code return from function where is used function findContours. I tried everything. Only thing that helps is use function imshow right after findContours but it works only when I call my function only once.

This works

void OpenCVTEST::ContoursTest(cv::Mat src)
    {
        cv::vector<cv::vector<cv::Point>> img_contours;
        cv::vector<cv::Vec4i> hierarchy;
        cv::Mat  new_contours_img;

        findContours( src, img_contours, hierarchy, CV_RETR_LIST ,CV_CHAIN_APPROX_NONE, cv::Point(0, 0) );
        cv::imshow("image",src);
    }

This doesn´t work

void OpenCVTEST::ContoursTest(cv::Mat src)
    {
        cv::vector<cv::vector<cv::Point>> img_contours;
        cv::vector<cv::Vec4i> hierarchy;
        cv::Mat  new_contours_img;

        findContours( src, img_contours, hierarchy, CV_RETR_LIST ,CV_CHAIN_APPROX_NONE, cv::Point(0, 0) );
    }

Please help what is wrong.


OpenCV 2.4.10

Visual Studio 2012

Linked libs (vc 11): opencv_core2410d.lib opencv_imgproc2410d.lib opencv_highgui2410d.lib opencv_ml2410d.lib opencv_video2410d.lib opencv_features2d2410d.lib opencv_calib3d2410d.lib opencv_objdetect2410d.lib opencv_contrib2410d.lib opencv_legacy2410d.lib opencv_flann2410d.lib