Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PixelRep
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
PixelRep
Commits
fbf1f25f
Commit
fbf1f25f
authored
Jul 27, 2016
by
Walt Mankowski
Browse files
Options
Downloads
Patches
Plain Diff
tweaked types to try to account for roundoff and conversion errors
parent
344c2789
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ImageJ/Demo_Pixel_Replication.java
+9
-3
9 additions, 3 deletions
src/ImageJ/Demo_Pixel_Replication.java
with
9 additions
and
3 deletions
src/ImageJ/Demo_Pixel_Replication.java
+
9
−
3
View file @
fbf1f25f
...
...
@@ -68,17 +68,22 @@ public class Demo_Pixel_Replication implements PlugInFilter {
for
(
int
y
=
r
.
y
;
y
<(
r
.
y
+
r
.
height
);
y
++)
{
for
(
int
x
=
r
.
x
;
x
<(
r
.
x
+
r
.
width
);
x
++)
{
int
n
=
(
int
)
Math
.
round
(
distMatIdx
.
get
(
y
,
x
));
long
n
=
(
int
)
Math
.
round
(
distMatIdx
.
get
(
y
,
x
));
if
(
n
>
0
)
{
Point2f
p
=
new
Point2f
(
x
,
y
);
UniqPts
.
add
(
p
);
for
(
int
i
=
0
;
i
<
n
;
i
++)
{
// long rep = Math.round((double)n/10.0);
long
rep
=
1
;
if
(
rep
==
0
)
rep
=
1
;
for
(
int
i
=
0
;
i
<
rep
;
i
++)
{
PrPts
.
add
(
p
);
}
}
}
}
IJ
.
log
(
String
.
format
(
"%d unique points, %d pixel rep points"
,
UniqPts
.
size
(),
PrPts
.
size
()));
// compute the gmm
EM
em
=
computeGMM
(
k
);
...
...
@@ -182,7 +187,8 @@ public class Demo_Pixel_Replication implements PlugInFilter {
em
.
set
(
"maxIters"
,
1000
);
em
.
set
(
"epsilon"
,
1
e
-
6
);
Mat
emMat
=
PrPts2Mat
(
PrPts
,
0.10
);
// Mat emMat = PrPts2Mat(PrPts, 0.10);
Mat
emMat
=
PrPts2Mat
(
PrPts
);
Mat
initMeans
=
randomInitMeans
(
k
);
// em.trainE(emMat, initMeans, noArray());
em
.
trainE
(
emMat
,
initMeans
,
new
Mat
(),
new
Mat
(),
logLikelihoods
,
labels
,
new
Mat
());
...
...
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