Skip to content

Commit 28fcb19

Browse files
committed
v.1.0.2 contd
* fix js/json output in haartojs.php * update node example w/ CanvasLite
1 parent 05faef2 commit 28fcb19

14 files changed

+56206
-48346
lines changed

Readme.md

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# HAAR.js
1+
# HAAR.js
22

33
**Note:** Further development has moved to the [FILTER.js](https://github.com/foo123/FILTER.js) project, for Image Processing and Computer Vision, which includes a new [**HaarDetector plugin**](https://github.com/foo123/FILTER.js/blob/master/src/plugins/HaarDetector.js) which can be seen as the continuation of this project.
44

@@ -40,8 +40,9 @@ Light-weight (~10kB minified, ~5kB gzipped).
4040
* [syntaxhighlighter-grammar](https://github.com/foo123/syntaxhighlighter-grammar) transform a formal grammar in JSON format to a highlight brush for SyntaxHighlighter code highlighter
4141
* [SortingAlgorithms](https://github.com/foo123/SortingAlgorithms) implementations of Sorting Algorithms in JavaScript
4242
* [PatternMatchingAlgorithms](https://github.com/foo123/PatternMatchingAlgorithms) implementations of Pattern Matching Algorithms in JavaScript
43-
* [Rasterizer](https://github.com/foo123/Rasterizer) stroke and fill lines, rectangles, curves and paths, without canvas.
44-
* [Gradient](https://github.com/foo123/Gradient) create linear, radial, conic and elliptic gradients and image patterns without canvas.
43+
* [CanvasLite](https://github.com/foo123/CanvasLite) an html canvas implementation in pure JavaScript
44+
* [Rasterizer](https://github.com/foo123/Rasterizer) stroke and fill lines, rectangles, curves and paths, without canvaσ
45+
* [Gradient](https://github.com/foo123/Gradient) create linear, radial, conic and elliptic gradients and image patterns without canvas
4546
* [css-color](https://github.com/foo123/css-color) simple class to parse and manipulate colors in various formats
4647

4748

@@ -56,6 +57,7 @@ Light-weight (~10kB minified, ~5kB gzipped).
5657
* [Changelog](/changelog.md)
5758
* [Credits](/credits.md)
5859

60+
5961
### Live Examples
6062
* [Interactive Face Detection](https://foo123.github.io/examples/face-detection/)
6163
* [Many Faces Detection](https://foo123.github.io/examples/faces-detection/)
@@ -79,7 +81,7 @@ haartojs haarcascades_frontalface_alt.xml > haarcascades_frontalface_alt.js
7981
this creates a javascript file: *haarcascades_frontalface_alt.js*
8082
which you can include in your html file or node file
8183

82-
the variable to use in javascript is similarly
84+
the variable to use in javascript is similarly
8385
*haarcascades_frontalface_alt* (both in browser and node)
8486

8587
to transform a cascade xml file to *json* format do:
@@ -98,35 +100,43 @@ __HAAR.js works both in the browser and in Node.js (supporting parallel computat
98100

99101

100102
#### Runing inside the browser
101-
Loading wth script tags
102-
You can run the example face.html or mouth.html inside your browser
103+
Loading with script tags.
104+
105+
You can run the example face.html or mouth.html inside your browser.
103106

104107
#### Running inside node
105-
For running, the package have a dependency on canvas
106-
You can find an example inside examples/nodes.js
107-
Valid Output
108+
For running in nodejs, the package has a dependency on canvas.
109+
110+
`Canvas` alternatives for nodejs:
111+
112+
1. [CanvasLite](https://github.com/foo123/CanvasLite)
113+
2. [node-canvas](https://github.com/Automattic/node-canvas)
114+
115+
To work properly `node-canvas` needs some system dependencies.
116+
You can find instruction on https://github.com/Automattic/node-canvas/wiki
117+
For example for Ubuntu :
108118
```bash
109-
node examples/node.js
110-
processing the picture
111-
[{"x":102.5,"y":105.5,"width":160.66666666666666,"height":160.66666666666666}]
119+
sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev
112120
```
113121

114-
To work properly, canvas need some system depencencies.
115-
You can find instruction on https://github.com/LearnBoost/node-canvas/wiki
116-
For example for Ubuntu :
122+
You can find an example inside examples/nodes.js for both alternatives.
123+
124+
Example Output
117125
```bash
118-
sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev
126+
node examples/node.js
127+
processing the picture
128+
[{"x":84,"y":90,"width":202,"height":202,"index":0,"area":40804,"isInside":false}]
119129
```
120130

121131
#### Loading with requirejs
122-
As a third option, you can load the library with requireJS, both on the browser on with node.
132+
As a third option, you can load the library with requireJS, both in the browser in node.
123133
There is an example of loading with RequireJS inside node in examples/require.js.
124134
The configuration would be the same inside a browser
125135

126136

127137
#### Supporting parallel computation
128-
The [parallel.js](https://github.com/adambom/parallel.js) library is included in this repository, see the _face.html_ example for how to use.
129-
In most cases using parallel computation (if supported) can be much faster (eg _eye.html_ example)
138+
The [parallel.js](https://github.com/adambom/parallel.js) library is included in this repository, see the _face.html_ example for how to use.
139+
In most cases using parallel computation (if supported) can be much faster (eg _eye.html_ example)
130140

131141

132142
### Where to find Haar Cascades xml files to use for feature detection

beeld.config

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ tasks =[{}]
5454
"output" = "./api-reference.md"
5555
@
5656

57+
out = ./build/haar-detector.js
58+
@
59+
60+
minify =[{}]
61+
62+
src =[]
63+
64+
./build/haar-detector.js
65+
@
66+
67+
# extract header from this file
68+
header = ./build/haar-detector.js
69+
5770
# Minify the Package (map of lists)
5871
minify ={}
5972
# Options for Node UglifyJS Compiler (if used, default), (mangle and compress)
@@ -75,5 +88,4 @@ tasks =[{}]
7588

7689
out = ./build/haar-detector.min.js
7790
@
78-
7991
@

0 commit comments

Comments
 (0)