Commit 473bf75a authored by Andrey Filippov's avatar Andrey Filippov

Added RB correlation LPF

parent 3043615f
......@@ -1044,11 +1044,12 @@ public class GPUTileProcessor {
}
public void setLpfCorr(
String const_name, // "lpf_corr"
float [] lpf_flat)
{
CUdeviceptr constantMemoryPointer = new CUdeviceptr();
long constantMemorySizeArray[] = { 0 };
cuModuleGetGlobal(constantMemoryPointer, constantMemorySizeArray, module, "lpf_corr");
cuModuleGetGlobal(constantMemoryPointer, constantMemorySizeArray, module, const_name);
int constantMemorySize = (int)constantMemorySizeArray[0];
System.out.println("constantMemoryPointer: " + constantMemoryPointer);
System.out.println("constantMemorySize: " + constantMemorySize);
......
......@@ -265,12 +265,31 @@ public class Correlation2d {
if (lpf != null) {
if (debug_gpu) {
System.out.println("=== LPF for CORRELATION ===");
/*
for (int i = 0; i < transform_size; i++) {
System.out.print("\t\t");
for (int j = 0; j < transform_size; j++) {
System.out.print(String.format("%10.5f ", lpf[transform_size * i + j]));
System.out.print(String.format("%10.8ff", lpf[transform_size * i + j]));
if ((j < (transform_size-1)) || (j < (transform_size-1))){
System.out.print(", ");
}
}
System.out.println();
}
*/
System.out.print("__constant__ float lpf_corr[64]={");
for (int i=0; i<lpf.length;i++){
System.out.print(String.format("%10.8ff", lpf[i]));
if (i == 63) {
System.out.println("};");
} else {
System.out.print(", ");
if ((i % 8) == 7) {
System.out.print("\n ");
}
}
}
}
for (int n = 0; n<4; n++) {
for (int i = 0; i < transform_len; i++) {
......
......@@ -9213,12 +9213,33 @@ public class ImageDtt {
}
if (debug_gpu && debug_tile) {
System.out.println("=== LPF-RB for CORRELATION ===");
/*
for (int i = 0; i < transform_size; i++) {
System.out.print("\t\t");
for (int j = 0; j < transform_size; j++) {
System.out.print(String.format("%10.5f ", lpf_rb_fd[transform_size * i + j]));
System.out.print(String.format("%10.8ff", lpf_rb_fd[transform_size * i + j]));
if ((j < (transform_size-1)) || (j < (transform_size-1))){
System.out.print(", ");
}
}
System.out.println();
}
*/
System.out.print("__constant__ float lpf_rb_corr[64]={");
for (int i=0; i<lpf_rb_fd.length;i++){
System.out.print(String.format("%10.8ff", lpf_rb_fd[i]));
if (i == 63) {
System.out.println("};");
} else {
System.out.print(", ");
if ((i % 8) == 7) {
System.out.print("\n ");
}
}
}
System.out.println("=== R+B LPF-ed CORRELATION ===");
for (int dct_mode = 0; dct_mode < 4; dct_mode++) {
System.out.println("------dct_mode="+dct_mode);
......
......@@ -1911,11 +1911,18 @@ public class TwoQuadCLT {
gPUTileProcessor.setLpfRbg(
lpf_rgb);
float [] lpf_flat = image_dtt.floatGetCltLpfFd(clt_parameters.getGpuCorrSigma(is_mono));
gPUTileProcessor.setLpfCorr(
"lpf_corr", // String const_name, // "lpf_corr"
lpf_flat);
float [] lpf_rb_flat = image_dtt.floatGetCltLpfFd(clt_parameters.getGpuCorrRBSigma(is_mono));
gPUTileProcessor.setLpfCorr(
"lpf_rb_corr", // String const_name, // "lpf_corr"
lpf_rb_flat);
final boolean use_aux = false; // currently GPU is configured for a single quad camera
......
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