Hi,
When I run an nppi resize (nppiResize_8u_C3R) function, setting an source image size to a very small number (eg, 1x1 px, 2x2 px) returns an NPP_RESIZE_NO_OPERATION_ERROR. However, the same code will work with images of larger sizes. Why does this happen?
cv::Mat image = cv::imread("pur.png");
int outheight = 10;
int outwidth = 10;
int outSize = outwidth * outheight * sizeof(uchar3);
int inheight = image.rows;
int inwidth = image.cols;
int memSize = inwidth * inheight * sizeof(uchar3);
NppiSize srcsize = {inwidth, inheight};
NppiRect srcroi = {0, 0, inwidth, inheight};
NppiSize dstsize = {outwidth, outheight};
NppiRect dstroi = {0, 0, outwidth, outheight};
uchar3* d_src = NULL;
uchar3* d_dst = NULL;
cudaMalloc((void**)&d_src, memSize);
cudaMalloc((void**)&d_dst, outSize);
cudaMemcpy(d_src, image.data, memSize, cudaMemcpyHostToDevice);
NppStatus status = nppiResize_8u_C3R( (Npp8u*) d_src, inwidth*3, srcsize, srcroi,
(Npp8u*) d_dst, outwidth*3, dstsize, dstroi,
NPPI_INTER_LINEAR);
cv::Mat newImage(outheight, outwidth, CV_8UC3);
cudaMemcpy(newImage.data, d_dst, outSize, cudaMemcpyDeviceToHost);
cv::imwrite("qqqgpu.jpg", newImage);
cudaFree(d_src);
cudaFree(d_dst);