Recent comments

Reply to: LibRaw image size data vs Adobe interpretation   9 years 4 months ago

Thank you, that's very helpful. I'll go with LibRaw's sensor-size and ActiveArea then.

I actually care mostly about the DefaultCrop since that's what the users sees. I guess Adobe reads the final size from the MakerNotes (e.g., Sony has a FullImageSize tag) and then probably centers it in the ActiveArea. Will see if I can extract some of those with libexiv2.

To make it more complicated, there are also ImageWidth/Height Exif tags at least for Canon/Sony, which seem to also include user settings like 16:9 crop. Adobe (in DNG 1.4) interestingly translates that to DefaultUserCrop, which means the DNG includes 4 nested crops (sensor size, active area, default crop, default user crop)...

Reply to: LibRaw image size data vs Adobe interpretation   9 years 4 months ago

Unfortunately, there is no any 'system' in LibRaw margin (ActiveArea) size.
- some of values are derived from dcraw without change
- some of values are read from RAW metadata
- some of values are assigned by hand with 'maximum possible area' in mind.

For entire sensor size, Adobe DNG convertor crops sensor data for some cameras for unknown reason. Also, this cropping may change with DNG convertor version change (I've seen this at least on some Fuji cameras).
Sensor size is definitely right in LibRaw. Wrong raw_width will result in completely distorted image, wrong (too small) raw_height will result in buffer overrun.

Reply to: LibRaw 1.7beta1 vs dcraw 9.26 result   9 years 4 months ago

Solved, now I'm able to get the exact match.
Thank you!

Reply to: LibRaw 1.7beta1 vs dcraw 9.26 result   9 years 4 months ago

P.S. Please note -h key (half interpolation), because AHD interpolation is slightly different in LibRaw and dcraw.

For binary comparison, you may use -q 1 (VNG interpolation, same in LibRaw and dcraw).

Reply to: LibRaw 1.7beta1 vs dcraw 9.26 result   9 years 4 months ago
Yes, LibRaw performs automatic maximum adjustment to prevent 'pink clouds' (and other highlights) problem seen on many cameras where real maximum varies with ISO or other camera settings.

To turn it off, use '-c 0' switch of dcraw_emu (or set imgdata.params.adjust_maximum_thr to 0.0).

Simple test:

$ ./bin/dcraw_emu -h -c 0 ~/temp/camera04_01.CR2
$~/dcr926/dcraw -h ~/temp/camera04_01.CR2
$ md5 ~/temp/camera04_01.*ppm
MD5 (/home/lexa/temp/camera04_01.CR2.ppm) = 6bc70a092bb0096bd75d1f9ef54714b4
MD5 (/home/lexa/temp/camera04_01.ppm) = 6bc70a092bb0096bd75d1f9ef54714b4
So, two PPMs (from dcraw 9.26 and from LibRaw's dcraw_emu) are binary the same.
Reply to: optimisation/bug in convert_to_rgb() ?   9 years 4 months ago

raw_color is, indeed, to avoid color matrix multiplication in convert-to-rgb loop.
This flag is set not only in this ifdef, but in some other cases too (NikonScan files, Leaf HDR files)

Reply to: optimisation/bug in convert_to_rgb() ?   9 years 4 months ago

Apologies I reversed the ifdef in my head, I should have pasted the else branch, it too sets the same variable, which appears to be part of the context of dcraw rather than the LibRaw code which is testing in convert_to_rgb_loop the value in the libraw_internal_data.internal_output_params.raw_color. I had imagined the intent was to avoid the matrix multiply when the matrix is unity.

Re subclassing - fine with me I'm probably going to combine that and some other code into a single pass over the memory as easy wins in performance.

Thanks for your efforts in producing the library much easier to use than the dcraw code direct.

Kevin

Reply to: VS 2013 Express simple program   9 years 4 months ago

You don't have to port you simple app on windows, it is simple enough and doesn't contain and system dependent part.
You should just download latest libraw binary and compile your app with proper toolchain (mignw or visual studio) and use proper include and library options during compilation (-I"your_libraw_include_path" -L"your_libraw_lib_path" -lraw options for mingw/gcc or "Additional Include directories" "Additional Library directories" and "Additional libraries" for Visual studio project settings)

Reply to: optimisation/bug in convert_to_rgb() ?   9 years 4 months ago

This code is under #ifndef LIBRAW_LIBRARY_BUILD, so it is not compiled into LibRaw (because LibRaw is compiled with LIBRAW_LIBRARY_BUILD defined).
LibRaw's code snippet is mostly the same, but without document_mode into account. And it is not wrong.

Histogram: LibRaw calls convert_to_rgb_loop() virtual function. If you do not need histogram calculation, you may provide your own convert_to_rgb_loop() in derived class. The histogram is needed for automatic brightness correction (if used).

Reply to: Modify parameters of raw image   9 years 4 months ago

LibRaw is definitely not the solution for your problem

Reply to: Modify parameters of raw image   9 years 4 months ago

I am doing a project about raw file processing.I do not know how to use C++ to write source code to modifies some parameters of RAW file . I have thought about the question for days. Can you give me some suggestion about it.
Thank you!

Reply to: Modify parameters of raw image   9 years 4 months ago

LibRaw opens files in read-only mode and never modifies file data.

Try to use exiftool (or other tools) to modify image metadata.

Reply to: How get correct RGB? No need auto levels   9 years 5 months ago

use imageProcessor.imgdata.params.no_auto_bright=1 before processing;

http://www.libraw.org/docs/API-datastruct-eng.html#libraw_output_params_t

Reply to: Standalone WIN32 program   9 years 5 months ago

Most likely you need Visual Studio runtime installed (or just copied into program folder)

Reply to: VS 2013 Express simple program   9 years 5 months ago

Could you please explain your problem in more details?

Reply to: How do I install the Demosaic Packs?   9 years 6 months ago

There is no any runtime check to check demosaic pack compiled in.

Make sure that you compile LibRaw with LIBRAW_DEMOSAIC_PACK_GPL2 and LIBRAW_DEMOSAIC_PACK_GPL3 defines.

Reply to: Any benchmarks?   9 years 6 months ago

There are two phases on raw processing:
- raw data decoding (decompressing)
- and postprocessing (black subtraction, white balance, demosaic, color conversion)

For Canon files, decoding is relatively slow, thanks for huffman compression used. RawSpeed is faster than LibRaw for these files (but you can use RawSpeed indirectly via LibRaw).

Postprocessing speed varies from method to method. For timelapse (e.g. video output in 1080p?) you don't need full resolution, so 'half' demosaic may be used.

The LibRaw's benchmark is 'samples/postprocessing-benchmark.cpp' which is included in LibRaw since v0.15

Reply to: Chromatic Abberation errors, blue halo   9 years 6 months ago

Any news on this? At least i confirm something's up with tiles, also in CA_correct_RT.cc,
`#define TS 256 // Tile sizez

Reply to: Difference dcraw and dcraw_emu in sequential brightness.   9 years 6 months ago

Worked great alex, you're the man. No problem, you need to make a donation button somewhere, i'd get your some coffee ;).

Reply to: Compatability Matrix   9 years 7 months ago

Actual camera list is returned by LibRaw::cameraList() call (http://www.libraw.org/docs/API-CXX-eng.html#cameraList )

There is no list on site, because the list updates frequently (if you use development branch), also actual list depends on actual version you use.

Nikon D610 is supported in LibRaw 0.16, D750 in 0.17(-Alpha1)

Also, to use LibRaw as library you definitely need to spend 'more than minute'.

Reply to: Difference dcraw and dcraw_emu in sequential brightness.   9 years 7 months ago

Sure, I mean to say -c 0:
-c float-num Set adjust maximum threshold (default 0.75)

Sorry for inconvenience, I need to sleep more :)

Reply to: Difference dcraw and dcraw_emu in sequential brightness.   9 years 7 months ago

Hi Alex, Thanks. But:
Tims-:bin tzaman$ ./dcraw_emu -T -w -W -e 0 /Volumes/TZ_USB3_32G/*.nef
Unknown option "-e".
Tim:bin tzaman$ ./dcraw_emu -T -w -W -e /Volumes/TZ_USB3_32G/*.nef
Unknown option "-e".

edit 1
Although i think you meant to say '-W'. This should turn auto brightening off, but it clearly does not for my images.

edit 2
Did you mean to say '-c 0' ?

Reply to: Difference dcraw and dcraw_emu in sequential brightness.   9 years 7 months ago

Followup: maximum values in two files are differ: 12335 and 14213 in G1 channel. May be hotpixel, may be just signal variation

Reply to: Difference dcraw and dcraw_emu in sequential brightness.   9 years 7 months ago

LibRaw (and dcraw_emu) with default settings uses automatic maximum level detection (to prevent 'pink clouds effect', 5 years ago I've written small article about it, it is in Russian, but google translate will help: http://blog.lexa.ru/2010/03/28/taina_rozovykh_oblakov.html )

To turn this detector off (and produce results nearly the same as dcraw) use -e 0 switch of dcraw_emu.

Reply to: Relations between cam_xyz and rgb_cam   9 years 7 months ago

cam_xyz[] matrix is the same matrix as DNG 'ColorMatrixN' (XYZ to Camera). For most cameras (ones without built-in color data) it is identical to Adobe's Color Matrix for Daylight.

rgb_cam[] is camera-to-sRGB conversion.

Pages