From 2438e0a034d7ef50c8d7837ea415ca6a95a94fc0 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Fri, 14 Mar 2014 15:14:37 +0000 Subject: publish version --- offsetProject/src/buttonChecker.cpp | 2 +- offsetProject/src/buttonChecker.h | 4 ++-- offsetProject/src/imageStore.h | 13 +++++++++---- offsetProject/src/main.cpp | 2 +- offsetProject/src/ofApp.cpp | 24 ++++++++++++++++++++++-- offsetProject/src/ofApp.h | 2 ++ 6 files changed, 37 insertions(+), 10 deletions(-) (limited to 'offsetProject/src') diff --git a/offsetProject/src/buttonChecker.cpp b/offsetProject/src/buttonChecker.cpp index b8170e8..efd08ab 100644 --- a/offsetProject/src/buttonChecker.cpp +++ b/offsetProject/src/buttonChecker.cpp @@ -1,6 +1,6 @@ #include "buttonChecker.h" -long ofToLong(const string& intString) { +long toLong(const string& intString) { long x = 0; istringstream cur(intString); cur >> x; diff --git a/offsetProject/src/buttonChecker.h b/offsetProject/src/buttonChecker.h index 2de14cb..edcde15 100644 --- a/offsetProject/src/buttonChecker.h +++ b/offsetProject/src/buttonChecker.h @@ -4,7 +4,7 @@ #include "ofMain.h" #include "ofURLFileLoader.h" -long ofToLong(const string& intString); +long toLong(const string& intString); class buttonChecker : public ofThread{ @@ -54,7 +54,7 @@ class buttonChecker : public ofThread{ //cout<<"."<last){ last=result; active=true; diff --git a/offsetProject/src/imageStore.h b/offsetProject/src/imageStore.h index 2f8ccbb..58ef560 100644 --- a/offsetProject/src/imageStore.h +++ b/offsetProject/src/imageStore.h @@ -123,11 +123,12 @@ class imageStore : public ofThread{ Matrix query(test,1,3); Matrix indices(new int[1], query.rows, 1); Matrix dists(new float[1], query.rows, 1); - index->knnSearch(query, indices, dists, 1,SearchParams(20)); + index->knnSearch(query, indices, dists, 1,SearchParams(10)); im=*imageptrs[*indices[0]]; //int i=rand()%imageptrs.size(); //im=images[imageptrs[i]]; //cerr<<"returning image "<second; if( lock() ){ + int* it=new int[1]; + float* ft=new float[1]; Matrix query(data,1,FLANN_MATRIX_SIZE*FLANN_MATRIX_SIZE*3); - Matrix indices(new int[1], query.rows, 1); - Matrix dists(new float[1], query.rows, 1); - index->knnSearch(query, indices, dists, 1,SearchParams(4)); + Matrix indices(it, query.rows, 1); + Matrix dists(ft, query.rows, 1); + index->knnSearch(query, indices, dists, 1,SearchParams(10)); im=*imageptrs[*indices[0]]; //int i=rand()%imageptrs.size(); //im=images[imageptrs[i]]; //cerr<<"returning image "<-1) { + ofEnableAlphaBlending(); + ofSetColor(255,255,255,b); + ofRect(0,0,ofGetWidth(),ofGetHeight()); + ofDisableAlphaBlending(); + } + } diff --git a/offsetProject/src/ofApp.h b/offsetProject/src/ofApp.h index 04d636c..b9508a3 100644 --- a/offsetProject/src/ofApp.h +++ b/offsetProject/src/ofApp.h @@ -5,6 +5,7 @@ #include "ofxKinect.h" #include "imageStore.h" +#include "buttonChecker.h" #define MODE_COLOURTILES 0 #define MODE_DEPTH 1 @@ -32,6 +33,7 @@ public: void windowResized(int w, int h); imageStore store; + buttonChecker button; int mode,farThreshold,angle; -- cgit v1.2.3