Loading src/main/java/com/elphel/imagej/cameras/EyesisCorrectionParameters.java +17 −2 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ public class EyesisCorrectionParameters { public boolean equirectangular= true; public boolean zcorrect= true; public boolean saveSettings = true; public String tile_processor_gpu = ""; // absolute path to tile_processor_gpu project or empty to use default GPU kernels public String [] sourcePaths= {}; // public String [] sourceSetPaths= {}; // 2019 - directories with image sets Loading Loading @@ -909,6 +910,9 @@ public class EyesisCorrectionParameters { gd.addTab ("File paths", "Select files and directories paths (common to main and optional auxiliary)"); gd.addMessage ("============ Common to the main and optional auxiliary camera============"); gd.addStringField ("GPU tile_processor_gpu project absolute path", this.tile_processor_gpu, 60, "Keep empty to use default GPU kernels"); gd.addCheckbox ("Select GPU directory", false); gd.addCheckbox ("Save current settings with results", this.saveSettings); // 1 gd.addStringField ("Source files directory", this.sourceDirectory, 60); // 2 Loading Loading @@ -1022,7 +1026,7 @@ public class EyesisCorrectionParameters { gd.showDialog(); if (gd.wasCanceled()) return false; this.tile_processor_gpu = gd.getNextString(); if (gd.getNextBoolean()) selectGPUSourceDirectory(false, false); this.saveSettings= gd.getNextBoolean(); // 1 Loading Loading @@ -1760,6 +1764,17 @@ public class EyesisCorrectionParameters { if (dir!=null) this.sourceDirectory=dir; return dir; } public String selectGPUSourceDirectory(boolean smart, boolean newAllowed) { // normally newAllowed=false String dir= CalibrationFileManagement.selectDirectory( smart, newAllowed, // save "GPU kernel development project", // title "Select GPU project directory", // button null, // filter this.tile_processor_gpu); // this.sourceDirectory); if (dir!=null) this.tile_processor_gpu=dir; return dir; } public String selectSensorDirectory(boolean smart, boolean newAllowed) { String dir= CalibrationFileManagement.selectDirectory( smart, Loading src/main/java/com/elphel/imagej/correction/Eyesis_Correction.java +1 −1 Original line number Diff line number Diff line Loading @@ -5784,7 +5784,7 @@ private Panel panel1, } if (GPU_TILE_PROCESSOR == null) { try { GPU_TILE_PROCESSOR = new GPUTileProcessor(); GPU_TILE_PROCESSOR = new GPUTileProcessor(CORRECTION_PARAMETERS.tile_processor_gpu); } catch (Exception e) { System.out.println("Failed to initialize GPU class"); // TODO Auto-generated catch block Loading src/main/java/com/elphel/imagej/gpu/GPUTileProcessor.java +10 −2 Original line number Diff line number Diff line Loading @@ -240,7 +240,7 @@ public class GPUTileProcessor { return new PointerWithAddress(p).getAddress(); } public GPUTileProcessor() throws IOException public GPUTileProcessor(String cuda_project_directory) throws IOException { // From code by Marco Hutter - http://www.jcuda.org // Enable exceptions and omit all subsequent error checks Loading Loading @@ -276,7 +276,15 @@ public class GPUTileProcessor { "#define IMCLT_TILES_PER_BLOCK " + IMCLT_TILES_PER_BLOCK+"\n"; for (String src_file:GPU_KERNEL_FILES) { File file = new File(classLoader.getResource(src_file).getFile()); File file = null; if ((cuda_project_directory == null) || (cuda_project_directory == "")) { file = new File(classLoader.getResource(src_file).getFile()); System.out.println("Loading resource "+file); } else { File src_dir = new File(cuda_project_directory, "src"); file = new File(src_dir.getPath(), src_file); System.out.println("Loading resource "+file); } System.out.println(file.getAbsolutePath()); String cuFileName = file.getAbsolutePath(); // /home/eyesis/workspace-python3/nvidia_dct8x8/src/dtt8x8.cuh";// "dtt8x8.cuh"; String sourceFile = readFileAsString(cuFileName); // readResourceAsString(cuFileName); Loading src/main/java/com/elphel/imagej/gpu/JCuda_ImageJ_Example_Plugin.java +0 −2 Original line number Diff line number Diff line Loading @@ -206,8 +206,6 @@ public class JCuda_ImageJ_Example_Plugin implements PlugInFilter */ private static String readResourceAsString(String name) { int a = 0; Class ccc = JCuda_ImageJ_Example_Plugin.class; InputStream inputStream = JCuda_ImageJ_Example_Plugin.class.getResourceAsStream(name); if (inputStream == null) Loading src/main/java/com/elphel/imagej/tileprocessor/TwoQuadCLT.java +7 −3 Original line number Diff line number Diff line Loading @@ -1920,6 +1920,7 @@ public class TwoQuadCLT { String [] rgb_titles = {"red","blue","green"}; int out_width = GPUTileProcessor.IMG_WIDTH + GPUTileProcessor.DTT_SIZE; int out_height = GPUTileProcessor.IMG_HEIGHT + GPUTileProcessor.DTT_SIZE; /* for (int ncam = 0; ncam < iclt_fimg.length; ncam++) { String title=name+"-RBG"+String.format("%02d", ncam); Loading @@ -1931,7 +1932,7 @@ public class TwoQuadCLT { title, rgb_titles); } */ ImagePlus [] imps_RGB = new ImagePlus[iclt_fimg.length]; for (int ncam = 0; ncam < iclt_fimg.length; ncam++) { String title=name+"-"+String.format("%02d", ncam); Loading Loading @@ -2081,11 +2082,14 @@ public class TwoQuadCLT { double_stacks_main[i][2][j]*=0.5; // Scale green 0.5 to compensate more pixels than R,B } } for (int i = 0; i < double_stacks_aux.length; i++){ if (double_stacks_aux[i].length > 2) { // skip for monochrome, only if color for (int j =0 ; j < double_stacks_aux[i][0].length; j++){ double_stacks_aux[i][2][j]*=0.5; // Scale green 0.5 to compensate more pixels than R,B } } } quadCLT_main.setTiles (imp_quad_main[0], // set global tp.tilesX, tp.tilesY clt_parameters, threadsMax); Loading Loading
src/main/java/com/elphel/imagej/cameras/EyesisCorrectionParameters.java +17 −2 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ public class EyesisCorrectionParameters { public boolean equirectangular= true; public boolean zcorrect= true; public boolean saveSettings = true; public String tile_processor_gpu = ""; // absolute path to tile_processor_gpu project or empty to use default GPU kernels public String [] sourcePaths= {}; // public String [] sourceSetPaths= {}; // 2019 - directories with image sets Loading Loading @@ -909,6 +910,9 @@ public class EyesisCorrectionParameters { gd.addTab ("File paths", "Select files and directories paths (common to main and optional auxiliary)"); gd.addMessage ("============ Common to the main and optional auxiliary camera============"); gd.addStringField ("GPU tile_processor_gpu project absolute path", this.tile_processor_gpu, 60, "Keep empty to use default GPU kernels"); gd.addCheckbox ("Select GPU directory", false); gd.addCheckbox ("Save current settings with results", this.saveSettings); // 1 gd.addStringField ("Source files directory", this.sourceDirectory, 60); // 2 Loading Loading @@ -1022,7 +1026,7 @@ public class EyesisCorrectionParameters { gd.showDialog(); if (gd.wasCanceled()) return false; this.tile_processor_gpu = gd.getNextString(); if (gd.getNextBoolean()) selectGPUSourceDirectory(false, false); this.saveSettings= gd.getNextBoolean(); // 1 Loading Loading @@ -1760,6 +1764,17 @@ public class EyesisCorrectionParameters { if (dir!=null) this.sourceDirectory=dir; return dir; } public String selectGPUSourceDirectory(boolean smart, boolean newAllowed) { // normally newAllowed=false String dir= CalibrationFileManagement.selectDirectory( smart, newAllowed, // save "GPU kernel development project", // title "Select GPU project directory", // button null, // filter this.tile_processor_gpu); // this.sourceDirectory); if (dir!=null) this.tile_processor_gpu=dir; return dir; } public String selectSensorDirectory(boolean smart, boolean newAllowed) { String dir= CalibrationFileManagement.selectDirectory( smart, Loading
src/main/java/com/elphel/imagej/correction/Eyesis_Correction.java +1 −1 Original line number Diff line number Diff line Loading @@ -5784,7 +5784,7 @@ private Panel panel1, } if (GPU_TILE_PROCESSOR == null) { try { GPU_TILE_PROCESSOR = new GPUTileProcessor(); GPU_TILE_PROCESSOR = new GPUTileProcessor(CORRECTION_PARAMETERS.tile_processor_gpu); } catch (Exception e) { System.out.println("Failed to initialize GPU class"); // TODO Auto-generated catch block Loading
src/main/java/com/elphel/imagej/gpu/GPUTileProcessor.java +10 −2 Original line number Diff line number Diff line Loading @@ -240,7 +240,7 @@ public class GPUTileProcessor { return new PointerWithAddress(p).getAddress(); } public GPUTileProcessor() throws IOException public GPUTileProcessor(String cuda_project_directory) throws IOException { // From code by Marco Hutter - http://www.jcuda.org // Enable exceptions and omit all subsequent error checks Loading Loading @@ -276,7 +276,15 @@ public class GPUTileProcessor { "#define IMCLT_TILES_PER_BLOCK " + IMCLT_TILES_PER_BLOCK+"\n"; for (String src_file:GPU_KERNEL_FILES) { File file = new File(classLoader.getResource(src_file).getFile()); File file = null; if ((cuda_project_directory == null) || (cuda_project_directory == "")) { file = new File(classLoader.getResource(src_file).getFile()); System.out.println("Loading resource "+file); } else { File src_dir = new File(cuda_project_directory, "src"); file = new File(src_dir.getPath(), src_file); System.out.println("Loading resource "+file); } System.out.println(file.getAbsolutePath()); String cuFileName = file.getAbsolutePath(); // /home/eyesis/workspace-python3/nvidia_dct8x8/src/dtt8x8.cuh";// "dtt8x8.cuh"; String sourceFile = readFileAsString(cuFileName); // readResourceAsString(cuFileName); Loading
src/main/java/com/elphel/imagej/gpu/JCuda_ImageJ_Example_Plugin.java +0 −2 Original line number Diff line number Diff line Loading @@ -206,8 +206,6 @@ public class JCuda_ImageJ_Example_Plugin implements PlugInFilter */ private static String readResourceAsString(String name) { int a = 0; Class ccc = JCuda_ImageJ_Example_Plugin.class; InputStream inputStream = JCuda_ImageJ_Example_Plugin.class.getResourceAsStream(name); if (inputStream == null) Loading
src/main/java/com/elphel/imagej/tileprocessor/TwoQuadCLT.java +7 −3 Original line number Diff line number Diff line Loading @@ -1920,6 +1920,7 @@ public class TwoQuadCLT { String [] rgb_titles = {"red","blue","green"}; int out_width = GPUTileProcessor.IMG_WIDTH + GPUTileProcessor.DTT_SIZE; int out_height = GPUTileProcessor.IMG_HEIGHT + GPUTileProcessor.DTT_SIZE; /* for (int ncam = 0; ncam < iclt_fimg.length; ncam++) { String title=name+"-RBG"+String.format("%02d", ncam); Loading @@ -1931,7 +1932,7 @@ public class TwoQuadCLT { title, rgb_titles); } */ ImagePlus [] imps_RGB = new ImagePlus[iclt_fimg.length]; for (int ncam = 0; ncam < iclt_fimg.length; ncam++) { String title=name+"-"+String.format("%02d", ncam); Loading Loading @@ -2081,11 +2082,14 @@ public class TwoQuadCLT { double_stacks_main[i][2][j]*=0.5; // Scale green 0.5 to compensate more pixels than R,B } } for (int i = 0; i < double_stacks_aux.length; i++){ if (double_stacks_aux[i].length > 2) { // skip for monochrome, only if color for (int j =0 ; j < double_stacks_aux[i][0].length; j++){ double_stacks_aux[i][2][j]*=0.5; // Scale green 0.5 to compensate more pixels than R,B } } } quadCLT_main.setTiles (imp_quad_main[0], // set global tp.tilesX, tp.tilesY clt_parameters, threadsMax); Loading