Read Insta360 .insp still images into NumPy arrays
Project description
readinsp
readinsp reads Insta360 .insp still-image files into NumPy arrays.
Usage
from readinsp import read_insp, read_metadata, read_preview
image = read_insp("example.insp")
print(image.shape, image.dtype) # (3040, 6080, 3) uint8
preview = read_preview("example.insp")
print(preview.shape) # (960, 1920, 3)
metadata = read_metadata("example.insp")
print(metadata.width, metadata.height, metadata.preview_size)
print(metadata.exif.get("Model"))
print(metadata.trailer.fields.get("camera_model"))
Rectilinear views
read_rectilinear undistorts the two circular fisheye images, combines the two lenses, and renders a regular perspective view:
from readinsp import read_rectilinear
view = read_rectilinear(
"example.insp",
spherical_angle=(0, 0), # yaw, pitch in degrees
hfov=90,
vfov=60,
width=1200,
)
print(view.shape) # (693, 1200, 3)
Angle convention: yaw 0 points at the left fisheye lens, yaw 180 points at the right fisheye lens, and positive pitch looks up. spherical_angle may also include a third roll value: (yaw, pitch, roll). When height is omitted, it is computed from the FOVs so the output has approximately square angular sampling near the view center. The default dual-fisheye model assumes a 190 degree fisheye per lens with an 8 degree blend near the stitch boundary. Both values can be overridden.
Gravity leveling is available for files with a valid EXIF MakerNote gravity vector:
from readinsp import SphericalAngle, read_rectilinear
floor = read_rectilinear(
"example.insp",
spherical_angle=SphericalAngle(yaw=0, pitch=-90, gravity_level=True),
hfov=90,
vfov=70,
width=1000,
)
With gravity_level=True, positive pitch looks opposite gravity and negative pitch looks along gravity. Yaw is still camera-relative because the inspected files do not include a usable magnetic-north heading.
Install for local development from the repository root with:
python -m pip install -e readinsp
Limitations
This is a reverse-engineered parser based on samples from the OneR and OneRS cameras and might not work for other camera models. Rectilinear rendering is an approximate open implementation and will not match Insta360 Studio's proprietary stitching exactly, especially near the lens seam.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file readinsp-0.1.0.tar.gz.
File metadata
- Download URL: readinsp-0.1.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95ccd13041a3610c11cddb180de2d62c36ba951052187811b627a1472f061065
|
|
| MD5 |
ca06826820d22384cba378a3e4d99baa
|
|
| BLAKE2b-256 |
a66744f3ec6654af768636797c7e7d11b310a38d76d77ddc78a0de6d186b7ae6
|
Provenance
The following attestation bundles were made for readinsp-0.1.0.tar.gz:
Publisher:
publish.yml on timmh/readinsp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
readinsp-0.1.0.tar.gz -
Subject digest:
95ccd13041a3610c11cddb180de2d62c36ba951052187811b627a1472f061065 - Sigstore transparency entry: 1917367139
- Sigstore integration time:
-
Permalink:
timmh/readinsp@f1502cdb28771b42611db3262ad575b30907cf35 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/timmh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f1502cdb28771b42611db3262ad575b30907cf35 -
Trigger Event:
release
-
Statement type:
File details
Details for the file readinsp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: readinsp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d8d8da858d6428131da5cd121a0628f2db8236a7f8e06978519c4e43a8010af
|
|
| MD5 |
c8ffd268f90565de1140e601bd0c52fa
|
|
| BLAKE2b-256 |
e26e71ed661177dabccb0dc706e9fd6d2d2ca3aa5ae42fd61b28b2461c4fe8a8
|
Provenance
The following attestation bundles were made for readinsp-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on timmh/readinsp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
readinsp-0.1.0-py3-none-any.whl -
Subject digest:
1d8d8da858d6428131da5cd121a0628f2db8236a7f8e06978519c4e43a8010af - Sigstore transparency entry: 1917367236
- Sigstore integration time:
-
Permalink:
timmh/readinsp@f1502cdb28771b42611db3262ad575b30907cf35 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/timmh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f1502cdb28771b42611db3262ad575b30907cf35 -
Trigger Event:
release
-
Statement type: