Created a segmentation by brightness script that automatically detects
thresholds and then segments an image based on that threshold I have
also attached an example