Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
JCL
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lafabregue
JCL
Commits
f8c22cfc
Commit
f8c22cfc
authored
Jul 27, 2017
by
lafabregue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed index computing in ImageSampler
parent
c6edaa9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
src/jcl/data/attribute/AttributeMultiDimSequence.java
src/jcl/data/attribute/AttributeMultiDimSequence.java
+2
-2
src/jcl/data/sampling/ImageSampler.java
src/jcl/data/sampling/ImageSampler.java
+10
-8
No files found.
src/jcl/data/attribute/AttributeMultiDimSequence.java
View file @
f8c22cfc
...
@@ -72,7 +72,7 @@ public class AttributeMultiDimSequence extends Attribute {
...
@@ -72,7 +72,7 @@ public class AttributeMultiDimSequence extends Attribute {
// contient une sequence de tuples.
// contient une sequence de tuples.
public double[][] sequence;
public double[][] sequence;
public static final short NB_THREADS =
3
0;
public static final short NB_THREADS =
5
0;
public static final boolean[] busy = new boolean[NB_THREADS];
public static final boolean[] busy = new boolean[NB_THREADS];
static {
static {
Arrays.fill(busy, false);
Arrays.fill(busy, false);
...
@@ -80,7 +80,7 @@ public class AttributeMultiDimSequence extends Attribute {
...
@@ -80,7 +80,7 @@ public class AttributeMultiDimSequence extends Attribute {
/**
/**
* ces attributs et la methode distopt sont déclarés static pour des raisons d'optimisation (on évite des réallocations de mémoire à chaque appel)
* ces attributs et la methode distopt sont déclarés static pour des raisons d'optimisation (on évite des réallocations de mémoire à chaque appel)
*/
*/
private final static int MAX_SEQ_LENGTH =
300
;
private final static int MAX_SEQ_LENGTH =
1025
;
private static double[][][] matriceW = new double[NB_THREADS][AttributeMultiDimSequence.MAX_SEQ_LENGTH][AttributeMultiDimSequence.MAX_SEQ_LENGTH];
private static double[][][] matriceW = new double[NB_THREADS][AttributeMultiDimSequence.MAX_SEQ_LENGTH][AttributeMultiDimSequence.MAX_SEQ_LENGTH];
...
...
src/jcl/data/sampling/ImageSampler.java
View file @
f8c22cfc
...
@@ -342,8 +342,9 @@ public class ImageSampler extends Sampler {
...
@@ -342,8 +342,9 @@ public class ImageSampler extends Sampler {
}
else
{
}
else
{
index
=
getIndex
(
i
);
index
=
getIndex
(
i
);
}
}
x
=
((
int
)
index
)
%
imageWidth
;
// the mask indexes is always related to the first image
y
=
((
int
)
index
)
/
imageWidth
;
x
=
((
int
)
index
)
%
readers
.
get
(
0
).
getImageWidth
();
y
=
((
int
)
index
)
/
readers
.
get
(
0
).
getImageWidth
();
result
.
add
(
new
DataObject
(
channelCount
));
result
.
add
(
new
DataObject
(
channelCount
));
try
{
try
{
...
@@ -508,8 +509,9 @@ public class ImageSampler extends Sampler {
...
@@ -508,8 +509,9 @@ public class ImageSampler extends Sampler {
}
else
{
}
else
{
index
=
getIndex
(
i
);
index
=
getIndex
(
i
);
}
}
x
=
getStartX
()
+
((
int
)
index
)
%
imageWidth
;
// the mask indexes is always related to the first image
y
=
getStartY
()
+
((
int
)
index
)
/
imageWidth
;
x
=
getStartX
()
+
((
int
)
index
)
%
readers
.
get
(
0
).
getImageWidth
();
y
=
getStartY
()
+
((
int
)
index
)
/
readers
.
get
(
0
).
getImageWidth
();
result
.
add
(
new
DataObject
(
1
));
result
.
add
(
new
DataObject
(
1
));
List
<
double
[]>
values
=
new
ArrayList
<
double
[]>();
List
<
double
[]>
values
=
new
ArrayList
<
double
[]>();
...
@@ -584,8 +586,8 @@ public class ImageSampler extends Sampler {
...
@@ -584,8 +586,8 @@ public class ImageSampler extends Sampler {
int
channelCount
=
readers
.
get
(
0
).
getChannelCount
();
int
channelCount
=
readers
.
get
(
0
).
getChannelCount
();
DataObject
result
=
new
DataObject
(
channelCount
);
DataObject
result
=
new
DataObject
(
channelCount
);
x
=
((
int
)
index
)
%
imageWidth
;
x
=
((
int
)
index
)
%
readers
.
get
(
0
).
getImageWidth
()
;
y
=
((
int
)
index
)
/
imageWidth
;
y
=
((
int
)
index
)
/
readers
.
get
(
0
).
getImageWidth
()
;
try
{
try
{
double
[]
pixel
=
readers
.
get
(
0
).
getPixel
(
x
,
y
);
double
[]
pixel
=
readers
.
get
(
0
).
getPixel
(
x
,
y
);
for
(
int
c
=
0
;
c
<
readers
.
get
(
0
).
getChannelCount
()
;
c
++)
{
for
(
int
c
=
0
;
c
<
readers
.
get
(
0
).
getChannelCount
()
;
c
++)
{
...
@@ -613,8 +615,8 @@ public class ImageSampler extends Sampler {
...
@@ -613,8 +615,8 @@ public class ImageSampler extends Sampler {
int
y
=
0
;
int
y
=
0
;
int
channelCount
=
readers
.
get
(
0
).
getChannelCount
();
int
channelCount
=
readers
.
get
(
0
).
getChannelCount
();
x
=
((
int
)
index
)
%
imageWidth
;
x
=
((
int
)
index
)
%
readers
.
get
(
0
).
getImageWidth
()
;
y
=
((
int
)
index
)
/
imageWidth
;
y
=
((
int
)
index
)
/
readers
.
get
(
0
).
getImageWidth
()
;
try
{
try
{
if
(
geoTranslateVectors
!=
null
)
{
if
(
geoTranslateVectors
!=
null
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment