gpt4 book ai didi

templates - 指定 ROI 之外的掩码/归零区域

转载 作者:行者123 更新时间:2023-12-02 16:47:36 25 4
gpt4 key购买 nike

我正在使用 OpenCV 进行模板匹配的项目,我想限制图像上的搜索区域。图像是从相机连续捕获的。

有没有办法在定义的 ROI 之外对图像进行归零/屏蔽,以便模板匹配过程可以针对剩余区域更快、更准确?

最佳答案

看看cvSetImageROI功能。

void cvSetImageROI(IplImage* image,
CvRect rect)

Sets an image Region Of Interest (ROI) for a given rectangle. Parameters:

  • image – A pointer to the image header
  • rect – The ROI rectangle

If the original image ROI was NULL and the rect is not the whole image, the ROI structure is allocated.

Most OpenCV functions support the use of ROI and treat the image rectangle as a separate image. For example, all of the pixel coordinates are counted from the top-left (or bottom-left) corner of the ROI, not the original image.

关于templates - 指定 ROI 之外的掩码/归零区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3361916/

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