Hi, I am try ing to use nppiWarpPerspectiveBatch_8U_C3R ,but stumbled on the understanding of the parameters.
Background: I want to warp the face in the image ,previously I use opencv warpPerspective --pass the original image ,the transform matrix( computed manually ) and desired size of output image , then result is ok .
cv2::void warpPerspective( InputArray src, OutputArray dst, InputArray M, Size dsize)
but when use nppi
typedef struct
{
- const void * pSrc; /* device memory pointer /
- int nSrcStep;*
- void * pDst; /* device memory pointer /
- int nDstStep;*
- Npp64f * pCoeffs; /* device memory pointer to the tranformation matrix with double precision floating-point coefficient values to be used for this image /
- Npp64f aTransformedCoeffs[3][3]; /* FOR INTERNAL USE, DO NOT INITIALIZE /
} NppiWarpPerspectiveBatchCXR;
nSrcStep is src_img_width * 3
as the demanded size for output image is 112 * 112 , so nDstStep is 112 * 3
and pCoeffs is the manually calclated transfrom matrix
nppiWarpPerspectiveBatch_8u_C3R(NppiSize oSmallestSrcSize, NppiRect oSrcRectROI, NppiRect oDstRectROI, int eInterpolation, NppiWarpPerspectiveBatchCXR * pBatchList, unsigned int nBatchSize)
the oSrcRectROI is (0,0, src_img.width ,src_img.height)
the oDstRectROI is the size of output image (0,0,112,112)
but the final result is wrong , the output image contains all zero values.
I think maybe the ROI parameter is used incorrectly . As I assumed ,the src ROI should be the face region in the image ,not the whole picture
Thanks a lot