Skip to content

Tag: annotations

Mark selected pixels in an image with circle

I have an image, and I have to mark pixels whose intensity value is less than threshold value with a circle. How do you do this, Scatter plot wont work as we need two input. Help in this regard is appreciated. Answer You can use the Circle patch function from matplotlib (see doc here). Here is an example insp…

Python: use Type Hints together with Annotations

In Python, we all know Type hints, which became available from 2015: and we also know Function Annotations, in particular here I am referring to textual annotations like: But is it possible to use Type Hints together with a textual function annotation? For example: This last one throws an error. I cannot seem…