簡體   English   中英

使用 LibRaw 正確解碼 CR2 圖像?

[英]Using LibRaw to correctly decode CR2 image?

我的最終目標是解碼來自多個攝像頭的 CR2 圖像,以便在桌面 gui 中顯示。

使用 LibRaw 圖像解碼庫,我使用示例項目嘗試將 CR2 圖像解碼為 .TIFF 文件。

作為jpg縮略圖的原始文件如下:

圖 1

解碼后保存為.TIFF的原始CR2如下:

圖 2

如您所見,結果略亮且偏黃。

示例項目包含以下用於解碼圖像的參數:

"-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"

我嘗試了各種選項來復制縮略圖中的圖像,例如白平衡 (-w)、插值質量 (-q N) 和嵌入顏色矩陣 (+M)。 當我使用白平衡時,它去除了淡黃色調,但產生了明亮的圖像。 然后我繼續禁用自動增亮(-W),它產生了一個非黃色的圖像,但比縮略圖暗得多。

哪些圖像解碼參數將幫助我將 CR2 解碼為看起來像縮略圖的高質量圖像(在顏色、亮度等方面)?

問題解決了。

雖然我還沒有具體細節,但我的前輩說 windows 不支持原始格式選項,他還逐行移動了內存。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM