0
I’m studying image processing using Python.
I interfaced with Kivy.app
, but is catching when it runs the while
. I am using the code below to fill an array with "0" or "1", making the image binarized.
Any tips on how to resolve the issue of not crashing?
Obs. In Python’s IDLE runs perfectly.
Code:
i = 0
while i < (hs-1):
j=0
while j < (ws-1):
j = j+1
if (lum_img2[i,j]) <= threshold2:
lum_img2[i,j] = 0
else:
lum_img2[i,j]= 1
i = i + 1
i = 0
More details of your problem are missing. Where part of the application (kivy) is entering this code? If possible rewrite the question by providing more details.
– Tuxpilgrim
And the code is poorly indented, there is no way to know if it is right or not. If the
i = i+1
is out of thewhile
, as posted in the question, the loop will be infinite, because alwaysi < hs-1
.– Woss
Anderson, thank you so much for the quick response.... really the indentation of 1 =i+1 was wrong.
– Sidney Andrade