It seems that cv::Filter engine ignores the horizontal coordinate of the srcROI, as demonstrated by the following code:
typedef float _Tp;
cv::Mat_<_Tp> mat = ... // Read some image here as float
// Create a filter engine:
cv::Ptr<cv::FilterEngine> engine =
createLinearFilter(cv::DataType<_Tp>::type,
cv::DataType<_Tp>::type,
_filter,
cv::Point(-1,-1),
0,
cv::BORDER_CONSTANT, cv::BORDER_CONSTANT,
cv::Scalar(0,0,0,0));
// Create a srcROI for the right half of the image:
cv::Rect srcRoi = cv::Rect(src.cols/2, 0, src.rows, src.cols);
cv::Point dstOfs = cv::Point(src.cols/2, 0);
static const bool isolated = false;
engine->apply(_src, _dst, srcRoi, dstOfs, isolated);
Am I missing something?
Can someone please guide me how to workaround or fix this problem?