diff options
Diffstat (limited to 'offsetProject/src/ofApp.h')
| -rw-r--r-- | offsetProject/src/ofApp.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/offsetProject/src/ofApp.h b/offsetProject/src/ofApp.h index ce00cc8..81f5895 100644 --- a/offsetProject/src/ofApp.h +++ b/offsetProject/src/ofApp.h @@ -4,20 +4,28 @@ #include "ofxOpenCv.h" #include "ofxKinect.h" -#define MIN_TILE_SIZE 4 //has to be a divisor of 320 and 240 as the tiles are centred -#define MAX_TILE_SIZE 32 //has to be a power of 2 * MIN_TILE_SIZE +#define MIN_TILE_SIZE 8 //has to be a divisor of 320 and 240 as the tiles are centred +#define MAX_TILE_SIZE 64 //has to be a power of 2 * MIN_TILE_SIZE class offsetCvColorImage : public ofxCvColorImage { public: void extend( int w, int h ) { - //cv::copyMakeBorder(cvImage,cvImage,(h-getHeight())/2,(h-getHeight())/2,(w-getWidth())/2,(w-getWidth())/2,cv::BORDER_REPLICATE); + IplImage* temp = cvCreateImage( cvSize(w,h), IPL_DEPTH_8U, 3 ); + cvCopyMakeBorder(cvImage,temp, cvPoint(0,0),IPL_BORDER_REPLICATE ); + allocate( w, h ); + cvCopy( temp, cvImage ); + cvReleaseImage( &temp ); } }; class offsetCvGrayscaleImage : public ofxCvGrayscaleImage { public: void extend( int w, int h ) { - //cv::copyMakeBorder(cvImage,cvImage,(h-getHeight())/2,(h-getHeight())/2,(w-getWidth())/2,(w-getWidth())/2,cv::BORDER_REPLICATE); + IplImage* temp = cvCreateImage( cvSize(w,h), IPL_DEPTH_8U, 1 ); + cvCopyMakeBorder(cvImage,temp, cvPoint(0,0),IPL_BORDER_REPLICATE ); + allocate( w, h ); + cvCopy( temp, cvImage ); + cvReleaseImage( &temp ); } }; |
