OpenCV:在顶部和底部配置中绘制匹配项?

标签 opencv image-processing computer-vision feature-detection

我正在尝试在 OpenCV 中使用 drawmatches 函数。

它以左右格式放置图像。我希望图像以 top-down 格式放置,然后绘制火柴以更加清晰。

有什么方法可以在 OpenCV 中完成吗?或者,我将不得不编写一个新函数?

最佳答案

恐怕您必须编写自己的函数。我觉得应该不会太复杂。

作为起点,看看https://github.com/Itseez/opencv/blob/2.4/modules/features2d/src/draw.cpp我们有函数 _prepareImgAndDrawKeypoints

static void _prepareImgAndDrawKeypoints( const Mat& img1, const vector<KeyPoint>& keypoints1,
                                         const Mat& img2, const vector<KeyPoint>& keypoints2,
                                         Mat& outImg, Mat& outImg1, Mat& outImg2,
                                         const Scalar& singlePointColor, int flags )
{
    Size size( img1.cols + img2.cols, MAX(img1.rows, img2.rows) );

例如尺寸应该改为

Size size( MAX(img1.cols + img2.cols), img1.rows + img2.rows );

然后您可以继续研究该函数(以及其他函数)并完成您的任务。也许您也可以通过您的新功能为 OpenCV 做出贡献。

关于OpenCV:在顶部和底部配置中绘制匹配项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20358217/

相关文章:

c++ - 使用 Opencv 分布良好的特征

computer-vision - Video-streaming Stopped 在 YOLOV3 模型中使用视频时显示 google colab

c++ - 在 opencv 中为任何随机棋盘查找棋盘点(模式大小未知)

c++ - 单 channel 平均值

python - OpenCV 中的图像序列到视频

php - PHP 中的动态图像生成

c++ - OpenCV predict() 与 detectMultiScale()

c# - 连通分量标记算法优化

python - 使用 Opencv python 查找灰度或彩色图像

visual-studio - OpenCV 和 Microsoft Visual Studio 2012(适用于 x64)