// 2d Image Transformations.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include #include #include #include #include #include #include using namespace std; static IplImage* img; static CvArr* resized; static int height,width,step,channels; static uchar *data; static int i,j,k; void arithScalling(IplImage* img, int x) { IplImage* bw=cvCloneImage(img); static int height,width,step,channels; static uchar *data; static int i,j,k; height = bw->height; width = bw->width; step = bw->widthStep; channels = bw->nChannels; data = (uchar *)bw->imageData; printf("%i",step); cvResize(bw, resized, x); cvNamedWindow( "Image Scalling", CV_WINDOW_AUTOSIZE); cvShowImage( "Image Scalling", resized); cvSaveImage("Scaled Image.jpg",resized); } int _tmain(int argc, _TCHAR* argv[]) { img=cvLoadImage("gt2.jpg",-1); if(!img) printf("Could not load image file: %s\n"); CvArr *bw = cvCreateImage(cvSize(100, 100), IPL_DEPTH_8U, 1); bw = cvCloneImage(img); arithScalling(img,5); cvWaitKey(0); return 0; }