Ask Your Question

nawara's profile - activity

2016-05-30 04:00:26 -0500 received badge  Enthusiast
2016-05-21 02:52:19 -0500 asked a question LSH matching save and load

Hi;

I'm using LSH for binary descriptor matching In order to save the processing time ; I would to perform the training step at once and save the index in a file for the next query.

How can do that ? Should I use the save/load of the FlannBasedMatcher class ? How ?

cv::Ptr<cv::flann::indexparams> indexParams = new cv::flann::LshIndexParams(20, 10, 2); FlannBasedMatcher matcher(indexParams);

2016-04-21 03:28:16 -0500 received badge  Supporter (source)
2016-04-20 15:12:56 -0500 asked a question Error matching ORB descriptors with LSH

I try to match orb descriptors with FlannDescriptorMatcher && LSH indexing
The following is my code

  Ptr<ORB> orb =ORB::create();

  //--FEATure extraction & MATCHING

     DescriptorMatcher* m_matcherPtr;

     Ptr<cv::flann::IndexParams> indexParams = new cv::flann::LshIndexParams(8, 30, 2);


    m_matcherPtr =(new FlannBasedMatcher(indexParams));


   for (size_t i = 0; i < queriesnames.size(); i++) {

          image_1 = imread(queriespath[i], CV_LOAD_IMAGE_GRAYSCALE);

          orb->detect(image_1,keypoints_r);

          orb->compute(image_1,keypoints_r,descriptors_r);

          m_matcherPtr->add(descriptors_r);
      }

   m_matcherPtr->train();

   image_1=imread(imgName_1,CV_LOAD_IMAGE_GRAYSCALE);

   orb->detect(image_1,keypoints_1);
   orb->compute(image_1,keypoints_1,descriptors_1);

   image_2=imread(imgName_2,CV_LOAD_IMAGE_GRAYSCALE);

   orb->detect(image_2,keypoints_2);

   orb->compute(image_2,keypoints_2,descriptors_2);


       vector<vector<DMatch> > matches;

   vector< DMatch > good_matches;

   vector<Mat> traindescriptors=m_matcherPtr->getTrainDescriptors();

       m_matcherPtr->knnMatch(descriptors_1,descriptors_2,matches,2);


   size_t num =matches.size();

   for(size_t i = 0; i < num; i++ )

   {

       if(matches[i][0].distance < 0.9*matches[i][1].distance){
              good_matches.push_back(matches[i][0]);
           }

   }


        //-- Draw only "good" matches
           Mat img_matches;
            drawMatches( image_1, keypoints_1, image_2, keypoints_2,
                      good_matches, out_img);

            //-- Show detected matches
            imshow( "Good Matches", out_img );


            waitKey(0);

However, I get the following error message (when debugging)

        Program received signal SIGSEGV, Segmentation fault.
        0x0806604e in main (argc=3, argv=0xbfffeed4) at ../src/main.cpp:314
           if(matches[i][0].distance < 0.9*matches[i][1].distance){
2016-02-10 05:42:55 -0500 asked a question descriptor evaluation opencv 3

How to evaluate features descriptors using opencv 3 . The sample file detector_descriptor_evaluation.cpp is removed

2014-06-14 01:03:21 -0500 received badge  Student (source)
2013-11-24 05:09:52 -0500 asked a question Developping a java Bag of words implemetation using JNI

I would to develop a Java program that extrat bag of visual word from a given image Opencv supports desktop java but the object categorisation classesare not implemented yet . So I need to call my C++ code that use BOWKMeansTrainer and BOWImgDescriptorExtractor classes from java program using JNI is that possible ?

2013-10-09 05:21:59 -0500 received badge  Editor (source)
2013-10-09 05:14:51 -0500 asked a question Implementation of BoVW model in openCV4Android

I'm developing an android app that extract bags of visuals word from any captured photo I'm a java developer and I'm not experimented in C++ and OpenCV
After reading all opencv4android tutorials and the java API , I didn't found how to implement the BoVW model in android

Does the opencv4android have all the original opencv functionalities? Or should I use the native BovW implementation like this tutorial within my android app ?

There is a diffrenece betwenn the usage of OpenCV as an android library and the usage of openCV as a native part ?