opencv
Advanced tools
Comparing version 2.0.0 to 3.0.0
# Changelog | ||
### 3.0.0 | ||
You wait ages for a release, and 2 come along at once... | ||
This one is awesome. It adds prebuilt binaries, so you don't need | ||
to build opencv for the common platforms. | ||
Many many thanks to @edgarsilva for awesome work here, and | ||
http://hybridgroup.com/ for hosting the binaries | ||
### 2.0.0 | ||
@@ -5,0 +16,0 @@ |
var cv = require('../lib/opencv'); | ||
cv.readImage("./files/mona.png", function(err, orig) { | ||
cv.readImage("./examples/files/mona.png", function(err, orig) { | ||
if (err) throw err; | ||
cv.readImage("./files/over_text.png", function(err, over_text) { | ||
cv.readImage("./examples/files/over_text.png", function(err, over_text) { | ||
if (err) throw err; | ||
@@ -11,5 +11,5 @@ | ||
result.addWeighted(orig, 0.7, over_text, 0.9); | ||
result.save("./tmp/weighted.png"); | ||
console.log('Image saved to ./tmp/weighted.png'); | ||
result.save("./examples/tmp/weighted.png"); | ||
console.log('Image saved to ./examples/tmp/weighted.png'); | ||
}); | ||
}); |
var cv = require('../lib/opencv'); | ||
var camera = new cv.VideoCapture(0); | ||
var window = new cv.NamedWindow('Video', 0) | ||
setInterval(function() { | ||
camera.read(function(err, im) { | ||
if (err) throw err; | ||
window.show(im); | ||
window.blockingWaitKey(0, 50); | ||
}); | ||
}, 20); | ||
try { | ||
var camera = new cv.VideoCapture(0); | ||
var window = new cv.NamedWindow('Video', 0) | ||
/* | ||
setInterval(function() { | ||
camera.read(function(err, im) { | ||
if (err) throw err; | ||
console.log(im.size()) | ||
if (im.size()[0] > 0 && im.size()[1] > 0){ | ||
window.show(im); | ||
} | ||
window.blockingWaitKey(0, 50); | ||
}); | ||
}, 20); | ||
*/ | ||
} catch (e){ | ||
console.log("Couldn't start camera:", e) | ||
} |
@@ -0,1 +1,4 @@ | ||
/* For some reason the cascade file is broken on linux :( | ||
var cv = require('../lib/opencv'); | ||
@@ -19,1 +22,2 @@ | ||
}); | ||
*/ |
@@ -6,3 +6,3 @@ // Face recognition proxy | ||
http.createServer(function(req, resp){ | ||
var server = http.createServer(function(req, resp){ | ||
var url = req.url.slice(1); | ||
@@ -31,2 +31,5 @@ request({uri:url, encoding:'binary'}, function(err, r, body){ | ||
}).listen(3000, function(){ console.log('Listening on http://localhost:3000'); }) | ||
}) | ||
//server.listen(3000, function(){ console.log('Listening on http://localhost:3000'); }) |
var cv = require('../lib/opencv'); | ||
cv.readImage("./files/mona.png", function(err, im) { | ||
salt(im, 1000); | ||
salt(im, 100); | ||
im.save("./tmp/salt.png"); | ||
@@ -6,0 +6,0 @@ console.log('Image saved to ./tmp/salt.png'); |
var cv = require('../lib/opencv'); | ||
var vid = new cv.VideoCapture(0); | ||
try { | ||
var vid = new cv.VideoCapture(0); | ||
vid.read(function(err, im){ | ||
if (err) throw err; | ||
im.detectObject(cv.FACE_CASCADE, {}, function(err, faces){ | ||
vid.read(function(err, im){ | ||
if (err) throw err; | ||
if (!faces.length) return console.log("No Faces"); | ||
if (im.size()[0] > 0 && im.size()[1] > 0){ | ||
var face = faces[0]; | ||
var ims = im.size(); | ||
var im2 = im.roi(face.x, face.y, face.width, face.height) | ||
/* | ||
im.adjustROI( | ||
-face.y | ||
, (face.y + face.height) - ims[0] | ||
, -face.x | ||
, (face.x + face.width) - ims[1]) | ||
*/ | ||
im2.save('./tmp/take-face-pics.jpg') | ||
console.log('Image saved to ./tmp/take-face-pics.jpg'); | ||
}) | ||
}); | ||
im.detectObject(cv.FACE_CASCADE, {}, function(err, faces){ | ||
if (err) throw err; | ||
if (!faces.length) return console.log("No Faces"); | ||
var face = faces[0]; | ||
var ims = im.size(); | ||
var im2 = im.roi(face.x, face.y, face.width, face.height) | ||
/* | ||
im.adjustROI( | ||
-face.y | ||
, (face.y + face.height) - ims[0] | ||
, -face.x | ||
, (face.x + face.width) - ims[1]) | ||
*/ | ||
im2.save('./examples/tmp/take-face-pics.jpg') | ||
console.log('Image saved to ./tmp/take-face-pics.jpg'); | ||
}) | ||
} else { | ||
console.log("Camera didn't return image") | ||
} | ||
}); | ||
} catch (e){ | ||
console.log("Couldn't start camera", e) | ||
} |
var cv = require('../lib/opencv'); | ||
cv.readImage("./mona.png", function(err, im) { | ||
cv.readImage("./files/mona.png", function(err, im) { | ||
if (err) throw err; | ||
@@ -14,4 +14,4 @@ | ||
im.warpPerspective(xfrmMat, width, height, [255, 255, 255]); | ||
im.save("./warp-image.png"); | ||
im.save("./tmp/warp-image.png"); | ||
console.log('Image saved to ./tmp/warp-image.png'); | ||
}); |
@@ -1,1 +0,7 @@ | ||
module.exports = require('../build/Release/opencv.node'); | ||
var binary = require('node-pre-gyp'); | ||
var path = require('path'); | ||
var binding_path = binary.find(path.resolve(path.join(__dirname,'../package.json'))); | ||
var binding = require(binding_path); | ||
//module.exports = require('../build/Release/opencv.node'); | ||
module.exports = binding; |
@@ -6,13 +6,19 @@ { | ||
"dependencies": { | ||
"node-pre-gyp": "0.5.31", | ||
"buffers": "0.1.1", | ||
"nan": "1.4.3" | ||
}, | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"devDependencies": { | ||
"tape": "^3.0.0" | ||
"tape": "^3.0.0", | ||
"aws-sdk": "~2.0.21", | ||
"glob": "^4.0.6", | ||
"request": "^2.45.0" | ||
}, | ||
"bundledDependencies":["node-pre-gyp"], | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "node-gyp build", | ||
"test": "node test/unit.js" | ||
"test": "node test/unit.js", | ||
"install": "node-pre-gyp install --fallback-to-build" | ||
}, | ||
@@ -32,3 +38,10 @@ "keywords": [ | ||
"node": ">=0.10" | ||
}, | ||
"binary": { | ||
"module_name" : "opencv", | ||
"module_path" : "./build/{module_name}/v{version}/{configuration}/{node_abi}-{platform}-{arch}/", | ||
"remote_path" : "./{module_name}/v{version}/{configuration}/", | ||
"package_name": "{node_abi}-{platform}-{arch}.tar.gz", | ||
"host" : "https://node-opencv.s3.amazonaws.com" | ||
} | ||
} |
@@ -25,2 +25,3 @@ # node-opencv | ||
## Examples | ||
Run the examples from the parent directory. | ||
@@ -27,0 +28,0 @@ ### Face Detection |
@@ -1,4 +0,4 @@ | ||
var cv = require('../lib/opencv') | ||
var cv = require('../lib/opencv'); | ||
var trainingData = [] | ||
var trainingData = []; | ||
/* | ||
@@ -25,3 +25,3 @@ for (var i = 1; i< 41; i++){ | ||
var th = mat.threshold(200, 200, "Threshold to Zero Inverted"); | ||
th.save('./examples/tmp/out.png') | ||
}) | ||
th.save('./examples/tmp/out.png'); | ||
}); |
@@ -278,1 +278,5 @@ var fs = require('fs') | ||
// Test the examples folder. | ||
require('./examples')() | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
23921571
143
689
207
3
4
1
2
3
+ Addednode-pre-gyp@0.5.31
+ Addednode-pre-gyp@0.5.31(transitive)