Ask Your Question

Hongbo Miao's profile - activity

2017-02-05 02:36:36 -0500 received badge  Autobiographer
2014-07-09 01:46:03 -0500 received badge  Guru (source)
2014-07-09 01:46:03 -0500 received badge  Great Answer (source)
2014-02-28 03:52:45 -0500 received badge  Necromancer (source)
2013-04-15 12:46:22 -0500 answered a question opencv 2.4.3 and microsoft visual studio ultimate 2012

Hi, please check this:

http://answers.opencv.org/question/6495/visual-studio-2012-and-rtlfreeheap-error/#6603

If you use old OpenCV 2.43, please skip over the part for OpenCV 2.44.

Good luck.

2013-03-02 19:32:02 -0500 commented answer Visual Studio 2012 and RtlFreeHeap error

Hi, @Aristoi, are you using OpenCV 2.43 or OpenCV 2.44? I think maybe you are using the latest OpenCV 2.44, so you should change the file names in fourth step according to the file folder in OpenCV\build\x64\vc10\lib or OpenCV\build\x64\vc11\lib.

2013-02-18 21:55:08 -0500 received badge  Good Answer (source)
2013-02-18 21:55:08 -0500 received badge  Enlightened (source)
2013-02-05 09:30:38 -0500 commented answer Mat output convertion is not working

You mean after you rebuilding OpenCV, the codes still cannot work? @ccng

2013-02-04 06:04:51 -0500 answered a question Mat output convertion is not working

I think you can try to rebuild your OpenCV.

http://answers.opencv.org/question/6495/visual-studio-2012-and-rtlfreeheap-error/#6603

Before rebuilding OpenCV, I used your codes and I got the similar problem like this.

image description

image description

But after rebuilding OpenCV, all things will work well. The codes can work well.

2013-02-03 08:58:54 -0500 answered a question MSER Sample in OpenCV 2.4.2 on Visual Studio 2012

Hi, I tried your code before rebuilding OpenCV by CMake. I got the same problem.

image description

This is because OpenCV does not work well with Visual Studio 2012, you have to use CMake to rebuild OpenCV. After that the codes work well.

Please follow this tutorial, good luck.

http://answers.opencv.org/question/6495/visual-studio-2012-and-rtlfreeheap-error/#6603

2013-02-03 06:48:31 -0500 commented answer Visual Studio 2012 and RtlFreeHeap error

Hi, @Daniil Osokin, first time I configure my OpenCV according to official tutorial. I used three days to do that, but always has something wrong. I mostly gave up, since the official tutorial is too complex which makes me so upset. So I try to figure it by myself according to other old tutorials online.

And actually if you use VS2010, it is not necessary to use CMake to rebuild OpenCV. Only VS2012 needs this process since OpenCV 2.43 does not work well with VS2012. If you don't rebuild it, many functions will have weird problems. For example, when you use "std::cout" on a "cv::Mat", it always fails.

I think people shouldn't spend their most time configuring OpenCV, they should spend their time on their project. So I try to write a tutorial to make things simple.

2013-02-03 06:21:54 -0500 commented answer Visual Studio 2012 and RtlFreeHeap error

@syco_link, did you use CMake to rebuild OpenCV according to tutorial? It seems that you forgot to add "C:\OpenCV\install\bin" in "Environment Variables -> System variables -> Path".

2013-02-03 06:12:14 -0500 commented answer Visual Studio 2012 and RtlFreeHeap error

Hi, @Nicola17, I really want to help you, but my computer does not have CUDA... So I cannot test it. Sorry about that. Hope you can find answer from other guys.

2013-02-02 05:08:29 -0500 received badge  Supporter (source)
2013-02-02 04:58:23 -0500 received badge  Scholar (source)
2013-02-02 04:50:40 -0500 received badge  Nice Answer (source)
2013-02-01 08:51:38 -0500 commented question Mat output convertion is not working

Hi, which compiler do you use?

