163 Commits

Autor SHA1 Mensagem Data
Peter Braden 440a72c38e Merge branch 'master' of github.com:peterbraden/node-opencv into beta 2013-04-09 21:34:41 -07:00
Peter Braden 865962c845 videocapture read now uses err, im convention 2013-04-09 21:34:00 -07:00
Peter Braden a347ab682e add adjustROI 2013-04-06 18:34:08 -07:00
Peter Braden f1d629bfb3 Merge pull request #43 from carter-thaxton/master
Add async save method
2013-03-28 10:21:40 -07:00
Carter Thaxton 507ecbf832 Add async save, triggering off existence of callback 2013-03-28 01:01:55 -07:00
Peter Braden f0461db126 Merge pull request #42 from mrnugget/patch-1
Fix travis.yml to run with correct Node.js version
2013-03-25 10:55:31 -07:00
Thorsten Ball 3c6028e0e3 Fix travis.yml to run with correct Node.js version
This changes the `.travis.yml` to use the correct Node.js version
by using strings as version numbers.

Relevant Travis CI documentation page: http://about.travis-ci.org/docs/user/languages/javascript-with-nodejs/#Choosing-Node-versions-to-test-against

Without using strings to specify the desired versions Travis CI
runs on Node.js 0.1 instead of 0.10.
2013-03-25 10:49:20 +01:00
Peter Braden 95b2585838 Merge branch 'master' of github.com:peterbraden/node-opencv 2013-03-19 17:18:49 -07:00
Peter Braden 289c519362 add 0.10 to tests 2013-03-19 16:54:54 -07:00
Peter Braden 1d542bc056 Cast cb for node 0.10 2013-03-19 16:53:50 -07:00
Peter Braden 76f3847321 get mat etc 2013-03-15 15:28:58 -07:00
Peter Braden 8e55b380cd add updateSync 2013-03-15 15:07:16 -07:00
Peter Braden 0efbd11d0c Constructors for other algorithms 2013-03-15 14:48:43 -07:00
Peter Braden b8ce5d0def Correct basic case with feedback from jraadt 2013-03-15 13:55:01 -07:00
Peter Braden 053a693c9a Basic version of Face recognition working 2013-03-13 18:08:05 -07:00
Peter Braden 64f933f2a9 WIP on face recognition 2013-03-13 17:42:05 -07:00
Peter Braden b17fceca72 Initial work on face recognition using the FaceRecognizer class from opencv 2.4.4 2013-03-13 16:15:29 -07:00
Peter Braden e5be89c813 Merge pull request #40 from jraadt/master
Fixed pausing a video stream.
2013-03-12 21:43:41 -07:00
Jeremy Raadt fd25b58e43 Fixed an invalid reference to this for pausing a video stream. 2013-03-12 23:34:58 -05:00
Peter Braden ebd1f6e4e8 Merge branch 'waitkey' into beta 2013-03-11 15:41:58 -07:00
Peter Braden e88d2d6b8a Blocking waitKey for development 2013-03-11 15:41:36 -07:00
Peter Braden daca1a14cb PyrDown / PyrUp 2013-03-05 11:28:37 -08:00
Peter Braden 11db468dcf v0.0.12 2013-03-05 11:19:25 -08:00
Peter Braden 55cbf0a37f add matrix clone 2013-03-04 12:03:35 -08:00
Peter Braden 77279a33c0 Add basic highgui window support 2013-03-04 11:12:33 -08:00
Peter Braden 6225a3c0f0 add keywords to package.json 2013-02-28 18:14:37 -08:00
Peter Braden f2ec2cd3ed Allow video capture to be streamed 2013-02-26 19:07:39 -08:00
Peter Braden c3d3f0f4b4 beta 0.0.11 2013-02-26 17:23:19 -08:00
Peter Braden 0840e0b2e2 Merge branch 'provide-cascades' into beta
Conflicts:
	lib/opencv.js
2013-02-26 16:52:36 -08:00
Peter Braden 4ca165635e provide image to event 2013-02-26 16:51:45 -08:00
Peter Braden a8e5ac4b6b Fix path 2013-02-26 16:27:34 -08:00
Peter Braden 24f255a161 unit test for imagestream 2013-02-26 16:23:14 -08:00
Peter Braden 0bb7fe9918 Add shortcut for face cascade file -> cv.FACE_CASCADE 2013-02-26 15:34:27 -08:00
Peter Braden 0cb436e930 Changing ImageStream -> ImageDataStream and creating ImageStream.
To pipe data into an image matrix, you now use ImageDataStream.

