資源簡介
Visual Geometry Group項目組開發的超分辨率重建的源碼,具有很好的效果。 附有詳細的文檔說明,可直接運行

代碼片段和文件信息
#include?“mex.h“
/*?eout?=?elle_eval_huber(xalpbetbivbih);?*/
double?alp;
double?huber(double?x)?{
????if?(x<0)?{x=-x;}
????if?(x ????else?{?return?(2*x*alp?-?alp*alp);?}?
????return?-1;
}
void?mexFunction(int?nlhs?mxArray?*plhs[]?int?nrhs?const?mxArray?*prhs[])?{
???const?double?r2?=?1.414213562373095;?/*?ideally?this?would?be?sqrt(2)?but?the?compiler?is?complaining..?*/
???uint?i=0?j=0;
???
???/*?Check?for?proper?number?of?arguments.?*/
???if(nrhs!=5)?{?
???????printf(“Wrong?number?of?inputs?(Should?have:?x?alpha?beta?biv?bih)\n“);
???????printf(“I?see?%i?and?should?see?5.\n“nrhs);
???????return;
???}
???if(nlhs>1)?{?printf(“Too?many?output?arguments“);?return;?}
???
???if(mxGetClassID(prhs[0])!=mxDOUBLE_CLASS)?{?printf(“X?(1st?arg)?must?be?of?type?double.“);?return;}
???if(mxGetClassID(prhs[1])!=mxDOUBLE_CLASS)?{?printf(“alpha?(2nd?arg)?must?be?of?type?double.“);?return;}
???if(mxGetClassID(prhs[2])!=mxDOUBLE_CLASS)?{?printf(“alpha?(3rd?arg)?must?be?of?type?double.“);?return;}
???if(mxGetClassID(prhs[3])!=mxDOUBLE_CLASS)?{?printf(“biv?(4th?arg)?must?be?of?type?double.“);?return;}
???if(mxGetClassID(prhs[4])!=mxDOUBLE_CLASS)?{?printf(“bih?(5th?arg)?must?be?of?type?double.“);?return;}
???if(mxGetM(prhs[0])>1)?{printf(“X?must?be?a?row?vector.“);?return;}
???
???double?*X?=?(double?*)?mxGetPr(prhs[0]);
???alp?=?(double)?mxGetPr(prhs[1])[0];
???double?bet?=?(double)?mxGetPr(prhs[2])[0];
???int?biv?=?(int)?mxGetPr(prhs[3])[0];
???int?bih?=?(int)?mxGetPr(prhs[4])[0];
???plhs[0]?=?mxCreateDoubleMatrix(11mxREAL);
???double?*eout?=?mxGetPr(plhs[0]);
???
???double?etemp?=?0;
???int?c;
???for?(i=0;?i ???????for?(j=0;?j ???????????c?=?j*biv+i;
???????????if?(i<(biv-1))?{?*eout?+=?huber(X[c+1]-X[c]);
???????????if?(j<(bih-1))?{?*eout?+=?huber((X[c+biv+1]-X[c])/r2);?}
???????????}
???????????if?(j<(bih-1))?{?*eout?+=?huber(X[c+biv]-X[c]);
???????????if?(i>=1)?{?*eout?+=?huber((X[c+biv-1]-X[c])/r2);?}
???????????}
???????}
???}
???*eout?*=?bet/2;?/*?now?eout?=?nu*Huber();?*/
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2099??2008-12-09?01:05??elleSR_0.2\elle_eval_huber.c
?????文件???????3121??2008-12-09?01:05??elleSR_0.2\elle_eval_huber_grad.c
?????文件???????9337??2008-12-09?01:05??elleSR_0.2\getAvim.c
?????文件???????8452??2008-12-09?01:05??elleSR_0.2\makeLR.c
?????文件??????12199??2008-12-09?01:05??elleSR_0.2\makeW.c
?????文件???????1170??2008-12-09?01:05??elleSR_0.2\nrand.h
?????文件???????6678??2008-12-09?01:05??elleSR_0.2\README
?????文件???????1704??2008-12-09?01:05??elleSR_0.2\SR_demo.m
?????文件???????3481??2009-02-25?23:29??elleSR_0.2\superres_huber.m
?????文件???????3197??2008-12-09?01:05??elleSR_0.2\superres_ml.m
?????文件???????2675??2008-12-09?01:05??elleSR_0.2\synthdata_demo.m
?????文件???????6846??2009-04-14?10:08??elleSR_0.2\新建?文本文檔.txt
?????目錄??????????0??2009-05-19?10:25??elleSR_0.2
-----------?---------??----------?-----??----
????????????????60959????????????????????13
- 上一篇:自頂向下的答案 網絡上的
- 下一篇:圖像的反卷積恢復
評論
共有 條評論