Closed DCHulskemper closed 1 year ago
I read a bit through the code and indeed it seems like something seems wrong. I am unsure whether it is a regression that I introduced at some point or whether it always has been wrong (which would be slightly embarrassing). On the bright side: I am fairly confident that the problem is on the Python side. The restriction to (start_epoch, end_epoch)
is not done on the C++ side, instead the required restriction is done on the calling Python side by slicing numpy
arrays:
There might be more issues, but this immediately seemed dubious to me.
I tested the additional slicing in https://github.com/3dgeo-heidelberg/py4dgeo/blob/main/src/py4dgeo/segmentation.py#L744. When added, the program crashed at this function, though.
Without the slicing, we would expect the distances between compared time series to be larger (than in the limited timespan). So I assume the return of 0.0 is a separate issue.
Issue: In segmentation.py the dtw distances within the initial neighborhood (
similarities
) computed in theseed_sorting_scorefunction
should be equal to theobjdata.indices_distances
of the initial neighborhood points computed in_py4dgeo.region_growing
. This is not the case. Theobjdata.indices_distances
for the neighborhood points are all zero instead and the distances outside the neighborhood seem too small.Solution: The problem could be that in the c++ function (
_py4dgeo.region_growing
) the dtw distance computation is done using the full time series instead of only the temporal segment betweenend_epoch
andstart_epoch
ofseed
. This could explain why the DTW distances insimilarities
andobjdata.indices_distances
are not equal, but this does not necessarily explain why theobjdata.indices_distances
in the neighborhood are zero.