Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DCT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
graintracking
DCT
Commits
f6b42a3f
Commit
f6b42a3f
authored
12 years ago
by
stefanschmie
Committed by
Nicola Vigano
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
trivial typo correction
Signed-off-by:
stefanschmie
<
sschmied@esrf.fr
>
parent
4d1a5b62
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
zUtil_Distortion/distortion_createnodes.m
+14
-14
14 additions, 14 deletions
zUtil_Distortion/distortion_createnodes.m
with
14 additions
and
14 deletions
zUtil_Distortion/distortion_createnodes.m
+
14
−
14
View file @
f6b42a3f
function
[
f_rows
,
f_cols
,
sx
,
sy
]
=
distortion_createnodes
(
im
g
,
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
(
'im
g
'
,
'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
(
im
g
(:))
max
(
im
g
(:))];
im
g
=
(
im
g
-
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
();
[
im
g
,
rect
]
=
imcrop
(
im
g
,
[
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
(
im
g
,
[
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
(
im
g
,
1
);
sy
=
size
(
im
g
,
2
);
imagesc
(
im
g
)
sx
=
size
(
im
,
1
);
sy
=
size
(
im
,
2
);
imagesc
(
im
)
pause
(
1
)
imc
=
imcrop
(
im
g
,
[
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
im
g
=
imresize
(
im
g
,
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
(
im
g
,
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'
,
'im
g
'
,
'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
(
im
g
,
[])
imshow
(
im
,
[])
title
(
'Nodes found:'
)
xlabel
(
'y'
)
ylabel
(
'x'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment