gpt4 book ai didi

opencv - 如何在 openCV 的 matchTemplate() 中处理边界像素?

转载 作者:太空宇宙 更新时间:2023-11-03 22:32:22 25 4
gpt4 key购买 nike

我正在尝试在两个图像之间建立相关性(较小的图像与较大的图像)。 openCv 中的边界处理是如何进行的?

cv::matchTemplate(webcamImageReceived,templateImage,resultImage,CV_TM_CCORR_NORMED);

最佳答案

模板永远不会跨越图像边界,并且结果图像的大小会减小模板大小(每个图像边的模板大小减半)。

看这里:http://docs.opencv.org/doc/tutorials/imgproc/histograms/template_matching/template_matching.html

(看看:

  /// Create the result matrix
int result_cols = img.cols - templ.cols + 1;
int result_rows = img.rows - templ.rows + 1;

)

关于opencv - 如何在 openCV 的 matchTemplate() 中处理边界像素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20172659/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com