Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
5893bc5e
Commit
5893bc5e
authored
Dec 21, 2022
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More on textured meshes
parent
36da3e22
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
378 additions
and
42 deletions
+378
-42
TexturedModel.java
...n/java/com/elphel/imagej/tileprocessor/TexturedModel.java
+25
-1
TriMesh.java
src/main/java/com/elphel/imagej/x3d/export/TriMesh.java
+353
-41
No files found.
src/main/java/com/elphel/imagej/tileprocessor/TexturedModel.java
View file @
5893bc5e
...
@@ -1261,9 +1261,11 @@ public class TexturedModel {
...
@@ -1261,9 +1261,11 @@ public class TexturedModel {
for
(
ArrayList
<
Integer
>
part_loc:
loc_multi
)
{
for
(
ArrayList
<
Integer
>
part_loc:
loc_multi
)
{
loc_list
.
addAll
(
part_loc
);
loc_list
.
addAll
(
part_loc
);
}
}
boolean
[]
discontinued
=
new
boolean
[
neib_lev
.
length
];
// Temporarily mark loc_list with max_neib_lev+1 to remove them from averaging
// Temporarily mark loc_list with max_neib_lev+1 to remove them from averaging
for
(
int
tile:
loc_list
)
{
for
(
int
tile:
loc_list
)
{
neib_lev
[
tile
]
=
max_neib_lev
+
1
;
neib_lev
[
tile
]
=
max_neib_lev
+
1
;
discontinued
[
tile
]
=
true
;
}
}
// there may be some orphans left neib_lev >0 that do not have neighbors with neib_lev one less
// there may be some orphans left neib_lev >0 that do not have neighbors with neib_lev one less
...
@@ -1372,9 +1374,24 @@ public class TexturedModel {
...
@@ -1372,9 +1374,24 @@ public class TexturedModel {
System
.
out
.
println
(
"buildTileCluster() BUG - no tiles removed from disparity_layers[]"
);
System
.
out
.
println
(
"buildTileCluster() BUG - no tiles removed from disparity_layers[]"
);
}
}
// Marking discontinued max_neib_lev with max_neib_lev+1 for building meshes they should not be connected to max_neib_lev
// Maybe there is a more elegant way to do this.
ai
.
set
(
0
);
for
(
int
ithread
=
0
;
ithread
<
threads
.
length
;
ithread
++)
{
threads
[
ithread
]
=
new
Thread
()
{
public
void
run
()
{
for
(
int
tile
=
ai
.
getAndIncrement
();
tile
<
tiles
;
tile
=
ai
.
getAndIncrement
())
if
(
discontinued
[
tile
]){
neib_lev
[
tile
]
=
max_neib_lev
+
1
;
}
}
};
}
ImageDtt
.
startAndJoin
(
threads
);
if
(
debugLevel
>
0
)
{
if
(
debugLevel
>
0
)
{
String
[]
dbg_titles
=
{
"Source"
,
"Intermediate"
,
"Final"
,
"neib_lev0"
,
"neib_lev1"
,
"neib_lev2"
,
String
[]
dbg_titles
=
{
"Source"
,
"Intermediate"
,
"Final"
,
"neib_lev0"
,
"neib_lev1"
,
"neib_lev2"
,
"seams"
,
"seams_layers_0"
,
"seams_layers_1"
,
"disparity_layers_0"
,
"disparity_layers_
0
"
};
"seams"
,
"seams_layers_0"
,
"seams_layers_1"
,
"disparity_layers_0"
,
"disparity_layers_
1
"
};
double
[][]
dbg_neib_lev
=
new
double
[
6
][
tiles
];
double
[][]
dbg_neib_lev
=
new
double
[
6
][
tiles
];
for
(
int
i
=
0
;
i
<
tiles
;
i
++)
{
for
(
int
i
=
0
;
i
<
tiles
;
i
++)
{
...
@@ -1412,6 +1429,8 @@ public class TexturedModel {
...
@@ -1412,6 +1429,8 @@ public class TexturedModel {
}
}
// Split result into connected clusters
// Split result into connected clusters
int
[]
pnum_clust
=
new
int
[
1
];
int
[]
pnum_clust
=
new
int
[
1
];
boolean
[]
sel_tiles
=
new
boolean
[
tiles
];
boolean
[]
sel_tiles
=
new
boolean
[
tiles
];
...
@@ -2129,6 +2148,9 @@ public class TexturedModel {
...
@@ -2129,6 +2148,9 @@ public class TexturedModel {
String
texturePath
=
imp_texture_cluster
.
getTitle
()+
".png"
;
String
texturePath
=
imp_texture_cluster
.
getTitle
()+
".png"
;
double
[]
scan_disparity
=
tileClusters
[
nslice
].
getSubDisparity
(
sub_i
);
// limited to cluster bounds
double
[]
scan_disparity
=
tileClusters
[
nslice
].
getSubDisparity
(
sub_i
);
// limited to cluster bounds
boolean
[]
scan_selected
=
tileClusters
[
nslice
].
getSubSelected
(
sub_i
);
// limited to cluster bounds
boolean
[]
scan_selected
=
tileClusters
[
nslice
].
getSubSelected
(
sub_i
);
// limited to cluster bounds
int
[]
scan_border_int
=
tileClusters
[
nslice
].
getSubBorderInt
(
sub_i
);
// limited to cluster bounds
int
max_border
=
tileClusters
[
nslice
].
getBorderIntMax
();
// skipping averaging disparity for a whole cluster (needs strength and does not seem to be useful)
// skipping averaging disparity for a whole cluster (needs strength and does not seem to be useful)
try
{
try
{
if
(
alpha
==
null
)
{
if
(
alpha
==
null
)
{
...
@@ -2174,6 +2196,8 @@ public class TexturedModel {
...
@@ -2174,6 +2196,8 @@ public class TexturedModel {
texture_bounds
,
// Rectangle texture_bounds, // if not null - allows trimmed combo textures
texture_bounds
,
// Rectangle texture_bounds, // if not null - allows trimmed combo textures
scan_selected
,
// scan.getSelected(),
scan_selected
,
// scan.getSelected(),
scan_disparity
,
// scan.disparity_map[ImageDtt.DISPARITY_INDEX_CM],
scan_disparity
,
// scan.disparity_map[ImageDtt.DISPARITY_INDEX_CM],
scan_border_int
,
// int [] border_int,
max_border
,
// int max_border,
clt_parameters
.
transform_size
,
clt_parameters
.
transform_size
,
tp
.
getTilesX
(),
// int tilesX,
tp
.
getTilesX
(),
// int tilesX,
tp
.
getTilesY
(),
// int tilesY,
tp
.
getTilesY
(),
// int tilesY,
...
...
src/main/java/com/elphel/imagej/x3d/export/TriMesh.java
View file @
5893bc5e
This diff is collapsed.
Click to expand it.
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