Esempio n. 1
0
        def take_picture(self):
            self._popup.dismiss()

            from plyer import camera
            fn = self.create_temporary_file()
            print 'taking picture to', fn
            camera.take_picture(fn, self._on_picture_complete)
Esempio n. 2
0
def take_picture():
    """Take a picture with the built in camera and save it to disk."""
    if platform != 'android':
        return
    picture_name = time.strftime('%Y-%m-%d-%H-%M-%S') + '.jpg'
    picture_output = '/storage/sdcard0/' + picture_name
    camera.take_picture(picture_output, lambda file_name: False)
Esempio n. 3
0
        def take_picture(self):
            self._popup.dismiss()

            from plyer import camera
            fn = self.create_temporary_file()
            print 'taking picture to', fn
            camera.take_picture(fn, self._on_picture_complete)
 def take_image(self):
     from plyer import camera
     filepath = self.user_data_dir + '/' + 'temp.png'
     try:
         camera.take_picture(filename=filepath,
                             on_complete=self.camera_callback)
     except NotImplementedError:
         print("Can't take a picture on this platform")
Esempio n. 5
0
 def takePicture(_):
     try:
         self.pic = "/storage/sdcard0/%s.jpg" % (str(self.switcher.robot.teamNumber) + "_" + str(time.time()))
         camera.take_picture(self.pic, lambda x: self.picture())
     except Exception as error:
         print(error)
         print("can't")
         pass
Esempio n. 6
0
 def loadCamera(self, *largs):
     """Loads photo camera"""
     
     Logger.info("Photo Camera Loaded")
     self.mediaType = 0
     e = App.get_running_app().user_data_dir + '/flicknik_temp.jpg'
     if os.path.isfile(e):
         os.remove(e)
     camera.take_picture(e,self.done)
Esempio n. 7
0
File: main.py Progetto: Piees/ML-app
    def do_capture(self):
        filepath = App.get_running_app().user_data_dir + '/mlpic.png'
        self.ids.path_label.text = "Machine Learning"
        ext = splitext(filepath)[-1].lower()

        try:
            camera.take_picture(filename=filepath,
                                on_complete=self.camera_callback)
        except NotImplementedError:
            popup = MsgPopup(
                msg=
                "This feature has not yet been implemented for this platform.")
            popup.open()
    def do_capture(self):

        if (os.path.exists(self.filepath)):
            os.remove(self.filepath)

        try:
            camera.take_picture(filename=self.filepath,
                                on_complete=self.camera_callback)
        except NotImplementedError:
            popup = MsgPopup(
                "This feature has not yet been\nimplemented for this platform."
            )
            popup.open()
Esempio n. 9
0
 def do_capture(self):
     self.clean()
     name = name_imgs()
     ext = '.jpg'
     filename = "{}{}".format(name, ext)
     filepath = os.path.join(self.cwd, filename)
     try:
         camera.take_picture(filename=filepath,
                             on_complete=self.camera_callback)
     except NotImplementedError:
         #self.camera_callback('image.jpg')
         popup = MsgPopup(
             "This feature is not implemented for this platform.")
         popup.open()
Esempio n. 10
0
    def do_capture(self):

        ext = splitext(self.filepath)[-1].lower()

        try:
            camera.take_picture(filename=self.filepath,
                                on_complete=self.camera_callback)
        except NotImplementedError:
            if __name__ == "__main__":
                value = recognize.Main("known_people", "one.jpg", 1, 0.5, True)
            print(value)
            if value[0] == "1":
                sound1 = SoundLoader.load("audio/sound1.mp3")
                sound1.play()
                sm.add_widget(ResultScreen("Одна Гривна"))
            if value[0] == "5":
                sound1 = SoundLoader.load("audio/sound5.mp3")
                sound1.play()
                sm.add_widget(ResultScreen("Пять Гривен"))
            if value[0] == "10":
                sound1 = SoundLoader.load("audio/sound10.mp3")
                sound1.play()
                sm.add_widget(ResultScreen("Десять Гривен"))
            if value[0] == "20":
                sound1 = SoundLoader.load("audio/sound20.mp3")
                sound1.play()
                sm.add_widget(ResultScreen("Двадцать Гривен"))
            if value[0] == "50":
                sound1 = SoundLoader.load("audio/sound50.mp3")
                sound1.play()
                sm.add_widget(ResultScreen("Пятьдесят Гривен"))
            if value[0] == "100":
                sound1 = SoundLoader.load("audio/sound100.mp3")
                sound1.play()
                sm.add_widget(ResultScreen("Сто Гривен"))
            if value[0] == "200":
                sound1 = SoundLoader.load("audio/sound200.mp3")
                sound1.play()
                sm.add_widget(ResultScreen("Двести Гривен"))
            if value[0] == "500":
                sound1 = SoundLoader.load("audio/sound500.mp3")
                sound1.play()
                sm.add_widget(ResultScreen("Пятьсот Гривен"))
            else:
                sound1 = SoundLoader.load("error.mp3")
                sound1.play()
                sm.add_widget(ResultScreen("Ошибка"))

            self.change()
Esempio n. 11
0
    def do_capture(self):
        filepath = self.cwd + self.ids.filename_text.text

        if (exists(filepath)):
            popup = MsgPopup("Picture with this name already exists!")
            popup.open()
            return False

        try:
            camera.take_picture(filename=filepath,
                                on_complete=self.camera_callback)
        except NotImplementedError:
            popup = MsgPopup(
                "This feature has not yet been implemented for this platform.")
            popup.open()
