Commit 24112d36 authored by Andrey Filippov's avatar Andrey Filippov

debugging code to generate data for macroblocks correlation

parent 4203dbbb
...@@ -2083,10 +2083,12 @@ public class TwoQuadCLT { ...@@ -2083,10 +2083,12 @@ public class TwoQuadCLT {
// corr_indices array of integers to be passed to GPU // corr_indices array of integers to be passed to GPU
// gPUTileProcessor.setCorrIndices(corr_indices); // gPUTileProcessor.setCorrIndices(corr_indices);
/*
int [] texture_indices = gPUTileProcessor.getTextureTasks( int [] texture_indices = gPUTileProcessor.getTextureTasks(
tp_tasks); tp_tasks);
gPUTileProcessor.setTextureIndices( gPUTileProcessor.setTextureIndices(
texture_indices); texture_indices);
*/
gPUTileProcessor.setGeometryCorrection( gPUTileProcessor.setGeometryCorrection(
quadCLT_main.getGeometryCorrection(), quadCLT_main.getGeometryCorrection(),
false); // boolean use_java_rByRDist) { // false - use newer GPU execCalcReverseDistortions); // once false); // boolean use_java_rByRDist) { // false - use newer GPU execCalcReverseDistortions); // once
...@@ -2146,12 +2148,11 @@ public class TwoQuadCLT { ...@@ -2146,12 +2148,11 @@ public class TwoQuadCLT {
clt_parameters.diff_sigma, // double diff_sigma, // pixel value/pixel change clt_parameters.diff_sigma, // double diff_sigma, // pixel value/pixel change
clt_parameters.diff_threshold, // double diff_threshold, // pixel value/pixel change clt_parameters.diff_threshold, // double diff_threshold, // pixel value/pixel change
clt_parameters.min_agree, // double min_agree, // minimal number of channels to agree on a point (real number to work with fuzzy averages) clt_parameters.min_agree, // double min_agree, // minimal number of channels to agree on a point (real number to work with fuzzy averages)
clt_parameters.dust_remove, // boolean dust_remove, clt_parameters.dust_remove); // boolean dust_remove,
clt_parameters.keep_weights); // boolean keep_weights);
long endTextures = System.nanoTime(); long endTextures = System.nanoTime();
// run texturesRBGA // run texturesRBGA
long startTexturesRBGA = System.nanoTime(); // System.nanoTime(); long startTexturesRBGA = System.nanoTime(); // System.nanoTime();
for (int i = 0; i < NREPEAT; i++ ) gPUTileProcessor.execRBGA( for (int i = 0; i < NREPEAT; i++ ) gPUTileProcessor.execRBGA(
col_weights, // double [] color_weights, col_weights, // double [] color_weights,
quadCLT_main.isLwir(), // boolean is_lwir, quadCLT_main.isLwir(), // boolean is_lwir,
...@@ -2193,7 +2194,26 @@ public class TwoQuadCLT { ...@@ -2193,7 +2194,26 @@ public class TwoQuadCLT {
int out_width = GPUTileProcessor.IMG_WIDTH + GPUTileProcessor.DTT_SIZE; int out_width = GPUTileProcessor.IMG_WIDTH + GPUTileProcessor.DTT_SIZE;
int out_height = GPUTileProcessor.IMG_HEIGHT + GPUTileProcessor.DTT_SIZE; int out_height = GPUTileProcessor.IMG_HEIGHT + GPUTileProcessor.DTT_SIZE;
int tilesX = GPUTileProcessor.IMG_WIDTH / GPUTileProcessor.DTT_SIZE;
int tilesY = GPUTileProcessor.IMG_HEIGHT / GPUTileProcessor.DTT_SIZE;
// show extra
/* */
String [] extra_group_titles = {"DIFF","Red","Blue","Green"};
String [] extra_titles = new String [extra_group_titles.length*GPUTileProcessor.NUM_CAMS];
for (int g = 0; g < extra_group_titles.length;g++) {
for (int ncam=0; ncam < GPUTileProcessor.NUM_CAMS;ncam++) {
extra_titles[g * GPUTileProcessor.NUM_CAMS+ncam]= extra_group_titles[g]+"-"+ncam;
}
}
float [][] extra = gPUTileProcessor.getExtra();
(new ShowDoubleFloatArrays()).showArrays(
extra,
tilesX,
tilesY,
true,
name+"-EXTRA-D"+clt_parameters.disparity,
extra_titles);
/* */
ImagePlus [] imps_RGB = new ImagePlus[iclt_fimg.length]; ImagePlus [] imps_RGB = new ImagePlus[iclt_fimg.length];
for (int ncam = 0; ncam < iclt_fimg.length; ncam++) { for (int ncam = 0; ncam < iclt_fimg.length; ncam++) {
String title=name+"-"+String.format("%02d", ncam); String title=name+"-"+String.format("%02d", ncam);
...@@ -2215,8 +2235,6 @@ public class TwoQuadCLT { ...@@ -2215,8 +2235,6 @@ public class TwoQuadCLT {
} }
//show_corr //show_corr
int tilesX = GPUTileProcessor.IMG_WIDTH / GPUTileProcessor.DTT_SIZE;
int tilesY = GPUTileProcessor.IMG_HEIGHT / GPUTileProcessor.DTT_SIZE;
int [] wh = new int[2]; int [] wh = new int[2];
if (clt_parameters.show_corr) { if (clt_parameters.show_corr) {
int [] corr_indices = gPUTileProcessor.getCorrIndices(); int [] corr_indices = gPUTileProcessor.getCorrIndices();
...@@ -2234,7 +2252,7 @@ public class TwoQuadCLT { ...@@ -2234,7 +2252,7 @@ public class TwoQuadCLT {
wh[0], wh[0],
wh[1], wh[1],
true, true,
"CORR2D", name+"-CORR2D-D"+clt_parameters.disparity,
GPUTileProcessor.getCorrTitles()); GPUTileProcessor.getCorrTitles());
} }
// convert to overlapping and show // convert to overlapping and show
...@@ -2369,14 +2387,16 @@ public class TwoQuadCLT { ...@@ -2369,14 +2387,16 @@ public class TwoQuadCLT {
} }
// convert textures to RGBA in Java // convert textures to RGBA in Java
if (clt_parameters.show_rgba_color && (debugLevel > 0)) { // disabling if (clt_parameters.show_rgba_color && (debugLevel > 100)) { // disabling
int numcol = quadCLT_main.isMonochrome()?1:3; int numcol = quadCLT_main.isMonochrome()?1:3;
int ports = imp_quad_main.length; int ports = imp_quad_main.length;
int [] texture_indices = gPUTileProcessor.getTextureIndices();
int num_src_slices = numcol + 1 + (clt_parameters.keep_weights?(ports + numcol + 1):0); // 12 ; // calculate int num_src_slices = numcol + 1 + (clt_parameters.keep_weights?(ports + numcol + 1):0); // 12 ; // calculate
// float [][][] ftextures = gPUTileProcessor.getTextures( // float [][][] ftextures = gPUTileProcessor.getTextures(
// (is_mono?1:3), // int num_colors, // (is_mono?1:3), // int num_colors,
// clt_parameters.keep_weights); // boolean keep_weights); // clt_parameters.keep_weights); // boolean keep_weights);
float [] flat_textures = gPUTileProcessor.getFlatTextures( float [] flat_textures = gPUTileProcessor.getFlatTextures(
texture_indices.length,
(is_mono?1:3), // int num_colors, (is_mono?1:3), // int num_colors,
clt_parameters.keep_weights); // boolean keep_weights); clt_parameters.keep_weights); // boolean keep_weights);
int texture_slice_size = (2 * GPUTileProcessor.DTT_SIZE)* (2 * GPUTileProcessor.DTT_SIZE); int texture_slice_size = (2 * GPUTileProcessor.DTT_SIZE)* (2 * GPUTileProcessor.DTT_SIZE);
......
...@@ -75,11 +75,13 @@ extern "C" __global__ void correlate2D( ...@@ -75,11 +75,13 @@ extern "C" __global__ void correlate2D(
float * gpu_corrs); // correlation output data float * gpu_corrs); // correlation output data
extern "C" __global__ void textures_accumulate( extern "C" __global__ void textures_nonoverlap(
int * woi, // x, y, width,height struct tp_task * gpu_tasks,
float ** gpu_clt, // [NUM_CAMS] ->[TILESY][TILESX][NUM_COLORS][DTT_SIZE*DTT_SIZE] int num_tiles, // number of tiles in task list
size_t num_texture_tiles, // number of texture tiles to process // declare arrays in device code?
int * gpu_texture_indices,// packed tile + bits (now only (1 << 7) int * gpu_texture_indices,// packed tile + bits (now only (1 << 7)
int * pnum_texture_tiles, // returns total number of elements in gpu_texture_indices array
float ** gpu_clt, // [NUM_CAMS] ->[TILESY][TILESX][NUM_COLORS][DTT_SIZE*DTT_SIZE]
// TODO: use geometry_correction rXY ! // TODO: use geometry_correction rXY !
struct gc * gpu_geometry_correction, struct gc * gpu_geometry_correction,
int colors, // number of colors (3/1) int colors, // number of colors (3/1)
...@@ -91,14 +93,11 @@ extern "C" __global__ void textures_accumulate( ...@@ -91,14 +93,11 @@ extern "C" __global__ void textures_accumulate(
float min_agree, // minimal number of channels to agree on a point (real number to work with fuzzy averages) float min_agree, // minimal number of channels to agree on a point (real number to work with fuzzy averages)
float weights[3], // scale for R,B,G float weights[3], // scale for R,B,G
int dust_remove, // Do not reduce average weight when only one image differs much from the average int dust_remove, // Do not reduce average weight when only one image differs much from the average
int keep_weights, // return channel weights after A in RGBA (was removed) (should be 0 if gpu_texture_rbg)? // int keep_weights, // return channel weights after A in RGBA (was removed) (should be 0 if gpu_texture_rbg)?
// combining both non-overlap and overlap (each calculated if pointer is not null ) // combining both non-overlap and overlap (each calculated if pointer is not null )
size_t texture_rbg_stride, // in floats size_t texture_stride, // in floats (now 256*4 = 1024) // may be 0 if not needed
float * gpu_texture_rbg, // (number of colors +1 + ?)*16*16 rgba texture tiles float * gpu_texture_tiles, // (number of colors +1 + ?)*16*16 rgba texture tiles // may be 0 if not needed
size_t texture_stride, // in floats (now 256*4 = 1024) float * gpu_diff_rgb_combo); // diff[NUM_CAMS], R[NUM_CAMS], B[NUM_CAMS],G[NUM_CAMS] // may be 0 if not needed
float * gpu_texture_tiles, // (number of colors +1 + ?)*16*16 rgba texture tiles
float * gpu_diff_rgb_combo); // diff[NUM_CAMS], R[NUM_CAMS], B[NUM_CAMS],G[NUM_CAMS]
extern "C" extern "C"
__global__ void imclt_rbg_all( __global__ void imclt_rbg_all(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment