4

任何人都知道如何以编程方式将 Google Photo Sphere XMP 元数据添加到 equirectangular(360) 图像?或者如何删除新的 Photo Sphere XMP 元数据并将其添加到 equirectangular(360) 图像?

这是示例:

<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>
4

2 回答 2

1

Exiftool 被称为不能将 Google Photosphere XMP 元数据注入 JPG 文件,可能是因为它错误地为每个命名空间创建了一个“描述”标签

可能 Exiv2 可以做到这一点,但我还没有测试它。

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

此命令采用上下等距矩形图像并将其转换为纸板格式:

equiToVr180Photo.exe -f tb -i immagine-top-bottom.jpg -o cardboard.vr.jpg  

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

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

 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 文件

于 2021-08-27T17:51:57.437 回答
1

使用Perl 在 cpanel 上安装ExifTool https://www.sno.phy.queensu.ca/~phil/exiftool/后,您可以通过输入以下命令来添加元数据

exiftool -XMP-GPano:ProjectionType='equirectangular' /public_html/panos/image_name.jpg

于 2019-11-23T14:44:49.933 回答