Reading camera raw file

Hi!
I am trying to import camera raw file in the Matlab and do further processing.
After that,I applied the code below to the file,as the article mentioned.
info = imfinfo('books.dng')
info.SubIFDs{1}
warning off MATLAB:tifflib:TIFFReadDirectory:libraryWarning
t = Tiff('books.dng','r');
offsets = getTag(t,'SubIFD');
setSubDirectory(t,offsets(1));
cfa = read(t);
close(t);
The warning below is come out and the 'cfa'file contain nothing.
Warning: JPEGLib: Must downscale data from 16 bits to 8.
Warning: JPEGPreDecode: Improper JPEG strip/tile size, expected 256x256, got 128x256.
I tried raw file from Nikon D40x and Sony Nex-3, also cannot get any improve.
What is the problem?
Thank you.
Andrew Tam

댓글 수: 2

Jurgen
Jurgen 2013년 4월 27일
So your file is also called books.dng right? Then what is the output of imfinfo('books.dng')?
tam
tam 2013년 7월 5일
Thanks for viewing, Thomas Stone's answer solve the problem

댓글을 달려면 로그인하십시오.

 채택된 답변

Thomas Stone
Thomas Stone 2013년 7월 5일

1 개 추천

I had the same problem, but fixed by making sure the image was uncompressed. If you are using Adobe DNG converter make sure the "compatibility" is set to custom, with "Uncompressed" ticked.

댓글 수: 1

tam
tam 2013년 7월 5일
Thanks!!! I successfully crack the file to bayer array. Now I can buy a super zoom DC and use Matlab to process its image, try to beat photo from DSLR on rookie's hand. Very thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

태그

질문:

tam
2013년 4월 27일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by