How to get makepano to read EXIF comment from Kolor Autopano output

  • When I first started using krpano 8 years ago, I built some tools to decode AutopanoGiga .pano files to extract panorama info, and feed it into my XMLs. With the recent upgrade, I see that krpanotools makepano says it does that if you use autodetect, so I have been looking at replacing my logic with makepano since it will do a better job of building the xml about the pano.

    However, in my first attempt, giving it a panorama with the following comments in the Exif:

    Image Description : ASCII Kolor stitching | 20 pictures | Size: 16021 x 1061 | Lens: Standard | RMS: 2.45 | FOV: 315.83 x 20.35 ~ -7.37 | Projection: Cylindrical | Color: LDR |
    User Comment : ASCII Kolor stitching | 20 pictures | Size: 16021 x 1061 | Lens: Standard | RMS: 2.45 | FOV: 315.83 x 20.35 ~ -7.37 | Projection: Cylindrical | Color: LDR |
    Comment : ASCII Kolor stitching | 20 pictures | Size: 16021 x 1061 | Lens: Standard | RMS: 2.45 | FOV: 315.83 x 20.35 ~ -7.37 | Projection: Cylindrical | Color: LDR |

    Using panotype=autodetect in my config file, it still asks me for a pano type and for the field of view. What do I need to do to get it to use this comment? Also, any idea what the 7.37 is in the comment?

    I still will probably continue to read the data myself since I will use different config file options to makepano based on what class of pano it is. (For example, I like to display wide aspect ratio panos full height, but more square panos I want to fit the window and let them zoom in if they want full height.

    Right now, absent this, I am coding my tool to invoke makepano with the parameters passed on the command line as attributes. I would also like to pass other strings to it, for example, a variable like %BASENAME% that I can use in url templates to define where I want these things to go. In particular, I want to put my tiles and XML in a directory sectionname/%BASENAME% but how do I pass the "sectionname" to makepano so that I can get it inserted in the URLs for the xml and tiles? I see how to define placeholders for the XML template, but is there a way to do this?

    Einmal editiert, zuletzt von bradtem (9. September 2020 um 06:05)

  • Hi,

    Image Description : ASCII Kolor stitching | 20 pictures | Size: 16021 x 1061 | Lens: Standard | RMS: 2.45 | FOV: 315.83 x 20.35 ~ -7.37 | Projection: Cylindrical | Color: LDR |
    User Comment : ASCII Kolor stitching | 20 pictures | Size: 16021 x 1061 | Lens: Standard | RMS: 2.45 | FOV: 315.83 x 20.35 ~ -7.37 | Projection: Cylindrical | Color: LDR |
    Comment : ASCII Kolor stitching | 20 pictures | Size: 16021 x 1061 | Lens: Standard | RMS: 2.45 | FOV: 315.83 x 20.35 ~ -7.37 | Projection: Cylindrical | Color: LDR |

    Using panotype=autodetect in my config file, it still asks me for a pano type and for the field of view. What do I need to do to get it to use this comment?

    That EXIF comments from above should work.
    If not please see me a not working image file for testing.


    Also, any idea what the 7.37 is in the comment?

    The vertical offset from the horizon (voffsetin krpano).

    Btw - EXIF Photosphere XMP metadata is also supported for the automatic panoramic type and fov detection.


    About placeholders - for the XML custom placeholders can be defined this way:
    https://krpano.com/docu/tools/config/#xmltemplate_var

    Templates for output urls can't be defined, but therefore you could directly specify the output url, that means already with your custom path.
    Note - any setting from the config file can be also passed as parameter.

    E.g.

    Code
    krpanotools makepano *.jpg -xmlpath=custompath/%BASENAME%.xml -tilepath=custompath/%BASENAME%.tiles/l%Al[_c]_%Av_%Ah.jpg -previewpath=... -thumbpath=... -htmlpath=...

    Best regards,
    Klaus

  • OK, pounded away at this for quite a while. Still not getting what I want. First, perhaps I should say what I want:

    1. In VR mode, the image should just display as a cylinder, sphere or flat in VR, the "view" largely ignored until we get around to handling zoom.
    2. Almost all my panos are cylinders. If aspect ratio is wide (say >3:1) I wish to begin with the pano fit to height, user has to scroll left and right to see all of pano, but user can also zoom out and view whole pano. Zoom out should stop at the outer dimensions. Zoom in should be set by maxpixelzoom. This applies to 360 panos.
    3. When zoomed out, the pano should look like a "flat" in the browser, it should have no distortions. it becomes a "bowtie" shape if I zoom out which is wrong for a cylinder. However, I can't set it as a flat as then it won't work right in VR.
    4. If hfov=360, it should wrap around, but start fit to height. If you zoom out it should zoom until it now is fit to width.
    5. For non-wide aspect ratios, I may output that as a flat pano.
    6. I have yet to figure out what to do with spheres, I have few of those, so cylinders must work first. My spheres are still mostly partial spheres not all the way to the zenith, but in general I would want to start with a typical "normal" view into the sphere, and let them zoom out a moderate amount. In this case I would expect distortion that is not desired on cylinders.


    As noted, in VR, none of this would apply, the HFOV will be set in the <image> tag to show how to display the partial or 360 pano in VR, but I presume that when we get to being able to zoom in VR, then there will be some adjustment of the <View> to change zoom.

    I have noticed with limitview=auto, it starts with fit to height (good) but you can't zoom out any more. So I am using limitview=fullrange, and that lets me zoom out to fit-to-width, which is also good. In this case, I must set <view fov=xx> where xx is the vertical FOV of the pano to manually make it fit to height. Would be nice if that could be automatic in some fashion, but not a must.

    I set maxpixelzoom to control zoom in at all times.

    I have it mostly working except that when wide panos I get the bowtie. I have tried setting distortion=0 but no effect. On 360 panos the bowtie is so bad that you can't see anything when zoomed out. I include an example of the bowtie in the attachment to this post. (I presume flat would get rid of the bowtie but flat will not work for 360 panos or VR.)

    Other notes: I have been unable to get xmtemplate_var to work to add parameters of my selection. I have tried things like -xmltemplate_var=fov:fov='10' but when I then insert something like <view [FOV] /> into the template, I just get the [FOV] not the tag I am trying to input.

    So instead, I am now building my <view> tag into a temp file, and setting -xmltemplate_view=tmpfile which works, but means I must create and destroy these temp files.

    I notice that while panomake has options to make it silent, and to not prompt on overwrite, so it can be used in scripts, if you don't make it silent it outputs to stdout. That's not usable as stdout has another function in most scripts (it goes into the html I am generating). As such I made a wrapper for krpanotools that redirects stdout to stderr, as I do like the see the output during debugging.

    Unrelated question: Is your voffset negative in sign from the one made by Kolor/Autopano?

    Getting there though -- it's mostly starting to look OK on the browser except the bowties. I thought the distortion was coming from a fisheye setting but now my XML is very simple as below:


    <krpano>

    <view limitview="fullrange" maxpixelzoom="1.5" fov='20.35'/>


    <image hfov="315.83" vfov="20.688280" voffset="-7.37">
    <cylinder url="t%l_%0v_%0h.jpg" multires="1024,15872x1052" />
    </image>


    <preview url="preview.jpg" />

    </krpano>

  • Another unrelated note. I have noticed that when I invoke makepano with -hfov=360.00 and also vfov and voffset, it does not encode these into the <image> tag as it does when other values are used. I presume the default is 360 and that's why it doesn't encode it, but is it OK not to encode the offset?

    BTW, another vote for the option to rebuild the XML but not rebuild the tiles if, for example, the tiles are newer than the source image perhaps.

  • Ping?

    Interested in finding out how I can get it to not attempt to distort the picture to make it rectilinear when it is wide (the bowtie.)
    Effectively, to act like a <flat> in the browser, except that if it is a 360 degree pano it should wrap around, and if you go into VR, it should be projected n VR (which is actually very similar to this in that you don't distort the image on a VR headset.)

    Is there some setting to turn off the distortion and act like a flat, wrapping cylinder? I find rectilinear distortion attempts look terrible once the FOV is above a certain amount, and am not sure why one would want them.

    My recollection is that original flash krpano did just this -- let you have a cylinder that was not distorted by wrapped around. Of course it did not offer VR.

    As an alternative, until this is possible, can you change the display style, so I could put a button to switch between flat and cylinder display? It would lose the very important wrap around, but would be better than the bowtie. Can you change the projection style live, or would it make more sense to have two scenes on the same pano (and same tiles) hacking it by taking the cylinder line and duplicating it in a scene with a flat tag? Or can you write directly to the image.type value to change it.

    Even so, 360 is one of the main attractions of krpano so a shame to lose it, though it's not as needed when zooming out to see the whole pano at once. Though if there is something interesting at the join, wrap around becomes important.

    As noted it would also be nice if there were a way to set the startup FOV to the one that is used when you request viewlimit=auto, which is the one which makes the pano fill the height in the center, so no black region is visible. Problem is when I set viewlimit=auto you can't zoom out if you want to, so I want the effect of viewlimit=auto but with the ability to zoom out -- and possibly just to switch to flat at that point.

    Einmal editiert, zuletzt von bradtem (17. September 2020 um 08:56)

  • . I have noticed that when I invoke makepano with -hfov=360.00 and also vfov and voffset, it does not encode these into the <image> tag as it does when other values are used. I presume the default is 360 and that's why it doesn't encode it, but is it OK not to encode the offset?

    What panotype setting have you used in your call?
    https://krpano.com/docu/tools/config/#panotype

    BTW, another vote for the option to rebuild the XML but not rebuild the tiles if, for example, the tiles are newer than the source image perhaps.

    How would that make sense for krpano?
    When the build settings are changing also the tiles can change, e.g. different sizes.
    And changing the xml settings after building is anytime possible.

  • I am using cylinder. When I found that makepano was not reading the Kolor Autopano comments from the exif, I wrote my own xif reader to generate the parameters on calls to makepano.

    I will invoke makepano with arguments as such:

    -config=mkp.config -hfov=360.00 -vfov=20.35 -voffset=7.37 -panotype=cylinder -xmlpath=burn18/wide/image.xml -previewpath=burn18/wi
    de/preview.jpg -tilepath=burn18/wide/t%Al_%Av_%Ah.jpg /local/photo/ring/pano/bm19/wide.jpg



    When the hfov is less than 360, all the parameters are put into the XML. However, when I put in 360, it just generates a bare "<image>" tag with no attributes for hfov, vfov and voffset. Losing vfov makes some sense as it is now calculable from the aspect ratio, but losing the voffset is surprising. Of course, as you know from my earlier post, I would rather not have any warp on these -- but of course it should be correct if it is to be done.


    I will look into triggering the change of scene on entry to VR. I guess I also now want to vary whether I display the flat or cylinder scene when loading in the browser. Probably flat for certain aspect ratios, cyl for 360 and others, but unless I pre-set which scene is the autoload, changing it will cause a re-load which I would prefer to avoid.

    Now that I am working with scenes, I know how you can set one scene to be the autoload scene. But how do you set that dynamically? For example, if loading in VR I want to start with the non-flat scene always, but for certain panos I want the autoload to be the flat scene, then switch it if they enter VR mode.

    Einmal editiert, zuletzt von bradtem (25. September 2020 um 23:26)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!