Assertion failed on picture size (31 px, #), cv2.canny in opencv 3.1

asked 2016-08-08 12:43:20 -0600

updated 2018-10-17 15:54:50 -0600

System:

  • opencv 3.1
  • mint 17.2
  • python 2.7.6
  • pycharm 2016.2 prof
  • ipython 5.0

Error message taken from ipython:

OpenCV Error: Assertion failed (0 <= _rowRange.start && _rowRange.start <= _rowRange.end && _rowRange.end <= m.rows) in Mat, file /home/georg/ocv31/modules/core/src/matrix.cpp, line 477 terminate called after throwing an instance of 'cv::Exception' what(): /home/georg/ocv31/modules/core/src/matrix.cpp:477: error: (-215) 0 <= _rowRange.start && _rowRange.start <= _rowRange.end && _rowRange.end <= m.rows in function Mat

Warning: Program '/usr/local/bin/ipython' crashed.

In [1]: import cv2

In [2]: import numpy as np

In [3]: a = np.zeros((31,20), np.uint8)

In [4]: b = cv2.Canny(a, 60, 300, L2gradient=True)

After this lines, ipython crashes with the messages above. It will not crash after setting L2gradient to False, or if changing the shape (e.g. 30,20).

The same happens with pycharm.

I have not had this message with opencv 3.0.

Can somebody help me?

09.08.2016: Now I have installed ocv 2.4.13. Everything is working well.

BTW: The Message Corrupt JPEG data: 2 extraneous bytes before marker 0x# during reading the video frames, is also disappeared (Logitech c270).

edit retag flag offensive close merge delete

Comments

hmm, can't reproduce it. (win10/opencv3.1/python2.7)

berak gravatar imageberak ( 2016-08-11 03:49:20 -0600 )edit

@berak I have already contact with alalek. I'll make a complete new installation on weekend and report my steps.

SchneiderGeorg gravatar imageSchneiderGeorg ( 2016-08-12 03:37:02 -0600 )edit

yes, i've seen it. (just did not want to add another comment there)

berak gravatar imageberak ( 2016-08-12 03:40:44 -0600 )edit