Loading src/main/java/com/elphel/imagej/correction/Eyesis_Correction.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -109,7 +109,7 @@ import com.elphel.imagej.ims.EventLogger; import com.elphel.imagej.ims.Imx5; import com.elphel.imagej.ims.Imx5; 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.orthomosaic.ComboMap; import com.elphel.imagej.orthomosaic.OrthoMap; import com.elphel.imagej.orthomosaic.ComboMatch; import com.elphel.imagej.orthomosaic.ComboMatch; import com.elphel.imagej.readers.ChangeImageResolution; import com.elphel.imagej.readers.ChangeImageResolution; import com.elphel.imagej.readers.DumpImageMetadata; import com.elphel.imagej.readers.DumpImageMetadata; Loading Loading @@ -5732,7 +5732,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener { IJ.showMessage("Error", "No images selected"); IJ.showMessage("Error", "No images selected"); return; return; } } ComboMap.testVideo(imp_sel); OrthoMap.testVideo(imp_sel); } } } } Loading src/main/java/com/elphel/imagej/orthomosaic/ComboMatch.java +53 −33 Original line number Original line Diff line number Diff line Loading @@ -45,7 +45,8 @@ public class ComboMatch { GPU_TILE_PROCESSOR = gpu_tile_processor; GPU_TILE_PROCESSOR = gpu_tile_processor; // find -L /media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-b/ -type f -name "*-GCORR-GEO.tiff" | sort > GCORR-GEO.list // find -L /media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-b/ -type f -name "*-GCORR-GEO.tiff" | sort > GCORR-GEO.list String files_list_path = "/media/elphel/SSD3-4GB/lwir16-proc/ortho_videos/maps_berdich2.list"; String files_list_path = "/media/elphel/SSD3-4GB/lwir16-proc/ortho_videos/maps_03_short.list"; String orthoMapsCollection_path = "/media/elphel/SSD3-4GB/lwir16-proc/ortho_videos/ortho_maps_collection.data"; double [][][] image_enuatr = {{{0,0,0},{0,0,0}},{{0,0,0},{0,0,0}}}; double [][][] image_enuatr = {{{0,0,0},{0,0,0}},{{0,0,0},{0,0,0}}}; int gpu_width= clt_parameters.imp.rln_gpu_width; // 3008; int gpu_width= clt_parameters.imp.rln_gpu_width; // 3008; Loading @@ -53,8 +54,13 @@ public class ComboMatch { int zoom_lev = -4; // 0; // +1 - zoom in twice, -1 - zoom out twice int zoom_lev = -4; // 0; // +1 - zoom in twice, -1 - zoom out twice boolean use_alt = false; boolean use_alt = false; boolean show_centers = true; boolean show_centers = true; boolean use_saved_collection = false; boolean save_collection = true; GenericJTabbedDialog gd = new GenericJTabbedDialog("Set image pair",1200,800); GenericJTabbedDialog gd = new GenericJTabbedDialog("Set image pair",1200,800); gd.addStringField ("Image list full path", files_list_path, 180, "Image list full path."); gd.addStringField ("Image list full path", files_list_path, 180, "Image list full path."); gd.addStringField ("Maps collection save path", orthoMapsCollection_path, 180, "Save path for serialized map collection data."); gd.addCheckbox ("Use saved maps collection", use_saved_collection, "If false - use files list."); gd.addCheckbox ("Save maps collection", save_collection, "If false - use files list."); // for (int n = 0; n < image_paths_pre.length; n++) { // for (int n = 0; n < image_paths_pre.length; n++) { // gd.addStringField ("Image path "+n, image_paths_pre[n], 180, "Image "+n+" full path w/o ext"); // gd.addStringField ("Image path "+n, image_paths_pre[n], 180, "Image "+n+" full path w/o ext"); // } // } Loading @@ -81,11 +87,11 @@ public class ComboMatch { gd.showDialog(); gd.showDialog(); if (gd.wasCanceled()) return false; if (gd.wasCanceled()) return false; files_list_path = gd.getNextString(); files_list_path = gd.getNextString(); // for (int n = 0; n < image_paths_pre.length; n++) { // image_paths_pre[n] = gd.getNextString(); orthoMapsCollection_path = gd.getNextString(); // } use_saved_collection = gd.getNextBoolean(); // image_paths_pre[0] = gd.getNextString(); save_collection = gd.getNextBoolean(); // image_paths_pre[1] = gd.getNextString(); for (int n = 0; n < image_enuatr.length; n++) { for (int n = 0; n < image_enuatr.length; n++) { image_enuatr[n][0][0] = gd.getNextNumber(); image_enuatr[n][0][0] = gd.getNextNumber(); image_enuatr[n][0][1] = gd.getNextNumber(); image_enuatr[n][0][1] = gd.getNextNumber(); Loading @@ -98,58 +104,71 @@ public class ComboMatch { gpu_width = (int) gd.getNextNumber(); gpu_width = (int) gd.getNextNumber(); gpu_height = (int) gd.getNextNumber(); gpu_height = (int) gd.getNextNumber(); ComboMap.setGPUWidthHeight(gpu_width,gpu_height); OrthoMap.setGPUWidthHeight(gpu_width,gpu_height); show_centers = gd.getNextBoolean(); show_centers = gd.getNextBoolean(); use_alt = gd.getNextBoolean(); use_alt = gd.getNextBoolean(); // ComboMap[] combo_maps = ComboMap.initializeComboMaps( OrthoMapsCollection maps_collection=null; // full_paths); // String [] image_paths); if (use_saved_collection) { ComboMap[] combo_maps = ComboMap.initializeComboMaps( try { files_list_path); // String [] image_paths); maps_collection = OrthoMapsCollection.readOrthoMapsCollection (orthoMapsCollection_path); String [] map_names = ComboMap.getNames(combo_maps); } catch (ClassNotFoundException | IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else { maps_collection = new OrthoMapsCollection(files_list_path); // should have ".list" extensiohn } String [] names = maps_collection.getNames(); // which pair to compare int [] gpu_pair = {1,2}; String [] gpu_spair = {names[gpu_pair[0]],names[gpu_pair[1]]}; int [] origin = new int[2]; int [] origin = new int[2]; ImagePlus imp_img = ComboMap.renderMulti ( ImagePlus imp_img = maps_collection.renderMulti ( "multi_"+zoom_lev, // String title, "multi_"+zoom_lev, // String title, false, // boolean use_alt, false, // boolean use_alt, show_centers, // boolean show_centers, show_centers, // boolean show_centers, combo_maps, // ComboMap [] maps, zoom_lev, // int zoom_level, zoom_lev, // int zoom_level, origin); // int [] origin){ origin); // int [] origin){ imp_img.show(); imp_img.show(); ImagePlus imp_alt = null; ImagePlus imp_alt = null; if (use_alt) { if (use_alt) { imp_alt =ComboMap.renderMulti ( imp_alt =maps_collection.renderMulti ( "multi_alt_"+zoom_lev, // String title, "multi_alt_"+zoom_lev, // String title, true, // boolean use_alt, true, // boolean use_alt, show_centers, // boolean show_centers, show_centers, // boolean show_centers, combo_maps, // ComboMap [] maps, zoom_lev, // int zoom_level, zoom_lev, // int zoom_level, origin); // int [] origin){ origin); // int [] origin){ imp_alt.show(); imp_alt.show(); } } // which pair to compare int [] gpu_pair = {1,2}; float [][] gpu_pair_img = new float [2][]; float [][] gpu_pair_img = maps_collection.getPaddedPairGPU( for (int n = 0; n < gpu_pair.length; n++) { gpu_spair, // String [] spair, gpu_pair_img[n] = combo_maps[gpu_pair[n]].getPaddedGPU ( zoom_lev); // int zoom_lev); zoom_lev, // int zoom_level, gpu_width, // int gpu_width, gpu_height); // int gpu_height) } ShowDoubleFloatArrays.showArrays( ShowDoubleFloatArrays.showArrays( gpu_pair_img, gpu_pair_img, gpu_width, gpu_width, gpu_height, gpu_height, true, true, "gpu_pair-zoom"+zoom_lev+"-"+combo_maps[gpu_pair[0]].getName()+"-"+combo_maps[gpu_pair[1]].getName(), "gpu_pair-zoom"+zoom_lev+"-"+gpu_spair[0]+"-"+gpu_spair[1], map_names); gpu_spair); if (save_collection) { try { maps_collection.writeOrthoMapsCollection(orthoMapsCollection_path); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } if (debugLevel <1000) { if (debugLevel <1000) { return true; return true; } } /* */ /* */ OrthoMap [] ortho_maps = maps_collection.getMaps(); // just temporarily int [] widths = new int[imp_src.length]; int [] widths = new int[imp_src.length]; int [] heights = new int[imp_src.length]; int [] heights = new int[imp_src.length]; for (int n = 0; n < imp_src.length; n++) { for (int n = 0; n < imp_src.length; n++) { Loading Loading @@ -178,8 +197,8 @@ public class ComboMatch { } } /* */ /* */ if (show_centers) { if (show_centers) { for (int n = 0; n < combo_maps.length; n++) { for (int n = 0; n < ortho_maps.length; n++) { combo_maps[n].getOriginalImage(true); ortho_maps[n].getOriginalImage(true); } } } } /* /* Loading @@ -187,11 +206,12 @@ public class ComboMatch { imp_src[n].show(); imp_src[n].show(); } } */ */ if (combo_maps[0].orig_zoom_level != combo_maps[1].orig_zoom_level) { if (ortho_maps[0].orig_zoom_level != ortho_maps[1].orig_zoom_level) { System.out.println("openTestPairGps() does not yet handle different scales, aborting"); System.out.println("openTestPairGps() does not yet handle different scales, aborting"); return false; return false; } } double [] enu_diff = combo_maps[0].enuOffsetTo(combo_maps[0]); double [] enu_diff = ortho_maps[0].enuOffsetTo(ortho_maps[0]); double pix_size1 = ElphelTiffReader.getPixelSize(imp_prop[0])[0]; double pix_size1 = ElphelTiffReader.getPixelSize(imp_prop[0])[0]; double [] pix_shift = {enu_diff[0]/pix_size1, -enu_diff[1]/pix_size1}; // E->X, N->-Y double [] pix_shift = {enu_diff[0]/pix_size1, -enu_diff[1]/pix_size1}; // E->X, N->-Y Loading Loading
src/main/java/com/elphel/imagej/correction/Eyesis_Correction.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -109,7 +109,7 @@ import com.elphel.imagej.ims.EventLogger; import com.elphel.imagej.ims.Imx5; import com.elphel.imagej.ims.Imx5; 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.orthomosaic.ComboMap; import com.elphel.imagej.orthomosaic.OrthoMap; import com.elphel.imagej.orthomosaic.ComboMatch; import com.elphel.imagej.orthomosaic.ComboMatch; import com.elphel.imagej.readers.ChangeImageResolution; import com.elphel.imagej.readers.ChangeImageResolution; import com.elphel.imagej.readers.DumpImageMetadata; import com.elphel.imagej.readers.DumpImageMetadata; Loading Loading @@ -5732,7 +5732,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener { IJ.showMessage("Error", "No images selected"); IJ.showMessage("Error", "No images selected"); return; return; } } ComboMap.testVideo(imp_sel); OrthoMap.testVideo(imp_sel); } } } } Loading
src/main/java/com/elphel/imagej/orthomosaic/ComboMatch.java +53 −33 Original line number Original line Diff line number Diff line Loading @@ -45,7 +45,8 @@ public class ComboMatch { GPU_TILE_PROCESSOR = gpu_tile_processor; GPU_TILE_PROCESSOR = gpu_tile_processor; // find -L /media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-b/ -type f -name "*-GCORR-GEO.tiff" | sort > GCORR-GEO.list // find -L /media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-b/ -type f -name "*-GCORR-GEO.tiff" | sort > GCORR-GEO.list String files_list_path = "/media/elphel/SSD3-4GB/lwir16-proc/ortho_videos/maps_berdich2.list"; String files_list_path = "/media/elphel/SSD3-4GB/lwir16-proc/ortho_videos/maps_03_short.list"; String orthoMapsCollection_path = "/media/elphel/SSD3-4GB/lwir16-proc/ortho_videos/ortho_maps_collection.data"; double [][][] image_enuatr = {{{0,0,0},{0,0,0}},{{0,0,0},{0,0,0}}}; double [][][] image_enuatr = {{{0,0,0},{0,0,0}},{{0,0,0},{0,0,0}}}; int gpu_width= clt_parameters.imp.rln_gpu_width; // 3008; int gpu_width= clt_parameters.imp.rln_gpu_width; // 3008; Loading @@ -53,8 +54,13 @@ public class ComboMatch { int zoom_lev = -4; // 0; // +1 - zoom in twice, -1 - zoom out twice int zoom_lev = -4; // 0; // +1 - zoom in twice, -1 - zoom out twice boolean use_alt = false; boolean use_alt = false; boolean show_centers = true; boolean show_centers = true; boolean use_saved_collection = false; boolean save_collection = true; GenericJTabbedDialog gd = new GenericJTabbedDialog("Set image pair",1200,800); GenericJTabbedDialog gd = new GenericJTabbedDialog("Set image pair",1200,800); gd.addStringField ("Image list full path", files_list_path, 180, "Image list full path."); gd.addStringField ("Image list full path", files_list_path, 180, "Image list full path."); gd.addStringField ("Maps collection save path", orthoMapsCollection_path, 180, "Save path for serialized map collection data."); gd.addCheckbox ("Use saved maps collection", use_saved_collection, "If false - use files list."); gd.addCheckbox ("Save maps collection", save_collection, "If false - use files list."); // for (int n = 0; n < image_paths_pre.length; n++) { // for (int n = 0; n < image_paths_pre.length; n++) { // gd.addStringField ("Image path "+n, image_paths_pre[n], 180, "Image "+n+" full path w/o ext"); // gd.addStringField ("Image path "+n, image_paths_pre[n], 180, "Image "+n+" full path w/o ext"); // } // } Loading @@ -81,11 +87,11 @@ public class ComboMatch { gd.showDialog(); gd.showDialog(); if (gd.wasCanceled()) return false; if (gd.wasCanceled()) return false; files_list_path = gd.getNextString(); files_list_path = gd.getNextString(); // for (int n = 0; n < image_paths_pre.length; n++) { // image_paths_pre[n] = gd.getNextString(); orthoMapsCollection_path = gd.getNextString(); // } use_saved_collection = gd.getNextBoolean(); // image_paths_pre[0] = gd.getNextString(); save_collection = gd.getNextBoolean(); // image_paths_pre[1] = gd.getNextString(); for (int n = 0; n < image_enuatr.length; n++) { for (int n = 0; n < image_enuatr.length; n++) { image_enuatr[n][0][0] = gd.getNextNumber(); image_enuatr[n][0][0] = gd.getNextNumber(); image_enuatr[n][0][1] = gd.getNextNumber(); image_enuatr[n][0][1] = gd.getNextNumber(); Loading @@ -98,58 +104,71 @@ public class ComboMatch { gpu_width = (int) gd.getNextNumber(); gpu_width = (int) gd.getNextNumber(); gpu_height = (int) gd.getNextNumber(); gpu_height = (int) gd.getNextNumber(); ComboMap.setGPUWidthHeight(gpu_width,gpu_height); OrthoMap.setGPUWidthHeight(gpu_width,gpu_height); show_centers = gd.getNextBoolean(); show_centers = gd.getNextBoolean(); use_alt = gd.getNextBoolean(); use_alt = gd.getNextBoolean(); // ComboMap[] combo_maps = ComboMap.initializeComboMaps( OrthoMapsCollection maps_collection=null; // full_paths); // String [] image_paths); if (use_saved_collection) { ComboMap[] combo_maps = ComboMap.initializeComboMaps( try { files_list_path); // String [] image_paths); maps_collection = OrthoMapsCollection.readOrthoMapsCollection (orthoMapsCollection_path); String [] map_names = ComboMap.getNames(combo_maps); } catch (ClassNotFoundException | IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else { maps_collection = new OrthoMapsCollection(files_list_path); // should have ".list" extensiohn } String [] names = maps_collection.getNames(); // which pair to compare int [] gpu_pair = {1,2}; String [] gpu_spair = {names[gpu_pair[0]],names[gpu_pair[1]]}; int [] origin = new int[2]; int [] origin = new int[2]; ImagePlus imp_img = ComboMap.renderMulti ( ImagePlus imp_img = maps_collection.renderMulti ( "multi_"+zoom_lev, // String title, "multi_"+zoom_lev, // String title, false, // boolean use_alt, false, // boolean use_alt, show_centers, // boolean show_centers, show_centers, // boolean show_centers, combo_maps, // ComboMap [] maps, zoom_lev, // int zoom_level, zoom_lev, // int zoom_level, origin); // int [] origin){ origin); // int [] origin){ imp_img.show(); imp_img.show(); ImagePlus imp_alt = null; ImagePlus imp_alt = null; if (use_alt) { if (use_alt) { imp_alt =ComboMap.renderMulti ( imp_alt =maps_collection.renderMulti ( "multi_alt_"+zoom_lev, // String title, "multi_alt_"+zoom_lev, // String title, true, // boolean use_alt, true, // boolean use_alt, show_centers, // boolean show_centers, show_centers, // boolean show_centers, combo_maps, // ComboMap [] maps, zoom_lev, // int zoom_level, zoom_lev, // int zoom_level, origin); // int [] origin){ origin); // int [] origin){ imp_alt.show(); imp_alt.show(); } } // which pair to compare int [] gpu_pair = {1,2}; float [][] gpu_pair_img = new float [2][]; float [][] gpu_pair_img = maps_collection.getPaddedPairGPU( for (int n = 0; n < gpu_pair.length; n++) { gpu_spair, // String [] spair, gpu_pair_img[n] = combo_maps[gpu_pair[n]].getPaddedGPU ( zoom_lev); // int zoom_lev); zoom_lev, // int zoom_level, gpu_width, // int gpu_width, gpu_height); // int gpu_height) } ShowDoubleFloatArrays.showArrays( ShowDoubleFloatArrays.showArrays( gpu_pair_img, gpu_pair_img, gpu_width, gpu_width, gpu_height, gpu_height, true, true, "gpu_pair-zoom"+zoom_lev+"-"+combo_maps[gpu_pair[0]].getName()+"-"+combo_maps[gpu_pair[1]].getName(), "gpu_pair-zoom"+zoom_lev+"-"+gpu_spair[0]+"-"+gpu_spair[1], map_names); gpu_spair); if (save_collection) { try { maps_collection.writeOrthoMapsCollection(orthoMapsCollection_path); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } if (debugLevel <1000) { if (debugLevel <1000) { return true; return true; } } /* */ /* */ OrthoMap [] ortho_maps = maps_collection.getMaps(); // just temporarily int [] widths = new int[imp_src.length]; int [] widths = new int[imp_src.length]; int [] heights = new int[imp_src.length]; int [] heights = new int[imp_src.length]; for (int n = 0; n < imp_src.length; n++) { for (int n = 0; n < imp_src.length; n++) { Loading Loading @@ -178,8 +197,8 @@ public class ComboMatch { } } /* */ /* */ if (show_centers) { if (show_centers) { for (int n = 0; n < combo_maps.length; n++) { for (int n = 0; n < ortho_maps.length; n++) { combo_maps[n].getOriginalImage(true); ortho_maps[n].getOriginalImage(true); } } } } /* /* Loading @@ -187,11 +206,12 @@ public class ComboMatch { imp_src[n].show(); imp_src[n].show(); } } */ */ if (combo_maps[0].orig_zoom_level != combo_maps[1].orig_zoom_level) { if (ortho_maps[0].orig_zoom_level != ortho_maps[1].orig_zoom_level) { System.out.println("openTestPairGps() does not yet handle different scales, aborting"); System.out.println("openTestPairGps() does not yet handle different scales, aborting"); return false; return false; } } double [] enu_diff = combo_maps[0].enuOffsetTo(combo_maps[0]); double [] enu_diff = ortho_maps[0].enuOffsetTo(ortho_maps[0]); double pix_size1 = ElphelTiffReader.getPixelSize(imp_prop[0])[0]; double pix_size1 = ElphelTiffReader.getPixelSize(imp_prop[0])[0]; double [] pix_shift = {enu_diff[0]/pix_size1, -enu_diff[1]/pix_size1}; // E->X, N->-Y double [] pix_shift = {enu_diff[0]/pix_size1, -enu_diff[1]/pix_size1}; // E->X, N->-Y Loading