2020年4月21日 星期二

MFCC的討論

MFCC python plot
https://blog.csdn.net/m0_37052320/article/details/80743906

How to plot MFCC in Python?
https://stackoverflow.com/questions/43506198/how-to-plot-mfcc-in-python

Speech Processing for Machine Learning: Filter banks, Mel-Frequency Cepstral Coefficients (MFCCs) and What's In-Between
https://haythamfayek.com/2016/04/21/speech-processing-for-machine-learning.html#fnref:1


人臉識別的討論

【人臉辨識】使用5 Facial Landmarks進行臉孔校正
https://makerpro.cc/2019/08/face-alignment-through-5-facial-landmarks/

[ Dlib ] 利用 Dlib進行臉部捕捉

Raspberry Pi: Facial landmarks + drowsiness detection with OpenCV and dlib

Trained model files for dlib example programs.

python dlib学习(七):人脸特征点对齐
https://blog.csdn.net/hongbin_xu/article/details/78511292


lepton 熱像儀 討論串

Errrrrrr.... (這個詞最近很紅? XD)


最近用熱像儀, 發現很容易讀不到畫面 (還是板子壞了? QQ)

把目前找到的分頁紀錄一下

Help! Setup Failed - Flir Lepton + Breakout v1.4 + RPI3 Model B
https://groups.google.com/forum/#!searchin/flir-lepton/red$20square|sort:date/flir-lepton/hFN4Rd93XM0/kD5OdFDaBwAJ

Raspberrypi_Video Red Square Forever...
https://groups.google.com/forum/#!searchin/flir-lepton/red$20square|sort:date/flir-lepton/-oGTU1Lk-NA/pGKlCD_TCAAJ

Flir Lepton中有關「red square」的結果
https://groups.google.com/forum/#!searchin/flir-lepton/red$20square%7Csort:date

2020年4月15日 星期三

RaspPI 安裝 dlib

Err: Failed building wheel for dlib
Sol: pip install --upgrade pip

Err: CMake must be installed to build the following extensions: dlib
Sol: sudo apt-get install cmake

在桌面環境安裝會超久 (12小時還沒好...)

使用終端機模式會快很多 (3小時內?)

sudo init 3   # 這個指令會關閉多人/桌面模式
pip install dlib

sudo init 5  # 恢復桌面模式

----

補充

pip install dlib -> 這個是python2用的版本, 因為wheel上沒有已編譯好的whl檔, 所以會變成抓source code下來安裝

如果用python3的話, 就有現成的whl可以用, 速度會超快 XDDDD

2020年4月7日 星期二

2020年3月31日 星期二

lepton 熱像儀

主要參考來源是這邊:
https://learn.sparkfun.com/tutorials/flir-lepton-hookup-guide

裡面提到很多前置作業, 像是開啟I2C, SPI...

接下來就是抓source code了!

======================================
1. Code for getting started with the FLIR Lepton breakout board
https://github.com/groupgets/LeptonModule

這邊的話, 有用過 raspberrypi_video 與 v4l2lepton 做過測試

A. raspberrypi_video
https://github.com/groupgets/LeptonModule/tree/master/software/raspberrypi_video

sudo raspi-config  # enable the SPI and I2C
sudo apt-get install qt4-dev-tools
qmake && make  # cd to the LeptonModule/sofware/raspberrypi_video folder
./raspberrypi_video

然後就會看到熱影像畫面了

如果這時候只看到一個紅色框框, 據說是相機模組(?)沒有裝好
把黑色的模組拔下來再重插就好


B. v4l2lepton
https://github.com/groupgets/LeptonModule/tree/master/software/v4l2lepton

這邊有參考台灣樹莓派的流程https://github.com/raspberrypi-tw/meetup19

* Build v4l2loopback virtual device node.
# Install Kernel Source and Header
sudo apt-get update
sudo apt-get install bc libncurses5-dev flex bison
sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source && sudo chmod +x /usr/bin/rpi-source && /usr/bin/rpi-source -q --tag-update
rpi-source

# Install required module
pip3 install imutils
pip3 install opencv-python==3.4.6.27


* Install V4L2 Kernel Module
$ cd ~
$ git clone https://github.com/umlaeute/v4l2loopback
$ cd ~/v4l2loopback
$ sudo make
$ sudo make install
$ sudo depmod -a
$ sudo modprobe v4l2loopback


* Enable FLIR Camera V4L2
cd ~
git clone https://github.com/groupgets/LeptonModule
cd ~/LeptonModule/software/v4l2lepton
sed -i -e 's/video1/video0/g' v4l2lepton.cpp
make
sudo ./v4l2lepton -v /dev/video0 & -d /dev/spidev0.0  # 這邊的編號會根據每個人的環境發生變化

然後終端機會看到下面的訊息: (要看到第二行的done reading才會有畫面)
Waiting for sink
done reading, resets: 


接下來去執行台灣樹莓派的範例 (flir_preview.py)就可以看到熱像儀畫面了

======================================
2. pylepton: Quick and dirty pure python library for interfacing with FLIR lepton
https://github.com/groupgets/pylepton

這邊有流程: https://lepton.flir.com/forums/topic/pylepton-overlay-guide-2-0-for-raspbian-pixel/

