Can you explain to me the purpose of passing the color threshold list to the find_blobs and image.get_statistics function. The issue I am having is if the find_blobs function is finding blobs that meet the color thresholds and the other threshold parameters, why does the image.get_statistics function need to be supplied with the threshold list again within the find_blobs loop?
for blob in img.find_blobs(threshold_list, pixel_threshold=pixel_thresh, area_threshold=area_thresh, margin=5, merge=False): roi_count = roi_count + 1 img.draw_rectangle(blob.rect()) #draws a rectangle (x, y, w, h) around blob for bounding box stats = img.get_statistics(thresholds=threshold_list, roi=blob.rect()) #get statistics for each blob where the blob is the roi. img.draw_string(blob.x(), blob.y() - 10, "%.4f C" % map_g_to_temp(stats.mean()), mono_space=False)
As an example if I am only looking for 1 color tuple of (120, 255) why do I need to supply this again to the get_statistics function, shouldn’t it just take the average of everything within blob.rect() as its already gone through a color threshold test in the find_blobs function.
In your documentation on the image.get_statistics function you say :
If you pass a list of thresholds then the histogram information will only be computed from pixels within the threshold list.
I don’t understand the logic behind providing the threshold list to the get_statistics function if it has already been used by the find_blobs function?
Hopefully I’ve explained myself well enough so you can understand my point of view.