Skip to content
btsimonh edited this page Nov 4, 2017 · 2 revisions

OpenCV

The opencv module is the root of the node-opencv package.

Accessing:

var cv = require('opencv');

give an OpenCV object.

note: none of the below are actually asynchronous at the time of writing this wiki article


cv.readImage( imagefilename:String, function( err, img ){} )

Reads an image from disk using cv::imread(filename, CV_LOAD_IMAGE_UNCHANGED)


cv.readImage( imagedata:Buffer, function( err, img ){} )

Decodes an image from a Buffer using cv::imdecode(*mbuf, CV_LOAD_IMAGE_UNCHANGED)


cv.readImage( width:number, height:number, function( err, img ){} )

creates a Matrix of the specified size and of type CV_64FC1. currently not operational because arg 2 has to be a function!


cv.readImageMulti( imagefilename:String, function( err, arr ){} )

Reads a file containing multiple images and calls back with an array of Matrix objects using cv::imreadmulti(filename, mats);

Does nothing and returns false in openCV < 3.

Returns undefined (? - untested) in OpenCV3.


Clone this wiki locally