Unrecognized Array type in cvGetMAt ,Moment Normalization

asked 2014-04-28 03:52:03 -0600

Yasmin93 gravatar image

I am trying to understand and run this function of moment normalization for hand gesture recognition ,however i am getting this error unrecognized or unsupported Array type in function cvGetMAt or cvGetSIze , i think it is something with input to the function normalize2 it take char* test , in the main i called it with normalize2("hand.jpg") ,

It loads successfuly so this isn't the problem, and i also tried different images with jpg structute but it didn't help .

PART OF NORMALIZE Function int normalize2 (char * test) { FILE fp; IplImage pic1=0 , *pic2=0 , *temp1=0, *temp2=0 , *temp3=0 , *temp4=0; double u11 , u20 , u02 , theta1=0 , compare=0, theta2=0 , theta3=0 , theta=0, ratio=0; int h= 100 , w= 100 ; // Parameters needed for rotation int a=0 , bright=0 , pixel1 =0 , pixel2 =0; int threshold = 80 , id=0 , i=0;

char * imageDB="hands.jpg"; //Any image with standard size in DB test="hands.jpg"; //name of captured image to be tested with images in DB char * name=0;

cvNamedWindow("show",1); cvShowImage("show",test); CvMoments moments;

cvNamedWindow("Tobe_Modified",1); cvMoveWindow( "Tobe_Modified", 0, 50); cvNamedWindow("final",1); cvMoveWindow( "final", 500, 50); cvNamedWindow("compare",1); cvMoveWindow( "compare", 250, 400);

pic1 = cvLoadImage( test,0); //Size of captured image pic2 = cvLoadImage( test,0); //Size of standard-size image in dB(Standard)

w=cvGetSize(pic2).width/2; //Set rotation axes from size of image h=cvGetSize(pic2).width/2;

temp1 = cvCreateImage( cvGetSize(pic1), IPL_DEPTH_8U, 1 );

temp1 = cvLoadImage( test,0);

cvResize( temp1,temp2, CV_INTER_NN ); // Normalize SIZE to standard size of Temp2 temp3 = cvCreateImage( cvGetSize(temp2), IPL_DEPTH_8U, 1 ); temp4 = cvCreateImage( cvGetSize(temp2), IPL_DEPTH_8U, 3 );

Blockquote

Main

int main(int argc, char* argv) { IplImage img = cvLoadImage("hand.jpg");

if (!img) {

cout <<"NOT LOADED= "<<endl; return="" 1;="" }else="" {="" cout="" &lt;&lt;"loaded="" "="" &lt;<endl;="" normalize2("hand.jpg");="" }="" cvreleaseimage(&amp;img);<="" p="">

return 0; }

edit retag flag offensive close merge delete