Ask Your Question

OpenCV Edgeboxes Implementation for C++ is causing assertion failure on running sample program.

asked 2018-03-30 09:24:38 -0500

Ijlal gravatar image

updated 2018-03-31 10:17:36 -0500

I have tried the new OpenCV edge boxes implementation. I ran the edgeboxes_demo program from OpenCV ximgproc samples and it causes the following assertion failure.

OpenCV(3.4.1) Error: Assertion failed ((unsigned)(i1 * DataType<_Tp>::channels) < (unsigned)(size.p[1] * channels())) in cv::Mat::at, file C:\OpenCV\opencv-3.4.1\modules\core\include\opencv2/core/mat.inl.hpp, line 1107

Tried to follow the error and found that it was caused by the prepDataStructsfuntion of the edge boxes class.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-03-30 11:49:31 -0500

LBerger gravatar image

updated 2018-03-30 14:47:06 -0500

Yes there is a problem.

try to change line

for (i = 0; i < n; i++)<int>(0,i) = -1;


for (i = 0; i < n; i++)<int>(i,0) = -1;

issue and PR

edit flag offensive delete link more


This is a valid edit, I have tried it already, but it doesn't solve the problem. The same exception is thrown even after the edit.

Ijlal gravatar imageIjlal ( 2018-03-31 02:15:37 -0500 )edit

you must compileand link opencv_contrib (and may be installed)and run edgeboxes_demo

LBerger gravatar imageLBerger ( 2018-03-31 02:23:09 -0500 )edit

Are you suggesting to recompile and link the contribs after making the change.

Ijlal gravatar imageIjlal ( 2018-03-31 04:52:13 -0500 )edit

Yes it is necessary because file changed is in ximgproc source not in the demo

LBerger gravatar imageLBerger ( 2018-03-31 04:53:31 -0500 )edit

This solves the problem. Thanks

Ijlal gravatar imageIjlal ( 2018-03-31 09:04:07 -0500 )edit

I cannot find that line in your hyperlink. Is it in edgeboxes.cpp?

anop0001 gravatar imageanop0001 ( 2018-08-28 22:11:32 -0500 )edit

Issue is closed now : there is no known bug in Edgeboxes. If you like archeology link is

LBerger gravatar imageLBerger ( 2018-08-29 01:51:44 -0500 )edit

Thank you so much. LBerger!

anop0001 gravatar imageanop0001 ( 2018-08-29 02:02:51 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-03-30 09:24:38 -0500

Seen: 158 times

Last updated: Mar 30 '18