Had a demo that used to work --- now it no longer works CV4.1.0 Issue

asked 2019-05-05 22:20:00 -0500

paulz gravatar image

updated 2019-05-06 08:26:31 -0500

All I can say is this thing worked forever. I believe I updated OpenCV and now it doesn't work and I get this error message. Any ideas?

(gurus) guru@pyimagesearch-gurus:~/Desktop/PZDemos/PZ Car Logo Finder - Guru$ python PZ-recognize_car_logos.py --train car_logos/ --test test_images/
[INFO] extracting features...
Traceback (most recent call last):
  File "PZ-recognize_car_logos.py", line 265, in <module>
    c = max(cnts, key=cv2.contourArea)
cv2.error: OpenCV(4.1.0) /io/opencv/modules/imgproc/src/shapedescr.cpp:274: error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function 'contourArea'
edit retag flag offensive close merge delete

Comments

i removed your screenshot (those are entirely useless here).

please EDIT your question, and add code / errors as TEXT, so ppl can quote you, it can be indexed for search, etc. -- thank you.

berak gravatar imageberak ( 2019-05-06 02:39:56 -0500 )edit
1

^^^ Fixed - sorry - first time caller :)

paulz gravatar imagepaulz ( 2019-05-06 08:25:54 -0500 )edit

^^^ yea, thanks a lot ;)

so, it did not find any contours. and you're accessing an empty / invalid array. but why ? how would we know, without seing code / data ?

berak gravatar imageberak ( 2019-05-06 08:29:42 -0500 )edit

^^^ It's rather large -- should I send a block of it or all of it ... (sorry I am not difficult just new ...)

paulz gravatar imagepaulz ( 2019-05-06 08:34:09 -0500 )edit