hello,
I did some further checks regarding this issue. As mentioned the camera
is not explicitly set to produce sraws (actually there is no option for
this).
I made a model specific fix for this, see below. Yet I am not sure that
the initial code (with factor 3 was correct). is there any sraw file
that causes this code to be executed? if so I am happy to further check.
---
diff --git a/src/common/imageio_rawspeed.cc b/src/common/imageio_rawspeed.cc
index d9226a0..956242a 100644
--- a/src/common/imageio_rawspeed.cc
+++ b/src/common/imageio_rawspeed.cc
@@ -215,13 +215,17 @@ dt_imageio_open_rawspeed_sraw(dt_image_t *img,
RawImage r, dt_mipmap_cache_alloc
#else
// TODO - OMPize this.
+ int factor = 3; // not sure why 3 was the default value - is this
value correct for other sraw files?
+ if(!strcmp(makermodel, "Leica M Monochrom"))
+ factor = 1;
+
float scale = 1.0 / (white - black);
for( int row = 0; row < raw_height; ++row )
for( int col = 0; col < raw_width; ++col )
for( int k = 0; k < 3; ++k )
((float *)buf)[4 * dt_imageio_write_pos(col, row, raw_width,
raw_height, raw_width, raw_height, orientation) + k] =
// ((float)raw_img[row*(raw_width + raw_width_extra)*3 +
col*3 + k] - black) * scale;
- ((float)raw_img[row*(r->pitch/2) + col*3 + k] - black) * scale;
+ ((float)raw_img[row*(r->pitch/2) + col*factor + k] - black) *
scale;
#endif
return DT_IMAGEIO_OK;
---
actually i don't like to stain the code with particular code for just
one camera, but if there is no objection i can put this officially into git.
good luck getting 1.4rc1 ready!
marcus
On 12/02/2013 11:04 PM, johannes hanika wrote:
> hey,
>
> thanks for checking it out, looks like there is a reasonably small fix
> for this.
>
> if you walk col in 1 increments, not 3*, you don't need the for(k..)
> loop any more.
>
> also of course you need to check whether or not you're dealing with a
> file from your particular camera before doing that.
>
> are all files from that cam sraw or did you set that explicitly?
>
> j.
>
>
> On Mon, Dec 2, 2013 at 2:55 PM, schmidtfrog <schmidtf...@gmx.de
> <mailto:schmidtf...@gmx.de>> wrote:
>
> Hello,
>
> jo thanks for the hint. I have been able to "adjust"
> src/common/imageio_rawspeed.cc. after applying below small change
> the Monochrom DNGs are displayed properly (not sure if overall
> darktable is handling the data correctly now).
> i am new to darktable with no idea of what evil whitchcraft i have
> applied here :)
>
> marcus
>
>
> diff --git a/src/common/imageio_rawspeed.cc
> b/src/common/imageio_rawspeed.cc
> index d9226a0..4c27a75 100644
> --- a/src/common/imageio_rawspeed.cc
> +++ b/src/common/imageio_rawspeed.cc
> @@ -221,7 +221,7 @@ dt_imageio_open_rawspeed_sraw(dt_image_t *img,
> RawImage r, dt_mipmap_cache_all
> for( int k = 0; k < 3; ++k )
> ((float *)buf)[4 * dt_imageio_write_pos(col, row,
> raw_width, raw_height, raw_width, raw_h
> // ((float)raw_img[row*(raw_width + raw_width_extra)*3
> + col*3 + k] - black) * scale;
> - ((float)raw_img[row*(r->pitch/2) + col*3 + k] - black)
> * scale;
> + ((float)raw_img[row*(r->pitch/2) + col + k] - black) *
> scale;
> #endif
>
> return DT_IMAGEIO_OK;
>
>
>
>
>
> On 11/29/2013 11:25 PM, schmidtfrog wrote:
>> Hello,
>>
>> thanks for the hints!
>>
>> yes, rawstudio can open the file
>> (https://www.dropbox.com/s/qo4v5hilv85myjp/snapshot2.jpg).
>>
>> I am not sure how the image information is stored in the DNG and
>> how it is processed by darktable. I will try to have a look in
>> imageio_rawspeed.
>>
>> marcus
>>
>>
>>
>>
>> On 11/29/2013 02:58 AM, johannes hanika wrote:
>>> heya,
>>>
>>> weird that it appears three times. doing some wrong bayer
>>> pattern interpolation would mean to oversmooth details, but
>>> three copies would be some sort of scanline/pixel storage order
>>> problem.
>>>
>>> anyways, i think some related modules would be:
>>>
>>> src/iop/temperature.c (whitebalance)
>>> src/iop/demosaic.c (demosaicing)
>>>
>>> both of them should effectively pass through the data, the first
>>> one could potentially need to promote it from 1x uint16_t per
>>> pixel to 1x float per pixel, and the latter one should promote
>>> it to 4x float/pixel so the rest of the modules can work on
>>> color data as they expect it.
>>>
>>> can you open the image in rawstudio? those three copies look
>>> like it's opened as an already-demosaiced color image that is
>>> wrongly interpreted as 3 floats/pixel where we only get one.
>>>
>>> might be necessary to adjust src/common/imageio_rawspeed.cc to
>>> understand that (in this case white balance and demosaic are
>>> probably already doing the expected passthrough).
>>>
>>> cheers,
>>> jo
>>>
>>>
>>>
>>> On Thu, Nov 28, 2013 at 1:38 PM, schmidtfrog <schmidtf...@gmx.de
>>> <mailto:schmidtf...@gmx.de>> wrote:
>>>
>>> Hello (for the first time),
>>>
>>> I have tried to open some DNGs from a Leica M Monochrom in
>>> Darktable
>>> (almost latest git master). Seems like some trouble due to
>>> the fact that
>>> a Bayer filter is missing in the cam. The actual image
>>> appears three
>>> times (see below screenshot).
>>>
>>> https://www.dropbox.com/s/qpy4j481y20rdzk/snapshot1.jpg?n=223299317
>>>
>>> Unfortunately I am not familar with darktable functions (had
>>> only a
>>> short look into the sources).
>>>
>>> Nevertheless I would be happy if someone has a hint which
>>> function/files
>>> are worthwhile to check.
>>>
>>> Marcus
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Rapidly troubleshoot problems before they affect your
>>> business. Most IT
>>> organizations don't have a clear picture of how application
>>> performance
>>> affects their revenue. With AppDynamics, you get 100%
>>> visibility into your
>>> Java,.NET, & PHP application. Start your 15-day FREE TRIAL
>>> of AppDynamics Pro!
>>>
>>> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> darktable-devel mailing list
>>> darktable-devel@lists.sourceforge.net
>>> <mailto:darktable-devel@lists.sourceforge.net>
>>> https://lists.sourceforge.net/lists/listinfo/darktable-devel
>>>
>>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Rapidly troubleshoot problems before they affect your business. Most IT
>> organizations don't have a clear picture of how application performance
>> affects their revenue. With AppDynamics, you get 100% visibility into
>> your
>> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of
>> AppDynamics Pro!
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
>>
>>
>> _______________________________________________
>> darktable-devel mailing list
>> darktable-devel@lists.sourceforge.net
>> <mailto:darktable-devel@lists.sourceforge.net>
>> https://lists.sourceforge.net/lists/listinfo/darktable-devel
>
>
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
darktable-devel mailing list
darktable-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/darktable-devel