有人知道如何以编程方式将Google photo sphere XMP元数据添加到等长方形(360)图像中吗?或者如何删除和添加新的照片球体XMP元数据到等长方形(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>
发布于 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,以正确地创建与纸板兼容的映像。
此命令获取一个自上而下的等长方形图像,并将其转换为纸板格式:
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文件
https://stackoverflow.com/questions/44405720
复制相似问题