FindConnectionOfRowsBetweenTwoTiles¶
Qualified name: crop_row_connector.find_connection_of_rows_between_two_tiles.FindConnectionOfRowsBetweenTwoTiles
- class FindConnectionOfRowsBetweenTwoTiles(distance_tolerance)[source]¶
Bases:
objectFind connection of rows between two tiles. Based on the Hungarian algorithm.
Methods
Find all valid row-to-row connections between two adjacent tiles.
Calculate the distance between a point and a line.
Calculate the distance between two rows as the difference between the point in one row and the two other points in the other row.
Remove rows when they have been used in a connection.
Remove the padded rows and columns from the connection matrix, as well as the rows that are too far apart.
- Parameters:
distance_tolerance (float)
- calculate_connections_between_2_tiles(tile_1, tile_2)[source]¶
Find all valid row-to-row connections between two adjacent tiles.
- distance_between_point_and_line(point, line_point_close, line_point_far)[source]¶
Calculate the distance between a point and a line.
- distance_between_rows(row_1, row_2)[source]¶
Calculate the distance between two rows as the difference between the point in one row and the two other points in the other row.
- keep_track_of_unused_rows_in_tiles(tile_1, tile_2, connection_matrix)[source]¶
Remove rows when they have been used in a connection.