linkimage
v0.1.2
Published
Find corresponding point between images
Downloads
31
Maintainers
Readme
linkimage
Find corresponding points between images. Using OpenCV and TensorFlow.js.
Install
npm install linkimage
or
yarn add linkimage
Usage
const fs = require('fs')
const { link, linkMat } = require('linkimage')
const { imdecode, imread } = require('opencv4nodejs')
const srcBuffer = fs.readFileSync('images/src.jpg')
const dstBuffer = fs.readFileSync('images/dst.jpg')
// Find point on the destination image which corresponds to the specific point on the source image.
// The source point is the center of the source image.
const point = link(srcBuffer, dstBuffer)
// You can also specify a source point:
// const point = link(srcBuffer, dstBuffer, [100, 100])
// You can also use 'linkMat' method to pass Mat objects directly.
const srcMat = imdecode(srcBuffer)
const dstMat = imdecode(dstBuffer)
// Or use imread instead
// const srcMat = imread('images/src.jpg')
// const dstMat = imread('images/dst.jpg')
const point2 = linkMat(srcMat, dstMat)
// Returns the cordinates of the corresponding point in format [x, y].
// If no point found, return [-1, -1].
console.log(point)