I want to transform a hyperbolic Poincaré disk with image textures (examples in https://www.flickr.com/photos/gbachelier/albums/72157676467905456) to the Bulatov band model and found in https://www.slideshare.net/chamb3rlain/a-poor-mans-hyperbolic-square-mapping (slide 25) the function based on the inverse hyperbolic tan that should do this: f(z) = 2*pi*atanh(z). But inserting it in a meshgrid based framework for image warping with complex valued functions I got nothing like the expected band structure.
So how could the mapping to the band model be made?
wh_out = num2cell([1000,2000]); [w_o,h_o] = wh_out{:};
[h_i, w_i, d] = size(img);
% GENERATE OUTPUT-GRID AND NORMALIZE [-1 1]
[xo1,yo1] = meshgrid(1:w_o,1:h_o);
xo1 = (xo1/w_o)*2 - 1;
yo1 = (yo1/h_o)*2 - 1;
% WARP OUTPUT-GRID WITH f(z) AND SEPARATE REAL AND IMAGINARY PARTS
fxiy = 2 * pi * atanh(deg2rad(xo1+1i*y_o1)));
xo1=real(fxiy);
yo1=imag(fxiy);
% NORMALIZE OUTPUT-GRID [0 1]
xo1 = (xo1+1)/2;
yo1 = (yo1+1)/2;
% GENERATE INPUT-GRID AND NORMALIZE [0 1]
[xi,yi] = meshgrid(linspace(0,w_i+1,w_i),linspace(0,h_i+1,h_i));
xi = xi / w_i;
yi = yi / h_i;
% INTERPOLATION OF OUTPUT-IMAGE
img = double(img);
img_out = zeros(h_o,w_o,d);
for k = 1:d; img_out(:,:,k) = uint8(interp2(xi, yi, img(:,:,k), xo1, yo1, interpol_meth)); end