Bug 262403 - BQM DNG tool : Add Aptina Camera Sensors support
Summary: BQM DNG tool : Add Aptina Camera Sensors support
Status: RESOLVED INTENTIONAL
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Bqm-DngConverter (show other bugs)
Version: 3.5.0
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-07 13:19 UTC by ajitsdeshpande
Modified: 2020-08-04 05:03 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.1.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ajitsdeshpande 2011-01-07 13:19:50 UTC
Version:           1.2.0 (using KDE 4.4.5) 
OS:                Linux

Hi,
I have a  digital camera using Aptina sensor, with which I take images in raw format used by Aptina. It's raw file format is 16bit per color channel, 'GRBG' mode with file extension is *.raw. 
This format is very much different that the usual *.NEF, *.CR2, *.SRF,.. raw formats of popular camera manufacturers.
It has No headers or any other metadata, just plain raw bayer samples. It does not specify any information about image width, image height, pixel width,etc.
(I have attached one Raw image file of this format)
When I try to use the Tool-> Raw Batch converter, or DNG converter on this raw file and try to add this *.raw file that I have, it says Camera:Cannot identify Raw Image
and hence no conversion is possible on this file.
It would help if Digikam can add support for this *.raw format.It can ask the user to enter image width,height,bits per pixel for this format and then interpret it accordingly.
Will it be possible to expect support for this type of raw image format?

thanks,
-AD.

Reproducible: Always


Actual Results:  
Camera:Cannot identify Raw Image 

Expected Results:  
Would be good if Digikam recognize this format and allow me to convert it to DNG or some other format.
Comment 1 ajitsdeshpande 2011-01-07 13:25:56 UTC
Please download the Aptina Raw image file from url below:- 

https://docs.google.com/leaf?id=0ByuMwWMOjsD0YTM1N2YzYTAtZDRhMy00ZWEzLThjNjctMjYxZTZmMzgzZmNh&sort=name&layout=list&num=50
Comment 2 caulier.gilles 2011-01-07 13:31:33 UTC
digiKam use libraw in background to play with RAW files. ther is nor RAW decoder source code in digiKam core.

For more information, look here : http://www.libraw.org

I CC Alex Tutubalin who is libraw coordinator.

Gilles Caulier
Comment 3 Alex Tutubalin 2011-01-07 13:43:58 UTC
There is no way to support this data format due to lack of header (and other metadata).
Comment 4 ajitsdeshpande 2011-01-07 13:58:54 UTC
If the user is asked to enter - width, height, bits per pixel, wouldn't it be possible? Just trying to understand here.
Comment 5 Alex Tutubalin 2011-01-07 14:34:11 UTC
image size and bps is not enough. For postprocessing stage you need:
 1) image size (full size and real image size)
 2) black and white levels (possibly per-channel)
 3) bayer pattern
 4) white balance data
 5) color data.

Generally, it is better to create separate Aptina-sensor to DNG converter, than use DNG files in every converter.
Comment 6 caulier.gilles 2011-01-07 14:40:23 UTC
So i move this entry to DNG COnverter...

Gilles Caulier
Comment 7 Alex Tutubalin 2011-01-07 14:50:31 UTC
(KDE) DNG Converter also uses LibRaw to read the data (and metadata). For Aptina files without metadata it is better to make separate (and very compact) application with metadata embedded into program (not into raw files).
Comment 8 ajitsdeshpande 2011-01-07 15:43:34 UTC
Hello Alex,
   Regarding your comment above, I have few mroe queries, if you please can answer.
  What if user manually enters below information needed in the Digikam tool for thsi format file:
>> 1) image size (full size and real image size) 
>> 3) bayer pattern (this format is GRBG)

>> 2) black and white levels (possibly per-channel)
  What is this. data. Is it the two values for black and white?
 
>> 4) white balance data
What comprises of this data? Is it some color temperature or white point for that temperature? Why is this data needed? 

>> 5) color data.
What is this data? Why is it needed?

Basically, why would white balance data and color data be needed in a raw file. I don't want to any Image processing on it. All I want is to be able to use Digikam to open this raw format(with user inputing some parameters to help it interpret it), then convert it to some other format say DNG. and store the DNG file.  
BTW, does DNG file format need White balance, Color data information ? 

thank you.
-AD.
Comment 9 Alex Tutubalin 2011-01-07 16:22:30 UTC
AFAIK, digiKam cannot write DNG files.

Anyway, digiKam is *photo* processing application. For photo processing no one want to look into RAW data: in linear space (so, very dark), without white balance (so, with strong green cast for most cameras), without color profile applied (so, with wrong colors). There is no way to show the photo right without white balance and color profile data.

Answers to questions:
 black level is 'dark current' value. This value should be subtracted from RAW data to get linearized data. Different cameras are very different in this aspect.
 White level is saturation point (maximum possible value). It is critical to know exact white level to get proper color in highlights.
 White balance/color temperature may be presented as color conversion matrix (bradford conversion or so) or as per-channel multipliers (different for each shot). LibRaw uses multipliers and try to get these values from camera metadata.
 Color data (color matrix or color profile) is generalized description of sensor's R/G/B filters.
Comment 10 ajitsdeshpande 2011-01-07 16:43:47 UTC
Hi , As per the news on the digikam site: http://www.digikam.org/drupal/node/373 
It does have support to convert Raw to DNG.

Digikam need not have preview or display of the raw image file format, it can just convert to DNG format.
Comment 11 ajitsdeshpande 2011-01-07 16:45:50 UTC
Hi , As per the news on the digikam site: http://www.digikam.org/drupal/node/373 
It does have support to convert Raw to DNG, under Linux

I am using the Linux Digikam binaries.
Digikam need not have preview or display of the Aptina raw image file format, it can just convert it to DNG format.  Since it supports conversion of raw to DNG.
Comment 12 Alex Tutubalin 2011-01-08 09:59:47 UTC
You cannot make valid DNG without color matrix.

Also, the image sample does not looks as 'linear' data. The data looks like gamma 1.8 image, or, possible, other tone curve is used.

So, to convert to DNG (either bayer-data or linear RGB) one needs to know exact tone curve used by camera.
Comment 13 caulier.gilles 2019-12-24 14:15:51 UTC
digiKam 7.0.0-beta1 is out :

https://download.kde.org/unstable/digikam/

This problem still reproducible with this version which include Libraw engine version 0.20.0 ?

Thanks in advance and merry Christmas

Gilles Caulier
Comment 14 caulier.gilles 2020-08-04 05:03:05 UTC
I close this file as this whish is out of scope of digiKam project.