lclevy / canon_cr3 Goto Github PK
View Code? Open in Web Editor NEWDescribing the Canon CR3 fileformat from Canon M50 / EOS R / SX70 HS / EOS RP...
License: GNU General Public License v3.0
Describing the Canon CR3 fileformat from Canon M50 / EOS R / SX70 HS / EOS RP...
License: GNU General Public License v3.0
Hiya!
From what I can gather from the README the only sample you have from the M6II is a RAW burst. If you are still looking for more samples from the camera I can provide them for you. Let me know what you need, if anything.
Recent models (e.g., G7X-III & G5X-II) support high-speed raw bursts which are recorded in a single cr3 file. Is there any support for parsing and extracting these individual frames?
Hello!
If you want to take ownership of this package please tell me your PyPI username and implement this.
Thank you!
I can extract the hd data as the output, hd00.bin. However, I have no ideal how to analyze and convert the sequential bytes into an array to recover the corresponding data on each sensors of cameras. Any suggestions or even some related articles about that? Thanks~
In your description, each record entry located in the CTMD box has two long values for Record Type (starting at offset 0) and Record Size (starting at 4). For most of the old cameras it is the right assumption, but I found a lot of new cameras (like EOR R3, EOS-1DXmkIII, EOS-R10, EOS-R50, EOS-R6M2, EOS-R7 and EOS-R8) using a different format. For record numbers 7, 8 and 9 these cameras writes [01 01 00 07] instead of [00 00 00 07] etc.
For this reason, I suggest to adopt the format definition and split the first value of long into two values of short, where the Record Type is taken from the second value. The first value will be 'unknown' for me.
I'm not using your software but the great CR3 format specification only, and I'm working on my own implementation. If you have any questions or comments, please let me known.
Regards,
Christoph
Hi,
I've got a sample for a Canon R7 HEIF if you're still looking for one
https://drive.google.com/file/d/1tBMZB5qwwQ_M0k4p_f7WF5z9VgSUaqzR/view?usp=share_link
You have written 'from canon_cr3 import Image'
But I am unable to find it anywhere in the repo
Do you still need samples from that camera?
It looks as if exiv2 cannot read the exif info in the raw file data but can read it in the craw format so there must be something new...
Happy to provide all sorts of samples.
Correct structure of CMP1 tag (terminology and structure from internals of CRX decoder). In terms of CRX decoder this CMP1 is essentially image header for encoded image (exists for each image track). Decoder uses CMP1 data to decode image track.
Offset | type | size | content |
---|---|---|---|
0 | long | 1 | size of this tag. 0x3c |
4 | char | 4 | "CMP1" |
8 | short | 1 | ? FF 00 |
10 | short | 1 | 0x30 - size of the image header to follow |
12 | short | 1 | version - always 0x100 for current CR3 (major.minor version in bytes?) |
14 | bytes | 2 | 00 00 |
16 | long | 1 | image width |
20 | long | 1 | image height |
24 | long | 1 | tile width |
28 | long | 1 | tile height |
32 | bytes | 1 | bits per sample - usually 0xE |
33 | bits | 4 | number of planes - 4 for RGGB |
33+4bits | bits | 4 | CFA layout (valid values 0..3) - only valid where number of planes > 1 |
34 | bits | 4 | extra bits per sample - only 1 or 3 |
34+4bits | bits | 4 | number of wavelet levels (set for wavelet compressed image) |
35 | bits | 1 | 1 = image has more than one tile horisontally (set for wavelet compressed image) |
35+1bit | bits | 1 | 1 = image has more than one tile vertically (set for wavelet compressed image) |
35+2bit | bits | 6 | unused in current version - always 0 |
36 | long | 1 | mdat track header size (mdat bitstream data starts following that header) |
40 | long | 1 | 0 |
44 | bytes | 16 | ? 4 times "01 01 00 00" |
Can you help me on this? It seems like the library should be able to support it, but i don't even know how i should get started
I have some R3 raw samples.
https://drive.google.com/file/d/1BH2HMqHvjLtVo2S_Nnf8selIOTa_V-5p/view?usp=sharing
I tried several example files from an R7 camera (firmware version 1.3.0), all using lossless RAW. They all fail here:
Traceback (most recent call last):
File "/Users/agf/Desktop/canon_cr3/parse_cr3.py", line 379, in <module>
if TiffIfd.TIFF_CANON_VIGNETTING_CORR2 in ctmd_makernote7.ifd:
^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'ifd'
Full output is https://gist.github.com/AGFeldman/c484bad40cf1fbe79c6c7ac88c42f836
To download an example file and reproduce:
wget https://aaron.na31.org/EYA_0236.CR3 && python3 parse_cr3.py EYA_0236.CR3
Thanks in advance if you can take a look! As an aside, I'm interested in this tool because I'm interested in automating raw burst extraction (#14 (comment)) although my understanding is that would take more work.
I can provide R3 HEIF (or any other R3 outputs) if needed, just let me know what formats you'd like.
and, in this repo, i can't find the definition for Image
.
I want to use this tool to get exif info from cr3 files.
can you wrote down some instructions, thanks
Hi,
I have a Canon EOS RP with which I shoot in RAW, and I would like to parse the raw data into a Python usable format.
Using the canon_cr3 lib, I'm not able to parse any data from mdat. Only preview_image (PRVW) returns me the downscaled jpeg image.
from canon_cr3 import Image
from canon_cr3 import CmtdData
image = 'IMG_0023.CR3'
img = Image(image)
print(len(img.preview_image)) # in PRVW
print(len(img.jpeg_image)) # trak1 of mdat
print(len(img.sd_crx_image)) # trak2 of mdat
print(len(img.hd_crx_image)) # trak3 of mdat
result:
92820
0
0
0
Here is a CR3 file taken with my Canon EOS RP: https://drive.google.com/file/d/1a__2VVyz1q2RhwYsGx9b5myo_ebYVfM4/view?usp=sharing
Any help on that would be much appreciated!
Are you still looking for Canon R8 files?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.