Giter Club home page Giter Club logo

node-optris's Introduction

node-optris

This module provides a NodeJS binding to the Evocortex Libirimager SDK. The direct binding allows to get images from Optris cameras using NodeJS. For any further information about the SDK and the functions available in the API please refers to the Evocortex documentation.

Under development

Installation

  • Download the irDirectSDK from the Evocortex website
  • Install the package: npm install https://github.com/FiloCara/node-optris.git

Implemented functions

direct binding name node-optris name description
evo_irimager_usb_init usb_init Initializes an IRImager instance connected to this computer via USB
evo_irimager_usb_init tcp_init Initializes the TCP connection to the daemon process (non-blocking)
evo_irimager_terminate terminate Disconnects the camera, either connected via USB or TCP
evo_irimager_get_thermal_image_size get_thermal_image_size Accessor to image width and height
evo_irimager_get_palette_image_size get_palette_image_size Accessor to width and height of false color coded palette image
evo_irimager_get_thermal_image get_thermal_image Accessor to thermal image by reference, Conversion to temperature values are to be performed as follows: t = ((double)data[x] - 1000.0) / 10.0
evo_irimager_get_palette_image get_palette_image Accessor to an RGB palette image by reference
evo_irimager_get_thermal_palette_image get_thermal_palette_image Accessor to an RGB palette image and a thermal image by reference
evo_irimager_set_palette set_palette Set RGB palette
evo_irimager_set_shutter_mode set_shutter_mode Sets shutter flag control mode (0:manual, 1:auto)
evo_irimager_trigger_shutter_flag trigger_shutter_flag Forces a shutter flag cycle
evo_irimager_daemon_launch daemon_launch Launch TCP daemon
evo_irimager_daemon_is_running daemon_is_running Check whether daemon is already running
evo_irimager_daemon_kill daemon_kill Kill TCP daemon

More information available in the docstrings of the node-optris.js file.

Examples

Get thermal images

// Example script to get palette image from Optris camera
const optris = require('../node-optris')

// Set you current config file path
xmlPath = "../config_file_windows.xml"
formatsPath = "../Formats.def"

// Load DLL 
sdkPath = "irDirectSDK/sdk/x64/libirimager.dll" // Define yout SDK path
optris.loadDLL(sdkPath)

optris.usb_init(xmlPath, formatsPath)

// Get w, h
let w, h = optris.get_thermal_image_size()

while (true) {
    // thermal image --> Buffer of size (w * h)
    let thermal_image = optris.get_thermal_image(w, h)
    // Buffer can now be converted to Array or base64 string

}

process.on("SIGINT", function() {
    optris.terminate()
    process.exit()
    })

Get palette images

// Example script to get palette image from Optris camera
const optris = require('../node-optris')

// Set you current config file path
xmlPath = "../config_file_windows.xml"
formatsPath = "../Formats.def"

// Load DLL 
sdkPath = "irDirectSDK/sdk/x64/libirimager.dll" // Define yout SDK path
optris.loadDLL(sdkPath)

console.log("Initialize USB communication")
optris.usb_init(xmlPath, formatsPath)

// Get w, h
let w, h = optris.get_palette_image_size()

while (true) {
    // palette image --> Buffer of size (w * h * 3)
    let palette_image = optris.get_palette_image(w, h)
    // Buffer can now be converted to Array or base64 string
}

// Handle CTRL-C to stop the script and terminate optris process correctly
process.on('SIGINT', () => {
    optris.terminate()
    process.exit()
})

node-optris's People

Contributors

filocara avatar

Watchers

 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.