I did the following changes in this part of my programme.. now the refereence error is removed but its showing me another error :<br><br>def ComputeClasses(data):<br> radius = .5 <br> points = []<br> for cy in xrange(0, data.height):<br>
for cx in xrange(0, data.width): <br> <br> if data[cy,cx] == (0.0,0.0,0.0):<br> continue<br> else : <br> centre = data[cy, cx]<br>
print centre<br> points.append(centre) <br> <br><br> change = True <br><br> while change: <br> <br> for ring_number in xrange(1, 1000): <br>
change = False<br> new_indices = GenerateRing(cx, cy, ring_number) <br> <br> for idx in new_indices:<br>
point = data[idx[0], idx[1]] <br> <br> if point == (0.0, 0.0, 0.0 ): <br> continue<br> else: <br> <br>
dist = distance(centre, point)<br> if dist < radius :<br> print point <br> points.append(point)<br> change = True<br>
print change<br> <br> <br> break <br> <br> <br> print points <br><br><br>ERROR :<br><br>Traceback (most recent call last):<br>
File "Z:/modules/classification1.py", line 71, in <module><br> ComputeClasses(data)<br> File "Z:/modules/classification1.py", line 47, in ComputeClasses<br> point = data[idx[0], idx[1]]<br>
error: index is out of range<br><br>What is meant by this statement ' Index out of range ' ? Does it mean that my range 1, 1000 is exceeded ??<br><br><br><div class="gmail_extra"><br></div>