Ask Your Question

dzywater's profile - activity

2017-10-21 12:28:05 -0600 answered a question Wrong in using solvePnPRansac in opencv 3.3.0.

I am meeting the same problem, version3.3 produces the wrong results, how to solve it?

2015-06-14 10:31:40 -0600 asked a question Exception of BOWKMeansTrainer::cluster()

OpenCV version: 3.0 OS: Windows 7 When using the OpenCV2.4.10, no the exception. void LocateByBOW() {
string parDir=".\..\TestData\"; string subDir[3]={"dog","cat","duck"};

    BOWKMeansTrainer bowTrainer(111);
    Ptr<Feature2D> detector = AKAZE::create(AKAZE::DESCRIPTOR_MLDB, 0, 3, 0.001f, 4, 4, KAZE::DIFF_PM_G2);
    for(int i=0;i<3;i++)
    {
        for(int j=0;j<5;j++)
        {
            string path=parDir+subDir[i]+"\\"+subDir[i]+" ("+NumericToString(j+1,0)+").jpg";
            Mat img= imread(path,0);
            vector<KeyPoint> kpt; 
            Mat dsp; 
            detector->detectAndCompute(img, Mat(), kpt, dsp, false); 
            bowTrainer.add(dsp);
        }
    }                                       
    Mat voc = bowTrainer.cluster();//Here the exception appears.

//Details: Unhandled exception at 0x76E9C41F in Opencv3Pro1.exe: Microsoft C++ exception: cv::Exception at memory location 0x0041ED78.

            .....

}