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?
Code: Select all
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)
In your documentation on the image.get_statistics function you say :
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?If you pass a list of thresholds then the histogram information will only be computed from pixels within the threshold list.
Hopefully I've explained myself well enough so you can understand my point of view.