Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- features the_features;
- the_extractor->extract_features(padded_image, padded_polygon, the_features);
- BOOST_LOG_TRIVIAL(trace) << "features rows: " << the_features.m_descriptors.rows << " keypoints: " << the_features.m_keypoints.size();
- #if 0
- std::vector<bool> passed(the_features.m_keypoints.size(), false);
- int count = 0;
- #endif
- boost::geometry::model::linestring<ez::point> linestring;
- std::copy(padded_polygon.outer().begin(), padded_polygon.outer().end(), std::back_inserter(linestring));
- linestring.push_back(padded_polygon.outer()[0]);
- features the_filtered_features;
- the_filtered_features.m_type = the_features.m_type;
- for (size_t index = 0; index < the_features.m_keypoints.size(); ++index)
- {
- ez::point p(the_features.m_keypoints[index].pt.x, the_features.m_keypoints[index].pt.y);
- if (boost::geometry::distance(p, linestring) > ((float)the_features.m_keypoints[index].size / 2.0f))
- {
- the_filtered_features.m_descriptors.push_back(the_features.m_descriptors.row((int)index));
- the_filtered_features.m_keypoints.push_back(the_features.m_keypoints[index]);
- }
- }
- the_filtered_features.m_descriptors.reshape(0, the_features.m_descriptors.cols);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement