Some methods, like Li, have some special handling for nan values, but that is not uniform across all our methods, as you have seen. 😂 I would suggest:
t = threshold_otsu(image[np.isfinite(image)])
That will only pass the non-nan, non-inf pixels to Otsu to do the calculation.
Hope this helps!
> On 18 Dec 2020, at 7:19 am, Laurynas Gedminas <laurynasgedminas(a)gmail.com> wrote:
> I have NDVI image, its not a square, and has some None values,
> I am trying to create otsu threshold, but getting error:
> autodetected range of [nan, nan] is not finite
> how to go around that?
> Thank you,