Two problems with a map

82 views
Skip to first unread message

paul womack

unread,
Jun 19, 2017, 6:01:16 AM6/19/17
to hugi...@googlegroups.com
I took a pano set of a map recently, using a pano head, from only
3 feet away from the map.

The control points and optimisation aren't perfect, but they're
OK (for the moment). My real show stoppers are:

1) Barrel distortion

http://i48.photobucket.com/albums/f234/bugbear33/misc/barrel.jpg

my previous experience with hugin (several years) has never
shown this issue, which should (I thought...) be simple correctable
by a projection change. The current output projection is rectilinear.

I have done previous maps (albeit smaller) using this technique
with no barrel distortion (quick check; working
map FOV 79 x 53)

problem map FOV 59 x 49.

2) Rotation;

I've accidently created the CP's 90 degrees "wrong".
I'd be happy just to rotate the map, but I've added a load
of horizontal and vertical line CPs.

I've tried rotating the image in Move/Drag but if I subsequently
call the optimiser it happily undoes my rotate!

BugBear

Greg 'groggy' Lehey

unread,
Jun 19, 2017, 7:52:33 PM6/19/17
to hugi...@googlegroups.com
On Monday, 19 June 2017 at 11:01:10 +0100, paul womack wrote:
> I took a pano set of a map recently, using a pano head, from only
> 3 feet away from the map.
>
> The control points and optimisation aren't perfect, but they're
> OK (for the moment). My real show stoppers are:
>
> 1) Barrel distortion
>
> http://i48.photobucket.com/albums/f234/bugbear33/misc/barrel.jpg

Sorry, it seems that this site wants me to disable my ad blocker. Can
you put it elsewhere?

Greg
--
Sent from my desktop computer.
Finger groo...@gmail.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed. If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA
signature.asc

bugbear

unread,
Jun 22, 2017, 10:05:26 AM6/22/17
to hugi...@googlegroups.com
Greg 'groggy' Lehey wrote:
> On Monday, 19 June 2017 at 11:01:10 +0100, paul womack wrote:
>> I took a pano set of a map recently, using a pano head, from only
>> 3 feet away from the map.
>>
>> The control points and optimisation aren't perfect, but they're
>> OK (for the moment). My real show stoppers are:
>>
>> 1) Barrel distortion
>>
>> http://i48.photobucket.com/albums/f234/bugbear33/misc/barrel.jpg
>
> Sorry, it seems that this site wants me to disable my ad blocker. Can
> you put it elsewhere?

Does this one work?

http://woodworkinfo.site88.net/barrel.JPG

BugBear

Roger Broadie

unread,
Jun 22, 2017, 11:56:52 AM6/22/17
to hugi...@googlegroups.com
Hello Paul,

I was a little surprised at the idea that Hugin could output a
panorama defined to be rectilinear but which would show with the
barrel distortion apparent in your stitch. So I tried converting your
output from all the list of allowable output formats to rectilinear.
Assuming the starting point was a fisheye seems to work well, at least
as far as the side (long) edges are concerned.. There was still
curvature in the top (short) edges, which I cured with a panini
general projection, adjusting the top and bottom sliders. Whether the
horizontal/vertical aspect ratio is correct, I cannot say, but the
writing in the tables looks unstretched in either dimension as far as
one can see at the available resolution. The pto file and output are
attached. I chose an hfov of 59 degrees, but there may be a better
angle.

So my question would be, whatever you may have thought, did you
actually choose a rectilinear output projection?

I don't find the rotation behaviour you mention surprising. Surely,
optimising will allow the horizontal and vertical lines you have
defined to reassert themselves and undo your hand rotation. The moral
would appear to be, either to swap all the horizontal and vertical
line-types, or, it that's too boring, to do all your optimisation
first and then rotate by hand, which is probably what you did.

