π Geometric Computer Vision Library for Spatial AI
kornia.geometry.homography.line_segment_transfer_error_one_way now returns inf for a segment with an endpoint that H maps to the line at infinity (w' = 0), as oneway_transfer_error does, and keeps growing as an endpoint approaches it. It used to dehomogenize the endpoints with transform_points, which returns the numerator unchanged for |w'| <= 1e-8, so such a segment read a small finite error (1 in the issue's case) and RANSAC(model_type="homography_from_linesegments") counted it as an inlier. A zero-length image-2 segment still reads 0. The distances are now computed in at least float32 and outside a caller's autocast: float16 segments with coordinates in the hundreds of pixels no longer overflow to inf or NaN, which made find_homography_lines_dlt_iterated return NaN in float16, and segments of different dtypes no longer raise; the result takes their promoted dtype.