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
a17be71e
Commit
a17be71e
authored
May 22, 2019
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tested telemetry, added ffc calibration before each image set
parent
1c75cb4c
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
174 additions
and
34 deletions
+174
-34
LwirReader.java
src/main/java/com/elphel/imagej/lwir/LwirReader.java
+52
-0
LwirReaderParameters.java
...ain/java/com/elphel/imagej/lwir/LwirReaderParameters.java
+1
-0
Lepton3Telemetry.java
...main/java/com/elphel/imagej/readers/Lepton3Telemetry.java
+121
-34
No files found.
src/main/java/com/elphel/imagej/lwir/LwirReader.java
View file @
a17be71e
...
...
@@ -191,6 +191,7 @@ public class LwirReader {
}
public
ImagePlus
[]
averageMultiFrames
(
ImagePlus
[][]
sets
)
{
//TODO: convert to multithreaded !
int
num_frames
=
sets
.
length
;
int
num_channels
=
sets
[
0
].
length
;
ImagePlus
[]
imps_avg
=
new
ImagePlus
[
num_channels
];
...
...
@@ -316,6 +317,54 @@ public class LwirReader {
return
imps_synced
;
}
public
boolean
calibrate
(
LwirReaderParameters
lrp
)
{
if
(
lrp
.
lwir_channels
.
length
==
0
)
{
LOGGER
.
error
(
"calibrate(): No LWIR channels are configured"
);
return
false
;
}
int
chn
=
lrp
.
lwir_channels
[
0
];
int
channels
=
0
;
for
(
int
c
:
lrp
.
lwir_channels
)
{
channels
|=
1
<<
c
;
}
String
hex_chan
=
String
.
format
(
"%x"
,
channels
);
System
.
out
.
println
(
"Channels = "
+
channels
+
" (0x"
+
hex_chan
);
String
url
=
"http://"
+
lrp
.
lwir_ip
+
"/parsedit.php?immediate&sensor_port="
+
chn
+
"&SENSOR_REGS67=0!"
+
hex_chan
;
Document
dom
=
null
;
try
{
DocumentBuilderFactory
dbf
=
DocumentBuilderFactory
.
newInstance
();
DocumentBuilder
db
=
dbf
.
newDocumentBuilder
();
dom
=
db
.
parse
(
url
);
if
(!
dom
.
getDocumentElement
().
getNodeName
().
equals
(
"parameters"
))
{
LOGGER
.
error
(
"programLWIRCamera() in "
+
url
+
": Root element: expected 'parameters', got \""
+
dom
.
getDocumentElement
().
getNodeName
()+
"\""
);
return
false
;
}
}
catch
(
MalformedURLException
e
){
LOGGER
.
error
(
"programLWIRCamera() in "
+
url
+
": "
+
e
.
toString
());
return
false
;
}
catch
(
IOException
e1
){
LOGGER
.
error
(
"programLWIRCamera() in "
+
url
+
" - camera did not respond: "
+
e1
.
toString
());
return
false
;
}
catch
(
ParserConfigurationException
pce
)
{
LOGGER
.
error
(
"programLWIRCamera() in "
+
url
+
" - PCE error: "
+
pce
.
toString
());
return
false
;
}
catch
(
SAXException
se
)
{
LOGGER
.
error
(
"programLWIRCamera() in "
+
url
+
" - SAX error: "
+
se
.
toString
());
return
false
;
}
for
(
int
i
=
0
;
i
<
FRAMES_SKIP
;
i
++)
{
if
(!
skipFrame
(
lrp
))
{
LOGGER
.
error
(
"programLWIRCamera():Failed to skip frame"
);
}
}
return
true
;
}
private
double
secOffs
(
double
sec1
,
double
sec2
)
{
double
aoff
=
Math
.
abs
(
sec2
-
sec1
);
if
(
aoff
>
30
)
{
...
...
@@ -370,6 +419,9 @@ public class LwirReader {
LOGGER
.
error
(
"acquire(): failed to program cameras"
);
return
null
;
}
if
(
lrp
.
lwir_ffc
)
{
calibrate
(
lrp
);
// seems to work. test calibration duration and if any images are sent during calibration
}
int
num_frames
=
lrp
.
avg_number
+
lrp
.
vnir_lag
+
2
*
lrp
.
max_frame_diff
;
ImagePlus
[][]
imps
=
readAllMultiple
(
num_frames
,
...
...
src/main/java/com/elphel/imagej/lwir/LwirReaderParameters.java
View file @
a17be71e
...
...
@@ -38,6 +38,7 @@ public class LwirReaderParameters {
protected
String
vnir_ip
=
"192.168.0.38"
;
protected
int
[]
lwir_channels
=
{
0
,
1
,
2
,
3
};
protected
int
[]
vnir_channels
=
{
0
,
1
,
2
,
3
};
protected
boolean
lwir_ffc
=
true
;
protected
boolean
lwir_telemetry
=
true
;
protected
double
vnir_quality
=
98.0
;
protected
boolean
vnir_scale
=
false
;
// restore sensor pixel values, undo camera white balancing
...
...
src/main/java/com/elphel/imagej/readers/Lepton3Telemetry.java
View file @
a17be71e
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