How to use ROI


I’m trying to use nppiResizeSqrPixel_8u_C1R to select a certain range of source image and out put it to destination image with resize operation.

I thought the parameter oSrcROI should be the area I try to select(by x, y, width and height) and the oDstROI should be (0, 0, dstWidth, dstHeight).

But it seems not work well with the x, y i specified in oSrcROI. Am I wrong with nppiResizeSqrPixel_8u_C1R and ROI? should i separate to two operations for copy then resize?

Any suggestion is appreciated.