Error for boundBox() and drawBB()

asked 2013-04-14 08:38:28 -0500

FunnyFunk91 gravatar image

I am currently writing a detection/tracking system for cars in a car park. I have gotten some great help from @jayrambhia. The only problem I am having now is that I cannot use the method boundBox() or drawBB(). Anytime I run the code I get the following errors.

Traceback (most recent call last):
   File "C:/Users/Chris/Desktop/SimpleCVScripts/", line 18, in    <module>
   car_blob_bounding_box = car_blobs.boundingBox()
AttributeError: 'FeatureSet' object has no attribute 'boundingBox'

And I get the following error for drawBB()

Traceback (most recent call last):
 File "C:/Users/Chris/Desktop/SimpleCVScripts/", line 24, in <module>
tracking_list.drawBB(color = scv.Color.RED)
AttributeError: 'list' object has no attribute 'drawBB'

I don't know what's causing this. I can't tell if the code I have written is going to work unless I test it. Is there anything in the code below that could be causing these errors?.

 import numpy
 import cv2 as cv
 import SimpleCV as scv
 from datetime import datetime

 background_subtraction = cv.BackgroundSubtractorMOG(24*60, 3, 0.9, 0.01)
 capture = cv.VideoCapture(0)

#Not used until detection/tracking is working
number_of_cars = 0;

#Clean up the image
def preproccessor():


#Remove the background from the image
def subtract_background():

    global f, image
    global fgmask
    global display_image

    f, image =
    fgmask = background_subtraction.apply(image)
    display_image = scv.Image(image)

#Detect blobs in the image
def detect_cars():

    global cars

    cars = display_image.findBlobs()

    if cars:

#Track the blobs that were detected
def track_cars():

    tracking_list = []
    car_bounding_box = cars.boundingBox()
    tracking_list = image.track("mftrack",ts,display_image,cbox)

#Main loop for the program
edit retag flag offensive close merge delete


jayrambhia gravatar imagejayrambhia ( 2013-04-14 14:38:02 -0500 )edit