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

Rotation scaling difference #27

Open
umerhasan17 opened this issue Jan 21, 2021 · 1 comment
Open

Rotation scaling difference #27

umerhasan17 opened this issue Jan 21, 2021 · 1 comment

Comments

@umerhasan17
Copy link

I came across this useful library however, I noticed some unexpected behaviour when I applied the examples to my images. Unfortunately, in the example below, it seems that not only is the image being rotated it is also being scaled down. It also seems the bounding box doesn't get scaled-down alongside the image.

The problem seems to be particularly prevalent with rotations.

Here is the code for generating both images:

bboxes = np.array([list(details[image_name]['bbox'][0].values())[1:]], dtype=float)
print(bboxes)
img = cv2.imread(data_dir + "images/" + image_name + ".jpg")
plotted_img = draw_rect(img, bboxes)
plt.imshow(plotted_img)
plt.show()

img1, bboxes1 = RandomRotate(180)(img.copy(), bboxes.copy())
plotted_img = draw_rect(img1, bboxes1)
plt.imshow(plotted_img)
plt.show()

Here are the images:
Imgur

Wondering if one of the authors could offer some explanation (intended effect or bug and why) and/ or a function to modify to fix this.

@HansLau
Copy link

HansLau commented Jun 28, 2021

Hi did u manage to solve this issue?

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

2 participants