I wanted to write a final post in my series on Mumford-Shah segmentation to explain how the approach we detailed so far could be extended for colour images. This time, our working example will be this charming picture of Paul Erdős with child prodigy Terrence Tao:

Mathematics transcending age barriers
In this case, both our image and cartoon will have three components (one for each primary colour),
hence we have to adapt our loss functional to penalise the total deviation in every component:
where
a = (
u1 * w1
+ (v**2) * dot(grad(u1), grad(w1))
+ u2 * w2
+ (v**2) * dot(grad(u2), grad(w2))
+ u3 * w3
+ (v**2) * dot(grad(u3), grad(w3))
) * dx
L = (g1 * w1 + g2 * w2 + g3 * w3) * dx
a = (
v * inner(grad(u), grad(u)) * w * dx
+ v * 1 / (4 * eps) * w * dx
- eps * dot(grad(v), grad(w)) * dx
)
L = fem.Constant(domain, 1 / (4 * eps)) * w * dx
We can again solve the equations through alternating iteration. Here is the result:


Segmentation of Tao-Erdos picture
Not too shabby if you ask me!