3

I am trying to use Mathematica to import and process raw camera data in the Canon CR2 format. What I would like is data which has a linear relationship to exposure. I am thinking that the closest I could get to that would be demosaiced data imported with gamma = 1. Can anyone tell me what preprocessing occurs for Import[imageFile] when the imageFile is a raw format?

Thank you.

Alexey Popkov
  • 61,809
  • 7
  • 149
  • 368
David Keith
  • 4,340
  • 1
  • 12
  • 28
  • What is the extension of your file? Have you checked the corresponding Docs page for your file extension? – Alexey Popkov Oct 10 '17 at 03:59
  • The extension is .cr2. It is generally documented as a raw format, but I find no information on what processing does or doesn't happen as part of importing a raw format. – David Keith Oct 10 '17 at 04:10
  • Looks like the "RawImage" element is what you need. But I'd be interested to know what processing is done by default. – Alexey Popkov Oct 10 '17 at 04:30
  • Also "ColorProfileData" element can shed light on the encoding. Then you can use ColorConvert to convert to sRGB which on turn can be converted to linear RGB. – Alexey Popkov Oct 10 '17 at 04:34
  • Related: https://mathematica.stackexchange.com/q/42153/280, https://mathematica.stackexchange.com/q/144019/280 – Alexey Popkov Oct 10 '17 at 04:37
  • I am not sure this is possible. You can get linear data without demosaicing, or you can get the final image (which is not linear). Or you can implement your own naïve demosaicing. Would that work for your? – Szabolcs Oct 10 '17 at 11:20

0 Answers0