首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何将强制的Google Photo Sphere XMP元数据添加到等长方形(360)图像?

如何将强制的Google Photo Sphere XMP元数据添加到等长方形(360)图像?
EN

Stack Overflow用户
提问于 2017-06-07 15:02:17
回答 2查看 534关注 0票数 3

有人知道如何以编程方式将Google photo sphere XMP元数据添加到等长方形(360)图像中吗?或者如何删除和添加新的照片球体XMP元数据到等长方形(360)图像?

示例如下:

代码语言:javascript
运行
复制
<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>
EN

Stack Overflow用户

发布于 2021-08-27 17:51:57

Exiftool不能将Google Photosphere XMP元数据注入到JPG文件probably because it erroneously create a "description" tag per each namespace中。

可能Exiv2可以do the trick,但我还没有测试它。

或者,您可以从VR180PhotoTools套件中以编程方式调用程序equiToVr180Photo.exe,以正确地创建与纸板兼容的映像。

此命令获取一个自上而下的等长方形图像,并将其转换为纸板格式:

代码语言:javascript
运行
复制
equiToVr180Photo.exe -f tb -i immagine-top-bottom.jpg -o cardboard.vr.jpg  

您可以在这里找到C#源代码:https://github.com/Vargol/VR180PhotoTools

看看文件equiToVR180Photo.cs的第99行:

代码语言:javascript
运行
复制
 string xmpMetadata = jpegFile.GetXmpMetadata(jpegs.GetRightEye.Width, jpegs.GetRightEye.Height, widthDegrees, heightDegrees, extendedMd5Hash);

 // insert the xmp in the jpeg..
 jpegFile.WriteVr180Jpeg(jpegs, xmpMetadata, extendedMd5Hash, extendedXmpXml, outJpeg);

GetXmpMetadata()实际上并不“获取”,它“创建”所有需要的XMP元数据,然后由jpegFile.WriteVr180Jpeg()将这些元数据写入jpg文件

票数 1
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44405720

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档