title: Error with Breif , Brisk descriptor opencv
body: <p><strong>I am facing a error while using BREIF descriptor in open cv.
  The error is that BREIF is not able to give descriptor for all the key point. It give descriptor for less number of keypoint than expected.Error I am getting is following</strong>.The error is only using breif descriptor.There is no error using SURF and SURF descriptor</p>
  
  <p>OpenCV Error: Assertion failed (masks[i].rows == queryDescriptorsCount &amp;&amp; masks[i].cols == trainDescCollection[i].rows &amp;&amp; masks[i].type() == CV_8UC1) in checkMasks, file /home/shashank/Desktop/opencv-2.4.5/modules/features2d/src/matchers.cpp, line 259
  terminate called after throwing an instance of 'cv::Exception'
    what():  /home/shashank/Desktop/opencv-2.4.5/modules/features2d/src/matchers.cpp:259: error: (-215) masks[i].rows == queryDescriptorsCount &amp;&amp; masks[i].cols == trainDescCollection[i].rows &amp;&amp; masks[i].type() == CV_8UC1 in function checkMasks</p>
  
  <p>On further enquiry we get<br>
  No of keypoint in previous image 957
  No of keypoint in next image 910
  size of breif descriptor <strong>32X880. It should be  32X957</strong>
  size of breif descriptor <strong>32X847. It should be  32X910</strong>
  <strong>mask [910 x 957]</strong></p>
  
  <p><strong>The code is as follow</strong> </p>
  
  <pre><code>     cv::Ptr&lt;FeatureDetector&gt; detector=new GridAdaptedFeatureDetector(new SurfAdjuster(),keypt,noofbucketinwidth,noofbucketinlength);//surf
  
  
   //cv::Ptr&lt;FeatureDetector&gt; detector=new GridAdaptedFeatureDetector(new FastAdjuster(10,true),keypt,noofbucketinwidth,noofbucketinlength); //FAST
  
       detector-&gt;detect(img,keypointimage);
      cout&lt;&lt;"noof keypoint "&lt;&lt;keypointimage.size()&lt;&lt;endl;
  
  
      //for descriptor
      Mat descriptor;
       Ptr&lt;DescriptorExtractor&gt; extractdetector=DescriptorExtractor::create("SURF");
       Ptr&lt;DescriptorExtractor&gt; extractdetector=DescriptorExtractor::create("BRIEF");   
          extractdetector-&gt;compute( img, detectedpoint, descriptor);    
  
      //for matching
      if(FAST_H_prev.empty())
              FAST_H_prev = Mat::eye(3,3,CV_32FC1);
  
          std::vector&lt;unsigned char&gt; FAST_match_mask;
  
          if(!currentimagekeypoint.empty())
          {
              std::vector&lt;cv::KeyPoint&gt; test_kpts;
              warpKeypoints(FAST_H_prev.inv(), nextimagekeypoint, test_kpts);
  
             cv::Mat FAST_mask = windowedMatchingMask( test_kpts, currentimagekeypoint, 25, 25);
                  matcher-&gt;match(Discriptorofnextimage,Discriptorofcurrentimage, FAST_matches, FAST_mask);
                        matches2points(currentimagekeypoint, nextimagekeypoint, FAST_matches, FAST_train_pts, FAST_query_pts);
              if(FAST_matches.size() &gt; 5)
              {
                  cv::Mat H = findHomography(FAST_train_pts, FAST_query_pts, RANSAC, 4, FAST_match_mask);
                  if(countNonZero(Mat(FAST_match_mask)) &gt; 15)
                      FAST_H_prev = H;
                  else
                      FAST_H_prev = Mat::eye(3,3,CV_32FC1);
                                 drawMatchesRelative(currentimagekeypoint, nextimagekeypoint, FAST_matches, currentimage, FAST_match_mask);
  
              }
          }
      else
      {
          FAST_H_prev = Mat::eye(3,3,CV_32FC1);
      }
  </code></pre>