Re: [Numpy-discussion] collecting the bluest pixels

2008-10-07 Thread Anne Archibald
2008/10/7 Christopher Barker <[EMAIL PROTECTED]>: > I wonder if the euclidian norm would make sense for this application: > > HowFarFromBlue = np.sqrt((255-image[...,BLU])**2 + > image[...,GRN]**2 + > image[...,RED]**2) > > smaller numbers would be

Re: [Numpy-discussion] collecting the bluest pixels

2008-10-07 Thread Christopher Barker
paul taney wrote: > Thank you Stefan and Anne for such quick replies. > > I am writing a gimp plugin cool! > I get a divide by zero error on > > np.divide(image[...,BLU], image[...,GRN], B) > > ...and I dont understand this well enough to diagnose. Any ideas? you're dividing the value o

Re: [Numpy-discussion] collecting the bluest pixels

2008-10-07 Thread paul taney
Thank you Stefan and Anne for such quick replies. I am writing a gimp plugin, and if anybody is interested in how do that -- there are only about 10-20 examples that I"ve found -- this plugin is attempting to do raster-to-vector conversion on the bluest pixels. It outputs SVG and a python tupl

Re: [Numpy-discussion] collecting the bluest pixels

2008-10-07 Thread Anne Archibald
2008/10/7 paul taney <[EMAIL PROTECTED]>: > Hi, > > I have this silly color filter that Stefan gave me: > > > def vanderwalt(image, f): >"""colorfilter, thanks to Stefan van der Walt""" >RED, GRN, BLU = 0, 1, 2 >bluemask = (image[...,BLU] > f*image[...,GRN]) & \ > (image[.

Re: [Numpy-discussion] collecting the bluest pixels

2008-10-07 Thread Stéfan van der Walt
Hi Paul 2008/10/7 paul taney <[EMAIL PROTECTED]>: > I have this silly color filter that Stefan gave me: > > def vanderwalt(image, f): >"""colorfilter, thanks to Stefan van der Walt""" >RED, GRN, BLU = 0, 1, 2 >bluemask = (image[...,BLU] > f*image[...,GRN]) & \ > (image[..

[Numpy-discussion] collecting the bluest pixels

2008-10-07 Thread paul taney
Hi, I have this silly color filter that Stefan gave me: def vanderwalt(image, f): """colorfilter, thanks to Stefan van der Walt""" RED, GRN, BLU = 0, 1, 2 bluemask = (image[...,BLU] > f*image[...,GRN]) & \ (image[...,BLU] > f*image[...,RED]) return bluemask To c