I have a grayscale image,
the dominant colors in the background are shades of white and light gray, I have tried using otsu binarization but it gave no good results, so I decided according to the histogram below to write manually:
img_gray[img_gray > 130] = 255
so all white/gray shades have been converted to white. it worked impressively well,
I was wondering is there an efficient way getting this threshold
without re-inventing the wheel, I know I can apply:
np.bincount(img_gray.ravel())
and try to find the beginning of the ramp before the peak.
Is there any function in openCV which offers something similar to this?
Thank you all!