so i am using loops to get each pixels in an image, but i am getting an error which i don't understand.I am using for in range loop to do this
height,width=img.shape
when i log these it gives the result alright. The dimensions are being logged, but then when i loop it gives error. I have seen a lot of code use this, but now it is giving some error. What is happening here?
for i in range(0, height):
TypeError: 'int' object is not callable
The code for the loop looks like:
p =[]
p.append(5000)
p.append(0)
p.append(5000)
p.append(0)
for i in range(0, height):
for j in range(0, width):
if mask[i][j]==0:
if i<p[0]:
p[0]=i
if i>p[1] :
p[1] = i
if j<p[2]:
p[2]=j
if j>p[3] :
p[3] = j
else:
img[i,j]=[255,255,255]