Figure F exists on a regular square grid.
T transforms F by any combination of horizontal or vertical reflection as well as rotation by 90 or 180 degrees.
A larger background grid of X by Y contains noise, where each square has a 50% chance of being 0 or 1.
I am trying to produce a score for the probability that F will match the background grid.
For a match, F or one of its transformations (T) must be able to be compared to the background grid at some location such that the squares that are part of F match the 1s on the background grid but none of the 0s.
The score does not need to be in any particular unit, but must be comparable to other scores.
For example:
F
### #
Background (X = 7, Y = 4)
0001010 1001101 0101100 0100110
A match occured. I have replaced the units that match with .
s, they matched because they were all 1
s and formed one of Fs transformations.
0001010 100..01 0101.00 0100.10
I'm currently using (64 / 2 ^ f_squares) + (c - 1) * 2
where c
is the transformational symmetry of F, f_squares is the number of squares in F and ^
is "to the power of". I'm looking for a more accurate approximation.
64 / 2 ^ f_squares
represents the decreasing probability of a match the more squares that F contains, with (c - 1) * 2
for the additional chance of a match if Fs transformations are different from each other.