2019年3月20日 星期三

[python]攝影機檔案儲存

cap=cv2.VideoCapture(0)

#decode
fourcc=cv2.VideoWriter_fourcc('I', '4', '2', '0')

#image save
out=cv2.VideoWriter('out.avi',fourcc,20.0,(640,480))

while(cap.isOpened()):
    ret,frame=cap.read()
    if ret==True:
        out.write(frame)
        cv2.imshow('frame',frame)
        if cv2.waitKey(1)& 0xFF==ord('q'):
            break
    else:
        break

cap.release()
out.release()
cv2.destroyAllWindows()

2019年3月19日 星期二

[python]開啟攝影機

cap=cv2.VideoCapture(0)
while(cap.isOpened()):
    ret,frame=cap.read()
    cv2.imshow('frame',frame)
    if cv2.waitKey(1)& 0xFF==ord('q'):
            break

2019年3月7日 星期四

[python]使用opencv 秀圖

在 visual studio ,安裝 opencv,必須在安裝 packeage 的搜尋地方打入 opencv-python 才行

簡單的程式:

import cv2
import numpy as np
import os
mywd="c:\pydata"
os.chdir(mywd)
cv2.namedWindow("test_show",1)
img=cv2.imread("1.jpg",1)
cv2.imshow("test_show",img)
cv2.waitKey(0)  ==>沒寫這欄,只會有框,不會秀圖........

成功!!!

2019年3月5日 星期二

[python]在visual studio 中安裝套件

不錯的文章:

在您的 Python 環境中安裝套件https://docs.microsoft.com/zh-tw/visualstudio/python/tutorial-working-with-python-in-visual-studio-step-05-installing-packages?view=vs-2017

2019年2月10日 星期日

[window]如何在window下 fdisk usb flash friver (使用linux分割過的)


不錯的文章
https://www.howtogeek.com/235824/how-to-clean-a-flash-drive-sd-card-or-internal-drive-to-fix-partition-and-capacity-problems/

2019年1月22日 星期二

[raspberry pi]How To Mount A USB Flash Disk On The Raspberry Pi

不錯的文章
https://www.raspberrypi-spy.co.uk/2014/05/how-to-mount-a-usb-flash-disk-on-the-raspberry-pi/

What Is the Linux fstab File, and How Does It Work?
https://www.howtogeek.com/howto/38125/htg-explains-what-is-the-linux-fstab-and-how-does-it-work/

[raspberry pi]IoT Weather Station With RPi and ESP8266

不錯的文章:
https://www.instructables.com/id/IoT-Weather-Station-With-RPi-and-ESP8266/