Clear Filters
Clear Filters

How can I import .dng files using compression scheme 52546?

13 views (last 30 days)
I am using this code to import .DNG raw images. However MATLAB doesn't seem to support 52546 compression. Any suggestion on how I can use these images in matlab without using external softwear?
clear; clc; close all;
%Example of reading and processing a Milky Way image I took with Matlab TIFF%
%By Fernando Zigunov 2020
[RGB, I]=ReadDNG(f,'rggb');
RGB=RGB/(2^8); %Correct levels for 12-bit camera
imshow(RGB); %Shows image (only shiny stars appear)
%=====Very simple image postprocessing, just to show what can be done======
%Image stretching (parameters manually selected)
RGBadjusted=imadjust(RGB,[0 0 0;0.02 0.04 0.016],[0 0 0;1 1 1],1.5);
RGBadjusted(:,:,1)=wiener2(RGBadjusted(:,:,1),[W W]);
RGBadjusted(:,:,2)=wiener2(RGBadjusted(:,:,2),[W W]);
RGBadjusted(:,:,3)=wiener2(RGBadjusted(:,:,3),[W W]);

Answers (1)

Austin M. Weber
Austin M. Weber on 16 Feb 2024
I haven't worked with .dng images before, but I found a function called DNG2JPG on the MATLAB File Exchange that might be useful (see the link and/or the attached function file). As the name implies, it converts .dng files into the .jpg format, which is a much more accessible file type.
Hopefully this helps.


Find more on Image Processing Toolbox in Help Center and File Exchange




Community Treasure Hunt

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

Start Hunting!