cuMemcpyDtoH(Pointer.to(cpu_texture_indices_ovlp),gpu_texture_indices_ovlp,cpu_texture_indices_ovlp.length*Sizeof.INT);// hope that Float.floatToIntBits(fcorr_indices[i]) is not needed
cpu_texture_indices_ovlp=newint[tilesX*tilesYa];
cuMemcpyHtoD(gpu_texture_indices_ovlp,Pointer.to(cpu_texture_indices_ovlp),cpu_texture_indices_ovlp.length*Sizeof.INT);// hope that Float.floatToIntBits(fcorr_indices[i]) is not needed
cuMemcpyDtoH(Pointer.to(cpu_texture_indices_ovlp),gpu_texture_indices_ovlp,cpu_texture_indices_ovlp.length*Sizeof.INT);// hope that Float.floatToIntBits(fcorr_indices[i]) is not needed
cuMemcpyHtoD(gpu_texture_indices_ovlp,Pointer.to(cpu_texture_indices_ovlp),cpu_texture_indices_ovlp.length*Sizeof.INT);// hope that Float.floatToIntBits(fcorr_indices[i]) is not needed
}
Pointerkp_gen_texture_list=Pointer.to(
Pointerkp_gen_texture_list=Pointer.to(
Pointer.to(newint[]{num_cams}),// int num_cams,
Pointer.to(newint[]{num_cams}),// int num_cams,
Pointer.to(gpu_ftasks),// float * gpu_ftasks, // flattened tasks, 29 floats for quad EO, 101 floats for LWIR16
Pointer.to(gpu_ftasks),// float * gpu_ftasks, // flattened tasks, 29 floats for quad EO, 101 floats for LWIR16
...
@@ -1937,9 +1953,9 @@ public class GpuQuad{ // quad camera description
...
@@ -1937,9 +1953,9 @@ public class GpuQuad{ // quad camera description
// copy gpu_num_texture_tiles back to host cpu_num_texture_tiles for processing by the CPU code
// copy gpu_num_texture_tiles back to host cpu_num_texture_tiles for processing by the CPU code
// int [] cpu_texture_indices_ovlp = new int [tilesX * tilesYa];
if(DEBUG8A){
cuMemcpyDtoH(Pointer.to(cpu_texture_indices_ovlp),gpu_texture_indices_ovlp,cpu_texture_indices_ovlp.length*Sizeof.INT);// hope that Float.floatToIntBits(fcorr_indices[i]) is not needed
cuMemcpyDtoH(Pointer.to(cpu_texture_indices_ovlp),gpu_texture_indices_ovlp,cpu_texture_indices_ovlp.length*Sizeof.INT);// hope that Float.floatToIntBits(fcorr_indices[i]) is not needed
@@ -1970,12 +1986,11 @@ public class GpuQuad{ // quad camera description
...
@@ -1970,12 +1986,11 @@ public class GpuQuad{ // quad camera description
0,null,// Shared memory size and stream (shared - only dynamic, static is in code)
0,null,// Shared memory size and stream (shared - only dynamic, static is in code)
kp_clear_texture_rbga,null);// Kernel- and extra parameters
kp_clear_texture_rbga,null);// Kernel- and extra parameters
cuCtxSynchronize();
cuCtxSynchronize();
booleanDEBUG8A=true;
// Testing parameters
// Testing parameters
// int [] cpu_texture_indices_ovlp = new int [tilesX * tilesYa];
if(DEBUG8A){
cuMemcpyDtoH(Pointer.to(cpu_texture_indices_ovlp),gpu_texture_indices_ovlp,cpu_texture_indices_ovlp.length*Sizeof.INT);// hope that Float.floatToIntBits(fcorr_indices[i]) is not needed
cuMemcpyDtoH(Pointer.to(cpu_texture_indices_ovlp),gpu_texture_indices_ovlp,cpu_texture_indices_ovlp.length*Sizeof.INT);// hope that Float.floatToIntBits(fcorr_indices[i]) is not needed
// cuMemcpyHtoD(gpu_texture_indices_ovlp, Pointer.to(cpu_texture_indices_ovlp), cpu_texture_indices_ovlp.length * Sizeof.INT); // hope that Float.floatToIntBits(fcorr_indices[i]) is not needed
}
// Run 8 times - first 4 1-tile offsets inner tiles (w/o verifying margins), then - 4 times with verification and ignoring 4-pixel
// Run 8 times - first 4 1-tile offsets inner tiles (w/o verifying margins), then - 4 times with verification and ignoring 4-pixel
// oversize (border 16x 16 tiles overhang by 4 pixels)
// oversize (border 16x 16 tiles overhang by 4 pixels)
...
@@ -2085,7 +2100,50 @@ public class GpuQuad{ // quad camera description
...
@@ -2085,7 +2100,50 @@ public class GpuQuad{ // quad camera description
doublemin_agree,// minimal number of channels to agree on a point (real number to work with fuzzy averages)
doublemin_agree,// minimal number of channels to agree on a point (real number to work with fuzzy averages)
booleandust_remove,// Do not reduce average weight when only one image differs much from the average
booleandust_remove,// Do not reduce average weight when only one image differs much from the average
booleancalc_textures,
booleancalc_textures,
booleancalc_extra)
booleancalc_extra,
booleanlinescan_order
){
if(GPUTileProcessor.USE_DS_DP){
execTextures_DP(
color_weights,
is_lwir,
min_shot,// 10.0
scale_shot,// 3.0
diff_sigma,// pixel value/pixel change
diff_threshold,// pixel value/pixel change
min_agree,// minimal number of channels to agree on a point (real number to work with fuzzy averages)
dust_remove,// Do not reduce average weight when only one image differs much from the average
calc_textures,
calc_extra,
linescan_order);
}else{
execTextures_noDP(
color_weights,
is_lwir,
min_shot,// 10.0
scale_shot,// 3.0
diff_sigma,// pixel value/pixel change
diff_threshold,// pixel value/pixel change
min_agree,// minimal number of channels to agree on a point (real number to work with fuzzy averages)
dust_remove,// Do not reduce average weight when only one image differs much from the average
calc_textures,
calc_extra,
linescan_order);
}
}
publicvoidexecTextures_DP(
double[]color_weights,
booleanis_lwir,
doublemin_shot,// 10.0
doublescale_shot,// 3.0
doublediff_sigma,// pixel value/pixel change
doublediff_threshold,// pixel value/pixel change
doublemin_agree,// minimal number of channels to agree on a point (real number to work with fuzzy averages)
booleandust_remove,// Do not reduce average weight when only one image differs much from the average
booleancalc_textures,
booleancalc_extra,
booleanlinescan_order)
{
{
execCalcReverseDistortions();// will check if it is needed first
execCalcReverseDistortions();// will check if it is needed first
Pointer.to(newint[]{ilinescan_order}),// 1, // int linescan_order, // if !=0 then output gpu_diff_rgb_combo in linescan order, else - in gpu_texture_indices order
Pointer.to(newfloat[]{(float)min_agree}),// float min_agree, // minimal number of channels to agree on a point (real number to work with fuzzy averages)
Pointer.to(gpu_color_weights),// float weights[3], // scale for R,B,G (or {1.0,0.0,0.0}
Pointer.to(newint[]{idust_remove}),// int dust_remove, // Do not reduce average weight when only one image differes much from the average
Pointer.to(newint[]{keep_texture_weights}),// int keep_weights, // return channel weights after A in RGBA
// combining both non-overlap and overlap (each calculated if pointer is not null )
Pointer.to(newint[]{0}),// const size_t texture_rbga_stride, // in floats
Pointer.to(newint[]{ilinescan_order}),// 1, // int linescan_order, // if !=0 then output gpu_diff_rgb_combo in linescan order, else - in gpu_texture_indices order