Bug in cv::FilterEngine ?

asked 2013-02-18 15:30:40 -0600

Ben-Uri gravatar image

updated 2013-02-18 15:31:56 -0600

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 to a matrix of floats

// 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?

edit retag flag offensive close merge delete