Re: [Numpy-discussion] Counting the Colors of RGB-Image

2012-01-18 Thread apo
Sorry, that i use this way to send an answer to Tony Yu , Nadav Horesh , Chris Barker. When iam direct answering on Your e-mail i get an error 5. I think i did a mistake. Your ideas are very helpfull and the code is very fast. Thank You elodw ___

[Numpy-discussion] Counting the Colors of RGB-Image

2012-01-15 Thread apo
Counting the Colors of RGB-Image, nameit im0 with im0.shape = 2500,3500,3 with this code: tab0 = zeros( (256,256,256) , dtype=int) tt = im0.view() tt.shape = -1,3 for r,g,b in tt: tab0[r,g,b] += 1 Question: Is there a faster way in numpy to get this result? MfG elodw ___