Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I answer myself, this works:

int dx = ((1 << levels) - width % (1 << levels)) % (1 << levels);
int dy = ((1 << levels) - height % (1 << levels)) % (1 << levels);

border_top = dy;
border_left = dx;
border_bottom = 0;
border_right = 0;

cv::copyMakeBorder(in1g, img_with_border1, border_top, border_bottom, border_left, border_right, BORDER_REFLECT);

I answer myself, this works:

int dx = ((1 << levels) - width % (1 << levels)) % (1 << levels);
int dy = ((1 << levels) - height % (1 << levels)) % (1 << levels);

border_top = dy;
border_left = dx;
border_bottom = 0;
border_right = 0;

cv::copyMakeBorder(in1g, cv::copyMakeBorder(img, img_with_border1, border_top, border_bottom, border_left, border_right, BORDER_REFLECT);