Commit 72a8b1df authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: Save NADIR-DISPARITY-MAPS hyperstack from getNadirDisparityMaps()

After computing per-scene pXpYD arrays, saves a tile-resolution
hyperstack <ts>-NADIR-DISPARITY-MAPS.tiff with:
  - frames = scenes (labelled by timestamp)
  - slices = pX, pY, D (3 channels)
  - NaN where scene has no pose or tile has no data

Useful for verifying disparity transform coverage before feeding
the rendered images into OpenMVS/COLMAP.
Co-authored-by: 's avatarClaude <claude@elphel.com>
parent f455f79f
...@@ -10877,6 +10877,40 @@ java.lang.NullPointerException ...@@ -10877,6 +10877,40 @@ java.lang.NullPointerException
num_virtual_refines, // final int num_refines, num_virtual_refines, // final int num_refines,
null); // final String debugSuffix null); // final String debugSuffix
} }
// Save pX/pY/D hyperstack for each scene at tile resolution
int tilesX = ref_scene.getTilesX();
int tilesY = ref_scene.getTilesY();
int ntiles = tilesX * tilesY;
String [] slice_titles = {"pX", "pY", "D"};
String [] frame_titles = new String[selected_scenes.length];
double [][][] disp_maps = new double[selected_scenes.length][3][ntiles];
for (int ns = 0; ns < selected_scenes.length; ns++) {
frame_titles[ns] = selected_scenes[ns].getImageName();
Arrays.fill(disp_maps[ns][0], Double.NaN);
Arrays.fill(disp_maps[ns][1], Double.NaN);
Arrays.fill(disp_maps[ns][2], Double.NaN);
if (nadir_pXpYD[ns] != null) {
for (int t = 0; t < ntiles; t++) {
if (nadir_pXpYD[ns][t] != null) {
disp_maps[ns][0][t] = nadir_pXpYD[ns][t][0]; // pX
disp_maps[ns][1][t] = nadir_pXpYD[ns][t][1]; // pY
disp_maps[ns][2][t] = nadir_pXpYD[ns][t][2]; // D (disparity)
}
}
}
}
ImagePlus imp_disp_maps = ShowDoubleFloatArrays.showArraysHyperstack(
disp_maps, // double [][][] pixels,
tilesX, // int width,
ref_scene.getImageName() + "-NADIR-DISPARITY-MAPS", // String title,
slice_titles, // String [] titles,
frame_titles, // String [] frame_titles,
false); // boolean show
if (imp_disp_maps != null) {
ref_scene.saveImagePlusInModelDirectory(
null, // String suffix,
imp_disp_maps);// ImagePlus imp
}
return nadir_pXpYD; return nadir_pXpYD;
} }
......
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