I will just ignore all that code you posted and recommend that you use warpAffine()
with a suitable transformation matrix, and the WARP_INVERSE_MAP
flag, so the matrix directly describes the calculation from destination coordinate to source coordinate.
afaik, INTER_AREA only works for resize()
, not for any of the warps
if you need a lowpass, do the lowpass explicitly.
or use pyrDown()