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
9c9cebb7
Commit
9c9cebb7
authored
Oct 07, 2018
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added viewer for raw binary images from C/GPU
parent
33cdb962
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
0 deletions
+68
-0
Eyesis_Correction.java
src/main/java/Eyesis_Correction.java
+14
-0
TwoQuadCLT.java
src/main/java/TwoQuadCLT.java
+54
-0
No files found.
src/main/java/Eyesis_Correction.java
View file @
9c9cebb7
...
@@ -641,6 +641,7 @@ private Panel panel1,
...
@@ -641,6 +641,7 @@ private Panel panel1,
addButton
(
"JCUDA TEST"
,
panelClt_GPU
);
addButton
(
"JCUDA TEST"
,
panelClt_GPU
);
addButton
(
"TF TEST"
,
panelClt_GPU
);
addButton
(
"TF TEST"
,
panelClt_GPU
);
addButton
(
"Rig8 gpu"
,
panelClt_GPU
,
color_conf_process
);
addButton
(
"Rig8 gpu"
,
panelClt_GPU
,
color_conf_process
);
addButton
(
"ShowGPU"
,
panelClt_GPU
,
color_conf_process
);
add
(
panelClt_GPU
);
add
(
panelClt_GPU
);
}
}
...
@@ -4584,6 +4585,13 @@ private Panel panel1,
...
@@ -4584,6 +4585,13 @@ private Panel panel1,
EYESIS_CORRECTIONS
.
setDebug
(
DEBUG_LEVEL
);
EYESIS_CORRECTIONS
.
setDebug
(
DEBUG_LEVEL
);
getPairImages2Gpu
();
getPairImages2Gpu
();
return
;
return
;
/* ======================================================================== */
}
else
if
(
label
.
equals
(
"ShowGPU"
))
{
DEBUG_LEVEL
=
MASTER_DEBUG_LEVEL
;
EYESIS_CORRECTIONS
.
setDebug
(
DEBUG_LEVEL
);
showImageFromGPU
();
return
;
//
/* ======================================================================== */
/* ======================================================================== */
}
else
if
(
label
.
equals
(
"RIG extrinsics"
))
{
}
else
if
(
label
.
equals
(
"RIG extrinsics"
))
{
DEBUG_LEVEL
=
MASTER_DEBUG_LEVEL
;
DEBUG_LEVEL
=
MASTER_DEBUG_LEVEL
;
...
@@ -5129,6 +5137,12 @@ private Panel panel1,
...
@@ -5129,6 +5137,12 @@ private Panel panel1,
return
true
;
return
true
;
}
}
public
boolean
showImageFromGPU
(){
// TWO_QUAD_CLT.showImageFromGPU();
TwoQuadCLT
.
showImageFromGPU
();
return
true
;
}
public
boolean
getPairImages2Gpu
()
{
public
boolean
getPairImages2Gpu
()
{
if
(!
prepareRigImages
())
return
false
;
if
(!
prepareRigImages
())
return
false
;
String
configPath
=
getSaveCongigPath
();
String
configPath
=
getSaveCongigPath
();
...
...
src/main/java/TwoQuadCLT.java
View file @
9c9cebb7
...
@@ -22,13 +22,16 @@
...
@@ -22,13 +22,16 @@
*/
*/
import
java.io.DataOutputStream
;
import
java.io.DataOutputStream
;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.FileNotFoundException
;
import
java.io.FileOutputStream
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.io.OutputStream
;
import
java.nio.ByteBuffer
;
import
java.nio.ByteBuffer
;
import
java.nio.ByteOrder
;
import
java.nio.ByteOrder
;
import
java.nio.FloatBuffer
;
import
java.nio.channels.Channels
;
import
java.nio.channels.Channels
;
import
java.nio.channels.FileChannel
;
import
java.nio.channels.WritableByteChannel
;
import
java.nio.channels.WritableByteChannel
;
import
java.nio.file.Files
;
import
java.nio.file.Files
;
import
java.nio.file.StandardCopyOption
;
import
java.nio.file.StandardCopyOption
;
...
@@ -912,6 +915,57 @@ public class TwoQuadCLT {
...
@@ -912,6 +915,57 @@ public class TwoQuadCLT {
return
results
;
return
results
;
}
}
public
static
void
showImageFromGPU
()
{
int
width
=
2592
+
8
;
int
height
=
1936
+
8
;
int
l
=
width
*
height
;
String
path
=
"/home/eyesis/workspace-python3/nvidia_dct8x8/clt/main_chn0.rbg"
;
String
[]
titles
=
{
"R"
,
"B"
,
"G"
};
float
[]
img_rbg
=
getFloatsFromFile
(
path
);
float
[][]
img
=
new
float
[
3
][
l
];
for
(
int
nc
=
0
;
nc
<
3
;
nc
++)
{
System
.
arraycopy
(
img_rbg
,
l
*
nc
,
img
[
nc
],
0
,
l
);
}
(
new
showDoubleFloatArrays
()).
showArrays
(
img
,
width
,
height
,
true
,
"RBG"
,
titles
);
}
public
static
float
[]
getFloatsFromFile
(
String
filepath
)
{
float
[]
fdata
=
null
;
try
{
FileInputStream
inFile
=
new
FileInputStream
(
filepath
);
// DataInputStream din = new DataInputStream(inFile);
FileChannel
inChannel
=
inFile
.
getChannel
();
int
cl
=
(
int
)
inChannel
.
size
();
ByteBuffer
buffer
=
ByteBuffer
.
allocateDirect
(
cl
);
//1024*1024*60);
buffer
.
order
(
ByteOrder
.
LITTLE_ENDIAN
);
buffer
.
clear
();
inChannel
.
read
(
buffer
);
buffer
.
flip
();
FloatBuffer
fb
=
buffer
.
asFloatBuffer
();
fdata
=
new
float
[
fb
.
limit
()];
fb
.
get
(
fdata
);
// fdata = fb.array();
inFile
.
close
();
}
catch
(
FileNotFoundException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
fdata
;
}
public
void
saveFloatKernels
(
String
file_prefix
,
public
void
saveFloatKernels
(
String
file_prefix
,
double
[][][][][][]
clt_kernels
,
double
[][][][][][]
clt_kernels
,
double
[][][]
image_data
,
double
[][][]
image_data
,
...
...
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