Esempio n. 12
0
    def tirarFoto(self):
        filepath = self.cwd + self.ids.filename_text.text
        ext = splitext(filepath)[-1].lower()

        if (exists(filepath)):
            popup = MsgPopup("Ja existe uma foto com este nome!")
            popup.open()
            return False

        try:
            camera.take_picture(filename=filepath,
                                on_complete=self.retornoCamera)
        except NotImplementedError:
            popup = MsgPopup("nao tem suporte para esta plataforma")
            popup.open()
Esempio n. 13
0
    def do_capture(self):
        filepath = self.cwd + self.ids.filename_text.text
        ext = splitext(filepath)[-1].lower()

        if(exists(filepath)):
            popup = MsgPopup("Picture with this name already exists!")
            popup.open()
            return False

        try:
            camera.take_picture(filename=filepath,
                                on_complete=self.camera_callback)
        except NotImplementedError:
            popup = MsgPopup(
                "This feature has not yet been implemented for this platform.")
            popup.open()
Esempio n. 14
0
    def do_capture(self):

        ext = splitext(self.filepath)[-1].lower()

        try:
            camera.take_picture(filename=self.filepath,
                                on_complete=self.camera_callback)
        except NotImplementedError:
            if __name__ == "__main__":
                value = recognize.Main("known_people", "hmqual.jpg", 1, 0.5,
                                       True)
                print(value)
                print(value)
            print(value[0])
            if value[0] == "1":
                sound1 = SoundLoader.load("audio/sound1.mp3")
                sound1.play()
                self.label.text = "Одна Гривна"
            if value[0] == '5':
                sound1 = SoundLoader.load("audio/sound5.mp3")
                sound1.play()
                self.label.text = "Пять Гривен"
            if value[0] == "10":
                sound1 = SoundLoader.load("audio/sound10.mp3")
                sound1.play()
                self.label.text = "Десять Гривен"
            if value[0] == "20":
                sound1 = SoundLoader.load("audio/sound20.mp3")
                sound1.play()
                self.label.text = "Двадцать Гривен"
            if value[0] == "50":
                sound1 = SoundLoader.load("audio/sound50.mp3")
                sound1.play()
                self.label.text = "Пятьдесят Гривен"
            if value[0] == "100":
                sound1 = SoundLoader.load("audio/sound100.mp3")
                sound1.play()
                self.label.text = "Сто Гривен"
            if value[0] == "200":
                sound1 = SoundLoader.load("audio/sound200.mp3")
                sound1.play()
                self.label.text = "Двести Гривен"
            if value[0] == "500":
                sound1 = SoundLoader.load("audio/sound500.mp3")
                sound1.play()
                self.label.text = "Пятьсот Гривен"
Esempio n. 15
0
 def on_touch_down(self, e):
     try:
         camera.take_picture(IMG_PATH, self.done)
     except:
         pass
Esempio n. 16
0
 def tirar_foto(self):
     print 'tirando foto...'
     filename = '/sdcard/foo.jpg'
     camera.take_picture(str(filename), self.foto_tirada)
Esempio n. 17
0
 def take_picture(self):
     filename = os.path.join(app.user_data_dir, 'tmp.jpg')
     camera.take_picture(filename, self.on_picture)
Esempio n. 18
0
	def take_picture(self):
		outname = str(uuid.uuid4())
		self.ids['_center_image'].source='init_pic.png'
		Clock.unschedule(self.callback)		
		camera.take_picture(self.picture_path+outname+'.jpg', self.done)
Esempio n. 19
0
 def photo(self):
     self.message_photo = self.user_data_dir + "/photo.jpg"
     camera.take_picture(self.message_photo, self.mm_callback)
     print "!!! Photo: " + self.message_photo
Esempio n. 20
0
 def camerabutton(self, e):
     camera.take_picture('/storage/sdcard/screenshot%(counter)04d.jpg',
                         self.done)
Esempio n. 21
0
    def on_touch_down(self, e):
        # camera.take_picture('/storage/sdcard0/example.jpg', self.done) #Take a picture and save at this location. After will call done() callback

        # with open("test.txt", "w") as f:
        # 	f.write("hmm")
        camera.take_picture('/storage/sdcard0/example.jpg', self.done)
Esempio n. 22
0
 def takepicture(self):
     camera.take_picture('/storage/sdcard0/example.jpg', self.done)
Esempio n. 23
0
File: main.py Progetto: dmuhs/ohf15
 def on_touch_down(self, e):
     camera.take_picture(
         "/storage/sdcard0/example.jpg", self.done
     )  # Take a picture and save at this location. After will call done() callback
Esempio n. 24
0
 def takepicture(self):
     camera.take_picture('/storage/sdcard0/example.jpg', self.done)
Esempio n. 25
0
 def on_touch_down(self, e):
     camera.take_picture('/storage/sdcard0/FotoTeste.jpg', self.done)
Esempio n. 26
0
 def on_touch_down(self, e):
     camera.take_picture('/storage/sdcard0/example.jpg', self.done)
Esempio n. 27
0
 def on_touch_down(self, e):
     camera.take_picture(
         '/storage/sdcard0/example.jpg', self.done
     )  #Take a picture and save at this location. After will call done() callback
Esempio n. 28
0
 def take_picture(self):
     camera.take_picture(self.create_temporary_file(),
                         self._on_picture_complete)
Esempio n. 29
0
 def on_touch_down(self, e):
     try:
         camera.take_picture(IMG_PATH, self.done)
     except:
         pass
Esempio n. 30
0
 def take_picture(self):
     camera.take_picture(
         self.create_temporary_file(),
         self._on_picture_complete)
Esempio n. 31
0
 def on_touch_down(self, e):
     camera.take_picture(
         '/storage/sdcard0/%s.jpg' % str(self.switcher.robot.teamNumber),
         lambda x: self.done())