本文介绍了使用谷歌API全景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用谷歌的 API 显示全景。显然,我需要输入一个jpg与全景图,我在其中嵌入XMP格式的元数据。如何才能做到这一点?它是我的工作,作为一个开发者或一个人谁创造的全景?可以用这个工具来完成?即Photoshop的?


解决方案

好吧,这是我做到了,我用Photoshop中有一个选项,从自定义模板,通过元数据,所以我创建了使用中提到的元数据的XMP文件谷歌文档页面。希望它可以帮助任何人谁发现这个职位!

< xpacket开始=''ID =''>< X:xmpmeta的xmlns:X ='土坯:NS:元/'>
< RDF:RDF的xmlns:RDF =HTTP://www.w3.org/1999/02/22-rdf-syntax-ns#'>    < RDF:RDF简介:约=的xmlns:GPano =htt​​p://ns.google.com/photos/1.0/panorama/>
        &所述; GPano:UsePanoramaViewer>真&下; / GPano:UsePanoramaViewer>
        < GPano:CaptureSoftware>的Photo Sphere< / GPano:CaptureSoftware>
        < GPano:StitchingSoftware>的Photo Sphere< / GPano:StitchingSoftware>
        < GPano:ProjectionType> equirectangular< / GPano:ProjectionType>
        < GPano:PoseHeadingDegrees>&350.0 LT; / GPano:PoseHeadingDegrees>
        &所述; GPano:InitialViewHeadingDegrees> 90.0℃的熔点/ GPano:InitialViewHeadingDegrees>
        < GPano:InitialViewPitchDegrees> 0.0< / GPano:InitialViewPitchDegrees>
        < GPano:InitialViewRollDegrees> 0.0< / GPano:InitialViewRollDegrees>
        < GPano:InitialHorizo​​ntalFOVDegrees> 75.0< / GPano:InitialHorizo​​ntalFOVDegrees>
        &所述; GPano:CroppedAreaLeftPixels大于0&下; / GPano:CroppedAreaLeftPixels>
        &所述; GPano:CroppedAreaTopPixels大于0&下; / GPano:CroppedAreaTopPixels>
        < GPano:CroppedAreaImageWidthPixels> 4000< / GPano:CroppedAreaImageWidthPixels>
        < GPano:CroppedAreaImageHeightPixels> 2000< / GPano:CroppedAreaImageHeightPixels>
        < GPano:FullPanoWidthPixels> 4000< / GPano:FullPanoWidthPixels>
        < GPano:FullPanoHeightPixels> 2000< / GPano:FullPanoHeightPixels>
        < GPano:FirstPhotoDate> 2012-11-07T21:03:13.465Z< / GPano:FirstPhotoDate>
        &所述; GPano:LastPhotoDate> 2012-11-07T21:04:10.897Z&下; / GPano:LastPhotoDate>
        &所述; GPano:SourcePhotosCount> 50℃/ GPano:SourcePhotosCount>
        < GPano:ExposureLockUsed>假LT; / GPano:ExposureLockUsed>
    < / RDF:说明>< / RDF:RDF>

I want to use google's API for displaying panoramas. Apparently I need for input a jpg with the panorama, in which I embed the metadata in XMP format. How can this be done? is it my job as a developer or the one's who creates the panorama? can this be done with a tool? ie photoshop?

解决方案

Ok this is how I did it, I used photoshop which has an option to pass metadata from a custom template so I created an XMP file using the metadata mentioned in google documentation page. Hope it helps anyone who finds this post!

<?xpacket begin='' id=''?><x:xmpmeta xmlns:x='adobe:ns:meta/'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>

    <rdf:Description rdf:about="" xmlns:GPano="http://ns.google.com/photos/1.0/panorama/">
        <GPano:UsePanoramaViewer>True</GPano:UsePanoramaViewer>
        <GPano:CaptureSoftware>Photo Sphere</GPano:CaptureSoftware>
        <GPano:StitchingSoftware>Photo Sphere</GPano:StitchingSoftware>
        <GPano:ProjectionType>equirectangular</GPano:ProjectionType>
        <GPano:PoseHeadingDegrees>350.0</GPano:PoseHeadingDegrees>
        <GPano:InitialViewHeadingDegrees>90.0</GPano:InitialViewHeadingDegrees>
        <GPano:InitialViewPitchDegrees>0.0</GPano:InitialViewPitchDegrees>
        <GPano:InitialViewRollDegrees>0.0</GPano:InitialViewRollDegrees>
        <GPano:InitialHorizontalFOVDegrees>75.0</GPano:InitialHorizontalFOVDegrees>
        <GPano:CroppedAreaLeftPixels>0</GPano:CroppedAreaLeftPixels>
        <GPano:CroppedAreaTopPixels>0</GPano:CroppedAreaTopPixels>
        <GPano:CroppedAreaImageWidthPixels>4000</GPano:CroppedAreaImageWidthPixels>
        <GPano:CroppedAreaImageHeightPixels>2000</GPano:CroppedAreaImageHeightPixels>
        <GPano:FullPanoWidthPixels>4000</GPano:FullPanoWidthPixels>
        <GPano:FullPanoHeightPixels>2000</GPano:FullPanoHeightPixels>
        <GPano:FirstPhotoDate>2012-11-07T21:03:13.465Z</GPano:FirstPhotoDate>
        <GPano:LastPhotoDate>2012-11-07T21:04:10.897Z</GPano:LastPhotoDate>
        <GPano:SourcePhotosCount>50</GPano:SourcePhotosCount>
        <GPano:ExposureLockUsed>False</GPano:ExposureLockUsed>
    </rdf:Description>

</rdf:RDF>

这篇关于使用谷歌API全景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-19 06:34