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
c216c7e4
Commit
c216c7e4
authored
May 21, 2025
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented CLT accumulation for virtual orientation
parent
952177ec
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
810 additions
and
27 deletions
+810
-27
GpuQuad.java
src/main/java/com/elphel/imagej/gpu/GpuQuad.java
+47
-15
OpticalFlow.java
...ain/java/com/elphel/imagej/tileprocessor/OpticalFlow.java
+266
-10
QuadCLT.java
src/main/java/com/elphel/imagej/tileprocessor/QuadCLT.java
+497
-2
No files found.
src/main/java/com/elphel/imagej/gpu/GpuQuad.java
View file @
c216c7e4
...
...
@@ -1114,6 +1114,17 @@ public class GpuQuad{ // quad camera description
copyD2H
.
Height
=
img_height
;
// /4;
cuMemcpy2D
(
copyD2H
);
// run copy
}
public
int
[]
getWH
(
boolean
use_ref
)
{
return
use_ref
?
gpu_clt_ref_wh
:
gpu_clt_wh
;
}
public
int
getNumColors
()
{
return
num_colors
;
}
public
int
getNumSensors
()
{
return
num_cams
;
}
public
int
getCltSize
(
boolean
use_ref
)
{
// per camera, in floats
int
[]
wh
=
use_ref
?
gpu_clt_ref_wh
:
gpu_clt_wh
;
...
...
@@ -1121,7 +1132,16 @@ public class GpuQuad{ // quad camera description
int
tilesY
=
wh
[
1
]
/
GPUTileProcessor
.
DTT_SIZE
;
return
tilesY
*
tilesX
*
num_colors
*
4
*
GPUTileProcessor
.
DTT_SIZE
*
GPUTileProcessor
.
DTT_SIZE
;
}
/*
public int getCltLength(boolean use_ref) {
int [] wh = use_ref ? gpu_clt_ref_wh : gpu_clt_wh;
int tilesX = wh[0] / GPUTileProcessor.DTT_SIZE;
int tilesY = wh[1] / GPUTileProcessor.DTT_SIZE;
int tile_size_td = getCltSize(use_ref); // 4 * GPUTileProcessor.DTT_SIZE * GPUTileProcessor.DTT_SIZE;
int num_tiles = tilesY*tilesX*num_colors;
return num_tiles* tile_size_td;
}
*/
public
float
[][]
getCltData
(
// only for color=0
boolean
use_ref
){
CUdeviceptr
[]
gpu_sel_clt_h
=
use_ref
?
gpu_clt_ref_h
:
gpu_clt_h
;
...
...
@@ -1209,24 +1229,36 @@ public class GpuQuad{ // quad camera description
return
;
}
/*
public void setBayerImage(
float [] bayer_image,
int ncam) {
public
void
setCltData
(
// for testing only
int
ncam
,
float
[]
fclt
,
//
boolean
use_ref
){
int
clt_size
=
getCltSize
(
use_ref
);
if
(
fclt
.
length
!=
clt_size
)
{
System
.
out
.
println
(
"getCltData(): wrong array size: got ["
+
fclt
.
length
+
"], "
+
"should be ["
+
clt_size
+
"]"
);
return
;
}
CUdeviceptr
[]
gpu_sel_clt_h
=
use_ref
?
gpu_clt_ref_h
:
gpu_clt_h
;
int
[]
wh
=
use_ref
?
gpu_clt_ref_wh
:
gpu_clt_wh
;
int
tilesX
=
wh
[
0
]
/
GPUTileProcessor
.
DTT_SIZE
;
int
tilesY
=
wh
[
1
]
/
GPUTileProcessor
.
DTT_SIZE
;
int
tile_size_td
=
4
*
GPUTileProcessor
.
DTT_SIZE
*
GPUTileProcessor
.
DTT_SIZE
;
int
num_tiles
=
tilesY
*
tilesX
*
num_colors
;
CUDA_MEMCPY2D
copyH2D
=
new
CUDA_MEMCPY2D
();
copyH2D
.
srcMemoryType
=
CUmemorytype
.
CU_MEMORYTYPE_HOST
;
copyH2D.srcHost = Pointer.to(
bayer_image
);
copyH2D.srcPitch =
img_width*Sizeof.FLOAT; // width_in_bytes
;
copyH2D
.
srcHost
=
Pointer
.
to
(
fclt
);
copyH2D
.
srcPitch
=
tile_size_td
*
Sizeof
.
FLOAT
;
copyH2D
.
dstMemoryType
=
CUmemorytype
.
CU_MEMORYTYPE_DEVICE
;
copyH2D.dstDevice = gpu_bayer_h[ncam]; // src_dpointer;
copyH2D.dstPitch = mclt_stride *Sizeof.FLOAT; // device_stride[0];
copyH2D.WidthInBytes = img_width*Sizeof.FLOAT; // width_in_bytes;
copyH2D.Height = img_height; // /4;
cuMemcpy2D(copyH2D);
copyH2D
.
dstDevice
=
gpu_sel_clt_h
[
ncam
];
copyH2D
.
dstPitch
=
tile_size_td
*
Sizeof
.
FLOAT
;
copyH2D
.
WidthInBytes
=
tile_size_td
*
Sizeof
.
FLOAT
;
copyH2D
.
Height
=
num_tiles
;
cuMemcpy2D
(
copyH2D
);
// run copy
return
;
}
*/
/**
* Copy a set of images to the GPU (if they are new)
...
...
src/main/java/com/elphel/imagej/tileprocessor/OpticalFlow.java
View file @
c216c7e4
This diff is collapsed.
Click to expand it.
src/main/java/com/elphel/imagej/tileprocessor/QuadCLT.java
View file @
c216c7e4
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