Advertisement
tomateblue

AiLuRusClientTestV3.141

Oct 12th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. import ftplib
  2. from SimpleCV import Image,Camera
  3. import time
  4.  
  5. camera =  Camera(0, {"width": 640, "height": 480})
  6.  
  7.  
  8. session = ftplib.FTP('ailurus.com','ailurus','panda')
  9.  
  10. def saveImage(name):
  11.     file = open(name,'rb')                  # file to send
  12.     session.storbinary('STOR  %s' % name, file)    
  13.     file.close()                                    # close file and FTP
  14.     session.quit()
  15.  
  16. while 1:
  17.     image = camera.getImage()
  18.     faces = image.findHaarFeatures("face.xml")
  19.     if faces:
  20.        for face in faces:
  21.            print "Encontrado nas coordenadas: " + str(face.coordinates())
  22.            face.draw()          
  23.            image.save("foto.jpg") # a
  24.            saveImage("foto.jpg") # aqui vai dar pau
  25.      else:
  26.        print "Não encontrado"
  27.  
  28.      sleep(.1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement