Ask Your Question

NameError: name 'Image' is not defined

asked 2014-09-10 01:37:44 -0500

Andrew1108 gravatar image

I try to find blobs using python here my code:

import cv2
import SimpleCV

bgsMOG = cv2.BackgroundSubtractorMOG2()
cap    = cv2.VideoCapture("d:\MOV_5702.avi")
if cap:
    while True:
        ret, frame =
        if ret:
            fgmask     = bgsMOG.apply(frame, None, 0.01)
            simplecvimg=Image(fgmask, cv2image=True)
            blobs      = simplecvimg.findBlobs()
            if blobs is not None:
            key = cv2.waitKey(100)
            if key == ord('q'):


but when I run it, get error in:

Traceback (most recent call last):
  File "C:\Users\LENOVO\Documents\", line 11, in <module>
    simplecvimg=Image(fgmask, cv2image=True)
NameError: name 'Image' is not defined

How I can fix it?

edit retag flag offensive close merge delete


I re-install all, and follow these and it's work.. But I got another problem, the simplecvimg is rotate, and even using rotate it can't fix...

Andrew1108 gravatar imageAndrew1108 ( 2014-09-10 07:17:09 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-09-13 08:55:58 -0500

this error is because you not import class Image of SimpleCV try using from SimpleCV import Image or from SimpleCV import *

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-09-10 01:37:44 -0500

Seen: 7,479 times

Last updated: Sep 13 '14