最近在做毕设,是数字图像去噪算法,老师要求c++结合Matlab编程,现在遇到了一些问题,如果有做过相关项目的大牛愿意帮我,请加小弟QQ:491298824,或者留下你的邮箱
     具体代码是这样的:
void CImageProcessingView::Onsaltpepper() 
{
// TODO: Add your command handler code here
if( ! mclInitializeApplication(NULL,0) )
{
MessageBox("Could not initialize the application");
exit(1);
}
if( !libimnoise2Initialize())   
    {   
        MessageBox("Could not initialize the lib");
        exit(1);   
    }

int nargout = 1;
//输出参数初始化
CImageProcessingDoc * pDoc = (CImageProcessingDoc *)this->GetDocument();
CDib * pDib = pDoc->m_pDibInit;
CSize sizeImage = pDib->GetDimensions();
int nWidth = sizeImage.cx ;
int nHeight= sizeImage.cy ;
mwArray R(nWidth,nHeight,mxDOUBLE_CLASS); //type变量的初始化和赋值
char *name = "salt & pepper";
int len = strlen(name);
mwArray type(1,len,mxCHAR_CLASS);
type.SetData(name,len); //M变量的初始化和赋值
int m = nHeight;
mwArray M(1,1,mxINT8_CLASS);
M.SetData(&m,1);

//N变量的初始化和赋值
int n = nHeight;
mwArray N(1,1,mxINT8_CLASS);
N.SetData(&n,1);

//参数的赋值
int canshu1 = 0.1;
mwArray a(1,1,mxDOUBLE_CLASS);
a.SetData(&canshu1,1);
int canshu2 = 0;
mwArray b(1,1,mxDOUBLE_CLASS);
b.SetData(&canshu2,1);
imnoise2(nargout, R, type, M, N, a, b);

//开辟内存,存储图象数据
int x,y;
int nSaveWidth = pDib->GetDibSaveDim().cx;
unsigned char * pUnchImage = new unsigned char[nWidth*nHeight]; for(y=0; y<nHeight; y++)
{
for(x=0; x<nWidth; x++)
{
pUnchImage[y*nWidth+x] = pDib->m_lpImage[y*nSaveWidth+x];
}
}

//对图像进行处理
//*/
for(x=1; x<=nWidth; x++)
{
for(y=1; y<=nHeight; y++)
{
temp =  R.Get(y,x); //这个方法不知道对不对,是想获得R中的值

if (temp == 0)
{
pUnchImage[y*nWidth+x] = 0;
}
}
}
//*/
libimnoise2Terminate();

mclTerminateApplication();
}imnoise2方法有个返回值是mwArray类型的R,R里面存的应该是150*150的矩阵值是0或者0.5,现在卡在不知道怎么从R中获得数据,是不是用GET方法图像处理MATLABMFCC++