filter2D and sepFilter2D, specifying the value for a constant border
When calling filter2D and sepFilter2D, I want to use a constant border, which I do by providing BORDER_CONSTANT for the "borderType" parameter as specified in the documentation (http://docs.opencv.org/modules/imgproc/doc/filtering.html?highlight=gaussianblur#filter2d).
However, I do not see how I can specify WHAT I want that constant value to be. How do I achieve this?
(edit: I did find that the default constant border value seems to be 0.)
(edit in reply to Alexander, I do not see how to reply directly to answers: If I am not mistaken, copyMakeBorder will allocate a new image and copy the input image to a subregion of that new image. That seems a little excessive just to get access to the the ability to have non-zero constant border interpolation methods. Is there any other way to change the constant border value that does not require such memory allocations and copies?)
Please use links to docs.opencv.org, because opencv.itseez.com may be shut down at some point...
The source for filter2D does a copyMakeBorder anyway, perhaps this is cheaper than doing a range check on every iteration as that would introduce branches? (i.e. If inside use the pixel value else use a constant value) https://github.com/Itseez/opencv/blob/5f590ebed084a5002c9013e11c519dcb139d47e9/modules/ts/src/ts_func.cpp#L787