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
32292d3b
Commit
32292d3b
authored
Sep 05, 2024
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
starting new branch, broken state
parent
2d5052a0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
16 deletions
+40
-16
FloatImageData.java
...in/java/com/elphel/imagej/orthomosaic/FloatImageData.java
+11
-1
OrthoMap.java
src/main/java/com/elphel/imagej/orthomosaic/OrthoMap.java
+27
-13
OrthoMapsCollection.java
...va/com/elphel/imagej/orthomosaic/OrthoMapsCollection.java
+2
-2
No files found.
src/main/java/com/elphel/imagej/orthomosaic/FloatImageData.java
View file @
32292d3b
...
...
@@ -11,7 +11,7 @@ public class FloatImageData {
public
int
width
;
public
int
height
;
public
int
zoom_lev
;
p
ublic
double
[]
vert
=
new
double
[
2
];
// x,y offset (in meters) of the point under the camera
p
rivate
double
[]
vert
=
new
double
[
2
];
// x,y offset (in meters) of the point under the camera
public
float
[]
data
;
public
FloatImageData
(
int
width
,
...
...
@@ -26,6 +26,16 @@ public class FloatImageData {
this
.
data
=
data
;
}
public
int
getWidth
()
{
return
width
;
}
public
int
getHeight
()
{
return
height
;
}
public
double
[]
getVertMeters
()
{
return
vert
;
}
public
double
[]
getDData
()
{
final
double
[]
ddata
=
new
double
[
data
.
length
];
final
Thread
[]
threads
=
ImageDtt
.
newThreadArray
();
...
...
src/main/java/com/elphel/imagej/orthomosaic/OrthoMap.java
View file @
32292d3b
...
...
@@ -116,8 +116,11 @@ public class OrthoMap implements Comparable <OrthoMap>, Serializable{
public
double
[][]
affine
=
new
double
[][]
{{
1
,
0
,
0
},{
0
,
1
,
0
}};
// relative to vert_meters[], positive Y is down (as in images)
public
transient
double
[][]
ers_affine
=
new
double
[][]
{{
1
,
0
},{
0
,
1
}};
// orientation only for remaining ERS, positive Y is down (as in images)
public
double
orig_pix_meters
;
public
double
[]
vert_meters
;
// offset of the image vertical in meters (scale-invariant), right (X) and down (Y)
@Deprecated
private
double
[]
vert_meters
;
// offset of the image vertical in meters (scale-invariant), right (X) and down (Y)
@Deprecated
public
int
orig_width
;
@Deprecated
public
int
orig_height
;
public
transient
FloatImageData
orig_image
;
public
transient
FloatImageData
alt_image
;
...
...
@@ -237,10 +240,16 @@ public class OrthoMap implements Comparable <OrthoMap>, Serializable{
}
public
int
getWidth
()
{
return
orig_width
;
return
getImageData
().
getWidth
();
//
orig_width;
}
public
int
getHeight
()
{
return
orig_height
;
return
getImageData
().
getHeight
();
//orig_height;
}
public
int
getAltWidth
()
{
return
getAltData
().
getWidth
();
// orig_width;
}
public
int
getAltHeight
()
{
return
getAltData
().
getHeight
();
//orig_height;
}
public
void
setMatch
(
...
...
@@ -692,7 +701,7 @@ public class OrthoMap implements Comparable <OrthoMap>, Serializable{
}
private
boolean
readAltData
()
{
// assuming the same scale as main image
private
boolean
readAltData
()
{
// assuming the same scale as main image
- WRONG
ImagePlus
imp
=
new
ImagePlus
(
getAltPath
(
path
));
int
width
=
imp
.
getWidth
();
int
height
=
imp
.
getHeight
();
...
...
@@ -744,24 +753,34 @@ public class OrthoMap implements Comparable <OrthoMap>, Serializable{
* Get vertical point offset from the top-left corner of the original orthoimage in meters (right and down)
* @return vertical point X,Y offset in meters from the top-left image corner
*/
public
double
[]
getVertMeters
()
{
public
double
[]
getVertMeters
Old
()
{
return
vert_meters
;
}
public
double
[]
getVertMeters
()
{
return
getImageData
().
getVertMeters
();
// ;
}
public
double
[]
getVertMetersAlt
()
{
return
getAltData
().
getVertMeters
();
// ;
}
/**
* Get vertical point offset from the top-left corner of the original orthoimage in pixels
* of the original resolution
* @return vertical point X,Y offset in pixels from the top-left image corner in original resolution
*/
public
int
[]
getVertPixels
()
{
double
[]
vm
=
getVertMeters
();
return
new
int
[]
{
(
int
)
Math
.
round
(
v
ert_meters
[
0
]/
orig_pix_meters
),
(
int
)
Math
.
round
(
v
ert_meters
[
0
]/
orig_pix_meters
)};
(
int
)
Math
.
round
(
v
m
[
0
]/
orig_pix_meters
),
(
int
)
Math
.
round
(
v
m
[
1
]/
orig_pix_meters
)};
}
public
ImagePlus
getOriginalImage
(
boolean
show_markers
)
{
FloatImageData
orig_image
=
getImageData
();
double
[]
vm
=
getVertMeters
();
if
(
orig_image
!=
null
)
{
String
full_name
=
path
.
substring
(
path
.
lastIndexOf
(
Prefs
.
getFileSeparator
())
+
1
);
ImagePlus
imp
=
ShowDoubleFloatArrays
.
makeArrays
(
...
...
@@ -771,7 +790,7 @@ public class OrthoMap implements Comparable <OrthoMap>, Serializable{
full_name
);
if
(
show_markers
)
{
PointRoi
roi
=
new
PointRoi
();
roi
.
addPoint
(
orig_image
.
vert
[
0
],
orig_image
.
vert
[
1
]);
roi
.
addPoint
(
vm
[
0
],
vm
[
1
]);
roi
.
setOptions
(
"label"
);
imp
.
setRoi
(
roi
);
}
...
...
@@ -1001,16 +1020,11 @@ public class OrthoMap implements Comparable <OrthoMap>, Serializable{
System
.
out
.
println
(
"downScaleForGPU(): indx = "
+
indx
+
" ("
+
spix
.
length
+
"), tileX= "
+
tileX
+
", tileY="
+
tileY
+
", px="
+
px
+
", py="
+
py
+
", ls="
+
ls
);
}
// if (sw > 0) {
// opix[tileY * width + tileX] = (float) (swd/sw);
// }
}
}
if
(
sw
>
0
)
{
opix
[
tileY
*
width
+
tileX
]
=
(
float
)
(
swd
/
sw
);
}
}
}
};
...
...
src/main/java/com/elphel/imagej/orthomosaic/OrthoMapsCollection.java
View file @
32292d3b
...
...
@@ -1346,7 +1346,7 @@ public class OrthoMapsCollection implements Serializable{
double
[][]
tlo_source_pixel
=
new
double
[
tlo_src_metric
.
length
][
2
];
for
(
int
n
=
0
;
n
<
tlo_source_pixel
.
length
;
n
++)
{
for
(
int
i
=
0
;
i
<
2
;
i
++)
{
tlo_source_pixel
[
n
][
i
]
=
(
tlo_src_metric
[
n
][
i
]
+
ortho_maps
[
gpu_pair
[
n
]].
vert_meters
[
i
])/
pix_size
;
tlo_source_pixel
[
n
][
i
]
=
(
tlo_src_metric
[
n
][
i
]
+
ortho_maps
[
gpu_pair
[
n
]].
getVertMeters
()
[
i
])/
pix_size
;
}
}
...
...
@@ -1862,7 +1862,7 @@ public class OrthoMapsCollection implements Serializable{
double
[]
tlo_src_metric_other
=
new
double
[
2
];
// check affines[][][] here -
for
(
int
i
=
0
;
i
<
2
;
i
++)
{
tlo_src_metric_other
[
i
]
=
affines_gpu
[
1
][
i
][
2
]
*
pix_size
-
ortho_maps
[
gpu_pair
[
1
]].
vert_meters
[
i
];
tlo_src_metric_other
[
i
]
=
affines_gpu
[
1
][
i
][
2
]
*
pix_size
-
ortho_maps
[
gpu_pair
[
1
]].
getVertMeters
()
[
i
];
for
(
int
j
=
0
;
j
<
2
;
j
++)
{
affines
[
1
][
i
][
j
]
=
affines_gpu
[
1
][
i
][
j
];
}
...
...
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