Commit 34ac02e8 authored by Andrey Filippov's avatar Andrey Filippov

refactoring

parent 7af3b919
...@@ -80,8 +80,11 @@ import com.elphel.imagej.common.DoubleGaussianBlur; ...@@ -80,8 +80,11 @@ import com.elphel.imagej.common.DoubleGaussianBlur;
import com.elphel.imagej.common.GenericJTabbedDialog; import com.elphel.imagej.common.GenericJTabbedDialog;
import com.elphel.imagej.common.ShowDoubleFloatArrays; import com.elphel.imagej.common.ShowDoubleFloatArrays;
import com.elphel.imagej.common.WindowTools; import com.elphel.imagej.common.WindowTools;
import com.elphel.imagej.gpu.GPUTileProcessor;
import com.elphel.imagej.gpu.JCuda_ImageJ_Example_Plugin;
import com.elphel.imagej.jp4.JP46_Reader_camera; import com.elphel.imagej.jp4.JP46_Reader_camera;
import com.elphel.imagej.lwir.LwirReader; import com.elphel.imagej.lwir.LwirReader;
import com.elphel.imagej.tensorflow.TensorflowInferModel;
import ij.CompositeImage; import ij.CompositeImage;
import ij.IJ; import ij.IJ;
......
...@@ -87,7 +87,7 @@ public class GeometryCorrection { ...@@ -87,7 +87,7 @@ public class GeometryCorrection {
public CorrVector extrinsic_corr; public CorrVector extrinsic_corr;
public RigOffset rigOffset = null; public RigOffset rigOffset = null;
int [] woi_tops; // used to calculate scanline timing public int [] woi_tops; // used to calculate scanline timing
public int [] getWOITops() { public int [] getWOITops() {
return woi_tops; return woi_tops;
......
...@@ -168,9 +168,9 @@ public class ImageDtt { ...@@ -168,9 +168,9 @@ public class ImageDtt {
"top-aux", "bottom-aux", "left_aux", "right-aux", "diagm-aux", "diago-aux", "hor-aux", "vert-aux", "top-aux", "bottom-aux", "left_aux", "right-aux", "diagm-aux", "diago-aux", "hor-aux", "vert-aux",
"inter", "other", "dbg1"}; "inter", "other", "dbg1"};
static int ML_OTHER_TARGET = 0; // Offset to target disparity data in ML_OTHER_INDEX layer tile public static int ML_OTHER_TARGET = 0; // Offset to target disparity data in ML_OTHER_INDEX layer tile
static int ML_OTHER_GTRUTH = 2; // Offset to ground truth disparity data in ML_OTHER_INDEX layer tile public static int ML_OTHER_GTRUTH = 2; // Offset to ground truth disparity data in ML_OTHER_INDEX layer tile
static int ML_OTHER_GTRUTH_STRENGTH = 4; // Offset to ground truth confidence data in ML_OTHER_INDEX layer tile public static int ML_OTHER_GTRUTH_STRENGTH = 4; // Offset to ground truth confidence data in ML_OTHER_INDEX layer tile
// indices in cross-camera correlation results // indices in cross-camera correlation results
...@@ -5842,7 +5842,7 @@ public class ImageDtt { ...@@ -5842,7 +5842,7 @@ public class ImageDtt {
* From Stephan Preibisch's Multithreading.java class. See: * From Stephan Preibisch's Multithreading.java class. See:
* http://repo.or.cz/w/trakem2.git?a=blob;f=mpi/fruitfly/general/MultiThreading.java;hb=HEAD * http://repo.or.cz/w/trakem2.git?a=blob;f=mpi/fruitfly/general/MultiThreading.java;hb=HEAD
*/ */
static Thread[] newThreadArray(int maxCPUs) { public static Thread[] newThreadArray(int maxCPUs) {
int n_cpus = Runtime.getRuntime().availableProcessors(); int n_cpus = Runtime.getRuntime().availableProcessors();
if (n_cpus>maxCPUs)n_cpus=maxCPUs; if (n_cpus>maxCPUs)n_cpus=maxCPUs;
return new Thread[n_cpus]; return new Thread[n_cpus];
......
...@@ -43,6 +43,7 @@ import java.util.Random; ...@@ -43,6 +43,7 @@ import java.util.Random;
import com.elphel.imagej.cameras.EyesisCorrectionParameters; import com.elphel.imagej.cameras.EyesisCorrectionParameters;
import com.elphel.imagej.common.GenericJTabbedDialog; import com.elphel.imagej.common.GenericJTabbedDialog;
import com.elphel.imagej.common.ShowDoubleFloatArrays; import com.elphel.imagej.common.ShowDoubleFloatArrays;
import com.elphel.imagej.gpu.GPUTileProcessor;
import com.elphel.imagej.jp4.JP46_Reader_camera; import com.elphel.imagej.jp4.JP46_Reader_camera;
import ij.IJ; import ij.IJ;
......
package com.elphel.imagej.dp; package com.elphel.imagej.gpu;
/** /**
** -----------------------------------------------------------------------------** ** -----------------------------------------------------------------------------**
** GPUTileProcessor.java ** GPUTileProcessor.java
...@@ -52,6 +52,10 @@ import java.nio.file.Files; ...@@ -52,6 +52,10 @@ import java.nio.file.Files;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import com.elphel.imagej.dp.DttRad2;
import com.elphel.imagej.dp.GeometryCorrection;
import com.elphel.imagej.dp.ImageDtt;
import Jama.Matrix; import Jama.Matrix;
import ij.IJ; import ij.IJ;
import jcuda.Pointer; import jcuda.Pointer;
...@@ -73,12 +77,12 @@ public class GPUTileProcessor { ...@@ -73,12 +77,12 @@ public class GPUTileProcessor {
static String GPU_CONVERT_CORRECT_TILES_NAME = "convert_correct_tiles"; static String GPU_CONVERT_CORRECT_TILES_NAME = "convert_correct_tiles";
static String GPU_IMCLT_RBG_NAME = "imclt_rbg"; static String GPU_IMCLT_RBG_NAME = "imclt_rbg";
// pass some defines to gpu source code with #ifdef JCUDA // pass some defines to gpu source code with #ifdef JCUDA
static int DTT_SIZE = 8; public static int DTT_SIZE = 8;
static int THREADSX = DTT_SIZE; static int THREADSX = DTT_SIZE;
static int NUM_CAMS = 4; public static int NUM_CAMS = 4;
static int NUM_COLORS = 3; static int NUM_COLORS = 3;
static int IMG_WIDTH = 2592; public static int IMG_WIDTH = 2592;
static int IMG_HEIGHT = 1936; public static int IMG_HEIGHT = 1936;
static int KERNELS_HOR = 164; static int KERNELS_HOR = 164;
static int KERNELS_VERT = 123; static int KERNELS_VERT = 123;
static int KERNELS_LSTEP = 4; static int KERNELS_LSTEP = 4;
...@@ -592,7 +596,7 @@ public class GPUTileProcessor { ...@@ -592,7 +596,7 @@ public class GPUTileProcessor {
cuCtxSynchronize(); cuCtxSynchronize();
} }
float [][] getRBG (int ncam){ public float [][] getRBG (int ncam){
int height = (IMG_HEIGHT + DTT_SIZE); int height = (IMG_HEIGHT + DTT_SIZE);
int width = (IMG_WIDTH + DTT_SIZE); int width = (IMG_WIDTH + DTT_SIZE);
int rslt_img_size = width * height; int rslt_img_size = width * height;
......
package com.elphel.imagej.dp; package com.elphel.imagej.gpu;
/** /**
* ImageJ Plugin using JCuda * ImageJ Plugin using JCuda
* *
......
/**
*
*/
/**
* @author eyesis
*
*/
package com.elphel.imagej.gpu;
\ No newline at end of file
package com.elphel.imagej.dp; package com.elphel.imagej.tensorflow;
/** /**
* Copyright (C) 2018 Elphel, Inc. * Copyright (C) 2018 Elphel, Inc.
* SPDX-License-Identifier: GPL-3.0-or-later * SPDX-License-Identifier: GPL-3.0-or-later
......
package com.elphel.imagej.dp; package com.elphel.imagej.tensorflow;
/** /**
* Copyright (C) 2018 Elphel, Inc. * Copyright (C) 2018 Elphel, Inc.
* SPDX-License-Identifier: GPL-3.0-or-later * SPDX-License-Identifier: GPL-3.0-or-later
...@@ -19,6 +19,7 @@ import org.tensorflow.SavedModelBundle; ...@@ -19,6 +19,7 @@ import org.tensorflow.SavedModelBundle;
import org.tensorflow.Tensor; import org.tensorflow.Tensor;
import com.elphel.imagej.common.ShowDoubleFloatArrays; import com.elphel.imagej.common.ShowDoubleFloatArrays;
import com.elphel.imagej.dp.ImageDtt;
import ij.IJ; import ij.IJ;
import ij.ImagePlus; import ij.ImagePlus;
......
/**
*
*/
/**
* @author eyesis
*
*/
package com.elphel.imagej.tensorflow;
\ No newline at end of file
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