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

fix: incorrect usage of error_colormap #79

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions ui/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

from hloc.utils.viz import add_text, plot_keypoints

np.random.seed(1995)
color_map = np.arange(100)
np.random.shuffle(color_map)


def plot_images(
imgs: List[np.ndarray],
Expand Down Expand Up @@ -232,11 +236,6 @@ def error_colormap(
)


np.random.seed(1995)
color_map = np.arange(100)
np.random.shuffle(color_map)


def fig2im(fig: matplotlib.figure.Figure) -> np.ndarray:
"""
Convert a matplotlib figure to a numpy array with RGB values.
Expand Down Expand Up @@ -284,9 +283,8 @@ def draw_matches_core(
The figure as a numpy array with shape (height, width, 3) and dtype uint8
containing the RGB values of the figure.
"""
thr = 5e-4
thr = 0.5
color = error_colormap(conf, thr, alpha=0.1)
color = error_colormap(1 - conf, thr, alpha=0.1)
text = [
# "image name",
f"#Matches: {len(mkpts0)}",
Expand Down
Loading