Forum

Author Topic: Auto rotate images in portrait orientation?  (Read 11181 times)

Mr_Curious

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
Auto rotate images in portrait orientation?
« on: December 10, 2012, 03:04:51 PM »
I'm curious,

Some DSLR's such as those by Canon have an auto rotate option where by the image will be automatically rotated if the camera has been placed in a portrait orientation.

Is there any best practice regarding this in respect to agisoft?  If my DSLR's offer this function should it be enabled or not if my cameras are used in a portrait orientation rather than landscape?

I'm thinking that it should be enabled :-)

Opinions?

Greetings,

Mr. Curious
« Last Edit: December 10, 2012, 03:42:45 PM by Mr_Curious »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14846
    • View Profile
Re: Auto rotate images in portrait orientation?
« Reply #1 on: December 10, 2012, 04:12:19 PM »
Hello Mr. Curious,

It is not important if this option turned on or not.
The important thing is not to rotate the image in the external editors and load only original images to PhotoScan.
Best regards,
Alexey Pasumansky,
Agisoft LLC

maddin

  • Full Member
  • ***
  • Posts: 161
    • View Profile
Re: Auto rotate images in portrait orientation?
« Reply #2 on: November 11, 2013, 07:21:52 PM »
I have the same question. I took .CR2 RAW pictures in Portrait orientation (the camera shutter button high up towards the sky) and the camera itself or the RAW converter have rotated them such that the image displays correctly on the monitor.

Now Photoscan is displaying the blue camera planes rotated by 90 degrees (i.e. in landscape orientation relative to the point cloud) after alignment, which seems incorrect to me?

Looking at the EXIF data of the RAW image using exiftool, I see:

Orientation                     : Rotate 270 CW
Image Width                     : 5184
Image Height                    : 3456

Any ideas why PS shows the camera in the wrong orientation?

Thanks
Martin

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14846
    • View Profile
Re: Auto rotate images in portrait orientation?
« Reply #3 on: November 11, 2013, 07:34:17 PM »
Dear Martin,

Could you please check what information is displayed under the image thumbnail in the Workspace pane?

Probably the software converter you are using applies the rotation (indicated in the RAW EXIF data) to the image, it is not acceptable.
Best regards,
Alexey Pasumansky,
Agisoft LLC

maddin

  • Full Member
  • ***
  • Posts: 161
    • View Profile
Re: Auto rotate images in portrait orientation?
« Reply #4 on: November 12, 2013, 10:17:00 PM »
Edit (was using the wrong scene):

The thumbnail says 'Dimensions: 3456 x 5184' and displays the image in Portrait mode.

FWIW, I use Adobe Bridge to convert the .CR2 RAW images into TIFs, and already the .CR2 thumbnails are shown in Portrait mode.

Martin
« Last Edit: November 12, 2013, 10:27:29 PM by maddin »

xplorer

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Auto rotate images in portrait orientation?
« Reply #5 on: May 26, 2018, 04:08:23 PM »
having the same issue, but i can't see anything in the exifs concerning a rotation.

once it's done, how can you reset the image rotation ?

I mean, i use DXO to edit my Raws, but the orientation is set to "original", so there isn't even a rotation or an auto rotation applied, yet, photoscan tells me the same message as you .... What can i edit ?

ruyi7952

  • Full Member
  • ***
  • Posts: 104
    • View Profile
    • My Blog
Re: Auto rotate images in portrait orientation?
« Reply #6 on: May 27, 2018, 08:14:15 AM »
Same question, I'm testing some methods.
« Last Edit: May 27, 2018, 10:31:08 AM by ruyi7952 »
Real Scene Model Professional Contractor

Collect、Process、Publish

Shadow

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • My 3D scans on Sketchfab
Re: Auto rotate images in portrait orientation?
« Reply #7 on: November 02, 2018, 06:32:53 AM »
Has anyone found a way to deal with this issue ?

I have the same question.  :-\
- My photos always have orientation data, since my camera (Sony A7RII) doesn't allow me to disable this ;
- There doesn't seem to be any way to tell Lightroom not to use this data when importing/exporting pictures, therefore my photos end up having various orientations when I import them in Photoscan.


Dave Martin

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: Auto rotate images in portrait orientation?
« Reply #8 on: November 02, 2018, 11:48:50 AM »
Shadow,

I don't believe the orientation - whether when it is captured, or when it is presented to PhotoScan - makes a blind bit of difference; the important thing is the minimum molestation of the images once they're shot.

Most of my UAV work is flown with either an NEX-5 or an A6300, and if I'm just flying one pattern, with nadir shots, I will try and keep the camera so that the gimbal keeps the camera aligned with the track so that side-lap and overlap along the track remain constant. If I then fly a second pattern at ninety degrees, I'll have the gimbal aligned with those tracks - so some images will be at ninety degrees to others; and, for example I grid with oblique shots, or circle a point of interest, the images will not be all co-aligned.

