请问高分辨率图像这里的坐标怎么修改?
我用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进行修改
Wr = exp(-(upref(n1,n2)-upref(rN1,rN2)).^2./2*(0.02).^2); weights=weights.*Wr;
end Wr = exp(-(upref(n1,n2)-upref(rN1,rN2)).^2./2*(0.02).^2);
我认为是这里的有问题,upref(rN1,rN2)表示PSF窗口中心对应的高分辨率图像那点的像素值,upref(n1,n2)应该表示为低分辨率图像映射到高分辨率图像对应点的像素值,但是这里坐标如果是(n1,n2)就导致upref(n1,n2)-upref(rN1,rN2)总是0,请问这里怎么修改?
页:
[1]