I assume that you forgot to specify the range between 300 and 400. But anyway this piece of code may give you a direction:
---------------------------------- import numpy as np ythreshold = np.repeat(np.arange(4,-1,-1), 100) * 20 +190 bin_image = image > ythreshold[:,None] ---------------------------------- Anyway I advice you to look at image morphology operations in scipy.ndimage Nadav -----Original Message----- From: [email protected] on behalf of ioannis syntychakis Sent: Wed 14-Apr-10 10:11 To: Discussion of Numerical Python Subject: [Numpy-discussion] look for value, depending to y position Hallo everybody maybe somebody can help with the following: i'm using numpy and pil to find objects in a grayscale image. I make an array of the image and then i look for pixels with the value above the 230. Then i convert the array to image and i see my objects. What i want is to make the grayscale depented to the place on th image. the image is 500 to 500 pixels. and for example i want that the pixelvalue the program is looking for decreases in the y direction. on position y= 0 to 100 the programm is looking for pixelvalues above the 250 on position y= 100 to 200 the programm is looking for pixelvalues above the 230 on position y= 200 to 300 the programm is looking for pixelvalues above the 210 on position y= 400 to 500the programm is looking for pixelvalues above the 190 is this possible? thanks in advance. greetings, Jannis
<<winmail.dat>>
_______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
