I am starting a new project that will involve taking two images and comparing the centers of dots inside the images. The original will be a picture with 27 rows and 15 columns of dots. The second picture will be a distorted version of the original where the dots have changed position and shape.
To begin this project I will need to store the original centers in an array.
I have made a formula to find the center of every circle in the original.
X: n = 0..26 [48n+5]
Y: m = 0..14 [48m+5]
As an example the center of dot (2,5) would be
[48(2)+5, 48(5)+5] = [101, 245]
TLDR: I need help storing (x,y) coorinates using the following formula
[X,Y] = [48(n)+5 , 48(m)+5] for n = 0..26, m = 0..14
Update:
So it looks like the 2D array is what I need to use. In the end I want to assign each coordinate a string name.
arr = []
for n in range(27):
for m in range(27):
arr.append([48*(m)+5 , 48*(n)+5])
for x in range(405):
print(arr[x])
Currently using this code numbers 0..404 will yield coordinate pairs (0=[5,5] and 404=[1253,677])
. However I want an easier way to reference each coordinate pair rather than finding which object it is numerically.
I want to assign the top left dot the name A0. It will have the propertie A0 = [5,5]
As you move right you reach the top right most dot with a center name A26. It will have the following properties A26 = [1253,5]
Going to the bottom left dot it's center would be called O0 and have the properties of O0 = [5,677]
and that row would span to the right until it hits the bottom right dot's center named O26 having the properties O26 = [1253,677]
As you can see in the diagram below I want to be able to call upon a grid of names that would be formatted in the following way.
A0... ...A26
. .
. .
. .
. .
. .
. .
O0... ...O26
So if I call for the coordinates of O26 it would return [1253,677]