2013-02-01 05:53:52 -0500 received badge  Self-Learner (source)
2013-02-01 05:29:48 -0500 answered a question How can I get Back Projection matrix including numbers over 255 or decimal by calcBackProject?

Finally, I wrote my own function to get Back Projection. Hope it can help you who have same problem.

float ReadValueFromHist( const Mat& hist, const int x, const int y ) const
{
    int indexAlpha = int( mat.at< Vec4b >( x, y )[ 3 ] ) * bins / 256;
    return hist.at< float >( indexAlpha, 0 );
}

void CalcBackProj()
{
    backProj = Mat( mat.rows, mat.cols, CV_32FC1);
    for ( int i = 0; i < mat.rows; ++i )
    {
        for ( int j = 0; j < mat.cols; ++j )
        {
            backProj.at< float >( i, j ) = ReadValueFromHist( hist, i, j );
        }
    }
}
2013-02-01 04:55:28 -0500 answered a question New install opencv 2.43 + Microsoft VS express 2012

Hi, it used me a lot of time to make OpenCV 2.43 and VS2012 work well. And so many people have same problem. So I wrote a tutorial about how to use OpenCV 2.43 in Visual Studio 2012 to try to make things simple. Good luck to you. If you still have questions, I'm happy to answer them.

http://answers.opencv.org/question/6495/visual-studio-2012-and-rtlfreeheap-error/#6603

2013-01-31 11:29:34 -0500 answered a question Visual Studio 2012 and RtlFreeHeap error

If you have CUDA, in CMake, before second time clicking Configure button, I think you need set some buttons into checked state. Because my computer doesn't have CUDA...so I'm not very sure how to set up them. Hope it can help you guys who has CUDA.

image description

2013-01-31 11:27:25 -0500 commented answer Visual Studio 2012 and RtlFreeHeap error

If you have CUDA, in CMake, before second time clicking Configure button, I think you need set some buttons into checked state. Since here I cannot add picture, so I added screenshot at the end of page. Because my computer doesn't have CUDA...so I'm not very sure how to set up them. Hope it can help you guys who has CUDA.

2013-01-30 00:00:35 -0500 received badge  Teacher (source)
2013-01-28 19:02:52 -0500 answered a question Visual Studio 2012 and RtlFreeHeap error

Note: This is a tutorial for using OpenCV 2.44 and OpenCV 2.43 in Vsiual Studio 2012. If you use old OpenCV 2.43, please skip over the part for OpenCV 2.44.

Using OpenCV 2.44 in Vsiual Studio 2012


First

Open Windows Explorer. Click on Computer and then System properties.

image description

Choose Advanced system settings.

image description

Click Environment Variables...

image description

Add only this to Environment Variables -> System variables -> Path

C:\OpenCV\build\x64\vc11\bin

image description

image description


Second

After creating your own project in Visual Studio 2012...

Build menu -> Configuration Manager

Change the Active solution platform. Click on Win32, Select New.... Use the settings below and click OK.

image description


Third

For Release:

View -> Property Manager

Double click Release | x64

  1. C/C++ -> General -> Additional Include Directories

C:\OpenCV\build\include\opencv

C:\OpenCV\build\include

  1. Linker -> General -> Additional Library Directories

C:\OpenCV\build\x64\vc11\lib

  • Linker -> Input -> Additional Dependencies

opencv_calib3d244.lib

opencv_contrib244.lib

opencv_core244.lib

opencv_features2d244.lib

opencv_flann244.lib

opencv_gpu244.lib

opencv_haartraining_engine.lib

opencv_highgui244.lib

opencv_imgproc244.lib

opencv_legacy244.lib

opencv_ml244.lib

opencv_nonfree244.lib

opencv_objdetect244.lib

opencv_photo244.lib

opencv_stitching244.lib

opencv_ts244.lib

opencv_video244.lib

opencv_videostab244.lib


For Debug:

View -> Property Manager

Double click Debug | x64

  1. C/C++ -> General -> Additional Include Directories

C:\OpenCV\build\include\opencv

C:\OpenCV\build\include

  1. Linker -> General -> Additional Library Directories

