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
dc4e1f60
Commit
dc4e1f60
authored
Feb 29, 2020
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated tested GPU image conversion with selectable kernel source
parent
ed43abc2
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
796 additions
and
10 deletions
+796
-10
EyesisCorrectionParameters.java
...com/elphel/imagej/cameras/EyesisCorrectionParameters.java
+17
-2
Eyesis_Correction.java
.../java/com/elphel/imagej/correction/Eyesis_Correction.java
+1
-1
GPUTileProcessor.java
src/main/java/com/elphel/imagej/gpu/GPUTileProcessor.java
+10
-2
JCuda_ImageJ_Example_Plugin.java
...va/com/elphel/imagej/gpu/JCuda_ImageJ_Example_Plugin.java
+0
-2
TwoQuadCLT.java
...main/java/com/elphel/imagej/tileprocessor/TwoQuadCLT.java
+7
-3
dtt8x8.cuh
src/main/resources/dtt8x8.cuh
+761
-0
No files found.
src/main/java/com/elphel/imagej/cameras/EyesisCorrectionParameters.java
View file @
dc4e1f60
...
...
@@ -85,6 +85,7 @@ public class EyesisCorrectionParameters {
public
boolean
equirectangular
=
true
;
public
boolean
zcorrect
=
true
;
public
boolean
saveSettings
=
true
;
public
String
tile_processor_gpu
=
""
;
// absolute path to tile_processor_gpu project or empty to use default GPU kernels
public
String
[]
sourcePaths
=
{};
// public String [] sourceSetPaths= {}; // 2019 - directories with image sets
...
...
@@ -909,6 +910,9 @@ public class EyesisCorrectionParameters {
gd
.
addTab
(
"File paths"
,
"Select files and directories paths (common to main and optional auxiliary)"
);
gd
.
addMessage
(
"============ Common to the main and optional auxiliary camera============"
);
gd
.
addStringField
(
"GPU tile_processor_gpu project absolute path"
,
this
.
tile_processor_gpu
,
60
,
"Keep empty to use default GPU kernels"
);
gd
.
addCheckbox
(
"Select GPU directory"
,
false
);
gd
.
addCheckbox
(
"Save current settings with results"
,
this
.
saveSettings
);
// 1
gd
.
addStringField
(
"Source files directory"
,
this
.
sourceDirectory
,
60
);
// 2
...
...
@@ -1022,9 +1026,9 @@ public class EyesisCorrectionParameters {
gd
.
showDialog
();
if
(
gd
.
wasCanceled
())
return
false
;
this
.
tile_processor_gpu
=
gd
.
getNextString
();
if
(
gd
.
getNextBoolean
())
selectGPUSourceDirectory
(
false
,
false
);
this
.
saveSettings
=
gd
.
getNextBoolean
();
// 1
this
.
saveSettings
=
gd
.
getNextBoolean
();
// 1
this
.
sourceDirectory
=
gd
.
getNextString
();
if
(
gd
.
getNextBoolean
())
selectSourceDirectory
(
false
,
false
);
// 3
this
.
use_set_dirs
=
gd
.
getNextBoolean
();
...
...
@@ -1760,6 +1764,17 @@ public class EyesisCorrectionParameters {
if
(
dir
!=
null
)
this
.
sourceDirectory
=
dir
;
return
dir
;
}
public
String
selectGPUSourceDirectory
(
boolean
smart
,
boolean
newAllowed
)
{
// normally newAllowed=false
String
dir
=
CalibrationFileManagement
.
selectDirectory
(
smart
,
newAllowed
,
// save
"GPU kernel development project"
,
// title
"Select GPU project directory"
,
// button
null
,
// filter
this
.
tile_processor_gpu
);
// this.sourceDirectory);
if
(
dir
!=
null
)
this
.
tile_processor_gpu
=
dir
;
return
dir
;
}
public
String
selectSensorDirectory
(
boolean
smart
,
boolean
newAllowed
)
{
String
dir
=
CalibrationFileManagement
.
selectDirectory
(
smart
,
...
...
src/main/java/com/elphel/imagej/correction/Eyesis_Correction.java
View file @
dc4e1f60
...
...
@@ -5784,7 +5784,7 @@ private Panel panel1,
}
if
(
GPU_TILE_PROCESSOR
==
null
)
{
try
{
GPU_TILE_PROCESSOR
=
new
GPUTileProcessor
();
GPU_TILE_PROCESSOR
=
new
GPUTileProcessor
(
CORRECTION_PARAMETERS
.
tile_processor_gpu
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"Failed to initialize GPU class"
);
// TODO Auto-generated catch block
...
...
src/main/java/com/elphel/imagej/gpu/GPUTileProcessor.java
View file @
dc4e1f60
...
...
@@ -240,7 +240,7 @@ public class GPUTileProcessor {
return
new
PointerWithAddress
(
p
).
getAddress
();
}
public
GPUTileProcessor
()
throws
IOException
public
GPUTileProcessor
(
String
cuda_project_directory
)
throws
IOException
{
// From code by Marco Hutter - http://www.jcuda.org
// Enable exceptions and omit all subsequent error checks
...
...
@@ -276,7 +276,15 @@ public class GPUTileProcessor {
"#define IMCLT_TILES_PER_BLOCK "
+
IMCLT_TILES_PER_BLOCK
+
"\n"
;
for
(
String
src_file:
GPU_KERNEL_FILES
)
{
File
file
=
new
File
(
classLoader
.
getResource
(
src_file
).
getFile
());
File
file
=
null
;
if
((
cuda_project_directory
==
null
)
||
(
cuda_project_directory
==
""
))
{
file
=
new
File
(
classLoader
.
getResource
(
src_file
).
getFile
());
System
.
out
.
println
(
"Loading resource "
+
file
);
}
else
{
File
src_dir
=
new
File
(
cuda_project_directory
,
"src"
);
file
=
new
File
(
src_dir
.
getPath
(),
src_file
);
System
.
out
.
println
(
"Loading resource "
+
file
);
}
System
.
out
.
println
(
file
.
getAbsolutePath
());
String
cuFileName
=
file
.
getAbsolutePath
();
// /home/eyesis/workspace-python3/nvidia_dct8x8/src/dtt8x8.cuh";// "dtt8x8.cuh";
String
sourceFile
=
readFileAsString
(
cuFileName
);
// readResourceAsString(cuFileName);
...
...
src/main/java/com/elphel/imagej/gpu/JCuda_ImageJ_Example_Plugin.java
View file @
dc4e1f60
...
...
@@ -206,8 +206,6 @@ public class JCuda_ImageJ_Example_Plugin implements PlugInFilter
*/
private
static
String
readResourceAsString
(
String
name
)
{
int
a
=
0
;
Class
ccc
=
JCuda_ImageJ_Example_Plugin
.
class
;
InputStream
inputStream
=
JCuda_ImageJ_Example_Plugin
.
class
.
getResourceAsStream
(
name
);
if
(
inputStream
==
null
)
...
...
src/main/java/com/elphel/imagej/tileprocessor/TwoQuadCLT.java
View file @
dc4e1f60
...
...
@@ -1920,6 +1920,7 @@ public class TwoQuadCLT {
String
[]
rgb_titles
=
{
"red"
,
"blue"
,
"green"
};
int
out_width
=
GPUTileProcessor
.
IMG_WIDTH
+
GPUTileProcessor
.
DTT_SIZE
;
int
out_height
=
GPUTileProcessor
.
IMG_HEIGHT
+
GPUTileProcessor
.
DTT_SIZE
;
/*
for (int ncam = 0; ncam < iclt_fimg.length; ncam++) {
String title=name+"-RBG"+String.format("%02d", ncam);
...
...
@@ -1931,7 +1932,7 @@ public class TwoQuadCLT {
title,
rgb_titles);
}
*/
ImagePlus
[]
imps_RGB
=
new
ImagePlus
[
iclt_fimg
.
length
];
for
(
int
ncam
=
0
;
ncam
<
iclt_fimg
.
length
;
ncam
++)
{
String
title
=
name
+
"-"
+
String
.
format
(
"%02d"
,
ncam
);
...
...
@@ -2081,9 +2082,12 @@ public class TwoQuadCLT {
double_stacks_main
[
i
][
2
][
j
]*=
0.5
;
// Scale green 0.5 to compensate more pixels than R,B
}
}
for
(
int
i
=
0
;
i
<
double_stacks_aux
.
length
;
i
++){
for
(
int
j
=
0
;
j
<
double_stacks_aux
[
i
][
0
].
length
;
j
++){
double_stacks_aux
[
i
][
2
][
j
]*=
0.5
;
// Scale green 0.5 to compensate more pixels than R,B
if
(
double_stacks_aux
[
i
].
length
>
2
)
{
// skip for monochrome, only if color
for
(
int
j
=
0
;
j
<
double_stacks_aux
[
i
][
0
].
length
;
j
++){
double_stacks_aux
[
i
][
2
][
j
]*=
0.5
;
// Scale green 0.5 to compensate more pixels than R,B
}
}
}
quadCLT_main
.
setTiles
(
imp_quad_main
[
0
],
// set global tp.tilesX, tp.tilesY
...
...
src/main/resources/dtt8x8.cuh
0 → 100644
View file @
dc4e1f60
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