/* ==================================================================== */ /* Author :Priyanka Hiranandani NIT Surat */ /* ==================================================================== */ /* Syntax : rotated_image=warpaffline(InputArray src, InputArray M,int size_x,int size_y ,string flag, string borderMode); */ /* ==================================================================== */ #include #include "opencv2/core/core.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/opencv.hpp" #include #include using namespace cv; using namespace std; extern "C" { #include "api_scilab.h" #include "Scierror.h" #include "BOOL.h" #include #include "../common.h" int warpaffine(char *fname, unsigned long fname_len) { // Error management variable SciErr sciErr; //variable info int iRows = 0; int iCols = 0; int piRows = 0; int piCols = 0; int* piAddr = NULL; int *piAddr7 =NULL; int* piAddr2 = NULL; int* piAddr3 = NULL; int* piAddr4 = NULL; int* piAddr5 = NULL; int* piAddr6 = NULL; int* piAddrNew = NULL; int* piLen = NULL; double* pstData = NULL; int* pstData2 = NULL; double *rrows; double *rcols; int error; ////checking input argument CheckInputArgument(pvApiCtx,6,6); //checking output argument CheckOutputArgument(pvApiCtx, 1, 1); //for first argument // get Address of first input sciErr = getVarAddressFromPosition(pvApiCtx,1,&piAddr); //retrieving image Mat img,dst; retrieveImage(img,1); //second argument double *m; //fetching address of second argument sciErr = getVarAddressFromPosition(pvApiCtx,2,&piAddr2); //checking for error if any if (sciErr.iErr) { printError(&sciErr, 0); return 0; } //this function will fetch value of second argument sciErr = getMatrixOfDouble(pvApiCtx, piAddr2, &iRows, &iCols ,&m); if(sciErr.iErr) { printError(&sciErr, 0); return 0; } Mat m1=Mat(2,3,CV_64F); int k=0; for(int j=0;j<3;j++) { for(int i=0;i<2;i++) { m1.at(i,j)=m[k++]; // cout<< m1.at(i,j)<<"\n"; } } cout<