Ask Your Question

Neha Mittal's profile - activity

2015-04-02 08:07:21 -0600 commented question Assertion fails in buildScalePyramids

I found that it is crashing in gpu/src/orb.cpp function: buildScalePyramids()

Rect inner(edgeThreshold_, edgeThreshold_, sz.width - 2 * edgeThreshold_, sz.height - 2 * edgeThreshold_);
buf_(inner).setTo(Scalar::all(255));

This because the dimension of the Rect inner has a negative height. I am unable to understand the significance of this setTo() when compared to the regular orb code. Looks like different things are happening in both the codes.

2015-04-01 01:28:15 -0600 commented question Assertion fails in buildScalePyramids

I just tried, did not solve the issue. Here is the exact error:

OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows) in GpuMat, file /home/ec2-user/opencv-2.4.10/modules/core/src/gpumat.cpp, line 413
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/ec2-user/opencv-2.4.10/modules/core/src/gpumat.cpp:413: error: (-215) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function GpuMat
2015-03-31 06:55:37 -0600 commented question Assertion fails in buildScalePyramids

This is what I had tried.

cv::gpu::GpuMat fullmask(image.size(), CV_8U, 0xFF);
orb(image, fullmask, orbKeypoints);

Did you also check the difference in the code for buildScalePyramids()?

2015-03-31 04:18:04 -0600 commented question Assertion fails in buildScalePyramids

I have tried that. Did not work. If you notice the ORB code without GPU, looks like they are creating a border around the image. Nothing like this is being done in the GPU code. Any idea why?

2015-03-31 03:31:07 -0600 commented question Assertion fails in buildScalePyramids

I have posted the code as part of my original question.

2015-03-31 03:30:13 -0600 received badge  Editor (source)
2015-03-31 01:54:26 -0600 asked a question Assertion fails in buildScalePyramids

I am currently using OpenCV 2.4.10 I had ORB working for feature extraction and matching. I am working on porting it to an AWS with GPU. I was finally able to build openCV and all but am now getting an assertion failure. From the call stack the only thing I figured out is that ORB_CUDA::buildScalePyramids() is calling GpuMat::GpuMat(const GpuMat& m, Rect roi) and the assertion in this function is failing.

CV_Assert(0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows);

I also noticed that there is some difference in the code for building the scale pyramid in the regular orb.cpp compared to the one in gpu.

Edit 1: I am not creating any GpuMat or roi. That code is internal to the ORB implementation. I only have a Mat img; which is a valid image and I have checked that the dimensions of this image are valid. My code is Function:_getRawORBKeypoints()

gpu::GpuMat image;
Mat outImage;
gpu::ORB_GPU orb(nFeat, 1.2f, 20, 10, 0, 3, ORB::HARRIS_SCORE, 10 );
image.upload(img);
orb(image, gpu::GpuMat(), orbKeypoints, orbDescriptors);

Edit 2 The callstack :

#0  0x00007fffdbf725c9 in raise () from /lib64/libc.so.6
#1  0x00007fffdbf73cd8 in abort () from /lib64/libc.so.6
#2  0x00007fffdc876535 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib64/libstdc++.so.6
#3  0x00007fffdc8746c6 in ?? () from /usr/lib64/libstdc++.so.6
#4  0x00007fffdc8746f3 in std::terminate() () from /usr/lib64/libstdc++.so.6
#5  0x00007fffdc87491f in __cxa_throw () from /usr/lib64/libstdc++.so.6
#6  0x00007ffff722f5a0 in cv::error(cv::Exception const&) () from /usr/local/lib/libopencv_core.so.2.4
#7  0x00007ffff72cf62c in cv::gpu::GpuMat::GpuMat(cv::gpu::GpuMat const&, cv::Rect_<int>) () from /usr/local/lib/libopencv_core.so.2.4
#8  0x00007fffdd28d97a in cv::gpu::ORB_GPU::buildScalePyramids(cv::gpu::GpuMat const&, cv::gpu::GpuMat const&) () from /usr/local/lib/libopencv_gpu.so.2.4
#9  0x00007fffdd28e072 in cv::gpu::ORB_GPU::operator()(cv::gpu::GpuMat const&, cv::gpu::GpuMat const&, cv::gpu::GpuMat&, cv::gpu::GpuMat&) ()  from /usr/local/lib/libopencv_gpu.so.2.4
#10 0x00007fffdd28e789 in cv::gpu::ORB_GPU::operator()(cv::gpu::GpuMat const&, cv::gpu::GpuMat const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::gpu::GpuMat&) () from /usr/local/lib/libopencv_gpu.so.2.4
#11 0x000000000040650e in _getRawORBKeypoints(cv::Mat, int, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::gpu::GpuMat&, bool)    ()