Simple python code with image processing not working
<p>I am working with pixels and I want to find location of first black pixel in picture below when traversing in row-major order. This is a part of project to recognize mnist numbers on image and count sum of all numbers on image.</p>

<p>Code looks like:</p>

<pre><code>for a in range(0,80):
    for b in range(0,80):
        if (imgt[a,b,0]==0 and imgt[a,b,1]==0 and imgt[a,b,2]==0):
            x=a
            y=b
            break
        break
    break

print x,y
</code></pre>

<p><strong>Explaination</strong>:- I have two for loops going through coordinates(picture is 80x80,so <code>range</code> is (0,80)). In for loop, I am checking if pixel is black=>if it is black,<code>x</code> is assigned coordinate value of <code>a</code>, <code>y</code> is <code>b</code>. </p>

<p><strong>Expected Output</strong>:- The program should finally write coordinates of first upperleft black pixel, which should be (29,27).</p>

<p><strong>Actual Output</strong>:- The prints me always (56,27).
Does anyone know what can be problem here? It seems to me very simple, but i don't know what to do.</p>

<p>Thanks in advance!</p>

<p><a href="https://i.stack.imgur.com/kIInf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kIInf.png" alt="enter image description here"></a></p>