Lines Matching refs:keypoints

68 // takes keypoints and culls them by the response
69 void KeyPointsFilter::retainBest(std::vector<KeyPoint>& keypoints, int n_points)
71 //this is only necessary if the keypoints size is greater than the number of desired points.
72 if( n_points >= 0 && keypoints.size() > (size_t)n_points )
76 keypoints.clear();
79 //first use nth element to partition the keypoints into the best and worst.
80 std::nth_element(keypoints.begin(), keypoints.begin() + n_points, keypoints.end(), KeypointResponseGreater());
82 float ambiguous_response = keypoints[n_points - 1].response;
83 //use std::partition to grab all of the keypoints with the boundary response.
85 std::partition(keypoints.begin() + n_points, keypoints.end(),
87 //resize the keypoints, given this new end point. nth_element and partition reordered the points inplace
88 keypoints.resize(new_end - keypoints.begin());
105 void KeyPointsFilter::runByImageBorder( std::vector<KeyPoint>& keypoints, Size imageSize, int borderSize )
110 keypoints.clear();
112 keypoints.erase( std::remove_if(keypoints.begin(), keypoints.end(),
115 keypoints.end() );
133 void KeyPointsFilter::runByKeypointSize( std::vector<KeyPoint>& keypoints, float minSize, float maxSize )
139 keypoints.erase( std::remove_if(keypoints.begin(), keypoints.end(), SizePredicate(minSize, maxSize)),
140 keypoints.end() );
157 void KeyPointsFilter::runByPixelsMask( std::vector<KeyPoint>& keypoints, const Mat& mask )
162 keypoints.erase(std::remove_if(keypoints.begin(), keypoints.end(), MaskPredicate(mask)), keypoints.end());
192 void KeyPointsFilter::removeDuplicated( std::vector<KeyPoint>& keypoints )
194 int i, j, n = (int)keypoints.size();
200 std::sort(kpidx.begin(), kpidx.end(), KeyPoint_LessThan(keypoints));
203 KeyPoint& kp1 = keypoints[kpidx[i]];
204 KeyPoint& kp2 = keypoints[kpidx[j]];
217 keypoints[j] = keypoints[i];
221 keypoints.resize(j);