I would like to create 10 variables with one for
in Python (not an array).
Something like this:
for i in range(1,10,1)
variable i = 100 / i
print variable i
I want to create variable names, in this case:
variable1
, variable2
, variable3
,..., variable10
I don't want an array
I have a map of coordinates (640 x 480). I am identifying the coordinates where the pixel color is white. There are 3 balls in the ground, I would like to get the central coordinate of each ball, so if the coordinate that is been evaluated is close from the last one, the x and y coordinate will be averaged, if the coordinate belongs to a new ball the coordinate belongs to a new group of coordinates will be evaluated.
p=0
h=0
for j in range(1,480,1):
for i in range(1,640,1):
c=cv.Get2D(image,j,i)
if c[0] == 255:
old_coord X = new_coord x
new_coord x += [(i,j)]
if (old_coord x - 5 < new_coord x < old_coord x + 5)
averx x = averx x + i
avery x = averx x + j
count x = count x + 1
else
p = p + 1
new_coord x += [(i,j)]
average(averx1 , count 1)
average(avery1 , count 1)
average(averx2 , count 2)
average(avery2 , count 2)