0

I am currently building an Automatic licence plate recongition system. I am referring to this page

http://nbviewer.jupyter.org/gist/kislayabhi/89b985e5b78a6f56029a

In this code, two paramters namely "CV_FLOODFILL_FIXED_RANGE and CV_FLOODFILL_MASK_ONLY" are used.

It has been called in the program by using cv2.cv as cv2.cv.CV_FLOODFILL_FIXED_RANGE

But when I tried executing the program, I got an error stating that cv2 has no attribute named cv

I also tried changing it to cv2.CV_FLOODFILL_FIXED_RANGE as in Opencv3 the version changes cv has been deprecated

But I get the following error

AttributeError: module 'cv2' has no attribute 'CV_FLOODFILL_FIXED_RANGE'

This means that either I have called CV_FLOODFILL_FIXED_RANGE wrong or it is not available in the name called

Can anyone please tell me what should I do for solving this error

Thanks in advance

Community
  • 1
  • 1
Srikanth
  • 237
  • 2
  • 4
  • 16

1 Answers1

0

I'm not sure how the version of cv2 in the notebook was built, but I suspect it might not have come out of the standard python package index. The notebook code refers to cv2.cv.CV_FLOODFILL_FIXED_RANGE, but opencv-python 3.4.3 (the current version in the package index) doesn't provide cv2.cv.

The underling C++ definitions (see here) are

CV_FLOODFILL_FIXED_RANGE =(1 << 16),
CV_FLOODFILL_MASK_ONLY   =(1 << 17)

so you might try the equivalent ints in your python code in place of the CV_FLOODFILL_* constants.

Dave W. Smith
  • 24,318
  • 4
  • 40
  • 46