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

Merge conversion improvements from custom branch. #5

Merged
merged 2 commits into from
Nov 7, 2019

Conversation

sjuxax
Copy link
Contributor

@sjuxax sjuxax commented Nov 7, 2019

This prevents several lossy conversions in the pipeline and saves out the rectified images with substantially less quality loss. Someday, someone should add options to allow the user finer control over the output level/quality.

Most of these changes were made in June 2018 and I never got around to making a PR for them, so figured I might as well do it now. Changes from upstream have been merged in and commits squashed. See https://github.com/sjuxax/theta_rectify/tree/less-lossy for commit history/details.

Thanks!

This avoids unnecessary quality loss from several jpg-to-jpg conversions.
Internal conversions are done with PNG to prevent quality loss. Final
POVRay output is converted from PNG to JPG at Q90. Ideally, a flag could
be added to use the original PNG output as the final image for users who
want more control over the process.

This re-unifies @sjuxax and @khufkens master. Some comments and minor
tweaks made during the squash. See sjuxax/less-lossy for further commit
history.

Thanks to https://stackoverflow.com/a/12797512/68573 for working inline
comments in bash ;)
@khufkens
Copy link
Owner

khufkens commented Nov 7, 2019

Hi @sjuxax thanks for the additions. Good point in not stacking the jpg to jpg conversions! I'll merge it into master as others can indeed benefit from this.

@khufkens khufkens merged commit f0e1b12 into khufkens:master Nov 7, 2019
@sjuxax
Copy link
Contributor Author

sjuxax commented Nov 9, 2019

Thanks for the merge. I have a MacOS system that I'll test on soon, though with the correction from shellcheck and the previous work from @gerlos I'd expect it to work without issue.

I have a side question here re: the Theta V. Recent photos I've taken are coming straight from the camera with zero values in the Pitch or Roll EXIF tags. It's not in either the normal tags nor the RicohPitch/RicohRoll tags. If I load these into the official desktop app, the option to "Write with top/bottom correction" is grayed out. Since this basically makes the POVRay output a no-op, would it be prudent to prompt, warn, or fail?

Is anyone else seeing this on semi-recent firmwares? I'll try to find the last image I took that had them and pinpoint the version in which they stopped being recorded soon. I can't seem to find an option in either the smartphone app or the official desktop app to toggle Pitch/Roll recording.

@khufkens
Copy link
Owner

A warning on fail would be nice indeed. I don't have a V to test things on. As you mention, this seems more like a bug in firmware than a "feature". I hope this gets fixed soon as this is rather crucial information for lots of applications I think. Thanks for the additions!

@gerlos
Copy link
Contributor

gerlos commented Nov 13, 2019

I did some tests with a Theta V running firmware 3.10.1 (released on 2019-10-24). I confirm that Write with top/bottom correction menu item in desktop app is always grayed out and Pitch and Roll EXIF tags are set to zero:

$ exiftool R0010496.JPG | grep -iE '(pitch|roll)'
Pose Pitch Degrees              : 0.0
Pose Roll Degrees               : 0.0
Ricoh Pitch                     : 0
Ricoh Roll                      : 0

It seems to me that now the orientation correction is done in-camera, perhaps before saving the picture to internal storage (so now is theta_rectify script redundant?).

I tried taking a few shots with camera upside down or laying on it side, and I always got them rectified straight out the camera regardless if I download the images from the smartphone app or via PTP from my laptop.

However, this change is not mentioned in Ricoh changelog.

@khufkens
Copy link
Owner

Ha, interesting. I'll update my S and see what happens. It would make life easy for sure.

@sjuxax
Copy link
Contributor Author

sjuxax commented Nov 13, 2019

Glad to know it's not just me. @gerlos If you have developer mode unlocked, can you get some logcat output when you take a photo? It gives me a lot of errors including a complaint about missing metadata fields. Probably just pieces of the app that were not updated to anticipate in-camera correction, but would be nice to confirm.

@gerlos
Copy link
Contributor

gerlos commented Nov 13, 2019

I don't have enabled developer mode so far. I'll give a try this week end. In the meanwhile, I posted a question related to this topic on the official Theta Developer community.

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.

3 participants