|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
我用POCS实现超分辨率图像重建,但是当低分辨率图像上点映射到高分辨率图像上时,这里的Wr始终为1,这不是想要的结果,我认为是upref(n1,n2)这里有问题,请哪位高手帮忙修改,谢谢!- mcX = X + u; %运动补偿到高分辨率图像的像素的坐标
- mcY=Y+ v;
- BW=edge(upref,'canny'); %边缘检测
- %%% Loop over entire (low-res) frame
- for m2 = 1:size(frame,2),
- for m1 = 1:size(frame,1),
- %%% Get high-resolution coordinates
- n1 = 2*m1; %行坐标
- n2 = 2*m2; %列坐标
- %%% Get coordinates of the motion compensated pixel
- N2 = mcX(n1,n2);
- N1 = mcY(n1,n2);
- %%% If not a border pixel
- if ( N1>3 & N1<size(upref,1)-2 & N2>3 & N2<size(upref,2)-2 )
-
- %%% Find center of the window where the PSF will be applied
- rN1 = round(N1); %PSF窗口中心值
- rN2 = round(N2);
-
- %%% Calculate the effective window 5*5
- windowX = Y(rN1-2:rN1+2,rN2-2:rN2+2);
- windowY = X(rN1-2:rN1+2,rN2-2:rN2+2);
-
- weights = exp(-((N1-windowX).^2+(N2-windowY).^2)./2); %计算高斯PSF权值,假设高斯方差为1,得到5x5的一个区域
- if (BW(rN1,rN2)==1) %如果PSF窗口中心在边缘上,就对weights进行修改
- [color=Red] Wr = exp(-(upref(n1,n2)-upref(rN1,rN2)).^2./2*(0.02).^2); [/color] weights=weights.*Wr;
-
- end
复制代码 |
|