Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def numRow(pict):
- #@param pict: Picture
- #@param count: int; numero righe con pixel aventi la stessa luminisota
- count=0
- for y in range(0,getHeight(pict)):
- if numPix(pict,y):
- count=count+1
- return count
- def numPix(source,h):
- #@param source: Picture
- #@param h: int; coordinata y dell immagine
- #@return bool
- count=0
- pix1=getPixel(source,0,0)
- for x in range(0,getWidth(source)):
- pix2=getPixel(source,x,h)
- if lum(pix1)==lum(pix2):
- count=count+1
- if count==getWidth(source):
- return true
- else:
- return false
- def lum(px):
- #@param px: Pixel
- #@return int; luminosita del pixel
- r=getRed(px)
- g=getGreen(px)
- b=getBlue(px)
- lumi=r+g+b
- return (lumi)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement