You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def calculateTransitions(im):
h, w = im.shape[0], im.shape[1]
prev = im[0,0]
n = 0
for x in range(1, h):
for y in range(1, w):
curr = im[x,y]
# check if the is black to white transition
n = n+1 if curr == 255 and prev == 0 else n
prev = curr
return n
There is something wrong with
n = n+1 if curr == 255 and prev == 0 else n
prev = curr
return n
this part
please solve getting the same error
The text was updated successfully, but these errors were encountered:
def calculateTransitions(im):
h, w = im.shape[0], im.shape[1]
prev = im[0,0]
n = 0
for x in range(1, h):
for y in range(1, w):
curr = im[x,y]
# check if the is black to white transition
n = n+1 if curr == 255 and prev == 0 else n
prev = curr
return n
There is something wrong with
n = n+1 if curr == 255 and prev == 0 else n
prev = curr
return n
this part
please solve getting the same error
The text was updated successfully, but these errors were encountered: