aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlluís gómez i bigordà <lluisbigorda@users.sourceforge.net>2009-09-18 11:27:38 +0000
committerlluís gómez i bigordà <lluisbigorda@users.sourceforge.net>2009-09-18 11:27:38 +0000
commit85258593cb9628e4e0b315a402552e3d5941458e (patch)
tree50f7547e6be157e572d72c6acf278210ed47479e
parent746a7193a90438e81b497ad90c432bc3f6b30657 (diff)
debug with image resize
svn path=/trunk/externals/pix_opencv/; revision=12392
-rw-r--r--pix_opencv_motempl.cc36
1 files changed, 18 insertions, 18 deletions
diff --git a/pix_opencv_motempl.cc b/pix_opencv_motempl.cc
index e755bc5..120a243 100644
--- a/pix_opencv_motempl.cc
+++ b/pix_opencv_motempl.cc
@@ -96,7 +96,7 @@ pix_opencv_motempl :: ~pix_opencv_motempl()
void pix_opencv_motempl :: processRGBAImage(imageStruct &image)
{
double timestamp = (double)clock()/CLOCKS_PER_SEC; // get current time in seconds
- CvSize size = cvSize(img->width,img->height); // get current frame size
+ CvSize size = cvSize(image.xsize,image.ysize); // get current frame size
int i, j, idx1 = last, idx2;
IplImage* silh;
CvSeq* seq;
@@ -145,14 +145,14 @@ void pix_opencv_motempl :: processRGBAImage(imageStruct &image)
}
for( i = 0; i < frame_buffer_num; i++ ) {
- //cvReleaseImage( &(buf[i]) );
+ // TODO if ( buf[i] != NULL ) cvReleaseImage( &buf[i] );
buf[i] = cvCreateImage( size, IPL_DEPTH_8U, 1 );
cvZero( buf[i] );
}
- cvReleaseImage( &mhi );
- cvReleaseImage( &orient );
- cvReleaseImage( &segmask );
- cvReleaseImage( &mask );
+ if ( mhi != NULL ) cvReleaseImage( &mhi );
+ if ( orient != NULL ) cvReleaseImage( &orient );
+ if ( segmask != NULL ) cvReleaseImage( &segmask );
+ if ( mask != NULL ) cvReleaseImage( &mask );
mhi = cvCreateImage( size, IPL_DEPTH_32F, 1 );
cvZero( mhi ); // clear MHI at the beginning
@@ -259,7 +259,7 @@ void pix_opencv_motempl :: processRGBAImage(imageStruct &image)
void pix_opencv_motempl :: processRGBImage(imageStruct &image)
{
double timestamp = (double)clock()/CLOCKS_PER_SEC; // get current time in seconds
- CvSize size = cvSize(img->width,img->height); // get current frame size
+ CvSize size = cvSize(image.xsize,image.ysize); // get current frame size
int i, j, idx1 = last, idx2;
IplImage* silh;
CvSeq* seq;
@@ -302,14 +302,14 @@ void pix_opencv_motempl :: processRGBImage(imageStruct &image)
}
for( i = 0; i < frame_buffer_num; i++ ) {
- //cvReleaseImage( &(buf[i]) );
+ // TODO if ( buf[i] != NULL ) cvReleaseImage( &(buf[i]) );
buf[i] = cvCreateImage( size, IPL_DEPTH_8U, 1 );
cvZero( buf[i] );
}
- cvReleaseImage( &mhi );
- cvReleaseImage( &orient );
- cvReleaseImage( &segmask );
- cvReleaseImage( &mask );
+ if ( mhi != NULL ) cvReleaseImage( &mhi );
+ if ( orient != NULL ) cvReleaseImage( &orient );
+ if ( segmask != NULL ) cvReleaseImage( &segmask );
+ if ( mask != NULL ) cvReleaseImage( &mask );
mhi = cvCreateImage( size, IPL_DEPTH_32F, 1 );
cvZero( mhi ); // clear MHI at the beginning
@@ -418,7 +418,7 @@ void pix_opencv_motempl :: processYUVImage(imageStruct &image)
void pix_opencv_motempl :: processGrayImage(imageStruct &image)
{
double timestamp = (double)clock()/CLOCKS_PER_SEC; // get current time in seconds
- CvSize size = cvSize(img->width,img->height); // get current frame size
+ CvSize size = cvSize(image.xsize,image.ysize); // get current frame size
int i, j, idx1 = last, idx2;
IplImage* silh;
CvSeq* seq;
@@ -464,14 +464,14 @@ void pix_opencv_motempl :: processGrayImage(imageStruct &image)
}
for( i = 0; i < frame_buffer_num; i++ ) {
- //cvReleaseImage( &(buf[i]) );
+ // TODO cvReleaseImage( &(buf[i]) );
buf[i] = cvCreateImage( size, IPL_DEPTH_8U, 1 );
cvZero( buf[i] );
}
- cvReleaseImage( &mhi );
- cvReleaseImage( &orient );
- cvReleaseImage( &segmask );
- cvReleaseImage( &mask );
+ if ( mhi != NULL ) cvReleaseImage( &mhi );
+ if ( orient != NULL ) cvReleaseImage( &orient );
+ if ( segmask != NULL ) cvReleaseImage( &segmask );
+ if ( mask != NULL ) cvReleaseImage( &mask );
mhi = cvCreateImage( size, IPL_DEPTH_32F, 1 );
cvZero( mhi ); // clear MHI at the beginning