In this meetup, we will introudce the FLIR camera and microscope camera on Pi. Demo code can be found below. The slide is available on Raspberry Pi特色相機介紹(熱成像攝影機+微距相機)
Our environment is Pi 3 + 2017-07-05-raspbian-jessie.img.
# Install Kernel Source and Header
$ sudo apt-get update
$ sudo apt-get install bc libncurses5-dev
$ 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
$ cd ~
$ git clone https://github.com/umlaeute/v4l2loopback
$ cd ~/v4l2loopback
$ sudo make
$ sudo make install
$ sudo depmod -a
$ sudo modprobe v4l2loopback
$ cd ~
$ git clone https://github.com/groupgets/LeptonModule
$ cd ~/LeptonModule/software/v4l2lepton
$ sed -i -e 's/video1/video0/g' v4l2lepton.cpp
$ make
$ sudo ./v4l2lepton /dev/video0 &
Waiting for sink
done reading, resets:
$ cd flir
# FLIR image preview
$ python flir_preview.py
# FLIR image to Gray scale image preview
$ python canny2.py
# Canny edge detection WITHOUT blur
$ python canny3.py
# Canny edge detection with blur
$ python canny4.py
$ python blend.py
$ pip install pytesseract
Use pytesseract to do OCR.
$ cd micro
$ python ocr_preview.py 0
Note:
- the
0
ofpython ocr_preview.py 0
means the 0th video device node, such as/dev/video0
. - When launch the program, press
t
to start Tesseract-OCR for the fixed area. - After finish Tesseract-OCR, the result will be shown on the preview window.
- Press
q
to exit the program.