-
-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I retrieve additional metadata information from the Spatial HEIC #1164
Comments
There are four properties in the file that might hold this information:
But we have no specification of those. They are proprietary. We would need a couple of images with known intrinsic parameters (covering several different values) to be able to reverse engineer their content. |
There should be additional metadata for each picture. Using the Image I/O framework, they'd be defined like this:
|
IMG_0050.zip |
Thanks. Could you please also send me the decoded metadata values that are stored in there? I don't have a Mac to read them out. |
Looks like its the same in each case. Do they ever vary? |
They can. In this case, because they were all shots on the Vision Pro in the same area the values are the same. I have panoramic photos that will have different intrinsics, but the format is the same. I suspect there's additional tags that Apple is using to determine this is a stereo pair. That's the code that I posted before. |
So to work out which values correspond with which bytes (or bits) in those UUID fields, we need to see the variations. Ideally one parameter change at a time would vary a small amount of the values. |
Hmm... I don't think I can provide that. The best I can do is more samples of photos that work on the Vision Pro by either taking photos with an iPhone or the AVP. |
Hi, (I posted the report in the other repo) Here is a set of 3 files focused on the "Camera model" field with the intrinsics matrix. Example: They are based on a similar code snippet as posted above with only variations in the Files and corresponding
Note: I only used integers but this is an array of floats. |
And here is a set of files focusing on the camera extrinsics key. Example: Files:
|
Intrinsics analysisFile 0 - two UUID properties, and each of the two items are associated with both. Intrinsics matrix uuid: File 1 - same two UUID properties, same association Intrinsics matrix uuid: File 2 - same two UUID properties, same association Intrinsics matrix uuid: Assume the So we have Its not clear to me how the 9 values could fit into 16 bytes unless there is some kind Possibly the 0x1e relates to a signature or encoded length (0x1e = 30, the number of bytes is 16). |
A general intrinsic matrix usually looks like this:
One can also assume that the skew It is also nice to see that the encoding of Thus, first four bytes unknown, maybe some flags (e.g. for "ModelType = Simplified Pinhole") |
Extrinsics data extractionEach file has two uuid properties (boxes). One is The other is more interesting. It is 5-Extrinsicsvalue: 6-Extrinsicsvalue: 7-Extrinsicsvalue: 8-Extrinsicsvalue: 9-Extrinsicsvalue: 10-Extrinsicsvalue: File 10 also has an extra uuid box: So it looks like coordinate system id may be by position (not coded). byte [7] is clearly changing as we step through the position changes.
|
also, if the photo is a spatial photo, there will be a 'grpl' box under 'meta' box where the 'grpl' Grouplistbox box will contain a 'ster' box that is Stereoscopic pair. |
I have attached two identical images, but one of them, spatial.HEIC, is a Spatial Photo that add the key metadata in it. |
Can you show the associated key metadata (i.e. as apple displays it)? |
What I do to these 2 images is one image generated with above code, another without the code. I attached two file that generated by pyisobmff: pyisobmff_decode.zip Just use the text comparing tools to check the difference. This is currently I can do so far. Below are screenshots that spatial image contained more than non_spatial image: "uuid""uuid2""grpl" that it contains 'ster' box inside of it but pyisobmff cannot decode it.
What the difference is the image @JWheeler and @JoanCharmant posted, the preview app in macOS will plus a tag "HEIC" that non-spatial image doesn't have. |
Hi all, I found the UUID also related to the image resolution. If I changed the image resolution, the value will change, too. |
Reading and writing of the camera intrinsic matrix should be working now in branch |
Is there some test data for the extrinsic camera matrix? Especially with camera orientation once specified as a quaternion and once with rotation angles? |
Assuming its the same as MPEGGroup/FileFormatConformance#86 and |
Thank you. That helped to confirm that intrinsics and quaternion-based rotation are read correctly. I have also chosen the rotation sequence order to match the output described in the |
While there is a function in heif.h for obtaining the rotation of the extrinsic_matrix (namely, heif_camera_extrinsic_matrix_get_rotation_matrix), there is no function for obtaining the position. Why is that? In heif_experimental.h, both heif_property_camera_extrinsic_matrix_get_rotation_matrix and heif_property_camera_extrinsic_matrix_get_position_vector are available. |
There is still some discussion about the exact semantics (MPEGGroup/FileFormat#102). |
Original issue with file example is here:
bigcat88/pillow_heif#234
Is there a way to get this information from an image and save the file so it contains it?
I tried to find where it is stored using
heif-info -d
but totally get lost in number of different boxes those file contains..I would be grateful for any help.
The text was updated successfully, but these errors were encountered: