コード例 #1
0
ファイル: pictureimporter.py プロジェクト: pombreda/prejudice
        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)
コード例 #2
0
ファイル: camera.py プロジェクト: rsmusllp/operator
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)
コード例 #3
0
ファイル: main.py プロジェクト: brousch/playground
        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)
コード例 #4
0
 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")
コード例 #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
コード例 #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)
コード例 #7
0
ファイル: main.py プロジェクト: 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()
コード例 #8
0
    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()
コード例 #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()
コード例 #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()
コード例 #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()
コード例 #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()
コード例 #13
0
ファイル: main.py プロジェクト: autosportlabs/plyer
    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()
コード例 #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 = "Пятьсот Гривен"
コード例 #15
0
 def on_touch_down(self, e):
     try:
         camera.take_picture(IMG_PATH, self.done)
     except:
         pass
コード例 #16
0
 def tirar_foto(self):
     print 'tirando foto...'
     filename = '/sdcard/foo.jpg'
     camera.take_picture(str(filename), self.foto_tirada)
コード例 #17
0
ファイル: main.py プロジェクト: antocuni/plyer
 def take_picture(self):
     filename = os.path.join(app.user_data_dir, 'tmp.jpg')
     camera.take_picture(filename, self.on_picture)
コード例 #18
0
ファイル: main.py プロジェクト: shakle17/rand0m-app
	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)
コード例 #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
コード例 #20
0
ファイル: main.py プロジェクト: Sigmatilde/Tox-Biosensor
 def camerabutton(self, e):
     camera.take_picture('/storage/sdcard/screenshot%(counter)04d.jpg',
                         self.done)
コード例 #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)
コード例 #22
0
ファイル: xx4.py プロジェクト: andreaskamalnathan/ck
 def takepicture(self):
     camera.take_picture('/storage/sdcard0/example.jpg', self.done)
コード例 #23
0
ファイル: main.py プロジェクト: 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
コード例 #24
0
 def takepicture(self):
     camera.take_picture('/storage/sdcard0/example.jpg', self.done)
コード例 #25
0
ファイル: Camara.py プロジェクト: FoxSGR/Android
 def on_touch_down(self, e):
     camera.take_picture('/storage/sdcard0/FotoTeste.jpg', self.done)
コード例 #26
0
 def on_touch_down(self, e):
     camera.take_picture('/storage/sdcard0/example.jpg', self.done)
コード例 #27
0
ファイル: main.py プロジェクト: urantialife/Kivy-Tutorials
 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
コード例 #28
0
 def take_picture(self):
     camera.take_picture(self.create_temporary_file(),
                         self._on_picture_complete)
コード例 #29
0
ファイル: main.py プロジェクト: fmarco/message-board-client
 def on_touch_down(self, e):
     try:
         camera.take_picture(IMG_PATH, self.done)
     except:
         pass
コード例 #30
0
ファイル: main.py プロジェクト: MichaelGradek/plyer
 def take_picture(self):
     camera.take_picture(
         self.create_temporary_file(),
         self._on_picture_complete)
コード例 #31
0
 def on_touch_down(self, e):
     camera.take_picture(
         '/storage/sdcard0/%s.jpg' % str(self.switcher.robot.teamNumber),
         lambda x: self.done())