Hello,

Im new to programming with openCV. I gotta do some geometrical transformations on an image, like translation,rotation, scaling, etc... I still dnt know how transformations are done in opencv. I looked in a cv refenrence manual and found a couple of functions many on resizing and rotation. I tried to do resizing on an image but it didnt work. Instead of describing what i did, i attached the file.cpp witch has my code. I think, this is better. The project compiled successfully but when I ran it, it gave null pointer (null array pointer) exception in Function cvGetMat... Please have a look at my code. Tell me your feedback and also tell me if you know were to find more about doing transformations on images on opencv or if you can tell me right away it wil be great. Any help, will be greatly appreciated. Thanks for your support!

hi
were you able to resolve the null pointer to cvmat error , please tell me how to resolve it . i get the same error while trying to open an image from current directory .

heres my code:

int main( int argc, char** argv ) 
{
    char buffer[_max_path];
if( _getcwd( buffer, _MAX_PATH ) == NULL )
      perror( "_getcwd error" );
   else
      printf( "%sn", buffer );

    int height = 620;int width = 440;
CvPoint pt = cvPoint( height/4, width/2 );

//IplImage* hw = cvCreateImage(cvSize(height, width), 8, 3);
IplImage* hw = cvLoadImage( "image0002A.jpg" );

cvSet(hw,cvScalar(0,0,0));
CvFont font;
cvInitFont( &font, CV_FONT_HERSHEY_COMPLEX,1.0, 1.0, 0, 1, CV_AA);
//cvPutText(hw, "To OpenCV", pt, &font, CV_RGB(150, 0, 150) );
cvNamedWindow("Hello World", 0);//display the image in the container
cvShowImage("Hello World", hw);//hold the output
cvWaitKey(0);
return 0;
}

Hello,

Im new to programming with openCV. I gotta do some geometrical transformations on an image, like translation,rotation, scaling, etc... I still dnt know how transformations are done in opencv. I looked in a cv refenrence manual and found a couple of functions many on resizing and rotation. I tried to do resizing on an image but it didnt work. Instead of describing what i did, i attached the file.cpp witch has my code. I think, this is better. The project compiled successfully but when I ran it, it gave null pointer (null array pointer) exception in Function cvGetMat... Please have a look at my code. Tell me your feedback and also tell me if you know were to find more about doing transformations on images on opencv or if you can tell me right away it wil be great. Any help, will be greatly appreciated. Thanks for your support!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.