FindConnectionOfRowsBetweenTwoTiles

Qualified name: crop_row_connector.find_connection_of_rows_between_two_tiles.FindConnectionOfRowsBetweenTwoTiles

class FindConnectionOfRowsBetweenTwoTiles(distance_tolerance)[source]

Bases: object

Find connection of rows between two tiles. Based on the Hungarian algorithm.

Methods

calculate_connections_between_2_tiles

Find all valid row-to-row connections between two adjacent tiles.

distance_between_point_and_line

Calculate the distance between a point and a line.

distance_between_rows

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

Remove rows when they have been used in a connection.

remove_padded_rows_cols

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.

Parameters:
Return type:

ndarray

distance_between_point_and_line(point, line_point_close, line_point_far)[source]

Calculate the distance between a point and a line.

Parameters:
Return type:

ndarray

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.

Parameters:
Return type:

float

keep_track_of_unused_rows_in_tiles(tile_1, tile_2, connection_matrix)[source]

Remove rows when they have been used in a connection.

Parameters:
Return type:

None

remove_padded_rows_cols(tile_1_rows, tile_2_rows, connection_matrix, cost_mat)[source]

Remove the padded rows and columns from the connection matrix, as well as the rows that are too far apart.

Parameters:
Return type:

ndarray