Wednesday, December 2, 2020

Mean textures

We can extend the idea of mean signals into 2D, as mean textures. In the previous post I found two signed and two complex signals that were non-trivial (they didn't tend to a spike signal). Here I look at the case for 2D, on signed textures (greyscale with 127=0). 

Here are the results with no 90 degree rotational symmetry. Showing a 5x5 tiled patch from a 2x2 texture (left) up to a 5x5 texture (right):

If I include reflection when matching:


If I include 90 degree rotational symmetry (no reflection):

And with reflection included:

Finally, for comparison, here is an unsigned texture, with 90 degree rotational symmetry, no reflection:


The unsigned texture is just like the unsigned signal of the previous post. The mean is a single spike. For the signed textures, they all appear to tend towards a pair of extremes (one positive, one negative) as the width goes up to 5.

One reasonable variant is for the random values to be a uniform distribution of signal energies (value squared). This supports the need for negative values, since we are taking the square root of the uniformly sampled numbers.

Here is with no reflection: (28 iterations)

and with reflection (28 iterations):

These do not show the same tendency towards a trivial case of one or two spikes at larger resolutions. However, the accuracy of the 5x5 is very poor, due to the huge number of iterations needed to converge. The rest are quite close, as verified by trialing with different random seeds.

Here's the above 4x4 (no reflection) shown over a larger surface:

We also do something very similar in the complex domain. Here I use the red component for real values, the green for imaginary values and set the blue to halfway. Lower iteration count (23) just to give an indication of what it might look like:

without reflection:

with reflection: 


Mean dice

The above tiled textures could be thought of as single textures in a toroidal universe (the space is topologically a torus). 

If we apply square tiling to a topologically spherical universe then there is only one option: one pixel per face of a cube. Finding the mean values is equivalent to finding what an "average dice" would look like. If you chose a random positive number per face, using the 'dice constraint' that the sum of the numbers is 21.

Here are the mean values compared to a normal dice:

Normal dice values:     1,     2,     3,     4,     5,     6

Mean dice values:        2.55,1.70,1.81,1.81,4.65,8.47

 

I used a cross-correlation to choose the best orientation of the dice for matching. If I change that to a sum square error, the result is exactly the same. I assume that is also the case for the following variants:


Mean signed dice:       -1.12,-9.38,0,    0,   1.12,  9.38

Mean energy +ve:      3.35, 2.57, 2.86, 2.86, 4.58, 5.98

Mean energy signed: -4.76,2.33,-3.93,-2.63,4.24,4.74

I have rotated the end result to be as close to the numbers on a real dice. These values are most probably mutually irrational, they don't show any signs of being rational multiples of each other.

No comments:

Post a Comment