Skip to content
Snippets Groups Projects
Commit f6b42a3f authored by stefanschmie's avatar stefanschmie Committed by Nicola Vigano
Browse files

trivial typo correction


Signed-off-by: default avatarstefanschmie <sschmied@esrf.fr>
parent 4d1a5b62
No related branches found
No related tags found
No related merge requests found
function [f_rows, f_cols, sx, sy] = distortion_createnodes(img, varargin)
function [f_rows, f_cols, sx, sy] = distortion_createnodes(im, varargin)
% [r, c, sx, sy] = distortion_createnodes(im, varargin)
% INPUTS:
% im - Image with a regular pattern
......@@ -13,7 +13,7 @@ function [f_rows, f_cols, sx, sy] = distortion_createnodes(img, varargin)
% distortion_createmap.m for the creation of distortion maps.
%
if (~exist('img', 'var'))
if (~exist('im', 'var'))
gtError('distortion_createnodes:wrong_argument', ...
'Specify the source image, please!')
end
......@@ -26,23 +26,23 @@ function [f_rows, f_cols, sx, sy] = distortion_createnodes(img, varargin)
conf = parse_pv_pairs(conf, varargin);
% scale im (.. %) between 0 and 1
lim = [min(img(:)) max(img(:))];
img = (img - lim(1)) ./ (lim(2) - lim(1));
lim = [min(im(:)) max(im(:))];
im = (im - lim(1)) ./ (lim(2) - lim(1));
if (conf.crop)
fprintf('\nChoose a region completely filled with regular features\n\n')
figure();
[img, rect] = imcrop(img, [0 1]); % display between 0 and 1
[im, rect] = imcrop(im, [0 1]); % display between 0 and 1
sx = rect(4);
sy = rect(3);
imc = imcrop(img, [sy*0.375 sx*0.375 sy*0.25 sx*0.25]);
imc = imcrop(im, [sy*0.375 sx*0.375 sy*0.25 sx*0.25]);
imagesc(imc)
else
sx = size(img, 1);
sy = size(img, 2);
imagesc(img)
sx = size(im, 1);
sy = size(im, 2);
imagesc(im)
pause(1)
imc = imcrop(img, [sy*0.375 sx*0.375 sy*0.375 sx*0.375]);
imc = imcrop(im, [sy*0.375 sx*0.375 sy*0.375 sx*0.375]);
imagesc(imc)
end
......@@ -72,7 +72,7 @@ function [f_rows, f_cols, sx, sy] = distortion_createnodes(img, varargin)
if (conf.scale ~= 1)
fprintf('Rescaling image with scale: %f..', conf.scale);
% oversample the image to give better resolution
img = imresize(img, conf.scale);
im = imresize(im, conf.scale);
feature = imresize(feature, conf.scale);
fprintf(' Done.\n');
end
......@@ -82,7 +82,7 @@ function [f_rows, f_cols, sx, sy] = distortion_createnodes(img, varargin)
fprintf('Convolution to get features..');
% Convolve to get feature positions
C = conv2(img, feature, 'same');
C = conv2(im, feature, 'same');
fprintf(' Done.\n');
% Get rid of weak peaks
......@@ -131,11 +131,11 @@ function [f_rows, f_cols, sx, sy] = distortion_createnodes(img, varargin)
if ~isempty(conf.fname_mat)
r = f_rows;
c = f_cols;
save(conf.fname_mat, 'r', 'c', 'img', 'feature', 'sx', 'sy');
save(conf.fname_mat, 'r', 'c', 'im', 'feature', 'sx', 'sy');
disp(['Nodes and image are saved in: "' conf.fname_mat '"']);
end
imshow(img, [])
imshow(im, [])
title('Nodes found:')
xlabel('y')
ylabel('x')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment