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

5 次查看(过去 30 天)
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
f='20240213_191745.dng';
[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);
%Denoising
W=5;
RGBadjusted(:,:,1)=wiener2(RGBadjusted(:,:,1),[W W]);
RGBadjusted(:,:,2)=wiener2(RGBadjusted(:,:,2),[W W]);
RGBadjusted(:,:,3)=wiener2(RGBadjusted(:,:,3),[W W]);
imshow(RGBadjusted)

回答(1 个)

Austin M. Weber
Austin M. Weber 2024-2-16
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.

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by