0

Looking at the basic example for copyMakeBorder(), we have the code:

copyMakeBorder( src, dst, top, bottom, left, right, borderType, value );

Are there any circumstances where the bits in src do not equal the bits in dst(top, left, dst.height - top - bottom, dst.width - left - right), or in other words is the src always unmodified within dst?

I ask because I've inherited some code that adds a border with cv::BORDER_REFLECT + cv::BORDER_ISOLATED but then extracts the src from inside the borders, so I'm suspicious that this is all unnecessary work.

Furthermore, I've used the code here to convince myself that for the current code the src and the centre of the dst are equal, but I'd still like confirmation that my assumptions are correct.

Community
  • 1
  • 1
Ken Y-N
  • 14,644
  • 21
  • 71
  • 114
  • check the size of the image using `img.shape` and compare – Jeru Luke Feb 23 '17 at 04:45
  • 1
    @JeruLuke I can empirically check that way, but I'd like to know for sure. The documentation is not clear on exactly what happens. – Ken Y-N Feb 23 '17 at 04:56
  • No, the values in the original image are never altered. You can check [the soruce code](https://github.com/opencv/opencv/blob/master/modules/core/src/copy.cpp#L1190) to convince yourself – Miki Feb 23 '17 at 11:37

0 Answers0