marsprobe / meetup19

In this meetup, we will introudce the FLIR camera and microscope camera on Pi. Demo code can be found below.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Raspberry Pi User Group Meetup 19th

Intro

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.

Required

Build v4l2loopback virtual device node.

# 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

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 /dev/video0 &
Waiting for sink
done reading, resets: 

FLIR Camera Canny Edge Detection

$ 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

FLIR Camera + Raspberry Pi Camera Alpha Blending

$ python blend.py

USB Microscope

Required

Install Python-tesseract

$ pip install pytesseract

Use pytesseract to do OCR.

$ cd micro
$ python ocr_preview.py 0

Note:

  1. the 0 of python ocr_preview.py 0 means the 0th video device node, such as /dev/video0.
  2. When launch the program, press t to start Tesseract-OCR for the fixed area.
  3. After finish Tesseract-OCR, the result will be shown on the preview window.
  4. Press q to exit the program.

About

In this meetup, we will introudce the FLIR camera and microscope camera on Pi. Demo code can be found below.


Languages

Language:Python 100.0%