Theta Exif库
thetaexif的Python项目详细描述
是理光θ图像的Python库。
它提供了一个exif阅读器类和一个校正工具。
要求
- python 3.6或更高版本
- 枕头
- scipy
设置
$ pip install thetaexif
用法
在python中
>>> from thetaexif import ExifReader, tag >>> reader = ExifReader('image.jpg') >>> reader.makernote[tag.FIRMWARE_VERSION] b'Rev0102' >>> reader.theta[tag.ZENITH_ES] (Fraction(20, 1), Fraction(-24, 1))
显示θexif
$ theta-tool info image.jpg RICOH Marker Note 0x0001 [MakerNoteType]: Rdc 0x0002 [FirmwareVersion]: Rev0102 0x0005 [SerialNumber]: 0000000000102690 0x1000 [RecordingFormat]: 2 THETA Subdir 0x0001 [RicohCameraType]: 1 0x0002 [HDRType]: 0 0x0003 [ZenithEs]: (20, -24) 0x0004 [CompassEs]: 45/2 0x0005 [AbnormalAcceleration]: 0 0x0101 [FilmISO]: (100, 0, 100, 0) 0x0102 [Aperture]: (21/10, 21/10) 0x0103 [ExposureTime]: (1/4000, 1/4000) 0x0104 [SensorSerial1]: A0015348 0x0105 [SensorSerial2]: A0015357
校正
校正命令读取陀螺仪和指南针数据并旋转图像以校正相机姿态。
correct image.jpg并保存到image_corrected.jpg:
$ theta-tool rectify image.jpg
使用指南针数据校正image.jpg(旋转图像以朝北):
$ theta-tool rectify -c image.jpg
保留exif并校正:
$ theta-tool rectify -e image.jpg
更改日志
0.2(2019-05-02)
- 支持python 3.x
- 删除对cython的依赖关系
0.1(2014-06-22)
- 初始版本