Photographing structures terrestrially, I will have a range of orientations; although I do try to keep to either 'portrait' or 'landscape' orientation; in fact CHI recommend for objects and facades etc. that multiple orientations are captured (equivalent of flying a cross-grid with a UAV) - details about 2/3 way down this page http://culturalheritageimaging.org/Technologies/Photogrammetry/index.html

So, my take is - varied orientation doesn't cause a problem and may well improve the final result; but key is to absolutely minimise changing the image before processing it.

Dave

macsurveyr

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: Auto rotate images in portrait orientation?
« Reply #9 on: November 03, 2018, 09:08:57 PM »
Hello

This is an important issue. If at all possible, turn off autorotation on the camera. Since that is not always possible, or is sometimes overlooked, there can be issues such as several of you have noted.

First scenario. Autorotation is on and the images from the camera have the orientation flag set. Importing those images directly into Metashape will be just fine. There will be only one camera created since Metashape understands and honors the orientation flag as it should.

Second scenario. Autorotation is on and the RAW images from the camera are processed using Bridge, Lightroom, DxO or any other RAW processing software. If the images appear rotated in the RAW processing software, then there will be issues. The images will be exported in the orientation that they appear at, but will have a new orientation flag set to 1, meaning zero rotation, no matter what the original orientation flag was. When imported into Metashape, rotated images will have the image width and height swapped and will be imported as a different camera than the landscape images.

The easiest, most efficient way to deal with the issue is to in fact destroy the orientation flag in the RAW file BEFORE you import into the RAW processing software. When I say destroy, I mean set the orientation flag to no value.

The exiftool to command to change a DNG orientation flag to nothing is

exiftool -Orientation= SOMEFILE.DNG

As Dave said, it is actually beneficial to have images rotated relative to each other as long as all images are properly grouped together as a single camera.

The orientation flag is evil. Destroy it before processing RAW files.

Tom

Darko

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • CADCOM
Re: Auto rotate images in portrait orientation?
« Reply #10 on: November 04, 2018, 01:21:38 PM »
That problem came with Sony A6000 and all newer Sony cameras. Auto rotation disabling doesn't do anything. The problem is that camera moves it's origin point depending on the pitch angle. It is written in the EXIF of each image and it must be rewritten before processing with Metashape. For that I am using IBatch that can edit all the photos at once in the batch mode and it is not expensive.
« Last Edit: November 04, 2018, 01:26:23 PM by Darko »

Shadow

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • My 3D scans on Sketchfab
Re: Auto rotate images in portrait orientation?
« Reply #11 on: November 07, 2018, 10:44:04 PM »
Indeed, this issue is quite annoying when shooting with a Sony camera, since there's no way to really disable auto-rotation.

Quote
Second scenario. Autorotation is on and the RAW images from the camera are processed using Bridge, Lightroom, DxO or any other RAW processing software.
This is the scenario I'm in, since I usually tweak the photos a little bit in Lightroom before importing them in Photoscan/Metashape. I obviously don't touch the lens distorsions since this should be avoided at all cost, but I usually correct the chromatic aberrations, sometimes the color temperature and noise (not sure if this is a good idea for the first part of the process, but the textures created by Photoscan/Metashape seem to be cleaner if I correct the noise & chromatic aberrations).

I followed Tom's advice and I used exitool (for other people who might be reading this thread : you can download it here https://www.sno.phy.queensu.ca/~phil/exiftool/ )

I just successfully tried this workflow with a bunch of Sony RAW (.ARW) files :
- put all the files that need to be processed in a specific folder, for example C:\correct_rotation\
- using the command line tool, type :
exiftool -Orientation=1 -n -overwrite_original C:\correct_rotation\*.ARW
then press enter.
(exiftool.exe must be in the current file directory of the command tool, or in C:\Windows : personally I'd rather keep it in a specific folder)
- all the ARW files in the C:\correct_rotation\ folder are now "corrected".
( I get a warning for each file :  "Warning: [minor] Entries in SubIFD were out of sequence. Fixed.". Looks like some of Sony's own metadata might not be in the right order. Lightroom doesn't seem to see any difference, so I guess it doesn't really matter.)
- Import the C:\correct_rotation\ folder in Lightroom (which in my case will move the files, convert them to *.DNG files) : they all have the same orientation.

Then I'm free to do whatever I need to do in Lightroom, and export everything as TIFF or JPG and use the result in Photoscan/Metashape.

Quote
CHI recommend for objects and facades etc. that multiple orientations are captured (equivalent of flying a cross-grid with a UAV) - details about 2/3 way down this page http://culturalheritageimaging.org/Technologies/Photogrammetry/index.html
Very interesting, I usually try to keep the same orientation but if this can improve the results I'll give it a try.

Thanks for your answers !
« Last Edit: November 07, 2018, 11:29:52 PM by Shadow »