Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in s2p.visualisation.plot_matches_low_level #125

Open
lionlai1989 opened this issue Jun 22, 2022 · 0 comments
Open

Bug in s2p.visualisation.plot_matches_low_level #125

lionlai1989 opened this issue Jun 22, 2022 · 0 comments

Comments

@lionlai1989
Copy link
Contributor

lionlai1989 commented Jun 22, 2022

In s2p.visualisation.plot_matches_low_level, it enforces images to be 3 dimensional like below.

    if img1.ndim < 3:
        img1 = np.dstack([img1] * 3)
    if img2.ndim < 3:
        img2= np.dstack([img2] * 3)

    # if images have more than 3 channels, keep only the first 3
    if img1.shape[2] > 3:
        img1 = img1[:, :, 0:3]
    if img2.shape[2] > 3:
        img2 = img2[:, :, 0:3]

Issues are:

  1. rasterio.read by default returns 3D array, (dim, height, width) = array.shape. If reading a panchromatic image (1 band only), its dimension is still 3D but img1.ndim < 3 is False.
  2. The dimension is at the first position not the last position. Thus, it should be if img2.shape[0] > 3:

Possible Solutions:

  1. Modify the code in s2p.visualisation.plot_matches_low_level.
  2. Or modify the code in s2p.visualisation.plot_matches.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant