Skip to content

Fix rotation direction in visualize_gaussians due to inverted Y-axis #4

@MathisDupont

Description

@MathisDupont

Hello,
First I want to thank you for the code provided!

When visualizing gaussians with the function visualize_gaussians in utils/image_utils.py, it seems the angle calculation needs to be inverted.

Since the Y-axis is inverted for image plotting (plt.ylim(img_h, 0)), the rotation direction is flipped. The angle should likely be: -rot[gid, 0] * 180 / np.pi instead of: rot[gid, 0] * 180 / np.pi

Relevant lines:

for gid in range(len(xy)):
ellipse = Ellipse(xy=(x[gid], y[gid]), width=scale[gid, 0], height=scale[gid, 1],
angle=rot[gid, 0]*180/np.pi, alpha=alpha, ec=None, fc=curr_feat[gid], lw=None)
ax.add_patch(ellipse)

Hope it helps,
Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions