PanoTools NG:
Re: Panotools rounding bug?
Steinar Midtskogen steinar@... 2014-Dec-13 12:47:52
"Bruno Postle #removed# [PanoToolsNG]"
<#removed#> writes:
> On 12 December 2014 19:39:51 GMT+00:00, Steinar Midtskogen wrote:
>>
>>A minimal .pto file to reproduce this issue is:
>>
>>$ cat x.pto
>>p f2 w360 h180 v360
>>i w1000 h1000 f20 p90
>>
>>$ echo 0 180 90 180 180 180 270 180 | pano_trafo -r x.pto 0 2> /dev/null
>>499.412993 489.530032
>>489.530032 499.587007
>>499.587007 509.469968
>>509.469968 499.412993
>>
>>The expected result should be 500 500 for all four points. But I get
>>points circled around 499.5 499.5 instead.
>
> It certainly looks like a bug to me, is there a similar problem at the
> nadir?
Yes.
$ cat > x.pto << EOF
p f2 w360 h180 v360
i w1000 h1000 f4 v180 p-90
EOF
$ echo 0 180 90 180 180 180 270 180 | pano_trafo -r x.pto 0 2> /dev/null
499.524241 496.722328
502.277672 499.524240
499.475759 502.277672
496.722328 499.475760
$ echo 0 179.5 90 179.5 180 179.5 270 179.5 | pano_trafo -r x.pto 0 2> /dev/null
499.500000 499.500000
499.500000 499.500000
499.500000 499.500000
499.500000 499.500000
The subtraction of 0.5 appears to happen for x as well.
An error of half a pixel is not much (though quite significant for me
since I'm not using pixels but degrees), but it could perhaps negatively
impact the matching algorithm. While a workaround is to increase the
output resolution, it would be nice to get this fixed. Is
https://bugs.launchpad.net/hugin/ the right place to report it?
I'll have a look at the source code repository and look for suspicious
+/- 0.5. My guess is that that +/- 0.5 is added explicitly somewhere
(twice, symmetrically), but it was probably added for a reason, and it
would be great if the one who wrote this could weigh in.
--
Steinar
------------------------------------
Posted by: Steinar Midtskogen <#removed#>
------------------------------------
--
<*> Wiki: http://wiki.panotools.org
<*> User Guidelines: http://wiki.panotools.org/User_Guidelines
<*> Nabble (Web) http://panotoolsng.586017.n4.nabble.com/
<*> NG Member Map http://www.panomaps.com/ng
<*> Moderators/List Admins: #removed#
------------------------------------
Yahoo Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/PanoToolsNG/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/PanoToolsNG/join
(Yahoo! ID required)
<*> To change settings via email:
#removed#
#removed#
<*> To unsubscribe from this group, send an email to:
#removed#
<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/