简体   繁体   English

使用 LibRaw 正确解码 CR2 图像?

[英]Using LibRaw to correctly decode CR2 image?

My eventual goal is to decode CR2 images from multiple cameras for display in a desktop gui.我的最终目标是解码来自多个摄像头的 CR2 图像,以便在桌面 gui 中显示。

Using the LibRaw image decoding library, I've used the sample project to attempt to decode a CR2 image into a .TIFF file.使用 LibRaw 图像解码库,我使用示例项目尝试将 CR2 图像解码为 .TIFF 文件。

The original file as a jpg thumbnail is as follows:作为jpg缩略图的原始文件如下:

Image 1图 1

And the original CR2 after decoding and saving into a .TIFF is as follows:解码后保存为.TIFF的原始CR2如下:

Image 2图 2

As you can see, the outcome is slightly brighter and yellowish.如您所见,结果略亮且偏黄。

The sample project was contains the following parameters for decoding images:示例项目包含以下用于解码图像的参数:

"-c float-num       Set adjust maximum threshold (default 0.75)\n"
"-v        Verbose: print progress messages (repeated -v will add verbosity)\n"
"-w        Use camera white balance, if possible\n"
"-a        Average the whole image for white balance\n"
"-A <x y w h> Average a grey box for white balance\n"
"-r <r g b g> Set custom white balance\n"
"+M/-M     Use/don't use an embedded color matrix\n"
"-C <r b>  Correct chromatic aberration\n"
"-P <file> Fix the dead pixels listed in this file\n"
"-K <file> Subtract dark frame (16-bit raw PGM)\n"
"-k <num>  Set the darkness level\n"
"-S <num>  Set the saturation level\n"
"-n <num>  Set threshold for wavelet denoising\n"
"-H [0-9]  Highlight mode (0=clip, 1=unclip, 2=blend, 3+=rebuild)\n"
"-t [0-7]  Flip image (0=none, 3=180, 5=90CCW, 6=90CW)\n"
"-o [0-5]  Output colorspace (raw,sRGB,Adobe,Wide,ProPhoto,XYZ)\n"
#ifndef NO_LCMS
"-o file   Output ICC profile\n"
"-p file   Camera input profile (use \'embed\' for embedded profile)\n"
#endif
"-j        Don't stretch or rotate raw pixels\n"
"-W        Don't automatically brighten the image\n"
"-b <num>  Adjust brightness (default = 1.0)\n"
"-q N      Set the interpolation quality:\n"
"          0 - linear, 1 - VNG, 2 - PPG, 3 - AHD, 4 - DCB\n"
#ifdef LIBRAW_DEMOSAIC_PACK_GPL2
"          5 - modified AHD,6 - AFD (5pass), 7 - VCD, 8 - VCD+AHD, 9 - LMMSE\n"
#endif
#ifdef LIBRAW_DEMOSAIC_PACK_GPL3
"          10-AMaZE\n"
#endif
"-h        Half-size color image (twice as fast as \"-q 0\")\n"
"-f        Interpolate RGGB as four colors\n"
"-m <num>  Apply a 3x3 median filter to R-G and B-G\n"
"-s [0..N-1] Select one raw image from input file\n"
"-4        Linear 16-bit, same as \"-6 -W -g 1 1\n"
"-6        Write 16-bit linear instead of 8-bit with gamma\n"
"-g pow ts Set gamma curve to gamma pow and toe slope ts (default = 2.222 4.5)\n"
"-T        Write TIFF instead of PPM\n"
"-G        Use green_matching() filter\n"
"-B <x y w h> use cropbox\n"
"-F        Use FILE I/O instead of streambuf API\n"
"-timing   Detailed timing report\n"
"-fbdd N   0 - disable FBDD noise reduction (default), 1 - light FBDD, 2 - full\n"
"-dcbi N   Number of extra DCD iterations (default - 0)\n"
"-dcbe     DCB color enhance\n"
#ifdef LIBRAW_DEMOSAIC_PACK_GPL2
"-eeci     EECI refine for mixed VCD/AHD (q=8)\n"
"-esmed N  Number of edge-sensitive median filter passes (only if q=8)\n"
#endif
#ifdef LIBRAW_DEMOSAIC_PACK_GPL3
//"-amazeca  Use AMaZE chromatic aberrations refine (only if q=10)\n"
"-acae <r b>Use chromatic aberrations correction\n" //modifJD
"-aline <l> reduction of line noise\n" 
"-aclean <l c> clean CFA\n"
"-agreen <g> equilibrate green\n"
#endif
"-aexpo <e p> exposure correction\n"
// WF
"-dbnd <r g b g> debanding\n"
#ifndef WIN32
"-mmap     Use mmap()-ed buffer instead of plain FILE I/O\n"
#endif
"-mem      Use memory buffer instead of FILE I/O\n"
"-disars   Do not use RawSpeed library\n"
"-disinterp Do not run interpolation step\n"
"-dsrawrgb1 Disable YCbCr to RGB conversion for sRAW (Cb/Cr interpolation enabled)\n"
"-dsrawrgb2 Disable YCbCr to RGB conversion for sRAW (Cb/Cr interpolation disabled)\n"
"-disadcf  Do not use dcraw Foveon code either if compiled with demosaic-pack-GPL2\n"

I've tried various options to replicate the image in the thumbnail, such as white balancing (-w), interpolation quality (-q N), and embedded color matrix (+M).我尝试了各种选项来复制缩略图中的图像,例如白平衡 (-w)、插值质量 (-q N) 和嵌入颜色矩阵 (+M)。 When I used white balancing, it removed the yellowish tint but produced a bright image.当我使用白平衡时,它去除了淡黄色调,但产生了明亮的图像。 I then went on to disable automatic brightening (-W) and it produced a non-yellow image but much darker than the thumbnail.然后我继续禁用自动增亮(-W),它产生了一个非黄色的图像,但比缩略图暗得多。

What image decoding parameters will help me to decode the CR2 into the a high-quality image that looks like the thumbnail (in terms of color, brightness, etc.)?哪些图像解码参数将帮助我将 CR2 解码为看起来像缩略图的高质量图像(在颜色、亮度等方面)?

Problem solved.问题解决了。

While I don't have the specifics just yet, my senior said windows didn't support the original formatting option, and he also moved memory row-by-by.虽然我还没有具体细节,但我的前辈说 windows 不支持原始格式选项,他还逐行移动了内存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM