void RBriefDescriptorExtractor::computeImpl(const Mat& image, std::vector<KeyPoint>& keypoints, Mat& descriptors) const { // Construct integral image for fast smoothing (box filter) Mat sum; integral(image, sum, CV_32S); //Remove keypoints very close to the border double border = sqrt(2)*PATCH_SIZE/2 + KERNEL_SIZE/2; int _border = ceil(border); removeBorderKeypoints(keypoints, image.size(), _border); descriptors = Mat::zeros(keypoints.size(), bytes_, CV_8U); test_fn_(sum, keypoints, descriptors, patternRot); }
void BriefDescriptorExtractor::computeImpl(const Mat& image, std::vector<KeyPoint>& keypoints, Mat& descriptors) const { // Construct integral image for fast smoothing (box filter) Mat sum; Mat grayImage = image; if( image.type() != CV_8U ) cvtColor( image, grayImage, CV_BGR2GRAY ); ///TODO allow the user to pass in a precomputed integral image //if(image.type() == CV_32S) // sum = image; //else integral( grayImage, sum, CV_32S); //Remove keypoints very close to the border KeyPointsFilter::runByImageBorder(keypoints, image.size(), PATCH_SIZE/2 + KERNEL_SIZE/2); descriptors = Mat::zeros((int)keypoints.size(), bytes_, CV_8U); test_fn_(sum, keypoints, descriptors); }