Giter Site home page Giter Site logo

libpyseek's Introduction

libPySeek

Description

This lib is a Python wrapper for Seek Thermal CompactPRO (https://www.thermal.com/compact-series.html)

Reference

Most of codes are refered or resued from the following repo's

  1. Seek-Thermal library https://github.com/maartenvds/libseek-thermal
  2. cv::Mat <--> Python Numpy array https://github.com/GarrickLin/numpy-opencv-converter

Build

Dependencies:

  • cmake
  • Opencv 3.x.x
  • libusb-1.0-0-dev
  • boost_1_66_0

Install libusb

sudo apt-get install libusb-1.0-0-dev

Install boost

wget https://sourceforge.net/projects/boost/files/boost/1.66.0/boost_1_66_0.tar.bz2
tar xjf boost_1_66_0.tar.bz2
cd boost_1_66_0
./bootstrap.sh
./b2 install

Note:

  1. you can see all available libraries.
./bootstrap.sh --show-libraries
  1. You can also install the library that you need. It saves time.
./bootstrap.sh --with-libraries=python
cd libPySeek
vi src/CMakeLists.txt

(Find key word "PLEASE_CHANGE_TO_YOUR_PATH". Change the paths to yours)

mkdir build
cd build
cmake ../
make

Run

An object file "build/src/pyseek.so" will be created. Copy that file to your wokring dir.

Example

from pyseek import thSeekThermalPro
import cv2

seek = thSeekThermalPro()
status = seek.seekInit()
print status

while True:
	if seek.seekRead() == 1:
		frame = seek.seekGetGrayCvFrame()
		cv2.imshow('seek',frame)
	if cv2.waitKey(1) & 0xFF == ord('q'):
		break

cv2.destroyAllWindows()

Note: Please use sudo yourcode.py

Getting USB access

You need to add a udev rule to be able to run the program as non root user:

Udev rule:

sudo vi /etc/udev/rules.d/100-usb.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="289d", ATTRS{idProduct}=="0011", MODE="0666", GROUP="users"

Replace 'XXXX' with:

  • 0011: Seek Thermal CompactPRO

or manually chmod the device file after plugging the usb cable:

sudo chmod 666 /dev/bus/usb/00x/00x

with '00x' the usb bus found with the lsusb command

libpyseek's People

Contributors

hntuan94 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.