sudo apt-get install python-opencv python-numpy
git clone https://github.com/kekiefer/pylepton.git
cd pylepton
sudo python setup.py install

然後執行 pylepton_overlay 就可以看到畫面了

不過這個程式是融合 pi camera 與 熱像儀的畫面, 所以需要設定透明度

官網範例: pylepton_overlay -a 255 就是100% lepton overlay 

======================================

後記(?)

感覺要用python去開發的話, 用v4l2lepton 似乎比較方便

只是這個東西似乎沒辦法取代額溫槍來量體溫, 誤差似乎比較大
而且還沒看到校正的方式 QQ

紅外線熱像儀 FLIR Radiometric Lepton

最近買了一個熱像儀, 稍微整理一下怎麼使用

產品資訊:
https://www.raspberrypi.com.tw/30009/15948-flir-radiometric-lepton-dev-kit-v2


只是拿到的板子是雙排pin腳, 網路上有些教學是單排pin腳, 而且還有印刷腳位名稱 QQ

雙排的規格可以參考這個網頁
https://drive.google.com/file/d/1ZoJ5Z3FIoHFgPHvqky2rA_vTJ1bs079j/view



















裡面的pin-out有說明腳位意義



pin腳的連接方式可以參考這邊的說明
https://learn.sparkfun.com/tutorials/flir-lepton-hookup-guide

基本上就是看PI的GPIO腳位名稱, 然後把I2C與SPI的腳位對接
Lepton熱像儀簡稱L, 樹莓派當然就用P來表示 XD

(L) -- (P)
1 ---- 9  # GND
5 ---- 3  # SDA
7 ---- 23  # SPI_CLK
9 ---- 19  # SPI_MOSI

2 ---- 1  # 3V3
8 ---- 5  # SCL
10 ---- 24  # SPI_CS
12 ---- 21  # SPI_MISO



==============================================

以上是腳位的線路連接方式, code再另外寫一篇好了 zzz

==============================================

一些規格書的連結:
FLIR LEPTON® Engineering Datasheet
https://www.flir.com/globalassets/imported-assets/document/flir-lepton-engineering-datasheet.pdf

FLIR Lepton® Camera Breakout Board v2.0
https://drive.google.com/file/d/1ZoJ5Z3FIoHFgPHvqky2rA_vTJ1bs079j/view

FLIR LEPTON® with Radiometry Datasheet
https://drive.google.com/file/d/10Ps99n8eudVfr7na4ImGDGzhxFpeNOie/view

FLIR LEPTON® Software Interface Description Document (IDD)
https://www.flir.com/globalassets/imported-assets/document/flir-lepton-software-interface-description-document.pdf

2020年3月30日 星期一

氣壓計原理說明

這個上課講義蠻豐富的: (p15是Pressure Sensors)
https://www.engr.sjsu.edu/trhsu/ME189_Chapter%202.pdf

這本書(?)有提到BMP085
https://books.google.com.tw/books?id=eENBDwAAQBAJ&pg=PA338&lpg=PA338&dq=bmp+085+Wheatstone+bridge&source=bl&ots=XdXx7Zph8i&sig=ACfU3U2xon4M5KDji9hd6pxVP0qs-_qScg&hl=zh-TW&sa=X&ved=2ahUKEwj5luWSoMHoAhVPFqYKHS07DV4Q6AEwCnoECAoQAQ#v=onepage&q=bmp%20085%20Wheatstone%20bridge&f=false

不過bmp085的datasheet有提到它是"Piezo-resistive pressure sensors", 這邊有提到
https://www.rohm.com/electronics-basics/sensor/barometric-pressure-sensor


Piezo-resistive原理的氣壓計, 感覺就是裡面有四個電阻, 然後用"惠斯通電橋(Wheatstone bridge)"去計算氣壓值

(看到piezo就會想到pizza, XD)

這邊也有提到:
https://www.electronicspecifier.com/products/sensors/a-quick-guide-to-choosing-a-pressure-sensor


2020年3月25日 星期三

調整PI的解析度

在使用TTL控制時, 設定完VNC遠端後, 用vnc viewer開啟時, 有時候會遇到螢幕太小 (解析度錯誤)的情形

我也不知道為什麼, 至少我沒遇過 ˊ_>ˋ

vnc官網其實有提到:
https://help.realvnc.com/hc/en-us/articles/360002249917-VNC-Connect-and-Raspberry-Pi#troubleshooting-vnc-server-0-7

在終端機打:
sudo raspi-config

然後去進階選項找"解析度"
Advanced Options > Resolution

選完之後, 他會自動重開機, 然後就ok了

相似度分析?

來研究一下opencv的相似度好了 QQ

colormap
https://docs.opencv.org/2.4/modules/contrib/doc/facerec/colormaps.html

OpenCv-C++-ORB特徵檢測與匹配
https://www.itread01.com/content/1545506044.html

python OpenCV 图片相似度 5种算法
https://blog.csdn.net/enter89/article/details/90293971

【python 图像相似度】OpenCV图像相似度ORB算法--相似图像去重
https://blog.csdn.net/u013421629/article/details/87364489