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

[ui] Viewer2D: support all Exif orientation tags #1857

Merged
merged 4 commits into from Jan 14, 2023

Conversation

mugulmd
Copy link
Contributor

@mugulmd mugulmd commented Dec 29, 2022

Description

The goal of this PR is to support all Exif orientation tags in the 2D viewer, which only handles tags 6 and 8 at the moment.

We also solved a bug with the features viewer not being at the right position with some orientation tag (noticed with orientation tag 6):
orientation_bug_small

Implementation remarks

Historically the 8bit viewer had to be handled differently than the other viewers because it is backed by Qt Images which handle orientation at the C++ level (therefore in the qtAliceVisionImageIO plugin in our case).
This automatic transform has been disabled to make sure we can control all viewers with the same mechanism.

Tests

The float viewer, 8bit viewer and features viewer have been tested on all Exif orientations (including images with no orientation metadata) on several datasets.

@mugulmd mugulmd self-assigned this Dec 29, 2022
@mugulmd mugulmd marked this pull request as ready for review December 29, 2022 16:41
Copy link
Contributor

@cbentejac cbentejac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this PR with the following images (https://github.com/recurser/exif-orientation-examples) and I noticed some issues for orientations 5 to 8, both in portrait and landscape images.

In landscape, the images with orientation tags of 5 and higher are "zoomed out" and displaced (not centered in the viewer). In portrait, it is the opposite: images with orientation tags of 5 and higher are "zoomed in".

I haven't checked in details where this might be coming from (maybe there is a specific issue with these images). With regular random images of different orientations, I didn't notice such an obvious displacement (but I noticed that images in general seem to be zoomed in, although it seems that this already occurred on the "develop" branch), and the feature viewer displacement that occurred for orientation tag 6 was fixed.

@mugulmd
Copy link
Contributor Author

mugulmd commented Jan 3, 2023

I tested this PR with the following images (https://github.com/recurser/exif-orientation-examples) and I noticed some issues for orientations 5 to 8, both in portrait and landscape images.

In landscape, the images with orientation tags of 5 and higher are "zoomed out" and displaced (not centered in the viewer). In portrait, it is the opposite: images with orientation tags of 5 and higher are "zoomed in".

I haven't checked in details where this might be coming from (maybe there is a specific issue with these images). With regular random images of different orientations, I didn't notice such an obvious displacement (but I noticed that images in general seem to be zoomed in, although it seems that this already occurred on the "develop" branch), and the feature viewer displacement that occurred for orientation tag 6 was fixed.

Should be fixed now :)

@fabiencastan fabiencastan added this to the Meshroom 2022.1.0 milestone Jan 3, 2023
@fabiencastan fabiencastan merged commit 2c7547e into develop Jan 14, 2023
@fabiencastan fabiencastan deleted the mug/exifOrientation branch January 14, 2023 21:25
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

Successfully merging this pull request may close these issues.

None yet

3 participants