StereoRectificationGridGenerator app failed
Mantis Issue 993, reported by cpalmann, assigned to jmichel, created: 2014-12-12
Tried to resample two input images to epipolar geometry through MVD2 (0.8 32bits). Got bad allocation.
Checked the dashboard : everything seems ok for the StereoRectificationGridGenerator app.
Could run the app under Ubuntu12.04-64bits-Release (for CS : Dora) without problem.
Steps to reproduce:
Just set two input images and execute the app.
For my CS colleagues:
Images of the test can be found here:
- /media/otbnas/cpalmann/ROIs/tristereo_melbourne_1_small.tif
- /media/otbnas/cpalmann/ROIs/tristereo_melbourne_2_small.tif
2014-12-15 14:51 - cpalmann: Correction: the bug can be reproduced under Ubuntu12.04-64bits-Release as well.
Actually, the relevant factor is about setting or not the parameters -inverse.outleft and -inverse.outright.
The bug simply occurs from the application StereoRectificationGridGenerator itself (cmd or qt), and MVD2 doesn't seem to be concerned.
2014-12-15 14:53 - julien: I can confirm I had the same issue on Ubuntu 14.04 64 bits during my OTB training in Mexico. Moreover the inverse field outputs are activated by default in MVD2, but they should not be.
2014-12-16 16:31 - cpalmann: Concerning this last remark, I opened a new issue here: #995 (closed).
2014-12-17 15:05 - cpalmann: Noticed that getting the inverse deformation grids involves intensive calculus on matrices; this is reason why the app seems to be freezed.
More precisely, this problem is related to the itkKernelTransorm class. It implements the parameter estimation of a thin plate splin deformation model. This estimation requires the inversion of a matrix "L", which is actually done via an svd decomposition (vnl_svd). The size of L is driven by the number of pairs of points to be mapped to each other (source and target points); and of course, this number is in turn related to the image size.
For instance, the image used for the dashboard tests is only 128x128, which produces a matrix L whose size is 206x206 (apTuDmStereoRectificationGridGeneratorTest). For an 1024x1024 image, the size of L is 12174x12174! On a eight-core platform, things begin to be hard with an 400x400 image (L's size is 1806x1806).
So this issue is not really a bug, but a strong limitation that makes the parameters -inverse.outleft and -inverse.outright virtually useless.
I suggest to simply drop them.
2014-12-19 15:29 - cpalmann: But... if those parameters have to be kept, a parameter that allows reducing the computational demand is "inverse.ssrate". It is used to resample input images to a given rate.
For instance, setting its value to 64 allows processing a 1024x1024 image within a reasonable timeframe.
Actually, the default value is 16.
2015-01-12 09:25 - gpasero: In this application, the deformation grid should NOT follow the image size. Both direct and inverse grids should be computed on a subsampled grid, simply because in OTB filters, those grids are not handled using streaming, they are fully loaded in memory. Maybe an optimal subsampling rate should be proposed to the user based on the input image size.
2015-01-12 09:27 - jmichel: Maybe this should be stated clearly in the application documentation.
2015-04-17 09:45 - jmichel: Depending on the disparity map, the output resampled image can be really huge (for instance when there are outliers in the disparity map). I do not think this is really a bug.
2015-04-17 09:46 - jmichel: Sorry I misinterpreted the issue. Anyway this has nothing to do with Monteverdi2. Do you still reproduce the problem ?
2015-11-02 20:39 - luiz: I'm not able to use the stereo deformation grid generator as well. I'm trying to use the complete Pleiades images. Using the extract available in the course, area around the Melbourne stadium, it works, using the full image it crashes. I'm using on Kubuntu 14.04 with 8gb of ram.
2015-11-05 15:24 - salbert: Should this issue be moved to OTB?