Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def contaPix(l,k):
- #@ param l : sequence of pixel
- #@ param k: int
- #@ return int
- p = 0
- for i in range(0, len(l)):
- count = 0
- lum1 = lum(l[i])
- for j in range (0, len(l)):
- if i != j:
- lum2 = lum(l[j])
- if lum1 == lum2:
- count = count+1
- if count == k:
- p=p+1
- return p
- def lum(p):
- #@ param p : pixel
- #@ return int
- return (getRed(p)+getGreen(p)+getBlue(p))/3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement