Commit fd1e373d authored by Kelvin Rodriguez's avatar Kelvin Rodriguez Committed by jlaura
Browse files

Fixes #288 (#308)

* fundamental matrix computation now fails gracefully if empty kepypoints are passed in

* merge markers left in
parent b14bc45e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -56,8 +56,12 @@ def place_points_in_overlaps(cg, size_threshold=0.0007, reference=None, height=0
        valid = compgeom.distribute_points_in_geom(geoalchemy2.shape.to_shape(o.geom))
        if not valid:
            continue

        overlaps = o.intersections

        if intersections == None:
            continue

        if reference is None:
            source = overlaps[0]
        else:
+3 −0
Original line number Diff line number Diff line
@@ -292,6 +292,9 @@ def compute_fundamental_matrix(kp1, kp2, method='mle', reproj_threshold=2.0,
    else:
        raise ValueError("Unknown estimation method. Choices are: 'lme', 'ransac', 'lmeds', '8point', or 'normal'.")

    if len(kp1) == 0 or len(kp2) == 0:
        warnings.warn("F Computation Failed.")
        return None, None

    # OpenCV wants arrays
    try: # OpenCV < 3.4.1