我正在研究OpenCV 4的ROS旋律。在undistort()之后,图像有一个由冲浪检测到的黑色背景。我怎么才能解决这个问题?

发布于 2021-12-15 10:32:16
由于米卡的评论,我找到了解决办法。我在低比率测试中过滤了特征:
//-- Filter matches using the Lowe's ratio test
//Default ratio_thresh: 0.7f;
vector<DMatch> matches;
size_t i = 0;
bool lowe_condition = false;
bool black_background_condition = false;
//Filter matches in black background
for (i; i < knn_matches.size(); i++)
{
lowe_condition = (knn_matches[i][0].distance < ratio_thresh * knn_matches[i][1].distance);
black_background_condition = ((keypoints1[i].pt.x >= width_low ) && (keypoints1[i].pt.x <= width_high)) && ((keypoints1[i].pt.y >= height_low ) && (keypoints1[i].pt.y <= height_high));
if (lowe_condition && black_background_condition)
{
matches.push_back(knn_matches[i][0]);
}
}https://stackoverflow.com/questions/70201258
复制相似问题