Page 1 of 2

Cr2 bit depth pimped? uint16 values restricted to 255

PostPosted: Fri Dec 13, 2013 6:53 pm
by noff
Hello Everyone!

I am working with RAW images from a Canon EOS Rebel XSi (also EOS 450D). The images of this camera are taken with a bit depth of 14 Bits, and stored into 16 Bits as usual. If I convert my pics to .Tiff images, I get my 16-Bit precision and everything is fine with my pics. If I try to load my raw Cr2 data into matlab with bfopen, I obtain uint16 variables without any error message, but they are all scaled from 0 to 255. It seems to me that there is some sort bug in the funcion, but we were not able to fix it so far.
Did anyone have this problem or knows how to help?

Thanks in advance.

Code: Select all
result = bfopen(path_of_file);

red   = result{1}{1,1};
green = result{1}{2,1};
blue  = result{1}{3,1};


Red, green and blue are my matrices with the values going from 0 to 255.

Re: Cr2 bit depth pimped? uint16 values restricted to 255

PostPosted: Sun Dec 15, 2013 8:10 pm
by sbesson
Hi,

First of all, could you tell us which version of Bio-Formats are you using? From the command prompt, the version number is returned by :

Code: Select all
>> disp(char(loci.formats.FormatTools.VERSION));


Could you please send one of the files that does not work properly so that we can fix the problem? You can upload the file to:

http://qa.openmicroscopy.org.uk/qa/upload/

Best regards,
Sebastien

Re: Cr2 bit depth pimped? uint16 values restricted to 255

PostPosted: Mon Dec 16, 2013 8:48 am
by noff
Hello,

First of all, thanks for your quick answer, then to your questions:

sbesson wrote:could you tell us which version of Bio-Formats are you using?


Code: Select all
>> disp(char(loci.formats.FormatTools.VERSION));
4.4.9


sbesson wrote:Could you please send one of the files that does not work properly so that we can fix the problem?


I coldn't find the extension .cr2 in the uploader, so i renamed it as a .raw file.
The name of the file is IMG_4689 - Copy.raw and the ID is 7778 (please mind that it is a .cr2 file, only renamed as a .raw).

Regards,
nico

Re: Cr2 bit depth pimped? uint16 values restricted to 255

PostPosted: Mon Dec 16, 2013 3:03 pm
by sbesson
Thanks Nico,

we received the files and will be in touch with you soon regarding this issue.

Sebastien

Re: Cr2 bit depth pimped? uint16 values restricted to 255

PostPosted: Mon Dec 16, 2013 10:10 pm
by mlinkert
Hi Nico,

Thank you for uploading a file. We now have a ticket for this on our issue tracking system:

https://trac.openmicroscopy.org.uk/ome/ticket/11847

You have been CC'd on the ticket, and so will receive an automated email each time the ticket is updated. If you prefer not to receive updates, please let us know.

Regards,
-Melissa

Re: Cr2 bit depth pimped? uint16 values restricted to 255

PostPosted: Mon Jan 06, 2014 2:41 pm
by noff
Hi everyone,
one of the links in the tickets is not available,
https://www.openmicroscopy.org/qa2/qa2/ ... back/7778/

Also the explanation given in the ticket sounds strange: with others viewing programs we obtain the full bit depth of the same image, only when opening it with the bioformats things go wrong

Re: Cr2 bit depth pimped? uint16 values restricted to 255

PostPosted: Mon Jan 06, 2014 3:16 pm
by jmoore
Proper URL is https://www.openmicroscopy.org/qa2/qa/feedback/7778/ I'll update the ticket.
~Josh

Re: Cr2 bit depth pimped? uint16 values restricted to 255

PostPosted: Wed Jan 31, 2018 4:15 pm
by kinor
Dear all,
unfortunately the links are not available any more.

I still have Nicos issue:
the data from the canon cr2 file is read in a 16 bit container but the 16 bit tif exported by the canon Digital Photo Professional software shows a much better usage of the 14 bit.

Additionally the library always yields full Resolution for raw images with lower Resolution.

could this issue be fixed?

I downloaded the library on 18th jan 2018

Matlab gives
>> disp(char(loci.formats.FormatTools.VERSION));
4.4.12

With pleasure I would upload example files for any raw format and the export of the canon software to be compared by a script i'd provide as well.
thanks a lot in advance for any help
Norbert

Re: Cr2 bit depth pimped? uint16 values restricted to 255

PostPosted: Thu Feb 01, 2018 3:53 pm
by dgault
Hi Norbert,

If you have a sample image, particularly one that displays the resolution issues that would be a great help for testing. You can upload the images to https://www.openmicroscopy.org/qa2/qa/upload/

David Gault

Re: Cr2 bit depth pimped? uint16 values restricted to 255

PostPosted: Mon Feb 05, 2018 8:54 am
by kinor
Hi David,

thanks a lot for your help.
i uploaded 3 raw files with full raw, sraw1 and sraw2 which have their format in the filenames and similarly named tif files which were exported by the canon software.
I expect the data read by bfopen to be equal to the tif data in resolution and contained values. Would be very great if you could go a step forward here.

Many thanks in advance for your effort.

Best
Norbert