File Exchange

image thumbnail

RAW Camera File Reader

version 1.4.0.1 (110 KB) by Bryan White
Functions to read raw images from many digital cameras into MATLAB.

9 Downloads

Updated 01 Sep 2016

View License

These functions will read raw images from many digital cameras into MATLAB.The reader function, READRAWC, is a C MEX-file implementation of Dave Coffin's dcraw.c program (version 1.194) from:

http://www.cybercom.net/~dcoffin/dcraw/

Comments and Ratings (17)

This is using code from dcraw 1.194, Vendor's Date: 2004/05/22. Dcraw is by now at 1.478, Date: 2018/06/01. Many things have changed since then... for one .nef files which I can't read meaningfully either. The C code is over 4000 lines here vs 10500 lines there, which makes merging a daunting task even for someone dedicated. It's a problew with dcraw itself, by design not provided as a library. Perhaps a binding to https://github.com/hfiguiere/libopenraw would have better chances to stay viable for longer, even thought both are single-developer projects.

I'd like to ask the same question as chang ardour did. Does it work for .nef files? I included .nef in rawFormat.ext to see what happens. Can anyone confirm if it works with .nef?

After loading .NEF images, the result is an image from a different size than the original and looking somehow redish or pinky... I don't know what I'm doing wrong, there is any working example somewhere?

Chethan

Haven't used it yet so I can't rate it, but just wanted to comment on the compilation of the C file using mex - you need to make sure you link with libjpeg. Assuming you have libjpeg installed, you should be able to do:

mex -ljpeg readrawc.c

That allowed me to compile with lots of warnings but no errors.

huang

why I can't compile the readrawc.c MEX-file,it has so mang errors.

Royi Avital

What's the output? Is it an Image after Demosaicing?
Is there an option to get the original bayer matrices?

Thanks.

Ryan Taylor

No idea whether the conversion takes the camera's ICC profile into account (and there appears no way to find out). This is extremely problematic if you want to do any accurate analysis of your images....

Kurt William

This older version, I was wondering when the newer version would be uploaded. thanks

Ehsan Azarnasab

Thanks, Good starting point for applying different filters, and techniques of photo bracketing in an environment which is more convenient to me.

Ehsan Azarnasab

Thanks, Good starting point for applying different filters, and techniques of photo bracketing in an environment which is more convenient to me.

Steffen Skopp

This code is based on an older version of dcraw.
I am trying some things, newer version of dcraw, documentmode and more - but still under development.

S. Skopp

Works on Mac OSX 10.5. as well. GREAT !

Only one little change to make. The compiled file was named to "-DWIN32.mexmaci", must change to "readrawc.mexmaci".

jack chan

Rick Sampson

How about *.cr2? Doesn't seem to be compatable with this, only CRW.

Lys Elisabeth

chang ardour

Does it support .NEF file?

Uwe Artmann

That's what i was looking for.

Updates

1.4.0.1

Updated license

1.4.0.0

Removed "readme.m.bak", which was inadvertently and unnecessarily included in previous submission.

1.2.0.0

Exceedingly minor update -- fixed compilation code in readme.m help, which had switched the Windows and Unix MEX commands.

MATLAB Release Compatibility
Created with R14SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: matlab-unpackRaw, Read RAW camera images