What does blobs.pixels() return ?

I am trying to find the number of pixels of a certain colour in a frame. I am using the following code for this;

blobs = img.find_blobs([brown_lab_threshold], merge=True)
    if blobs:
        for b in blobs:
            count = count + b.pixels()

Here is my question, does blob.pixels() return all the pixels within the upper and lower limits of the blob or does it only return the number of pixels in the blob that are of the colour that I am looking for?

The upper and lower limits form a rectangle and my blobs are rarely a regular shape, they tend to be curvy (:P) so there are bound to be a bunch pixel of a colour I don’t care about within the upper and lower limit.

If blob.pixels() return every pixel in the upper and lower limits, how do I get an exact count of the number of pixels if a certain colour in an image?

pixels return the number of pixels in that blob.

http://docs.openmv.io/library/omv.image.html#image.blob.pixels

Its the number of pixels in the blob. It’s not related to the area of the bounding rectangle of the blob.