First time here? Check out the FAQ!
answered 2017-07-25 17:52:17 -0600
you need to expand borders of your input image after loading it.
like the line below ( c++ )
copyMakeBorder(img, img, img.cols / 2, img.cols / 2, img.rows / 2, img.rows / 2, BORDER_REPLICATE);