0

I am using a Nikon D5200. I intend to do some image processing on the raw images shot with the camera. But I am encountering a problem when I read the raw images using GNU Octave. Rather than giving bit depth of 16 (since the .NEF are shot at 14-bit depth), the result is just a 8-bit array. What might be the problem?

imfinfo("/media/karthikeyan/3434-3531/DCIM/100D5200/DSC_1094.NEF")

ans =

scalar structure containing the fields:

Filename = /media/karthikeyan/3434-3531/DCIM/100D5200/DSC_1094.NEF

FileModDate = 10-Oct-2016 18:10:02

FileSize = 26735420

Format = DCRAW

FormatVersion =

Width = 6036

Height = 4020

BitDepth = 8

ColorType = truecolor

I am using Ubuntu 14.04, Octave 4.0.3.

  • Could be related to this question: photo.stackexchange.com/questions/20156/… – Brendan Burkett Oct 12 '16 at 15:00
  • What does exiftool DCS_1094.NEF | grep -i bit tell you? – chili555 Oct 12 '16 at 15:52
  • @chili555 Here is what your command tells me - exiftool DSC_1094.NEF | grep -i bit Bits Per Sample : 14 – karthikeyan Oct 12 '16 at 16:49
  • That suggests that the RAW file is, indeed 14-bit but that there is an issue with Octave. – chili555 Oct 12 '16 at 20:07
1

Check out this page:

Tips for reading a camera raw file into MATLAB

According to this you are actually reading the thumbnail image and not the RAW file itself. You must convert the .NEF to .DNG and then utilize a Tiff class.

  • If the file size is 26 Mb, then I doubt he is reading the thumbnail. – chili555 Oct 12 '16 at 15:46
  • @chili555 Is that the compressed or decompressed size? – Michael C Oct 12 '16 at 17:01
  • @MichaelClark How do it check that? I guess its compressed based on official tech-specs. Or did you mean something like zip? – karthikeyan Oct 12 '16 at 17:14
  • @karthikeyan I don't know. I don't use MATLAB. But when it is displayed on your monitor a compressed jpeg has to be decompressed first. The size of the decompressed file will be based on the resolution times the bit depth for each color channel. – Michael C Oct 12 '16 at 17:17
  • @chili555 I don't work with NEF files but I'm pretty sure they have both a small thumbnail and either a half or full size jpeg embedded in them. – Michael C Oct 12 '16 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.