Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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://opencv.itseez.com/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?

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://opencv.itseez.com/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.)

click to hide/show revision 3
Updated the link to go to docs.opencv.org

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://opencv.itseez.com/modules/imgproc/doc/filtering.html?highlight=gaussianblur#filter2d).(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.)

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