Skip to content

Commit

Permalink
[feat]IBA:demosaic add X-Trans demosaicing
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Dukhovnikov <[email protected]>
  • Loading branch information
antond-weta committed Jan 1, 2025
1 parent fd411a6 commit 796f59f
Show file tree
Hide file tree
Showing 7 changed files with 1,177 additions and 225 deletions.
14 changes: 9 additions & 5 deletions src/doc/oiiotool.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4212,13 +4212,17 @@ current top image.
Optional appended modifiers include:

`pattern=` *name*
sensor pattern. Currently supported patterns: "bayer"
sensor pattern. Currently supported patterns: "bayer", "xtrans".
`layout=` *name*
photosite order of the specified pattern. For layouts of the Bayer
pattern supported: "RGGB", "GRBG", "GBRG", "BGGR".
photosite order of the specified pattern. The default value is "RGGB"
for Bayer, and "GRBGBR BGGRGG RGGBGG GBRGRB RGGBGG BGGRGG" for X-Trans.
`algorithm=` *name*
the name of the algorithm to use: "linear"(simple bilinear demosaicing),
"MHC"(Malvar-He-Cutler algorithm)
the name of the algorithm to use.
The Bayer-pattern algorithms:
"linear"(simple bilinear demosaicing),
"MHC"(Malvar-He-Cutler algorithm).
The X-Trans-pattern algorithms:
"linear"(simple bilinear demosaicing).
`white-balance=` *v1,v2,v3...*
optional white balance weights, can contain either three (R,G,B) or four
(R,G1,B,G2) values. The order of the white balance multipliers is as
Expand Down
5 changes: 3 additions & 2 deletions src/doc/pythonbindings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3701,9 +3701,10 @@ Color manipulation
bool ImageBufAlgo.demosaic (dst, src, pattern="", algorithm="", layout="", white_balance=py::none(), roi=ROI.All, nthreads=0)
Demosaic a raw digital camera image.
`demosaic` can currently process Bayer pattern images (pattern="bayer")
`demosaic` can currently process Bayer-pattern images (pattern="bayer")
using two algorithms: "linear" (simple bilinear demosaicing), and "MHC"
(Malvar-He-Cutler algorithm). The optional white_balance parameter can take
(Malvar-He-Cutler algorithm); or X-Trans-pattern images (pattern="xtrans")
using "linear" algorithm. The optional white_balance parameter can take
a tuple of three (R,G,B), or four (R,G1,B,G2) values. The order of the
white balance multipliers is as specified, it does not depend on the matrix
layout.
Expand Down
6 changes: 4 additions & 2 deletions src/include/OpenImageIO/imagebufalgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -2164,7 +2164,7 @@ bool OIIO_API repremult (ImageBuf &dst, const ImageBuf &src,
///
/// - "pattern" : string (default: "bayer")
///
/// The type of image sensor color filter array. Currently only the Bayer-pattern images are supported.
/// The type of image sensor color filter array. Currently only the Bayer-pattern or X-Trans-pattern images are supported.
///
/// - "algorithm" : string (default: "linear")
///
Expand All @@ -2173,8 +2173,10 @@ bool OIIO_API repremult (ImageBuf &dst, const ImageBuf &src,
/// - `linear` - simple bilinear demosaicing. Fast, but can produce artefacts along sharp edges.
/// - `MHC` - Malvar-He-Cutler linear demosaicing algorithm. Slower than `linear`, but produces
/// significantly better results.
/// The following algorithms are supported for X-Trans-pattern images:
/// - `linear` - simple linear demosaicing. Fast, but can produce artefacts along sharp edges.
///
/// - "layout" : string (default: "RGGB")
/// - "layout" : string (default: "RGGB" for Bayer, "GRBGBR BGGRGG RGGBGG GBRGRB RGGBGG BGGRGG" for X-Trans)
///
/// The order the color filter array elements are arranged in, pattern-specific.
///
Expand Down
Loading

0 comments on commit 796f59f

Please sign in to comment.