% for NEGATIVE PRINT OF IMAGE; often saves toner. Steve Mann; 1990OCT22
%
% LOG SCALED
%
% scales a real matrix to [0,255] range, takes 255-image,
% and places a border of all black (zeros) around the outside.
% the dimension is increased by 2 (or more) each way
%
% Y = border(X); % black border all around
% % so if image is mostly white, you can see its region of support
%
% Y = border(X,2); % double thickness border all around
%
% Y = border(X,3,4); % 3 rows of zeros, 4 cols of zeros;
% % looks nice on a 3by4 image (eg. TV screen size)
function Y = dummy(X,thicknessrow,thicknesscol)
minX = min(min(X));
thresh = input(sprintf('smallest image value = %g; choose thres to avoid neg. val.s; big thresh==flat hist ',minX));
if nargin == 2
thicknesscol = thicknessrow;
end%if
if nargin == 1
thicknesscol = 1;
thicknessrow = 1;
end%if
[M N] = size(X);
rowpad = zeros(thicknessrow,N);
colpad = zeros(M+2*thicknessrow,thicknesscol);
Y = [colpad [rowpad;255-scaler2(log(X+thresh));rowpad] colpad];
dis = sprintf(' to %g by %g, took NEGATIVE and SCALED to [0,255] range',M+2*thicknessrow,N+2*thicknesscol);
disp([sprintf('zero padded %g by %g',M,N) dis])