OpenCV 中的 getRectSubPix 和 borderInterpolate
getRectSubPix and borderInterpolate in OpenCV
OpenCVs getRectSubPix() 函数的文档:
C++: void getRectSubPix(InputArray image, Size patchSize,
Point2f center, OutputArray patch, int patchType=-1 )
包含语句:
While the center of the rectangle must be inside the image,
parts of the rectangle may be outside. In this case,
the replication border mode (see borderInterpolate() )
is used to extrapolate the pixel values outside of the image.
但我看不到在 getRectSubPix 中设置 borderInterpolate 模式的方法。许多其他 OpenCV 函数(boxFilter, copyMakeBorder,...)允许您传入 borderInterpolate 枚举,但不允许传入 getRectSubPix。
这只是文档错误吗?
声明“复制边界模式(参见borderInterpolate())用于外推像素值”,明确指出它使用称为 BORDER_REPLICATE
的预定义模式来估计图像边界外的像素,您不能使用其他边界方法,如 BORDER_REFLECT
、BORDER_WRAP
、BORDER_CONSTANT
等。
OpenCVs getRectSubPix() 函数的文档:
C++: void getRectSubPix(InputArray image, Size patchSize,
Point2f center, OutputArray patch, int patchType=-1 )
包含语句:
While the center of the rectangle must be inside the image, parts of the rectangle may be outside. In this case, the replication border mode (see borderInterpolate() ) is used to extrapolate the pixel values outside of the image.
但我看不到在 getRectSubPix 中设置 borderInterpolate 模式的方法。许多其他 OpenCV 函数(boxFilter, copyMakeBorder,...)允许您传入 borderInterpolate 枚举,但不允许传入 getRectSubPix。
这只是文档错误吗?
声明“复制边界模式(参见borderInterpolate())用于外推像素值”,明确指出它使用称为 BORDER_REPLICATE
的预定义模式来估计图像边界外的像素,您不能使用其他边界方法,如 BORDER_REFLECT
、BORDER_WRAP
、BORDER_CONSTANT
等。