How many triangles in picture? Formula or algorithm for this?

2.8k Views Asked by At

enter image description here

How many triangles are in this picture? Is there any formula or computer software to calculate this?

Also: I know programming so I can program something to solve this if someone can point out an algorithm for this.