Keep getting AttributeError: 'Image" object has no attribute 'find_blob'

I keep getting this error, but I don’t know what is the problem… I was also getting the
NameError: name ‘blob’ not defined. but then I changed the code and this error came up… Does anyone know what is the problem?

I’ll attach the code below.

import sensor, image, time #sensor

#import sensor → Import the module for sensor related functions
#import image → Import module containing machine vision algorithms
#import time → Import module for tracking elapsed time

sensor.reset() # Resets the sensor
sensor.set_pixformat(sensor.RGB565) # Sets the sensor to grayscale
sensor.set_framesize(sensor.QVGA) # Sets the resolution to 320x240 pixels
sensor.skip_frames(time = 2000) # Skip some frame to let the image stabilize


clock = time.clock()
thresholds = (100,255)

img = sensor.snapshot().lens_corr(1.8) # Takes a snapshot and saves it to the memory

circles = img.find_circles(threshold = 3000, x_margin = 20, y_margin =20, r_margin = 20,
        r_min = 2, r_max = 100, r_step = 2)
blobs = img.find_blob( [thresholds], area_threshold = 225 , merge = False)
    # threshold = (100,255) defines the min/max gray scale values i'm looking for
    # area_threshold = 225 : to find blobs with a minimal area of 15x15=220 pixels
    # merge = False : Overlapping blobs will not be merged

for c in circles:
    img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0))


for b in blobs:
    img.draw_rectangle(blob.rect(),color = 255)     # Draw a rectangle where the blob was found
    img.draw_cross(,, color = 255)   # Draw a cross in the middle of the blob
print("FPS %f" % clock.fps())

Thanks for everything in advance!!


are you trying to find grayscaled blobs in a rgb image?
if yes please change to grayscale…

Thank you for your reply!! However, I already changed to grayscale, but the same error, AttributeError: ‘Image’ object has no attribute ‘find_blob’ , keeps popping up… Do you know what else could be the problem?
Best regards!
Miguel Garcia

try img.find_blobs instead of img.find_blob…