%smoothing_upsamp2_ex

load_image
typeH=input('horizontal subdiv. mode typeH: 2--dyadic; 3--tryadic; ?')
typeV=input('vertical subdiv. mode typeV: 2--dyadic; 3--tryadic; ?')

parH=input('horizontal spline order (if typeH=2 then only even order); ?')
parV=input('vertical spline order (if typeV=2 then only even order); ?')


LlH=input('horizontal number of subdiv. steps; ?')
LlV=input('vertical number of subdiv. steps; ?')

ToX=.000000001;
range_rho1=10000000;%input('range_rho1; 111-former; ?')
% if range_rho1~=111
    range_rho=[0 range_rho1];
% end

y=bloch;
[M,~]=size(bloch);
st1=input('noise std; 0--no noise(interpolation);111-former; ?')
if st1~=111
    st=st1;
    noi=st*randn(M);
end
x=bloch+noi;
ee=sum(noi(:).^2);
rho=defroPSm(parH,x,ee,range_rho,ToX);
spli=smooth_spline2DPt(x,typeH,parH,LlH,typeV,parV,LlV,rho);

figure(1);

aj(bloch);
title(['\fontsize{16}Original'])
set(gca,'FontSize',20)
figure(2);

aj(x);
title(['\fontsize{16}STD=' num2str(st)])
%rho=0
set(gca,'FontSize',20)
figure(3);
aj(spli);
title(['\fontsize{14}H.order: '  int2str(parH) ', V.order: '  int2str(parV)  ',H.depth: '  int2str(LlH) ', V.depth: '  int2str(LlV)  ', \rho=' num2str(rho,4) ])
set(gca,'FontSize',20)
figure(4);
subplot(2,2,1)
aj(x);
title(['\fontsize{16}STD=' num2str(st)])
set(gca,'FontSize',16)
subplot(2,2,2)
aj(spli);
title(['\fontsize{14}H.order: '  int2str(parH) ', V.order: '  int2str(parV)  ',H.depth: '  int2str(LlH) ', V.depth: '  int2str(LlV)  ', \rho=' num2str(rho,4) ])
set(gca,'FontSize',16)
subplot(2,2,3)
aj(x(160:420,180:410));
set(gca,'FontSize',16)
%title(['\fontsize{16}STD=' num2str(st)])
subplot(2,2,4)
fspli=spli(160*typeV^LlV:420*typeV^LlV,180*typeH^LlH:410*typeH^LlH);
aj(fspli);
set(gca,'FontSize',16)