C:\OpenCV\build\x64\vc11\lib

  1. Linker -> Input -> Additional Dependencies

opencv_calib3d244d.lib

opencv_contrib244d.lib

opencv_core244d.lib

opencv_features2d244d.lib

opencv_flann244d.lib

opencv_gpu244d.lib

opencv_haartraining_engined.lib

opencv_highgui244d.lib

opencv_imgproc244d.lib

opencv_legacy244d.lib

opencv_ml244d.lib

opencv_nonfree244d.lib

opencv_objdetect244d.lib

opencv_photo244d.lib

opencv_stitching244d.lib

opencv_ts244d.lib

opencv_video244d.lib

opencv_videostab244d.lib

Note the file names has extra "d" which means debug



Using OpenCV 2.43 in Vsiual Studio 2012


First

Download CMake. Open CMake and use settings below. Then click Configure.

image description

Choose Visual Studio 11 Win64. Click Finish.

image description

After a while, click Configure again. Wait a moment and then click Generate.

Close CMake and go to C:\MyOpenCV, open OpenCV.sln.

Choose Debug.

image description

Right click INSTALL. And choose Build.

image description

After a long period of time, go back and choose Release. Similarly, right click INSTALL. And choose Build.

Close Visual Studio 2012.

Copy C:\MyOpenCV\install folder to C:\OpenCV.

So now you have a C:\OpenCV\install folder. You can delete C:\MyOpenCV whole folder if you want.


Second

Open Windows Explorer. Click on Computer and then System properties.

image description

Choose Advanced system settings.

image description

Click Environment Variables...

image description

Add only this to Environment Variables -> System variables -> Path

C:\OpenCV\install\bin

image description

image description


Third

After creating your own project in Visual Studio 2012...

Build menu -> Configuration Manager

Change the Active solution platform. Click on Win32, Select New.... Use the settings below and click OK.

image description


Fourth

For Release:

View -> Property Manager

Double click Release | x64

  1. C/C++ -> General -> Additional Include Directories

C:\OpenCV\build\include\opencv

C:\OpenCV\build\include

  1. Linker -> General -> Additional Library Directories

C:\OpenCV\build\x64\vc10\lib

  1. Linker -> Input -> Additional Dependencies

opencv_calib3d243.lib

opencv_contrib243.lib

opencv_core243.lib

opencv_features2d243.lib

opencv_flann243.lib

opencv_gpu243.lib

opencv_haartraining_engine.lib

opencv_highgui243.lib

opencv_imgproc243.lib

opencv_legacy243.lib

opencv_ml243.lib

opencv_nonfree243.lib ...

(more)
2013-01-28 18:40:09 -0500 commented answer Visual Studio 2012 and RtlFreeHeap error

Hi, actually, it used me a lot of time to make all things work. So let me give you a simple tutorial.

2013-01-27 20:24:17 -0500 edited answer Visual Studio 2012 and RtlFreeHeap error

Hi, your code works well on my computer. Since OpenCV 2.43 does not work well with Visual Studio 2012, you have to use CMake to rebuild OpenCV 2.43. Have you done it? If you don't know how to rebuild it, tell me.

2013-01-27 11:23:49 -0500 edited question How can I get Back Projection matrix including numbers over 255 or decimal by calcBackProject?

Hi, I need to use calcBackProject and then display the exact number.

    for ( int i = 0; i < backProj.rows; ++i )
    {
        for ( int j = 0; j < backProj.cols; ++j )
        {
            cout << int(backProj.at< uchar >( i, j )) << " ";
        }
        cout << endl;
    }

But its max value is 255 because of "uchar". I tried to use

    Mat backProj( slid_.rows, slid_.cols, CV_64FC1 );

After using calcBackProject, display it

    cout << backProj.at< double >( i, j );

but it does not work.

I really need the exact numbers which are bigger than 255. I don't want to use normalize before. Can I make it by calcBackProject?

If I try to scale it down, can this Back Projection matrix includes decimal? Because I don't want that 0 exists in this matrix.

Thank you.