OpenPathView / OPV_Tasks

GNU General Public License v3.0
0 stars 2 forks source link

Ensure images orientation #39

Open Benvii opened 6 years ago

Benvii commented 6 years ago

Ensure that hugin always put for instance APN1 at the center of the equirectangular projection (compute the "lacet"). We might have an offset, if so we will need to add this information to the panorma table in the database.

Benvii commented 6 years ago

Optimise reference image is set to the image 0 in the project base file (base.pto), this means that the APN3.JPG (which is the first image in the project file) is used as a reference. https://github.com/OpenPathView/OPV_Tasks/blob/stable/opv_tasks/ressources/base.pto#L42

According to the documentation this image will no move during optimisation :

By selecting an image in the images table and via right-click Anchor this image for position you can indicate that a particular image shouldn't move when optimising the positions in the panorama. Only one image can be the anchor, and by default this is the first image in the project. 

The position is set to r0 p0 y0, yaw 0 is the center of the final projection (canvas) (cf the documentation here) :

Yaw, Pitch and Roll values of a source image always refer to the optical axis[*]. An image positioned in Yaw=0 and Pitch=0 means the source image optical axis[*] is in the canvas center. Please note that the actual source image center does not need to match the optical axis[*] due to Lens shift correction. Hence the image boundaries of an image with Yaw=0 and Pitch=0 need not to be centered on the result canvas. Other lens correction parameters don't affect image positioning since they are performed symmetrically around the optical axis. 

This ensure that we will always have APN3 at the center of the final projection, which means having APN3 center at Yaw:0 in Pannellum also.

Moreover, we know the APN2 center direction 89° clockwise relatively from the compass heading direction. Camera are numbered counterclockwise (we could say if we look from over the photo head that APN3 is a the left of APN2), as it's a pentagone the angle between direction of APN2 to APN3 is 72 degrees. So APN3 is at 17° degree (clockwise) from compass heading.

Finally, we could say that the center of the canvas/panorama/equirectangular (meaning yaw=0) is at {campass bearing } + 17°.

A complete representation here : 2018-8-12_33712

I will test it this afternoon and try to take more pictures with rederbro to check if it's good or not.

Benvii commented 6 years ago

Has we don't know if the heading of the compass is really passing though the center of the photo head it's difficult to find the right angle. The easiest way to determine it is to take some pictures (10 pictures for instance) with a real compass in front of the APN3 and then calibrate/estimate the angle.

I can't do it know as Rederbro isn't fully functional (one of the camera's regulator is down), it will be replace in 2-3 days, so I'll do it Thursday or Friday. We might also take pictures this weekend.

Benvii commented 6 years ago

I have termined that the GPS antenna magnetic fixation has impact on the compass, deviation from 10 to 25 degrees (maybe more) depending on it's position on the photo head. As the GPS antenna is poorly fixed, so not always at the same position we can't rely on past compass data for the test images and in the future I will simply remove the antenna to ensure compass data aren't polluted or replace it with the other antenna we have.

Comparing compass value with a real compass I also noticed that the compass in not correctly monted, indeed our compass is upside down, it's not a critical issue but we need to compensate it ( correctedAngle = 360 - upsideDownCompassAngle . This should be done in rederbro script https://github.com/OpenPathView/reder-bro/issues/4