Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void EnhanceImageAux(Matrix* outputImage,Matrix* image,Vector* breastIndices,int lambda)
- {
- double* image_ptr = NULL;
- double* breastIndices_ptr = NULL;
- double* lambda_ptr = NULL;
- double* tmp = NULL;
- mxArray* outputImage_mxArray = NULL;
- mxArray* image_mxArray = NULL;
- mxArray* breastIndices_mxArray = NULL;
- mxArray* lambda_mxArray = NULL;
- outputImage_mxArray = mxCreateDoubleMatrix(0,0,mxREAL);
- image_mxArray = mxCreateDoubleMatrix(0,0,mxREAL);
- CopyFromMatrixToArray(image,&image_ptr);
- tmp = mxGetPr(image_mxArray);
- mxFree(tmp);
- mxSetPr(image_mxArray,image_ptr);
- mxSetM(image_mxArray,image->m);
- mxSetN(image_mxArray,image->n);
- FreeMatrix(image);
- breastIndices_mxArray = mxCreateDoubleMatrix(0,0,mxREAL);
- CopyFromVectorToArray(breastIndices,&breastIndices_ptr);
- tmp = mxGetPr(breastIndices_mxArray);
- mxFree(tmp);
- mxSetPr(breastIndices_mxArray,breastIndices_ptr);
- mxSetM(breastIndices_mxArray,breastIndices->m);
- mxSetN(breastIndices_mxArray,1);
- FreeVector(breastIndices);
- lambda_mxArray = mxCreateDoubleMatrix(1,1,mxREAL);
- CopyFromScalarToArray((double)lambda,&lambda_ptr);
- tmp = mxGetPr(lambda_mxArray);
- mxFree(tmp);
- mxSetPr(lambda_mxArray,lambda_ptr);
- mlfMyFunc(1,NULL,image_mxArray,breastIndices_mxArray,lambda_mxArray);
- mxSetM(outputImage_mxArray,image->m);
- mxSetN(outputImage_mxArray,image->n);
- AllocateMatrix(outputImage_mxArray,outputImage);
- AllocateMatrix(image_mxArray,image);
- AllocateVector(breastIndices_mxArray,breastIndices);
- mxDestroyArray(outputImage_mxArray);
- mxDestroyArray(image_mxArray);
- image_mxArray = NULL;
- mxDestroyArray(breastIndices_mxArray);
- breastIndices_mxArray = NULL;
- mxDestroyArray(lambda_mxArray);
- lambda_mxArray = NULL;
- image_ptr = NULL;
- breastIndices_ptr = NULL;
- lambda_ptr = NULL;
- }
Add Comment
Please, Sign In to add comment