Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DeProj
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
IAH public
DeProj
Commits
49028dd1
Commit
49028dd1
authored
4 years ago
by
Jean-Yves TINEVEZ
Browse files
Options
Downloads
Patches
Plain Diff
Compute perimeter 3d.
parent
40385764
No related branches found
Branches containing commit
No related tags found
1 merge request
!9
Rework the whole code for the upcoming publication.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
RunExample.m
+9
-3
9 additions, 3 deletions
RunExample.m
src/perimeter3d.m
+14
-0
14 additions, 0 deletions
src/perimeter3d.m
with
23 additions
and
3 deletions
RunExample.m
+
9
−
3
View file @
49028dd1
...
...
@@ -147,11 +147,14 @@ for i = 1 : n_objects
o
=
objects
(
i
);
area
=
area3d
(
o
.
boundary
);
perim
=
perimeter3d
(
o
.
boundary
);
objects
(
i
)
.
area
=
area
;
objects
(
i
)
.
perimeter
=
perim
;
uncorr
=
struct
();
uncorr
.
area
=
polyarea
(
o
.
boundary
(:,
1
),
o
.
boundary
(:,
2
)
);
objects
(
i
)
.
area
=
area
;
uncorr
.
perimeter
=
perimeter3d
(
o
.
boundary
(
:,
1
:
2
)
);
objects
(
i
)
.
uncorr
=
uncorr
;
end
...
...
@@ -181,7 +184,10 @@ for i = 1 : n_objects
o
=
objects
(
i
);
P
=
o
.
boundary
;
patch
(
P
(:,
1
),
P
(:,
2
),
P
(:,
3
),
o
.
area
/
o
.
uncorr
.
area
,
...
err
=
o
.
perimeter
/
o
.
uncorr
.
perimeter
-
1
;
patch
(
P
(:,
1
),
P
(:,
2
),
P
(:,
3
),
err
,
...
'LineWidth'
,
2
);
text
(
o
.
center
(
1
),
o
.
center
(
2
),
o
.
center
(
3
)
+
0.5
,
num2str
(
i
),
...
'HorizontalAlignment'
,
'center'
,
...
...
...
This diff is collapsed.
Click to expand it.
src/perimeter3d.m
0 → 100644
+
14
−
0
View file @
49028dd1
function
perim
=
perimeter3d
(
p
)
%PERIMETER3D Perimeter of a closed N-dimensional polygon.
% p can be a N x d matrix, with d being the dimensionality.
p2
=
[
p
;
p
(
1
,
:
)
];
p_diff
=
diff
(
p2
);
p_diff_2
=
p_diff
.*
p_diff
;
p_diff_2_sum
=
sum
(
p_diff_2
,
2
);
sls
=
sqrt
(
p_diff_2_sum
);
perim
=
sum
(
sls
);
end
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