ImageStream is now a stream that transforms image buffers into matrices.
2013-02-26 15:26:54 -08:00
Peter Braden 3a7469fe52 catch older versions in build step 2013-02-26 15:00:29 -08:00
Peter Braden e1e1267bc3 Merge pull request #37 from ryansouza/node-08
Have travis test against node 0.8 as well
2013-02-26 10:43:49 -08:00
Peter Braden 32a1b76852 Merge pull request #36 from ryansouza/contour-stuff
Include more info about working with contours
2013-02-26 10:43:30 -08:00
Ryan Souza a320ff9af0 Have travis test against node 0.8 as well 2013-02-25 23:06:21 -08:00
Ryan Souza 521139a76e Include more info about working with contours
Some readme examples for using functions on a Contours object
Examples detecting and playing with simple shapes and contours
2013-02-25 22:58:14 -08:00
Peter Braden 454fd1188a s/cols,rows/rows,cols/g re #30 2013-02-13 13:30:31 -08:00
Peter Braden 0de039956e Clarify width, height params re #30 2013-02-12 05:24:50 -08:00
Peter Braden bb1fa037f3 Merge pull request #34 from mintplant/contours
Contours expansion: minAreaRect and convexHull bindings, expose underlying point data
2013-02-11 12:18:16 -08:00
Michael Smith 84e5f255df Add ConvexHull binding for Contours class 2013-02-10 15:26:58 -08:00
Michael Smith 4f7968e567 Expose MinAreaRect binding for Contours 2013-02-10 15:25:26 -08:00
Michael Smith a197586673 Expose point data from Contours
Add in a Point method to the Contours class to access the underlying
point coordinates from the JavaScript side.
2013-02-10 15:04:37 -08:00
Peter Braden e64b558bbd v0.0.10 2013-02-05 14:39:19 -08:00
Peter Braden c057d411a5 Remove todo - that's what github issues are for 2013-02-05 14:27:46 -08:00
Peter Braden fb55cec501 Merge pull request #29 from jtlebi/master
New bindings
2013-02-05 14:25:55 -08:00
Peter Braden be92fe5e65 Strip trailing spaces in matrix.cc re #29 2013-02-05 14:24:05 -08:00
Peter Braden 642f111f9d Merge branch 'master' of github.com:peterbraden/node-opencv 2013-02-05 14:21:35 -08:00
Peter Braden 8d6180bcaf Merge pull request #26 from prabirshrestha/buffers
fixed require('buffers')
2013-02-04 09:00:34 -08:00
Peter Braden 63891ae4fa Merge pull request #31 from gluxon/master
Add bindings for inRange
2013-02-03 11:01:33 -08:00
Brandon Cheng 22bdf646b1 Add bindings for cv::inRange 2013-01-27 18:16:30 -05:00
Jean-Tiare LE BIGOT 3b3c591517 add bindings for boundingBox in contours --> returns an (x, y, width, height) object 2013-01-20 15:39:51 +01:00
Jean-Tiare LE BIGOT abf5e9948c add bindings for cornerCount (size in OpenCV) in contours + fix bool instead of double in approxPolyDP 2013-01-20 15:07:20 +01:00
Jean-Tiare LE BIGOT d2e8b1969f add bindings for isConvex in contours 2013-01-20 14:20:33 +01:00
Jean-Tiare LE BIGOT e3280ddc1e add bindings for approxPolyDP in contours 2013-01-20 14:16:16 +01:00
Jean-Tiare LE BIGOT a94bc32d5f add bindings for arcLength in contours 2013-01-20 14:02:48 +01:00
Jean-Tiare LE BIGOT 7be98efacf add bindings for gaussianBlur 2013-01-20 01:05:43 +01:00
Jean-Tiare LE BIGOT b73ccb67fa add bindings for 'erode' 2013-01-19 23:28:54 +01:00
prabirshrestha 3efe469ea0 fixed require('buffers') 2012-12-03 13:34:50 -05:00
Peter Braden 8b899d073a don't save images in example 2012-11-29 13:44:31 -08:00
Peter Braden 2d0e747a4d Getting rid of old build script 2012-11-27 17:13:57 -08:00
Peter Braden 644f6797d3 Merge branch 'camshift' 2012-11-27 17:09:18 -08:00
Peter Braden f90cea5ffd std::vector, explicitly 2012-11-27 16:54:29 -08:00
Peter Braden 4f56834420 correct import. Linux is way whinier about this sort of stuff. 2012-11-27 16:52:05 -08:00
Peter Braden ab686c5445 specify std::dtring 2012-11-27 16:48:20 -08:00
Peter Braden dcf7462b13 travis is puking again 2012-11-27 16:42:33 -08:00
Peter Braden 7d43360b72 fix unit test 2012-11-27 16:36:18 -08:00
Peter Braden 20fa7a1c51 ignore out jpgs and examples avi's - too big for repos and test output 2012-11-27 16:15:31 -08:00
Peter Braden 0ab26f913c WIP 2012-11-27 16:13:23 -08:00
Peter Braden c4aac1d201 Allow specifying which image channel to use for the back projection 2012-11-27 16:08:58 -08:00
Peter Braden 6df8bbbb9b WIP on camshift re #22 - Got a working example but still unreliable
This is a combination of 4 commits.
WIP on camshift - need to focus the histogram on the ROI

Weird fringing issue, but otherwise tracking objects successfully

motion track example

WIP on camshift

WIP on camshift - have a smoke example, but bad results are coming back.
2012-11-26 20:11:59 -08:00
Peter Braden 33146b15e0 stubbing test for multiple imports bug 2012-11-19 12:39:49 -08:00
Contra c50cdf35a4 allow thickness and color args for ellipse 2012-11-19 12:15:59 -08:00
Peter Braden fa6e6b4da1 poitential fix for null pointer error. Test still screwed though. 2012-11-19 12:14:18 -08:00
Peter Braden b6468cff4e 0.0.9 2012-11-12 13:33:53 -08:00
Peter Braden e33afd97ef WIP on TrackedObject re #22 2012-11-12 13:30:26 -08:00
Peter Braden a9717c7dc0 WIP on camshift re #22 2012-11-12 10:54:37 -08:00
Peter Braden b5fe027703 setting up trackedobject 2012-11-09 17:29:54 -08:00
Peter Braden 3a1477c527 WIP on CamShift with TrackedObject re #22 2012-11-09 16:48:31 -08:00
Peter Braden e4c0ddd4e4 changelog 2012-11-09 10:29:46 -08:00
Peter Braden d71b0ae7b3 if toBuffer has a cb, run it async. re #21 2012-11-09 10:21:41 -08:00
Peter Braden ac6c685b56 Fix async toBufffer test 2012-10-29 23:48:12 -07:00
Peter Braden 56fd1824d3 WIP on an async toBuffer re #21 2012-10-29 23:10:34 -07:00
Peter Braden ceb4d1f5e0 0.0.8 2012-10-23 23:01:21 -07:00
Peter Braden c4cc2d45b8 Merge branch 'master' of https://github.com/rhasson/node-opencv 2012-10-22 21:49:26 -07:00
Peter Braden 391eb01ca6 Merge pull request #19 from c4milo/master
just cleaned up some compiler warnings
2012-10-22 21:46:12 -07:00
Camilo Aguilar 3b5311cf42 Some code clean up 2012-10-20 02:35:15 -04:00
rhasson 298cc5adf3 corrected module name in NODE_MODULE call 2012-10-19 16:36:18 -04:00
Peter Braden e9cbf158d5 better docs 2012-10-15 13:57:34 -07:00
Peter Braden d4579e6d4c remove duplicate info - docs are in Readme.md 2012-10-15 13:40:07 -07:00
Peter Braden d1ffdb056f bump version 2012-10-15 13:37:49 -07:00
Peter Braden f7bd72f1ae reorg matrix header 2012-10-15 13:37:14 -07:00
Peter Braden 03e444071c Fix Get / Set - closes #15 2012-10-15 13:09:37 -07:00
Peter Braden 7468d0e5fe Fix Get, Row and Col 2012-10-15 12:20:12 -07:00
Peter Braden 849e8a7beb broken tests for #15 2012-09-27 16:24:44 -07:00
Peter Braden 7e564d504e move smoke tests to directory 2012-09-27 16:22:57 -07:00
Peter Braden 0d43626aa0 comment out broken tests for now 2012-09-24 15:41:02 -07:00
Peter Braden 809b5eba50 WIP on proper get/set 2012-09-24 15:38:12 -07:00
Peter Braden 26484a1ed2 remove debug 2012-09-24 15:04:37 -07:00
Peter Braden ad9623c2f6 just include both 2012-09-24 15:02:51 -07:00
Peter Braden a640b94dc7 debug 2012-09-24 15:00:22 -07:00
Peter Braden ef423a2be9 test debug 2012-09-24 14:59:08 -07:00
Peter Braden b4489cfb77 debug 2012-09-24 14:54:15 -07:00
Peter Braden 6a6fb0ea7e move cflags out 2012-09-24 14:49:16 -07:00
Peter Braden cb7a49b4f1 try different package 2012-09-24 14:36:19 -07:00
Peter Braden 037cfb8c9c WIP on travis 2012-09-24 16:13:27 -04:00
Peter Braden 624194e334 try installing opencv_contrib? 2012-09-24 16:09:13 -04:00
Peter Braden e1f4182a3e WIP on travis 2012-09-24 16:05:30 -04:00
Peter Braden f74971be01 add pkg-config to linux - trying to get travis-ci to build 2012-09-24 12:56:16 -07:00
Peter Braden 8037d68386 try linux conditions 2012-09-24 12:51:38 -07:00
Peter Braden 55b2aa2476 add MIT license 2012-09-24 12:40:33 -07:00
Peter Braden 0b6aab7b2b Travis line 2012-09-24 12:38:14 -07:00
Peter Braden 06e984c8f6 gitignore 2012-09-19 16:39:52 -07:00
Peter Braden 1faf584392 change example out 2012-09-19 16:39:16 -07:00
Peter Braden e8cc061187 hough lines 2012-09-19 16:35:04 -07:00
Peter Braden 48ab05f624 basics of goodFeaturesToTrack 2012-09-19 12:26:46 -07:00
Peter Braden 946e1fc344 bump version number as I don't think I did after the gyp stuff 2012-08-24 13:26:07 -07:00
Peter Braden c01ae532a6 Classifier resize image, new example 2012-08-24 13:17:37 -07:00
Peter Braden f855b2a332 travis 2012-08-02 15:01:34 -07:00
Wade Simmons 97ffde101f match upstream tab style 2012-08-01 23:22:04 -07:00
Wade Simmons ce126ba9c8 wrap Mat(Mat, Rect) constructor
This is so you can create a clone of a ROI (Rectangle of Interest)
2012-08-01 23:09:42 -07:00
Peter Braden 6412013e41 try and use single package 2012-07-30 18:41:01 -07:00
Peter Braden 9bf1f8bfdc fix smoke 2012-07-30 18:35:54 -07:00
Peter Braden 8bfb1630cc correct test image 2012-07-30 17:55:17 -07:00
Peter Braden dbebe54425 use vows as runner 2012-07-30 17:39:42 -07:00
Peter Braden 279c3709f7 bump version 2012-07-30 17:32:12 -07:00
Felix Geisendörfer 447c949d09 Move 'libraries' directive to toplevel
Suggested by @tootallnate, makes the build work on all *nix systems.
2012-07-27 00:43:18 +02:00
Felix Geisendörfer 82694e5082 Fix #9 (broken gyp build)
Adding the 'libraries' directive causes gyp to link opencv into the
addon.
2012-07-27 00:38:42 +02:00
Peter Braden 7272c1a9b5 correct flag for non mac build 2012-07-06 02:06:40 -04:00
Peter Braden 0ff2d8dc83 WIP on fixing build 2012-07-05 14:08:11 -07:00
Peter Braden cc16770900 debug puts wrong path 2012-07-05 13:29:14 -07:00
Peter Braden 83ef8576dc gyp file 2012-07-05 13:27:39 -07:00
Peter Braden e1db78e6d9 WIP on gyp 2012-07-04 18:51:29 -07:00
Peter Braden 5c1243329d WIP on moving to gyp 2012-07-04 18:42:38 -07:00
Peter Braden 1adb8409b9 WIP on travis 2012-06-22 15:00:31 -07:00
Peter Braden 7b6fad7606 Debug build 2012-06-22 14:58:35 -07:00
Peter Braden ec160560fc clarify version 2012-06-22 14:38:19 -07:00
Peter Braden 8d618a523a Working on build in OS X 2012-06-22 14:29:34 -07:00
Peter Braden 48996e2448 add namespaces 2012-06-22 14:14:58 -07:00
Peter Braden 7532b9e332 Fix build warnings 2012-06-22 14:02:03 -07:00
Peter Braden 8f8181b539 updated build script 2012-06-22 13:59:59 -07:00
Peter Braden 62293f5ecb Merge pull request #8 from talvarez/master
Some additions (examples, libuv, videocapture)
2012-06-22 11:40:44 -07:00
Tomas Alvarez 9f88205143 New rectangle function, new example and added std namespace fixing the vector compile problem 2012-06-22 14:01:40 -03:00
Tomas Alvarez 4d1ea2867b Merge github.com:talvarez/node-opencv
Conflicts:
	src/Matrix.cc
	src/Matrix.h
2012-06-19 14:53:52 -03:00
Tomas Alvarez a0308135cb Added videocapture working (libuv), some examples, more methods to Matrix and implement of libuv for detectobjects 2012-06-18 12:01:28 -03:00
Tomas Alvarez b73174c00f Added videocapture working (libuv), some examples, more methods to Matrix and implement of libuv for detectobjects 2012-06-18 11:54:31 -03:00
Peter Braden efbae5b61b move smoke to unit test 2012-06-01 15:45:51 -04:00
Peter Braden c4a1c7161f Fix row and col tests for 1 channel matrices 2012-06-01 15:42:29 -04:00
Peter Braden 6168713d5f WIP on binding.gyp. node-gyp looks crazy, I don't really care about windows so not gonna bother with it yet 2012-05-31 19:19:41 -04:00
Peter Braden 5f4ef5af30 Fix unit test build - looks like cv::resize doesn't work with 64 bit floats
re - http://stackoverflow.com/questions/7385465/resize-an-image-and-changing-its-depth
2012-05-31 17:00:04 -04:00
Peter Braden d154496199 fix exception for older opencv versions 2012-05-31 15:57:39 -04:00
Peter Braden 0c7d496c0d node-gyp 2012-05-31 15:13:39 -04:00
Peter Braden 8468ea4385 try and get some outpu 2012-05-31 15:08:08 -04:00
Peter Braden 19526c294b try and get travis running again 2012-05-31 14:42:43 -04:00
Peter Braden 2d1c374918 rebump :s 2012-05-29 18:07:42 -04:00
Peter Braden be208afaae bump npm 2012-05-29 18:06:37 -04:00
Peter Braden c13aa6a945 Merge pull request #2 from jhurliman/master
Fix Matrix::Row() and Matrix::Col() to return proper BGR pixel values for images
2012-05-04 17:19:07 -07:00
John Hurliman 765ee8d68b Fix Matrix::Row() and Matrix::Col() to return proper BGR pixel values for images 2012-05-04 15:27:35 -07:00
Peter Braden 118da26a80 adding cascade files 2012-04-26 13:35:48 -07:00
Peter Braden 43b376e5e4 WIP 2012-04-26 13:35:20 -07:00
Peter Braden 1f41b20438 mv data 2012-01-27 11:43:38 -08:00
77 arquivos alterados com 535020 adições e 365 exclusões
Arquivo normal → Arquivo executável
+3
Ver Arquivo
@@ -2,3 +2,6 @@ build
.lock-wscript
.DS_Store
node_modules
npm-debug.log
out*.jpg
examples/*.avi
Arquivo normal → Arquivo executável
+5 -10
Ver Arquivo
@@ -1,16 +1,11 @@
language: node_js
node_js:
- 0.6
- "0.6"
- "0.8"
- "0.10"
before_install:
- sudo apt-get update
- sudo apt-get upgrade
- sudo apt-get install libavformat-dev
- sudo apt-get install ffmpeg
- sudo apt-get install libcv2.1
- sudo apt-get install libcvaux2.1
- sudo apt-get install libhighgui2.1
- sudo apt-get install libcv-dev
- sudo apt-get install libcvaux-dev
- sudo apt-get install libcv-dev
- sudo apt-get install libopencv-dev
- sudo apt-get install libhighgui-dev
+20
Ver Arquivo
@@ -0,0 +1,20 @@
Copyright 2012 Peter Braden and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Arquivo normal → Arquivo executável
+135 -17
Ver Arquivo
@@ -3,11 +3,13 @@
[![Build Status](https://secure.travis-ci.org/peterbraden/node-opencv.png)](http://travis-ci.org/peterbraden/node-opencv)
[OpenCV](http://opencv.willowgarage.com/wiki/) bindings for Node.js
[OpenCV](http://opencv.willowgarage.com/wiki/) bindings for Node.js. OpenCV is the defacto computer vision library - by interfacing with it natively in node, we get powerful real time vision in js.
People are using node-opencv to fly control quadrocoptors, detect faces from webcam images and annotate video streams. If you're using it for something cool, I'd love to hear about it!
## Install
You'll need OpenCV installed. I'm using v2.2 because I couldn't get 2.3 to compile, but it should theoretically work with 2.3
You'll need OpenCV 2.3.1 installed.
Then:
@@ -18,7 +20,7 @@ Then:
Or to build the repo:
node-waf configure && node-waf build
node-gyp rebuild
## Examples
@@ -27,13 +29,12 @@ Or to build the repo:
cv.readImage("./examples/test.jpg", function(err, im){
im.detectObject("./examples/haarcascade_frontalface_alt.xml", {}, function(err, faces){
im.detectObject(cv.FACE_CASCADE, {}, function(err, faces){
for (var i=0;i<faces.length; i++){
var x = faces[i]
im.ellipse(x.x + x.width/2, x.y + x.height/2, x.width/2, x.height/2);
}
im.save('./out.jpg');
im.save('./out.jpg');
});
})
@@ -48,7 +49,11 @@ base datastructure in OpenCV. Things like images are just matrices of pixels.
#### Creation
new Matrix(width, height)
new Matrix(rows, cols)
Or if you're thinking of a Matrix as an image:
new Matrix(height, width)
Or you can use opencv to read in image files. Supported formats are in the OpenCV docs, but jpgs etc are supported.
@@ -60,18 +65,33 @@ Or you can use opencv to read in image files. Supported formats are in the OpenC
...
})
If you need to pipe data into an image, you can use an imagestream:
If you need to pipe data into an image, you can use an ImageDataStream:
var s = new cv.ImageDataStream()
s.on('load', function(matrix){
...
})
fs.createReadStream('./examples/test.jpg').pipe(s);
If however, you have a series of images, and you wish to stream them into a
stream of Matrices, you can use an ImageStream. Thus:
var s = new cv.ImageStream()
s.on('load', function(matrix){
...
})
s.on('data', function(matrix){
...
})
fs.createReadStream('./examples/test.jpg').pipe(s);
ardrone.createPngStream().pipe(s);
Note: Each 'data' event into the ImageStream should be a complete image buffer.
#### Accessing Data
#### Accessors
var mat = new cv.Matrix.Eye(4,4); // Create identity matrix
mat.get(0,0) // 1
@@ -80,9 +100,28 @@ If you need to pipe data into an image, you can use an imagestream:
mat.col(4) // [0,0,0,1]
##### Save
mat.save('./pic.jpg')
or:
var buff = mat.toBuffer()
#### Image Processing
im.convertGrayscale()
im.canny(5, 300)
im.houghLinesP()
#### Simple Drawing
im.ellipse(x, y)
im.line([x1,y1], [x2, y2])
#### Object Detection
@@ -93,10 +132,89 @@ detection. This can be used for face detection etc.
mat.detectObject(haar_cascade_xml, opts, function(err, matches){})
For convenience in face recognition, cv.FACE_CASCADE is a cascade that can be used for frontal face recognition.
Also:
mat.goodFeaturesToTrack
#### Contours
## WIP
mat.findCountours
mat.drawContour
mat.drawAllContours
This is a WIP. I've never written C++ before so the code may be _interesting_ - if
I'm doing stuff wrong please feel free to correct me.
### Using Contours
`findContours` returns a `Contours` collection object, not a native array. This object provides
functions for accessing, computing with, and altering the contours contained in it.
See [relevant source code](src/Contours.cc) and [examples](examples/)
var contours = im.findContours;
# Count of contours in the Contours object
contours.size();
# Count of corners(verticies) of contour `index`
contours.cornerCount(index);
# Access vertex data of contours
for(var c = 0; c < contours.size(); ++c) {
console.log("Contour " + c);
for(var i = 0; i < contours.cornerCount(c); ++i) {
var point = contours.point(c, i);
console.log("(" + point.x + "," + point.y + ")");"
}
}
# Computations of contour `index`
contours.area(index);
contours.arcLength(index, isClosed);
contours.boundingRect(index);
contours.minAreaRect(index);
contours.isConvex(index);
# Destructively alter contour `index`
contours.approxPolyDP(index, epsilon, isClosed);
contours.convexHull(index, clockwise);
## MIT License
The library is distributed under the MIT License - if for some reason that
doesn't work for you please get in touch.
## Changelog
#### 0.0.13
- V Early support for face recognition - API is _likely_ to change. Have fun!
- *API Change*: VideoCapture.read now calls callback(err, im) instead of callback(im)
#### 0.0.12
- Matrix clone()
- NamedWindow Support
#### 0.0.11
- Bug Fixes
- ImageStream becomes ImageDataStream, and new ImageStream allows multiple images to be
streamed as matrices, for example, with an object detection stream.
- @ryansouza improved documentation
- Correcting matrix constructor (thanks @gluxon)
- @Michael Smith expanded Contours functionality.
Thanks all!
#### 0.0.10
- Bug Fixes
- @Contra added code that allows thickness and color args for ellipse
- Camshift Support
- @jtlebi added bindings for erode, gaussianBlur, arcLength, approxPolyDP, isConvex, cornerCount
- @gluxon added bindings for inRange
Thanks everyone!
#### 0.0.9
- toBuffer can now take a callback and be run async (re #21)
-45
Ver Arquivo
@@ -1,45 +0,0 @@
im.calcHistograms(function(err, hist){})
im.calcHistograms(mask, function(err, hist){})
## Face recognition TODO
// Load Database
// TODO<
cv.loadImage('test.jpg', function(err, im){
im.detectObject("front-face.xml", {}, function(err, faces){
_.each(faces, function(v){
// TODO {
var section = im.slice(v.x, v.y, v.x + v.width, v.y + v.height);
section.convertGrayscale()
section.resize(WID, HEIGHT);
section.equaliseHistogram();
// } TODO
})
})
})
-----
http://www.athile.net/library/wiki/index.php?title=Library/V8/Tutorial#Wrapping_a_Javascript_function_as_a_std::function.3C.3E
https://www.cloudkick.com/blog/2010/aug/23/writing-nodejs-native-extensions/
Arquivo executável
+40
Ver Arquivo
@@ -0,0 +1,40 @@
{
"targets": [{
"target_name": "opencv"
, "sources": [
"src/init.cc"
, "src/Matrix.cc"
, "src/OpenCV.cc"
, "src/CascadeClassifierWrap.cc"
, "src/Contours.cc"
, "src/Point.cc"
, "src/VideoCaptureWrap.cc"
, "src/CamShift.cc"
, "src/HighGUI.cc"
, "src/FaceRecognizer.cc"
]
, 'libraries': [
'<!@(pkg-config --libs opencv)'
]
, 'cflags': [
'<!@(pkg-config --cflags --libs "opencv >= 2.3.1" )'
, '-Wall'
]
, 'cflags!' : [ '-fno-exceptions']
, 'cflags_cc!': [ '-fno-rtti', '-fno-exceptions']
, "conditions": [
['OS=="mac"', {
# cflags on OS X are stupid and have to be defined like this
'xcode_settings': {
'OTHER_CFLAGS': [
'<!@(pkg-config --cflags opencv)'
]
, "GCC_ENABLE_CPP_RTTI": "YES"
, "GCC_ENABLE_CPP_EXCEPTIONS": "YES"
}
}]
]
}]
}
Arquivo executável
+15452
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+33158
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff