Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cuda::remap - illegal memory access #2712

Open
4 tasks done
gyzcode opened this issue Oct 15, 2020 · 1 comment
Open
4 tasks done

cuda::remap - illegal memory access #2712

gyzcode opened this issue Oct 15, 2020 · 1 comment

Comments

@gyzcode
Copy link

gyzcode commented Oct 15, 2020

System information (version)
  • OpenCV => 4.4.0
  • Operating System / Platform => Windows 64 Bit / ubuntu 18.04 amd64
  • Compiler => Visual Studio 2019 / gcc 7.5.0
Detailed description

For some specific data, the cpu version remap works fine, but the cuda version remap can not work. The error message is as follows:
OpenCV(4.4.0) Error: Gpu API call (an illegal memory access was encountered) in cv::cuda::device::imgproc::RemapDispatcherNonStream<Filter, B, T>::call, file D:/programming/ opencv_contrib-4.4.0/modules/cudawarping/src/cuda/remap.cu, line 107

Steps to reproduce

map data to reproduce:map.zip

// C++ code example

#include <opencv2/opencv.hpp>
#include <opencv2/cudawarping.hpp>

using namespace cv;
using namespace cv::cuda;

int main(int argc, const char** argv)
{
	FileStorage fs("D:/map.yml", FileStorage::READ);
	Mat map1, map2;
	fs["map1"] >> map1;
	fs["map2"] >> map2;
	fs.release();

	Mat src, dst;
	src = Mat(640, 640, CV_8UC3, Scalar(255,255,255));
	cv::remap(src, dst, map1, map2, INTER_LINEAR);

	imshow("dst", dst);
	waitKey();

	GpuMat gsrc, gdst, gmap1, gmap2;
	gmap1.upload(map1);
	gmap2.upload(map2);
	gsrc.upload(src);
	cuda::remap(gsrc, gdst, gmap1, gmap2, INTER_LINEAR);
	gdst.download(dst);

	imshow("gdst", dst);
	waitKey();

	return 0;
}
Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    answers.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc
@alalek
Copy link
Member

alalek commented Oct 15, 2020

Looks like a duplicate of #2361

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants