Recent comments

Reply to: How to emulate dcraw -D (dcraw document mode)   9 years 9 months ago

Update:
document_mode is dropped from simple_dcraw (although help not changed, sorry) due to LibRaw internals change.

To get unprocessed raw data please use these LibRaw samples:
4channels - to get per-channel data in separate files
unprocessed_raw to get unprocessed raw data in 1-color bitmap.

Reply to: How to emulate dcraw -D (dcraw document mode)   9 years 9 months ago

Latest versions of dcraw have changed much in document mode, LibRaw sample may be not up-to-date.

Please specify what kind of output do you want to receive and I'll provide you imgdata.params you need to set to get this mode from LibRaw.

Reply to: cam_xyz is not available for DNG files   9 years 9 months ago

Thanks, didn't know about the GitHub repository.

Reply to: cam_xyz is not available for DNG files   9 years 9 months ago

This is already fixed in development branch (available at https://github.com/LibRaw/LibRaw ) in two ways
1) Internal LibRaw color profile is copied to imgdata.color.cam_xyz[] ever for DNG files.
2) For DNG files full DNG color data preserved in imgdata.color.dng_color[2] (if DNG contains two color matrices, then both matrices are preserved)

Reply to: Conversion to gray level   9 years 10 months ago

For unprocessed (not demosaiced) image you may ignore G2 or average (G+G2)/2.
Processed image is RGB in most cases, just ignore 4th component.

Reply to: Maximum value is not 65535 in the raw image   9 years 10 months ago

Thank you so much!
It is now clear for the NEF file. I need however to test if the problem comes from my IIQ picture...

I've check one more time and I still get a maximum value of 11040 for the 16bits data from the PhaseOne IQ180 (even if there's some white zones in the photograph).
Thanks to Alex, I'm now confident with the piece of code used, and I will investigate the problem in the settings of the digital back.

Another question:
is it a normal behavior to have different values for imgdata.color.maximum and max (the latter being computed by looping over the raw pixels)? Here is what I obtain:

max = 11040
iProcessor.imgdata.color.maximum = 64508

Thank you again.

Reply to: Maximum value is not 65535 in the raw image   9 years 10 months ago

D90 is 12-bit camera, so maximum possible value is 4096.
It may be slightly less if 'zero level' (bias) is subtracted by camera.

IQ180 is 16-bit, so maximum value should be 64k (and it is in my tests)

Reply to: output_color = 0 and half_size = 1 gives RGBA-Color   9 years 10 months ago

I can confirm his finding, it is in RGBA. This does not only impact dcraw_make_mem_image(), but it also breaks dcraw_ppm_tiff_writer! I am working on Linux 13.04 (libraw v 0.15-0Beta4)
I can also confirm this is *NOT* a problem in OSx 10.9 (libraw v 0.16.0).

I can now confirm this is an issue with <0.16 versions. Update to 0.16 and you are okay.

T

Reply to: Half sized image with raw output color   9 years 10 months ago

I can confirm this is an issue since it has been posted before: http://www.libraw.org/node/1865

Reply to: Half sized image with raw output color   9 years 10 months ago

the emulator works fine for me too. But my code is simple and still fails for half size and raw color. Maybe the dcraw make mem image function?

(...)
iProcessor.unpack();
// call for postprocessing utility
iProcessor.dcraw_process();
int check_makemem;
image = iProcessor.dcraw_make_mem_image(&check_makemem);
Mat image_rawRGB(cv::Size(image->width, image->height), rawBitDepthCV, image->data, cv::Mat::AUTO_STEP);

This gives out a mangled image if half size is on and raw colors..

Reply to: Half sized image with raw output color   9 years 11 months ago

dcraw_emu -o 0 -h works fine for me

could you please specify more details?

Reply to: Only decode specific area.   9 years 11 months ago

1) half-size interpolation is a special (very fast) mode: each 4 bayer pixels (r-g-b-g) are joined into one RGB pixel with two greens averaged.
2) There is no way to do partial RAW decoding (LibRaw::unpack()), all RAW data always decoded.
3) For partial processing you may set imgdata.params.cropbox (to x1,y1,x2,y2) and LibRaw::dcraw_process() will return you part of image. This is not thread safe, so cannot be used in parallel.
4) LibRaw can use OpenMP for parts of processing (e.g. AHD interpolation), just compile it with OpenMP

Reply to: LibRaw 0.16.0 dynamic library - Problem?   9 years 11 months ago

Hi Alex, thanks for that. I eventually found the problem that I was encountering in relation to the 0.16.0 build - I was inadvertently including the libraw.h file from the 0.15.4 build.

All working now, thanks,
duxy

Reply to: NEF missing values   9 years 11 months ago

This is Nikon's 'White balance preconditioning' feature (no way to turn it off, AFAIK).
The data from Red and Green channels are multiplied by some small coefficient and rounded to integer after that.

I do not know WHY Nikon is doing this, but it happens on ALL recent Nikon cameras (have not tested very old ones like D2).

The nikon data is 'lossless JPEG' (huffman compression) compressed. Decompressor code is same for many camera types (Canon, Nikon, Lossless DNG, several others). The missing values occur only on Nikon files. So, this is definitely not decompression artifact, but source data artifact.

Reply to: LibRaw 0.16.0 dynamic library - Problem?   9 years 11 months ago

Yes, 0.15 and 0.16 (or 0.11 and 0.12) are binary incompatible due to internals change.
You can use 0.15.x (from 0.15.0 to 0.15.4) or 0.14.x (from 0.14.0 to 0.14.8) without recompile of your app.

But if you change 'major' (second, because first entry is always 0) version, you need to recompile your application.

You may create some wrapper (with getters/setters to access imgdata.* fields) to stabilize the API for your needs (if you need to set only output_bps, you need only one setter call).

Reply to: LibRaw 0.16.0 dynamic library - Problem?   9 years 11 months ago

Hi Alex, I appreciate the quick response.

OK maybe I'm overlooking something obvious, and correct me if I'm wrong.... but if I re-compile my app each time, and re-compile the libs, then I can link to either the 0.15.4 or 0.16.0 libs? So this is what I have been doing each time that I test. I am aware that the API has changed between those two libs, but I do not know of any functions I'm calling directly from my code that need to be altered to use the two different libs (see code snippet in my previous post).

So my code base stays the same for either lib, yet I get different answers for the bit depth of the same image (after calling dcraw_make_mem_image()) depending on which lib I link to under Mac. Also the windows compile of my app gives the same bit depth for both libs. As I say, maybe I'm overlooking something obvious....

Thanks,
duxy

Reply to: LibRaw 0.16.0 dynamic library - Problem?   9 years 11 months ago

You cannot replace Libraw 0.15 binary (.so/.dylib) file with 0.16 (and vice versa).
The internal data structures are different.

Reply to: LibRaw 0.16.0 dynamic library - Problem?   9 years 11 months ago

Hi Alex, thanks for the quick response.

Sorry I should have mentioned that I recompiled my app when linking to the 0.16.0 libs. However, after debugging further I have realised that the LibRaw lib functions actually appear to be working ok, and that my problem lies somewhere else. The problem now is that the 0.15.4 and 0.16.0 libs produce different results for the following code snippet:

myImg->unpack();
myImg->imgdata.params.output_bps=16;
myImg->dcraw_process();
myRawData = myImg->dcraw_make_mem_image();
bitDepth = myRawData->bits;

For the *same* image, linking to 0.15.4 libs gives bitDepth=16, whereas linking to 0.16.0 libs gives bitDepth=8. This is despite the output_bps parameter being set to 16.

Any insight as to why this would be the case?

Thanks,

duxy

Reply to: LibRaw 0.16 Release   9 years 11 months ago

The current development branch (0.17-pre-pre-alpha) has been pushed to GitHub. https://github.com/LibRaw/LibRaw

The A7/A7R cameras are supported

Reply to: LibRaw 0.15.4   9 years 11 months ago

Нет, я не согласен, что так надо делать

Reply to: LibRaw 0.15.4   9 years 11 months ago

Тестовый комментарий

Reply to: LibRaw 0.16.0 dynamic library - Problem?   9 years 11 months ago

LibRaw *major* versions are not binary compatible (i.e. if you replace 0.15.xx to 0.16.xx you need to recompile your app). This is because internals are changed.

Correct versioning is implemented in configure and cmake scripts (and for Linux). I'm not sure, that configure/cmake scripts works well under Mac.

Reply to: LibRaw 0.16 Release   9 years 11 months ago

A7R is supported in (internal) development branch. It is under (heavy) internals change, so I do not push it to github (public repo) on regular schedule.
I can push it once, but this is *development* release, no guarantee for seamless work (and, sure, it is not binary compatible with 0.16).

Reply to: LibRaw 0.16 Release   9 years 11 months ago

My Digikam 3.5.0 can open Sony A7R RAW files, BUT the colours are strange and images appear as though under frosted glass.

Can you correct and add the A7R camera to your list of supported cameras?

Thank you.

Reply to: StdCall or Cdecl?   9 years 11 months ago

I'm not Windows development guru, so I'm not sure.
The DLLs are compiled with Microsoft Visual C++ with /LD switch (create DLL). I suspect, these DLLs are Cdecl because made with C/C++ without any additional settings.

Because LibRaw is distributed in open-source, you can easily modify it as you wish, including functions calling conventions.

Pages