mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
fix up sample; and improve arg calling
This commit is contained in:
parent
b548ea957a
commit
e27e96e551
@ -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");
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user