i am working extracting data from images using Matlab, i use the function im2bw in gray images for use later bwlabel but the threshold doesn't work in all images, by that the images gain noise and the data obtained isn't representative. How i can configure the threshold for evitate that problem?the function graytresh doesn't give a good threshold, exist any other method to fix the problem? I work with a lot of images (more of ten thousand sometimes) and i can't run one by one. The images are of fishes swimming and i need to be careful. Thanks for read my problem!.
I use graytresh in images bw like this https://i.stack.imgur.com/kPtPc.jpg -Sometimes the distortion on images are too much dropbox with images https://www.dropbox.com/sh/xve7oe84xcfj9yt/AACA0dYrK_m7o8Oie0KWWR-2a?dl=0 starter images, bin images with distortion and bw images