Iterative image processing and spiral asymmetric behavior

I love how Mathematica lets you create endless animations with just a tiny bit of code. Here is a short hypnocode with iterative image processing:

a = RandomReal[1, 200 {1, 1}]; Dynamic[Image[a = Rescale[a - GradientFilter[a, 2, Method -> "Sobel"]]]]

4gridofitgrfi.gif

For symmetric initial conditions such as DiskMatrix[10, 200] the asymmetry appears after just one iteration of the filter. I guess the swirling rose is stable with respect to small numerical errors. I was unable to find any initial condition which didn’t eventually lead to it, but there may well be other stable states that we haven’t seen yet. Not exact arithmetic, but a bit of rounding makes it interesting…

a = DiskMatrix[10, 200];
Dynamic[Image[a = Rescale[Round[a - GradientFilter[a, 2, Method -> "Sobel"], 0.09]]]]

For no particularly good reason, I made a version of my iterative gradient filter on a 3D image. It doesn’t run very fast, as you might imagine, so I uploaded also a movie here.

i = RandomReal[{0, 1}, {100, 100, 100}];
Do[i = Rescale[i - GradientFilter[i, 2]]; t = 2 Pi j/300.;
 Export["image_" <> ToString[j] <> ".bmp", 
  Rasterize[Image3D[i^10, ViewPoint -> {3 Cos[t], 3 Sin[t], 2}, 
    SphericalRegion -> True], ImageSize -> {300, 300}]], {j, 800}]

Dimgfilgra2.gif

15 Likes

This reminds me very much about so called Belousov-Zhabotinsky reaction which are considered as a complex phenomenon in chemistry. They can be described by Complex Ginzburg-Landau Equation

bigCGL.gif

or Cellular Automata - see references below. Now we can notice an interesting thing - GradientFilter is a discrete analogy of the squared gradient standing in the Ginzburg-Landau Equation. So maybe adding a non-linear term (similar to cubic term in equation above) can help to enrich behavior and stray away from only single spiral as an outcome:

a = RandomReal[1, 200 {1, 1}];
Manipulate[Image[a = Rescale[a - GradientFilter[a, 2] - s a^p]], {{p, 1.3}, .01,2}, {{s, .9}, 0, 2}]

0aasd6a.gif

  1. Idealized Belousov-Zhabotinsky Reaction
  2. Greenberg-Hastings Model
  3. The World of the Complex Ginzburg-Landau Equation
  4. The Complex Ginzburg-Landau equation - David M. Winterbottom

Here are some images take from the references:


8 Likes