Roger Broadie
> --
> A list of frequently asked questions is available at:
> http://wiki.panotools.org/Hugin_FAQ
> --- You received this message because you are subscribed to the Google
> Groups "hugin and other free panoramic software" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to hugin-ptx+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/hugin-ptx/5947A0E6.60704%40papermule.co.uk.
> For more options, visit https://groups.google.com/d/optout.
barrel - fisheye g.jpg
barrel - fisheye.pto

bugbear

unread,
Jun 22, 2017, 12:26:30 PM6/22/17
to hugi...@googlegroups.com
Roger Broadie wrote:
> Hello Paul,
>
> I was a little surprised at the idea that Hugin could output a
> panorama defined to be rectilinear but which would show with the
> barrel distortion apparent in your stitch.

I attached my pto file as evidence in my defence :-)

> So I tried converting your
> output from all the list of allowable output formats to rectilinear.
> Assuming the starting point was a fisheye seems to work well, at least
> as far as the side (long) edges are concerned.. There was still
> curvature in the top (short) edges, which I cured with a panini
> general projection, adjusting the top and bottom sliders. Whether the
> horizontal/vertical aspect ratio is correct, I cannot say, but the
> writing in the tables looks unstretched in either dimension as far as
> one can see at the available resolution. The pto file and output are
> attached. I chose an hfov of 59 degrees, but there may be a better
> angle.
>
> So my question would be, whatever you may have thought, did you
> actually choose a rectilinear output projection?

My current pto is attached.

>
> I don't find the rotation behaviour you mention surprising. Surely,
> optimising will allow the horizontal and vertical lines you have
> defined to reassert themselves and undo your hand rotation. The moral
> would appear to be, either to swap all the horizontal and vertical
> line-types, or, it that's too boring, to do all your optimisation
> first and then rotate by hand, which is probably what you did.

No - since I wanted hugin to optmise "properly" I allowed it to move
the "anchor" image in YPR; in conjunction with H and V CP pairs,
this has always (up until now) worked well to regularise
images of 2D rectangular objects, compensating for the camera
either being off-centre, or pointing off centre.

I have successfully captured maps before using this approach
and am currently rather baffled as to my current failure.

BugBear
estate_map.pto

T. Modes

unread,
Jun 22, 2017, 12:55:17 PM6/22/17
to hugin and other free panoramic software


Am Donnerstag, 22. Juni 2017 18:26:30 UTC+2 schrieb bugbear:

My current pto is attached.

I had a short look on it, the main problem is probably the wrong fov. (really shoot with a 35 mm equivalent focal length of 120 mm from 1 m distance?).
When I increase the fov the horizontal and vertical lines better line up.

bugbear

unread,
Jun 23, 2017, 4:07:28 AM6/23/17
to hugi...@googlegroups.com
T. Modes wrote:
>
>
> Am Donnerstag, 22. Juni 2017 18:26:30 UTC+2 schrieb bugbear:
>
>
> My current pto is attached.
>
> I had a short look on it, the main problem is probably the wrong fov. (really shoot with a 35 mm equivalent focal length of 120 mm from 1 m distance?).

It really was shot that way, to get high resolution. 1m is as high above the table as my tripod would go.

It is possible I have parallax errors, since my pano head is built (literally) for my lens at "full wide"
(around 35mm equiv), but since the map is pretty much a 2D item, this should
have minimal consequences.

> When I increase the fov the horizontal and vertical lines better line up.

Intriguing. I'm happy to do "whatever it takes" to get a good result,
but it seems wrong that I have to lie to hugin in such a (I think)
simple circumstance.

I would have thought (perhaps wrongly) that the maths should "just work".

BugBear

T. Modes

unread,
Jun 24, 2017, 2:55:44 AM6/24/17
to hugin and other free panoramic software


Am Freitag, 23. Juni 2017 10:07:28 UTC+2 schrieb bugbear:
Intriguing. I'm happy to do "whatever it takes" to get a good result,
but it seems wrong that I have to lie to hugin in such a (I think)
simple circumstance.

I would have thought (perhaps wrongly) that the maths should "just work".

Could you post one image of the set so I could have a look at the reading of the EXIF data?

Thomas

Roger Broadie

unread,
Jun 24, 2017, 6:33:23 AM6/24/17
to hugi...@googlegroups.com
Sorry, Paul, you are absolutely right and your pto file shows you had
indeed chosen a rectilinear output projection. So the barrel
distortion visible in your output remains to be sorted out.

To view your pto file in Hugin's graphical interface I had to create a
series of blank dummy images. They don't contain any content, but the
pto file does include control points that can be seen in the fast
preview preview window, as shown in screenshot 1, attached. I found
it quite illuminating. At first I thought the little fan of h lines
visible at the top left must be a mistake, but then I realised it was
actually consistent with the bowed shape of the lines you had added to
emphasize the edges of the map. In fact, I don't think your h and v
lines force all the edges to be straight, because they often don't
exclude the possibility of bowing of the edges between the specified
points. If your choices have worked in the past I suspect that is
more because the presence of neighbouring normal control points has
kept the edges straight.

I did try swapping the line types of the horizontal and vertical lines
and found that reoptimising them turned the stitched image through 90
degrees, to make the orientation portrait rather than landscape. At
the same time I did a little trimming of control points, because the
preview showed rather a lot of red crosses, and added some more
parameters to optimise, which, you will not be surprised to learn,
included making X, Y and Z generally optimisable. I've attached the
revised pto file and resultant preview (screenshot 2). Probably there
are now too few control points and extra need to be added, but one
needs the originals for that.

What is interesting is that the h lines (now v lines) on the left edge
now form a single straight line. I should be disappointed if the
corresponding edge is not now sorted out, though the other the others,
especially that on the right, may need more work. I suspect it would
be worthwhile, if more laborious, to add conventional h and v lines
each defined within a single edge image (i.e. with the same image in
both frames of the control point window - 0,0, 1,1 etc).

It rather looks to me as though the problem here are not due to some
strange property of Hugin, but rather, less dramatically, difficulties
in defining control points and managing the stitching process.

Roger Broadie
> --
> A list of frequently asked questions is available at:
> http://wiki.panotools.org/Hugin_FAQ
> --- You received this message because you are subscribed to the Google
> Groups "hugin and other free panoramic software" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to hugin-ptx+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/hugin-ptx/594BEFAF.6040907%40papermule.co.uk.
Screenshot 1.jpg
Screenshot 2.jpg
estate_mapR.pto

Roger Broadie

unread,
Jun 24, 2017, 10:04:54 AM6/24/17
to hugi...@googlegroups.com
In the meantime I've had a little think about Thomas Modes's
discomfort about the lens's field of view. I think it may help us to
the simplest explanation of Paul Womack ("bugbear")'s problem.

I took Paul's pto file and reoptimised the lens parameters. Instead
of the indicated hfov of 16.5 I got a value of 37.2 (with a, b and c
included in the optimisation - optimising just the hfov gave no
change). As far as I could see from the fast preview window with the
control points shown it was a good stitch.

Of course, that was for a landscape-mode output. When I turned to my
portrait-mode
modification and repeated the process the hfov of 16.5 was virtually
unchanged at 16.3. Paul told us initially (19 June) that he had
originally confused the orientation of the control points. Might he
have used a value for the hfov appropriate to a portrait-aspect lens
when working with landscape aspect images?

Roger Broadie

Paul Womack

unread,
Jun 24, 2017, 12:34:38 PM6/24/17
to hugi...@googlegroups.com
I think you (and T Modes) may have found the issue.

The camera was pointing STRAIGHT DOWN when the shots were taken, so its angle sensor reading would have been meaningless.

I shall check the exif of these images against more "normal" samples from other shooting sessions, and see what I find. If needed, I will force the vert/port sensor reading in the files to tell the truth (or at least my version of the truth).

