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
4bdd4cd8
Commit
4bdd4cd8
authored
Oct 27, 2023
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaning up
parent
064ff7ca
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
512 additions
and
87 deletions
+512
-87
PixelMapping.java
...main/java/com/elphel/imagej/calibration/PixelMapping.java
+1
-1
EyesisCorrections.java
.../java/com/elphel/imagej/correction/EyesisCorrections.java
+1
-1
EyesisTiff.java
src/main/java/com/elphel/imagej/readers/EyesisTiff.java
+17
-29
IntersceneMatchParameters.java
...lphel/imagej/tileprocessor/IntersceneMatchParameters.java
+80
-19
TexturedModel.java
...n/java/com/elphel/imagej/tileprocessor/TexturedModel.java
+1
-1
TileNeibs.java
src/main/java/com/elphel/imagej/tileprocessor/TileNeibs.java
+1
-1
StructureFromMotion.java
.../elphel/imagej/tileprocessor/sfm/StructureFromMotion.java
+411
-35
No files found.
src/main/java/com/elphel/imagej/calibration/PixelMapping.java
View file @
4bdd4cd8
...
@@ -1221,7 +1221,7 @@ public class PixelMapping {
...
@@ -1221,7 +1221,7 @@ public class PixelMapping {
if
(
saveTiff
){
if
(
saveTiff
){
String
outPath
=((
resultDirectory
.
length
()<
1
)?
""
:(
resultDirectory
+
Prefs
.
getFileSeparator
()))+
impOverlap
.
getTitle
()+
".tiff"
;
String
outPath
=((
resultDirectory
.
length
()<
1
)?
""
:(
resultDirectory
+
Prefs
.
getFileSeparator
()))+
impOverlap
.
getTitle
()+
".tiff"
;
try
{
try
{
(
new
EyesisTiff
())
.
saveTiff
(
EyesisTiff
.
saveTiff
(
impOverlap
,
impOverlap
,
outPath
,
outPath
,
3
,
// float32
3
,
// float32
...
...
src/main/java/com/elphel/imagej/correction/EyesisCorrections.java
View file @
4bdd4cd8
...
@@ -2743,7 +2743,7 @@ public class EyesisCorrections {
...
@@ -2743,7 +2743,7 @@ public class EyesisCorrections {
try
{
try
{
(
new
EyesisTiff
()).
saveTiffARGB32
(
(
new
EyesisTiff
()).
saveTiffARGB32
(
imp
,
imp
,
path
,
// +".tiff",
path
+
".tiff"
,
//path
, // +".tiff",
false
,
// correctionsParameters.imageJTags,
false
,
// correctionsParameters.imageJTags,
debugLevel
);
debugLevel
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
...
src/main/java/com/elphel/imagej/readers/EyesisTiff.java
View file @
4bdd4cd8
...
@@ -295,7 +295,7 @@ the type of pixel data in this file getPixelType()
...
@@ -295,7 +295,7 @@ the type of pixel data in this file getPixelType()
public
void
saveTiff
(
public
static
void
saveTiff
(
ImagePlus
imp
,
ImagePlus
imp
,
String
path
,
String
path
,
int
mode
,
// 0 - 8-bit, 1 - 16-bit, 2 - 32-bit unsigned, 3 - 32FP (only if source image is a 4-stack of FP)
int
mode
,
// 0 - 8-bit, 1 - 16-bit, 2 - 32-bit unsigned, 3 - 32FP (only if source image is a 4-stack of FP)
...
@@ -316,7 +316,7 @@ the type of pixel data in this file getPixelType()
...
@@ -316,7 +316,7 @@ the type of pixel data in this file getPixelType()
IJ
.
showMessage
(
"Not yet implemented for this image type"
);
IJ
.
showMessage
(
"Not yet implemented for this image type"
);
}
}
public
void
saveTiffARGB
(
public
static
void
saveTiffARGB
(
ImagePlus
imp
,
ImagePlus
imp
,
String
path
,
String
path
,
int
mode
,
// 0 - 8-bit, 1 - 16-bit, 2 - 32-bit unsigned, 3 - 32FP (only if source image is a 4-stack of FP)
int
mode
,
// 0 - 8-bit, 1 - 16-bit, 2 - 32-bit unsigned, 3 - 32FP (only if source image is a 4-stack of FP)
...
@@ -428,12 +428,14 @@ the type of pixel data in this file getPixelType()
...
@@ -428,12 +428,14 @@ the type of pixel data in this file getPixelType()
return
;
return
;
}
}
// System.out.println("saveTiffARGBFloat32(): mode="+mode+" pixelType="+pixelType+" bw="+bw);
// System.out.println("saveTiffARGBFloat32(): mode="+mode+" pixelType="+pixelType+" bw="+bw);
// ExifGPSTagSet gps_set = new ExifGPSTagSet();
// EXIFGPSTagSet gps_set = new EXIFGPSTagSet();
IFD
ifd
=
new
IFD
();
IFD
ifd
=
new
IFD
();
ifd
.
put
(
new
Integer
(
IFD
.
LITTLE_ENDIAN
),
new
Boolean
(
false
)
);
ifd
.
put
(
IFD
.
LITTLE_ENDIAN
,
false
);
// ifd.put(new Integer(IFD.LITTLE_ENDIAN), new Boolean(true));
// ifd.put(new Integer(IFD.LITTLE_ENDIAN), new Boolean(true));
ifd
.
put
(
new
Integer
(
IFD
.
IMAGE_WIDTH
)
,
imp
.
getWidth
());
ifd
.
put
(
IFD
.
IMAGE_WIDTH
,
imp
.
getWidth
());
ifd
.
put
(
new
Integer
(
IFD
.
IMAGE_LENGTH
)
,
imp
.
getHeight
());
ifd
.
put
(
IFD
.
IMAGE_LENGTH
,
imp
.
getHeight
());
ifd
.
put
(
new
Integer
(
IFD
.
SAMPLES_PER_PIXEL
)
,
4
);
ifd
.
put
(
IFD
.
SAMPLES_PER_PIXEL
,
4
);
ifd
.
putIFDValue
(
IFD
.
SOFTWARE
,
"Elphel Eyesis"
);
ifd
.
putIFDValue
(
IFD
.
SOFTWARE
,
"Elphel Eyesis"
);
ifd
.
putIFDValue
(
IFD
.
IMAGE_DESCRIPTION
,
description
);
ifd
.
putIFDValue
(
IFD
.
IMAGE_DESCRIPTION
,
description
);
// copy some other data?
// copy some other data?
...
@@ -484,7 +486,7 @@ the type of pixel data in this file getPixelType()
...
@@ -484,7 +486,7 @@ the type of pixel data in this file getPixelType()
true
);
// boolean last)
true
);
// boolean last)
}
}
public
void
saveTiffARGB32
(
public
static
void
saveTiffARGB32
(
ImagePlus
imp
,
ImagePlus
imp
,
String
path
,
String
path
,
boolean
imageJTags
,
boolean
imageJTags
,
...
@@ -511,18 +513,19 @@ the type of pixel data in this file getPixelType()
...
@@ -511,18 +513,19 @@ the type of pixel data in this file getPixelType()
bytes
[
pIndex
++]=(
byte
)
((
iPixels
[
i
]>>
24
)&
0xff
);
// alpha
bytes
[
pIndex
++]=(
byte
)
((
iPixels
[
i
]>>
24
)&
0xff
);
// alpha
}
}
IFD
ifd
=
new
IFD
();
IFD
ifd
=
new
IFD
();
ifd
.
put
(
new
Integer
(
IFD
.
LITTLE_ENDIAN
),
new
Boolean
(
false
)
);
ifd
.
put
(
IFD
.
LITTLE_ENDIAN
,
false
);
// ifd.put(new Integer(IFD.LITTLE_ENDIAN), new Boolean(true));
// ifd.put(new Integer(IFD.LITTLE_ENDIAN), new Boolean(true));
ifd
.
put
(
new
Integer
(
IFD
.
IMAGE_WIDTH
)
,
imp
.
getWidth
());
ifd
.
put
(
IFD
.
IMAGE_WIDTH
,
imp
.
getWidth
());
ifd
.
put
(
new
Integer
(
IFD
.
IMAGE_LENGTH
)
,
imp
.
getHeight
());
ifd
.
put
(
IFD
.
IMAGE_LENGTH
,
imp
.
getHeight
());
ifd
.
put
(
new
Integer
(
IFD
.
SAMPLES_PER_PIXEL
)
,
4
);
ifd
.
put
(
IFD
.
SAMPLES_PER_PIXEL
,
4
);
ifd
.
putIFDValue
(
IFD
.
SOFTWARE
,
"Elphel Eyesis"
);
ifd
.
putIFDValue
(
IFD
.
SOFTWARE
,
"Elphel Eyesis"
);
ifd
.
putIFDValue
(
IFD
.
IMAGE_DESCRIPTION
,
description
);
ifd
.
putIFDValue
(
IFD
.
IMAGE_DESCRIPTION
,
description
);
// copy some other data?
// copy some other data?
ifd
.
putIFDValue
(
IFD
.
COMPRESSION
,
1
);
//TiffCompression.UNCOMPRESSED);
ifd
.
putIFDValue
(
IFD
.
COMPRESSION
,
1
);
//TiffCompression.UNCOMPRESSED);
ifd
.
putIFDValue
(
IFD
.
PHOTOMETRIC_INTERPRETATION
,
2
);
// RGB
ifd
.
putIFDValue
(
IFD
.
PHOTOMETRIC_INTERPRETATION
,
2
);
// RGB
ifd
.
putIFDValue
(
IFD
.
EXTRA_SAMPLES
,
2
);
// extra bytes (over 3) meaning Unassociated alpha data
// ifd.putIFDValue(IFD.EXTRA_SAMPLES,2); // extra bytes (over 3) meaning Unassociated alpha data
ifd
.
putIFDValue
(
IFD
.
EXTRA_SAMPLES
,
1
);
// extra bytes (over 3) meaning Unassociated alpha data
ifd
.
putIFDValue
(
IFD
.
SAMPLE_FORMAT
,
1
);
//
// int [] bpsArray={8,8,8,8};
// int [] bpsArray={8,8,8,8};
// ifd.putIFDValue(IFD.BITS_PER_SAMPLE, bpsArray); // will be done automatically
// ifd.putIFDValue(IFD.BITS_PER_SAMPLE, bpsArray); // will be done automatically
if
(
imp
.
getProperty
(
"XPosition"
)!=
null
)
{
if
(
imp
.
getProperty
(
"XPosition"
)!=
null
)
{
...
@@ -548,24 +551,9 @@ the type of pixel data in this file getPixelType()
...
@@ -548,24 +551,9 @@ the type of pixel data in this file getPixelType()
int
index
=
0
;
int
index
=
0
;
for
(
int
i
=
0
;
i
<
ImageJInfoMagic
.
length
;
i
++)
bInfo
[
index
++]=
ImageJInfoMagic
[
i
];
for
(
int
i
=
0
;
i
<
ImageJInfoMagic
.
length
;
i
++)
bInfo
[
index
++]=
ImageJInfoMagic
[
i
];
for
(
int
i
=
skipFirstBytes
;
i
<
bInfoBody
.
length
;
i
++)
bInfo
[
index
++]=
bInfoBody
[
i
];
// first 2 bytes {-2, -1} ???
for
(
int
i
=
skipFirstBytes
;
i
<
bInfoBody
.
length
;
i
++)
bInfo
[
index
++]=
bInfoBody
[
i
];
// first 2 bytes {-2, -1} ???
/*
StringBuffer sb=new StringBuffer("bInfo: ");
for (int i=0;i<bInfo.length;i++) sb.append(bInfo[i]+" ");
System.out.println(sb.toString());
sb=new StringBuffer("ImageJInfoMagic: ");
for (int i=0;i<ImageJInfoMagic.length;i++) sb.append(ImageJInfoMagic[i]+" ");
System.out.println(sb.toString());
sb=new StringBuffer("bInfoBody: ");
for (int i=0;i<bInfoBody.length;i++) sb.append(bInfoBody[i]+" ");
System.out.println(sb.toString());
System.out.println("info[0]="+info.charAt(0));
System.out.println("info[1]="+info.charAt(1));
System.out.println("info[2]="+info.charAt(2));
*/
long
[]
imageJcounts
={
12
,
bInfoBody
.
length
-
skipFirstBytes
};
long
[]
imageJcounts
={
12
,
bInfoBody
.
length
-
skipFirstBytes
};
ifd
.
putIFDValue
(
IFDImageJByteCounts
,
imageJcounts
);
ifd
.
putIFDValue
(
IFDImageJByteCounts
,
imageJcounts
);
ifd
.
putIFDValue
(
IFDImageJInfo
,
bInfo
);
ifd
.
putIFDValue
(
IFDImageJInfo
,
bInfo
);
}
}
(
new
File
(
path
)).
delete
();
// Otherwise TiffSaver appends!
(
new
File
(
path
)).
delete
();
// Otherwise TiffSaver appends!
TiffSaver
tiffSaver
=
new
TiffSaver
(
path
);
TiffSaver
tiffSaver
=
new
TiffSaver
(
path
);
...
@@ -584,7 +572,7 @@ the type of pixel data in this file getPixelType()
...
@@ -584,7 +572,7 @@ the type of pixel data in this file getPixelType()
public
void
propertiesTiff
(
ImagePlus
imp
){
public
static
void
propertiesTiff
(
ImagePlus
imp
){
FileInfo
fi
=
imp
.
getOriginalFileInfo
();
FileInfo
fi
=
imp
.
getOriginalFileInfo
();
if
((
fi
==
null
)
||(
fi
.
directory
==
null
)
||
(
fi
.
fileFormat
!=
FileInfo
.
TIFF
))
{
if
((
fi
==
null
)
||(
fi
.
directory
==
null
)
||
(
fi
.
fileFormat
!=
FileInfo
.
TIFF
))
{
IJ
.
error
(
"TIFF Dumper"
,
"File path not available or not TIFF file"
);
IJ
.
error
(
"TIFF Dumper"
,
"File path not available or not TIFF file"
);
...
...
src/main/java/com/elphel/imagej/tileprocessor/IntersceneMatchParameters.java
View file @
4bdd4cd8
This diff is collapsed.
Click to expand it.
src/main/java/com/elphel/imagej/tileprocessor/TexturedModel.java
View file @
4bdd4cd8
...
@@ -3070,7 +3070,7 @@ public class TexturedModel {
...
@@ -3070,7 +3070,7 @@ public class TexturedModel {
hdr_whs
[
0
],
// int width,
hdr_whs
[
0
],
// int width,
wh
,
// int [] wh, // should be initialized to int [2]
wh
,
// int [] wh, // should be initialized to int [2]
full_render
);
// double [][] img_src)
full_render
);
// double [][] img_src)
if
(
img_cropped
!=
null
)
{
if
(
img_cropped
!=
null
)
{
// has NaN and alpha 0-1
scenes
[
ref_index
].
saveDoubleArrayInModelDirectory
(
scenes
[
ref_index
].
saveDoubleArrayInModelDirectory
(
suffix
+
"-CROP"
,
// String suffix,
suffix
+
"-CROP"
,
// String suffix,
null
,
// String [] labels, // or null
null
,
// String [] labels, // or null
...
...
src/main/java/com/elphel/imagej/tileprocessor/TileNeibs.java
View file @
4bdd4cd8
...
@@ -131,7 +131,7 @@ public class TileNeibs{
...
@@ -131,7 +131,7 @@ public class TileNeibs{
* @param dy offset in y direction
* @param dy offset in y direction
* @return new index or -1 if leaving
* @return new index or -1 if leaving
*/
*/
int
getNeibIndex
(
int
indx
,
int
dx
,
int
dy
)
{
public
int
getNeibIndex
(
int
indx
,
int
dx
,
int
dy
)
{
int
y
=
indx
/
sizeX
+
dy
;
int
y
=
indx
/
sizeX
+
dy
;
int
x
=
indx
%
sizeX
+
dx
;
int
x
=
indx
%
sizeX
+
dx
;
if
((
x
<
0
)
||
(
y
<
0
)
||
(
x
>=
sizeX
)
||
(
y
>=
sizeY
))
return
-
1
;
if
((
x
<
0
)
||
(
y
<
0
)
||
(
x
>=
sizeX
)
||
(
y
>=
sizeY
))
return
-
1
;
...
...
src/main/java/com/elphel/imagej/tileprocessor/sfm/StructureFromMotion.java
View file @
4bdd4cd8
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