It's nice, but missing the most valuable (and simplest) take from computer vision: the Hough transforms.
Let's take the circle Hough transform as it's one of the most enlightening ones!
Say you are looking for a circle of a given diameter. After a binarization to make the edge stand out, make all the potential points "vote" for a circle center.
The method is simple: using a matrix, you +1 all the points that are as far from this point as the radius of the circle will allow.
Extension 1: if you don't know the radius, apply iteratively for a range of values, then again, take the max: if you imagine how it works (or code it as an example then animate the result), it's like doing a "mathematical" focus.
Extension 2: if it's too costly to do a dense exploration of the space of values for the radius, while you know there's only one circle, do a gradient descent on the increase.
Extension 3: If there are more that one circle, other techniques exist - the easiest to picture are based on the maximization of variance of the distribution of values in the matrix resulting from the binarization, but you can also use 2d lattices and other fun tricks.
I agree it's very cool, but I have found it to be surprisingly poor in certain scenarios.
A "faint" circle will often score worse than 2 high-contrast parallel lines that happen to be the right distance apart, since the lines manage to trigger pixels along 20% of a circle's arc and their contrast massively inflates their score compared to the faint circle (higher edge pixel density).
It seems like there should be a simple way to weight the results by how dispersed within the circle's arc the pixels are, but I've never dug any further, after hitting this problem I had to move on.
My initial reaction is that adding an angle parameter would help. A circle should have votes from many angles while lines will vote from only a portion of the circle. With some added weight from angled convergence the faint circle could score higher.
Hough is sweet and simple, but it's more or less the brute force method of CV: It comes with awful runtime and memory complexity even in straightforward cases. If it works it works, but more often it's neither efficient nor reliable.
I will take the opportunity to call out one of my favourite libraries, BoofCV (http://boofcv.org)
It comes with a wonderful demonstration tool that allows you to apply the various included algorithms to images and tweak the parameters in real-time – including the Hough transform. A great tool for helping to understand how these kinds of algorithms work!
> After a binarization to make the edge stand out ...
Edge binarization is dependent upon edge detection algorithm choice, threshold algorithm choice, and both of their respective parameters. It's often very difficult to find a set of parameters that aren't brittle due to occlusions, poor contrast, camera noise, etc.
Hough works great if you can do this part confidently. But in my experience, robust edge binarization for Hough is often not very feasible in the wild.
> It's even simpler to make artificial neurons vote for a circle center.
Is it?
It's not conceptually simpler: people can more easily imagine circles around points converging to a center, so they can also put that idea into code more easily.
> you can apply the method to other shapes as well.
Yes you can. Read about Hough.
I just presented the one that is the most enlightening.
I may be biased against neural network approaches and their likes, because I see them as black boxes with failure modes that are hard to predict or work around: I prefer what I can understand and explain, and unfortunately, it seems at odd with the current demographics of ML (cf https://news.ycombinator.com/item?id=27361812 ) who has no clue about what makes these black boxes tick, sometimes even after they get a PhD in the dark art of tweaking black boxes.
One of the nicer things about the hough approach is also that you can get a bunch of other information from parameter space, like horizon lines and vanishing points.
Let's take the circle Hough transform as it's one of the most enlightening ones!
Say you are looking for a circle of a given diameter. After a binarization to make the edge stand out, make all the potential points "vote" for a circle center.
The method is simple: using a matrix, you +1 all the points that are as far from this point as the radius of the circle will allow.
Do this for every point, and take the max: https://en.wikipedia.org/wiki/Circle_Hough_Transform
Simple, and works in guaranteed time.
Extension 1: if you don't know the radius, apply iteratively for a range of values, then again, take the max: if you imagine how it works (or code it as an example then animate the result), it's like doing a "mathematical" focus.
Extension 2: if it's too costly to do a dense exploration of the space of values for the radius, while you know there's only one circle, do a gradient descent on the increase.
Extension 3: If there are more that one circle, other techniques exist - the easiest to picture are based on the maximization of variance of the distribution of values in the matrix resulting from the binarization, but you can also use 2d lattices and other fun tricks.