fix up sample; and improve arg calling

This commit is contained in:
John Ludwig 2014-05-09 14:08:47 -07:00
parent b548ea957a
commit e27e96e551
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
var cv = require('../lib/opencv');
cv.readImage("./quads.jpg", function(err, im) {
cv.readImage("./mona.png", function(err, im) {
var srcArray = [
0,0,
@ -10,14 +10,14 @@ cv.readImage("./quads.jpg", function(err, im) {
var dstArray = [
0,0,
im.width()*.9,im.height()*.1,
im.width().im.height(),
im.width(),im.height(),
im.width()*.2,im.height()*.8];
var xfrmMat = im.getPerspectiveTransform(srcArray,dstArray);
img_warp = im.copy();
img_warp.warpPerspective(xfrmMat,im.width,im.height,[255,255,255]);
img_warp.save("/tmp/warp.jpg");
img_warp.save("/tmp/mona_warp.png");
});

View File

@ -1762,7 +1762,7 @@ Matrix::PutText(const v8::Arguments& args) {
Handle<Value>
Matrix::GetPerspectiveTransform(const v8::Arguments& args) {
SETUP_FUNCTION(Matrix)
HandleScope scope;
// extract quad args
Local<Object> srcArray = args[0]->ToObject();