Compression of Canon CR2 raw images in MATLAB ?

조회 수: 3 (최근 30일)
Steffen B. Petersen
Steffen B. Petersen 2019년 5월 4일
답변: Bray Falls 2020년 1월 15일
I am using my Canon 5D Mark IV to acquire images of star fields. Often in Astro photography the most interesting features have very low intensity compared to the noise level.
The noise level in RAW camera images should not be exposed to compression schemes. I enclose one image above, where the red channel of the image displayed (an astronomical image with a few high intensity stars) is a correct representation of what MATLAB displays - but clearly there is a problem with the lowest intensity levels of the image. It appears as if MATLAB is utilizing lossy compression scheme, which in the appeararance looks like JPEG compression.
I would like to know how to switch off the compression, if anybody knows.
Here is the code used to display the image in MATLAB
[myfile,mypath]=uigetfile({'*.cr2'});
>> mygray2=myim(:,:,1);
>> mytiny2=mygray2(2000:2500,3300:3800);
>> figure(3);
>> imshow(mytiny2,[10 30]);
Below is shown the same image - but processed with PIXINSIGHT - please note the noise background in this image - no lossy compression artefacts, no large square patches- a telltale of compression.
  댓글 수: 9
Steffen B. Petersen
Steffen B. Petersen 2019년 6월 2일
Hi Walter
The problem is still not solved. I spoke to MATLAB and they state that their imread and imshow does not introduce compression. Also spoke to Canon support. They were not helpful at all - basically stating that their CR2 format was secret and they brushed me off, stating that I bought a normal consumer camera and I could not expect any special services.
The Canon 5D mark 4 camera produces beatiful images of size 30 MP - so I have plenty of resolution.
Reading the image header file, the CR2 file appear to consist of 4 TIFF files of different sizes and compression codes. One TIFF file seem to be empty, size is 0 - and maybe this is where to dig for the real raw data.
Walter Roberson
Walter Roberson 2019년 6월 3일
Try adding an index to the imread call. Beyond that I would try with Tiff()

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

답변 (1개)

Bray Falls
Bray Falls 2020년 1월 15일
For sanity purposes I'm letting you know I also experience severe compression effects when loading CR2 files into MATLAB. I am processing solar eclipse images, and after filtering the images they are full of square tiles and other artifacts. Converting to .tiff in pixinsight is fine but I'd like to read the raw file directly.

카테고리

Help CenterFile Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by