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
6a57b1fc
Commit
6a57b1fc
authored
Jan 30, 2023
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working, but unfinished
parent
8d0998f2
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
217 additions
and
113 deletions
+217
-113
TexturedModel.java
...n/java/com/elphel/imagej/tileprocessor/TexturedModel.java
+179
-109
TileCluster.java
...ain/java/com/elphel/imagej/tileprocessor/TileCluster.java
+34
-1
TriMesh.java
src/main/java/com/elphel/imagej/x3d/export/TriMesh.java
+4
-3
No files found.
src/main/java/com/elphel/imagej/tileprocessor/TexturedModel.java
View file @
6a57b1fc
This diff is collapsed.
Click to expand it.
src/main/java/com/elphel/imagej/tileprocessor/TileCluster.java
View file @
6a57b1fc
...
...
@@ -34,6 +34,8 @@ class TileCluster{
int
border_int_max
;
// outer border value
int
[]
stitch_stitched
;
// +1 - stitch, +2 - stitched
int
[]
no_connect
;
// bit mask of prohibited directions
int
[]
class_conn
;
// 1 - disconnected from, 2 - disconnected (not only for stitch)
double
[]
disparity
;
// all and only unused - NaN
int
[]
cluster_index
=
null
;
// for debug purposes, index of the source cluster
...
...
@@ -57,12 +59,12 @@ class TileCluster{
public
TileCluster
(
Rectangle
bounds
,
int
index
,
// <0 to skip
// boolean [] border,
int
[]
border_int
,
// will replace border? Provide on-the-fly?
int
border_int_max
,
// outer border value
int
[]
stitch_stitched
,
// +1 - stitch, +2 - stitched
int
[]
no_connect
,
// bit mask of prohibited directions
double
[]
disparity
,
int
[]
class_conn
,
// 1 - disconnected from, 2 - disconnected (not only for stitch)
boolean
is_sky
){
this
.
bounds
=
bounds
;
this
.
index
=
index
;
...
...
@@ -101,10 +103,16 @@ class TileCluster{
stitch_stitched
=
new
int
[
bounds
.
width
*
bounds
.
height
];
}
this
.
stitch_stitched
=
stitch_stitched
;
if
(
no_connect
==
null
)
{
no_connect
=
new
int
[
bounds
.
width
*
bounds
.
height
];
}
this
.
no_connect
=
no_connect
;
if
(
class_conn
==
null
)
{
class_conn
=
new
int
[
bounds
.
width
*
bounds
.
height
];
}
this
.
class_conn
=
class_conn
;
}
public
boolean
isSky
()
{
...
...
@@ -139,6 +147,7 @@ class TileCluster{
public
int
[]
getBorderInt
()
{
return
border_int
;}
public
int
[]
getStitchStitched
()
{
return
stitch_stitched
;}
public
int
[]
getNoConnect
()
{
return
no_connect
;}
public
int
[]
getClassConn
()
{
return
class_conn
;}
public
int
getBorderIntMax
()
{
return
border_int_max
;}
public
double
[]
getDisparity
()
{
return
disparity
;}
public
void
setDisparity
(
double
[]
disparity
)
{
this
.
disparity
=
disparity
;}
...
...
@@ -263,6 +272,24 @@ class TileCluster{
return
sub_no_connect
;
}
public
int
[]
getSubClassConn
(
int
indx
)
{
if
(
clust_list
==
null
)
{
return
null
;
}
Rectangle
sub_bounds
=
clust_list
.
get
(
indx
).
bounds
;
int
[]
sub_class_conn
=
new
int
[
sub_bounds
.
width
*
sub_bounds
.
height
];
int
src_x
=
sub_bounds
.
x
-
bounds
.
x
;
for
(
int
dst_y
=
0
;
dst_y
<
sub_bounds
.
height
;
dst_y
++)
{
int
src_y
=
dst_y
+
sub_bounds
.
y
-
bounds
.
y
;
System
.
arraycopy
(
class_conn
,
src_y
*
bounds
.
width
+
src_x
,
sub_class_conn
,
dst_y
*
sub_bounds
.
width
,
sub_bounds
.
width
);
}
return
sub_class_conn
;
}
...
...
@@ -420,6 +447,12 @@ class TileCluster{
no_connect
,
dst_y
*
bounds
.
width
+
dst_x
,
tileCluster
.
bounds
.
width
);
System
.
arraycopy
(
tileCluster
.
class_conn
,
src_y
*
tileCluster
.
bounds
.
width
,
class_conn
,
dst_y
*
bounds
.
width
+
dst_x
,
tileCluster
.
bounds
.
width
);
}
return
;
}
...
...
src/main/java/com/elphel/imagej/x3d/export/TriMesh.java
View file @
6a57b1fc
...
...
@@ -1295,9 +1295,10 @@ public class TriMesh {
/**
* Triangulate all vertice indices - combine triangulation of same-size equailateral 45-degree
* large (tile size) and small (tile subdivisions) and add connections between large and small ones
* @param indices - array of [height][width]{{index}} for large tiles and [heigh][width][py][px]
* for small ones. This array will be modified and re-indexed if needed.
* @return int [][3] - array of triangles 3 vertex indices, clockwise
* @param indices array of [height][width]{{index}} for large tiles and [heigh][width][py][px]
* for small ones. This array will be modified and re-indexed if needed.
* @param no_connect 0 - neutral 1 - max_neib_lev, 2 - max_neib_lev+1
* @return int [][3] - array of triangles 3 vertex indices, clockwise
*/
public
static
int
[][]
triangulateAll
(
int
[][][][]
indices
,
...
...
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