what is the difference between area_threshold and pixel_threshold in the for loop of blob detection?
Area threshold is a threshold bases on the area (w*h) of the object versus the pixel threshold is based on the number of pixels in it. If you look at the ratio (density) of the two you can get some idea how good your lock on the object is because the number of pixels should area be near the area for square objects. For other shapes like circles you can calculate the true area by using the width and height and then compare to the pixel value.
Anyway, the area threshold is straight forward if you care to only find large objects and the pixel threshold is straight forward for if you care to only find objects with lots of pixels set. Both values are more or less correlated. But, not 100% equal to each other.