-3

I found Msnakes at here. Python 3.4.3, Numpy 1.11 (numpy==1.11), OpenCV 3.1.0 (opencv-python==3.1.0)

There is an error at main.py:

# Creates the snake
snake = snake.Snake( image, closed = True )

The error as follows:

AttributeError                            Traceback (most recent call last)
<ipython-input-6-71f52f50012b> in <module>()
      1 # Creates the snake
----> 2 snake = snake.Snake( image, closed = True )

~\cakalang\snake.py in __init__(self, image, closed)
     49 
     50         # Image properties
---> 51         self.width = image.shape[1]
     52         self.height = image.shape[0]
     53 

AttributeError: 'NoneType' object has no attribute 'shape'

How to fix that? Thanks in advance.

sliawatimena
  • 338
  • 1
  • 4
  • 16

1 Answers1

1

From the traceback, It shows that the image you are passing to create Snake object is None. Please pass proper image frame.

And there is no problem with the object creation. self is not an argument it's the part of the Class declaration. Read this,

Rahul K P
  • 15,740
  • 4
  • 35
  • 52