Raspberry pi之树莓派基础建设-2

1.ssh pi与本地文件传输

  一般ssh是默认会支持sftp的,所以你可以考虑用filezila之类的ftp工具远程连接登陆

2.我考虑到要拍照,前提是你得有个摄像头,usb直接插上去

3.python控制opencv来调用摄像头

  直接sudo apt-get install python-opencv就可以了

4.编码

  1 #encoding=utf-8

  2 import os

  3 import time

  4 import cv

  5 

)

)

)

  9 

 10 

 11 def cap_img(file):

 12         frame = cv.QueryFrame(cap)

 13         cv.SaveImage(file, frame)

 14         returnfile

 15 

 16 def remove_img(file):

 17         if os.path.exists(file):

 18                 os.remove(file)

 19                 return True

 20         else:

 21                 return False

 22 

 23 def main():

 24         img_file = 'tmp.jpg'

 25         path = cap_img(img_file)

 26         print path

 27         #remove_img(path)

 28 #?~O?以?~\?此?~D设置?~@个?~W??~Z~T?~W??~W??~L循?~N??~P~Q认?~A?~Z~D微?~V~D?~J?| ?~[??~I~G

 29 if __name__ == '__main__':

 30         main()

5.照片出来了,没调整焦距,所以还是有些问题

 Raspberry pi之树莓派基础建设-2

上一篇:在QT中自定义头文件和源文件的使用方法


下一篇:ACM: 限时训练题解-Runtime Error-二分查找