Thanks to both - I shall report back.

    BugBear


>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/hugin-ptx/594BEFAF.6040907%40papermule.co.uk.
>>
>> For more options, visit https://groups.google.com/d/optout.

--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hugin-ptx+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/CAHQACeosbCXt1%2B6rwGbk%3Dp4MvHXj3oiQYKHcjOqht9dD9JqOiw%40mail.gmail.com.

paul womack

unread,
Jun 30, 2017, 5:57:33 AM6/30/17
to hugi...@googlegroups.com
Paul Womack wrote:
> I think you (and T Modes) may have found the issue.
>
> The camera was pointing STRAIGHT DOWN when the shots were taken, so its angle sensor reading would have been meaningless.
>
> I shall check the exif of these images against more "normal" samples from other shooting sessions, and see what I find. If needed, I will force the vert/port sensor reading in the files to tell the truth (or at least my version of the truth).
>
> Thanks to both - I shall report back.

OK; I have some info.

In the original (flawed) set, the Hfov(v) was 16.5;
this show in the GUI on the Photos tabs as
Focal Length: 25.03, Focal length multiplier 4.769

I attempted to optimise Hfov(v), but nothing came of it.
I then simply tweaked it, and fairly rapidly converged on 38
as the angle that gives the straightest borders.

(I had other issues with blending, which I'll post separately).

I've cut and pasted the result of exiftool -S on one of the images.
I note (with interest) the "FOV: 38.4 deg"

BugBear

ExifToolVersion: 9.46
FileName: IMG_1096.JPG
Directory: .
FileSize: 2.7 MB
FileModifyDate: 2017:06:12 15:54:40+01:00
FileAccessDate: 2017:06:30 10:45:12+01:00
FileInodeChangeDate: 2017:06:19 10:36:41+01:00
FilePermissions: rw-r--r--
FileType: JPEG
MIMEType: image/jpeg
ExifByteOrder: Little-endian (Intel, II)
Make: Canon
Model: Canon PowerShot A630
Orientation: Horizontal (normal)
XResolution: 180
YResolution: 180
ResolutionUnit: inches
ModifyDate: 2017:06:12 12:03:14
YCbCrPositioning: Centered
ExposureTime: 1/5
FNumber: 8.0
ExifVersion: 0220
DateTimeOriginal: 2017:06:12 12:03:14
CreateDate: 2017:06:12 12:03:14
ComponentsConfiguration: Y, Cb, Cr, -
CompressedBitsPerPixel: 5
ShutterSpeedValue: 1/5
ApertureValue: 8.0
MaxApertureValue: 3.2
Flash: Off, Did not fire
FocalLength: 10.8 mm
MacroMode: Normal
SelfTimer: 5 s, Custom
Quality: Superfine
CanonFlashMode: Off
ContinuousDrive: Single
FocusMode: Single
RecordMode: JPEG
CanonImageSize: Large
EasyMode: Manual
DigitalZoom: None
Contrast: Normal
Saturation: Normal
Sharpness: 0
CameraISO: 80
MeteringMode: Evaluative
FocusRange: Auto
AFPoint: Auto AF point selection
CanonExposureMode: Manual
LensType: Unknown (-1)
MaxFocalLength: 29.2 mm
MinFocalLength: 7.3 mm
FocalUnits: 1000/mm
MaxAperture: 3.2
MinAperture: 8
FlashBits: (none)
FocusContinuous: Single
AESetting: Normal AE
ZoomSourceWidth: 3264
ZoomTargetWidth: 3264
SpotMeteringMode: Center
ManualFlashOutput: n/a
FocalType: Zoom
FocalPlaneXSize: 7.44 mm
FocalPlaneYSize: 5.59 mm
AutoISO: 100
BaseISO: 79
MeasuredEV: 9.91
TargetAperture: 8
TargetExposureTime: 1/5
ExposureCompensation: 0
WhiteBalance: Daylight
SlowShutter: Off
SequenceNumber: 0
OpticalZoomCode: 3
FlashGuideNumber: 0
FlashExposureComp: 0
AutoExposureBracketing: Off
AEBBracketValue: 0
ControlMode: Camera Local Control
FocusDistanceUpper: 0.72 m
FocusDistanceLower: 0 m
BulbDuration: 0
CameraType: Compact
AutoRotate: None
NDFilter: Off
SelfTimer2: 0
FlashOutput: 0
CanonImageType: IMG:PowerShot A630 JPEG
CanonFirmwareVersion: Firmware Version 1.00
FileNumber: 101-1096
OwnerName:
ISO: 75
Rotation: 0
CameraTemperature: 24 C
CanonModelID: PowerShot A630
AFAreaMode: Multi-point AF or AI AF
NumAFPoints: 9
ValidAFPoints: 9
CanonImageWidth: 3264
CanonImageHeight: 2448
AFImageWidth: 1088
AFImageHeight: 409
AFAreaWidths: 196 196 196 196 196 196 196 196 196
AFAreaHeights: 74 74 74 74 74 74 74 74 74
AFAreaXPositions: -196 0 196 -196 0 196 -196 0 196
AFAreaYPositions: -75 -75 -75 0 0 0 75 75 75
AFPointsInFocus: 5
PrimaryAFPoint: 5
ThumbnailImageValidArea: 0 0 0 0
DateStampMode: Off
MyColorMode: Off
FirmwareRevision: 1.00 rev 3.00
Categories: (none)
ImageUniqueID: 4cda7c5348f0e378640ccbafc1e9297f
UserComment:
FlashpixVersion: 0100
ColorSpace: sRGB
ExifImageWidth: 3264
ExifImageHeight: 2448
InteropIndex: R98 - DCF basic file (sRGB)
InteropVersion: 0100
RelatedImageWidth: 3264
RelatedImageHeight: 2448
FocalPlaneXResolution: 11412.58741
FocalPlaneYResolution: 11439.25234
FocalPlaneResolutionUnit: inches
SensingMethod: One-chip color area
FileSource: Digital Camera
CustomRendered: Normal
ExposureMode: Manual
DigitalZoomRatio: 1
SceneCaptureType: Standard
Compression: JPEG (old-style)
ThumbnailOffset: 5120
ThumbnailLength: 1928
ImageWidth: 3264
ImageHeight: 2448
EncodingProcess: Baseline DCT, Huffman coding
BitsPerSample: 8
ColorComponents: 3
YCbCrSubSampling: YCbCr4:2:2 (2 1)
Aperture: 8.0
DriveMode: Self-timer Operation
ImageSize: 3264x2448
Lens: 7.3 - 29.2 mm
LensID: Unknown 7-29mm
ScaleFactor35efl: 4.8
ShootingMode: Manual
ShutterSpeed: 1/5
ThumbnailImage: (Binary data 1928 bytes, use -b option to extract)
CircleOfConfusion: 0.006 mm
FOV: 38.4 deg
FocalLength35efl: 10.8 mm (35 mm equivalent: 51.7 mm)
HyperfocalDistance: 2.33 m
Lens35efl: 7.3 - 29.2 mm (35 mm equivalent: 34.8 - 139.2 mm)
LightValue: 8.7

bugbear

unread,
Jun 30, 2017, 6:15:28 AM6/30/17
to hugi...@googlegroups.com
Oh. Dear.

I just loaded one of the shots into a fresh project,
and Hugin shows Hfov(v) 38.

It looks like the fault may well be all of my own making,
and not Hugin's at all.

I'm wondering if I did an ill advise optimise that included the FOV early
on, and forgot about it.

BugBear (off to hang his head in shame)
Reply all
Reply to author
Forward
0 new messages