X-Git-Url: http://git.maemo.org/git/?p=opencv;a=blobdiff_plain;f=samples%2Fc%2Fdft.c;fp=samples%2Fc%2Fdft.c;h=b34a9be705d80803fb078788d809bccfe5892c6d;hp=73173ae0b964b3fa0b65e07c6a2b309b6f9164bb;hb=e4c14cdbdf2fe805e79cd96ded236f57e7b89060;hpb=454138ff8a20f6edb9b65a910101403d8b520643 diff --git a/samples/c/dft.c b/samples/c/dft.c index 73173ae..b34a9be 100644 --- a/samples/c/dft.c +++ b/samples/c/dft.c @@ -1,3 +1,5 @@ +#define CV_NO_BACKWARD_COMPATIBILITY + #include #include #include @@ -7,7 +9,7 @@ // src & dst arrays of equal size & type void cvShiftDFT(CvArr * src_arr, CvArr * dst_arr ) { - CvMat * tmp; + CvMat * tmp=0; CvMat q1stub, q2stub; CvMat q3stub, q4stub; CvMat d1stub, d2stub; @@ -19,15 +21,15 @@ void cvShiftDFT(CvArr * src_arr, CvArr * dst_arr ) CvSize dst_size = cvGetSize(dst_arr); int cx, cy; - if(dst_size.width != size.width || + if(dst_size.width != size.width || dst_size.height != size.height){ - cvError( CV_StsUnmatchedSizes, "cvShiftDFT", "Source and Destination arrays must have equal sizes", __FILE__, __LINE__ ); + cvError( CV_StsUnmatchedSizes, "cvShiftDFT", "Source and Destination arrays must have equal sizes", __FILE__, __LINE__ ); } if(src_arr==dst_arr){ tmp = cvCreateMat(size.height/2, size.width/2, cvGetElemType(src_arr)); } - + cx = size.width/2; cy = size.height/2; // image center @@ -42,7 +44,7 @@ void cvShiftDFT(CvArr * src_arr, CvArr * dst_arr ) if(src_arr!=dst_arr){ if( !CV_ARE_TYPES_EQ( q1, d1 )){ - cvError( CV_StsUnmatchedFormats, "cvShiftDFT", "Source and Destination arrays must have the same format", __FILE__, __LINE__ ); + cvError( CV_StsUnmatchedFormats, "cvShiftDFT", "Source and Destination arrays must have the same format", __FILE__, __LINE__ ); } cvCopy(q3, d1, 0); cvCopy(q4, d2, 0);