Browse files

increase threshold to reduce false positives

  • Loading branch information...
1 parent 0908268 commit 7108206e11b69736be9423f0ae9d2f22442be479 @harthur committed Jun 17, 2012
Showing with 14 additions and 21 deletions.
  1. +12 −11 kittydar.js
  2. +1 −1 package.json
  3. +1 −9 testing/test.js
View
23 kittydar.js
@@ -31,15 +31,23 @@ var kittydar = {
resize: 360, // initial image resize size in px
- threshold: 0.999, // probablity threshold for classifying
+ threshold: 0.9999, // probablity threshold for classifying
scaleStep: 6, // scaling step size in px
- shiftBy: 6, // px to slide window by
+ shiftBy: 6, // px to slide window by
- overlapThresh: 0.4, // min overlap ratio to classify as an overlap
+ overlapThresh: 0.3, // min overlap ratio to classify as an overlap
- minOverlaps: 1, // minumum overlapping rects to classify as a head
+ minOverlaps: 2, // minumum overlapping rects to classify as a head
+
+ HOGparams: { // parameters for HOG descriptor
+ cellSize: 6,
+ blockSize: 2,
+ blockStride: 1,
+ bins: 6,
+ norm: "L2"
+ },
detectCats: function(canvas, options) {
this.setOptions(options || {});
@@ -60,13 +68,6 @@ var kittydar = {
for (var opt in options) {
this[opt] = options[opt];
}
- this.HOGparams = options.HOGparams || {
- "cellSize": 6,
- "blockSize": 2,
- "blockStride": 1,
- "bins": 6,
- "norm": "L2"
- };
},
getAllSizes: function(canvas, minSize) {
View
2 package.json
@@ -1,7 +1,7 @@
{
"name": "kittydar",
"description": "Cat detection",
- "version": "0.1.1",
+ "version": "0.1.2",
"author": "Heather Arthur <fayearthur@gmail.com>",
"repository": {
"type": "git",
View
10 testing/test.js
@@ -43,14 +43,7 @@ function runTest() {
utils.drawImgToCanvas(file, function(err, canvas) {
console.time("detecting");
- var options = {
- scaleStep: 6,
- overlapThresh: 0.3,
- minOverlaps: 1,
- shiftBy: 8
- };
-
- var cats = kittydar.detectCats(canvas, options);
+ var cats = kittydar.detectCats(canvas);
console.timeEnd("detecting", file)
var missed = true;
@@ -65,7 +58,6 @@ function runTest() {
else {
falsePos++;
}
- saveCrop(canvas, cat, overlaps);
});
if (missed) {

0 comments on commit 7108206

Please sign in to comment.