Skip to content

Commit 900122f

Browse files
committed
[feat]IBA:demosaic add X-Trans demosaicing
Signed-off-by: Anton Dukhovnikov <[email protected]>
1 parent fd411a6 commit 900122f

File tree

7 files changed

+1173
-225
lines changed

7 files changed

+1173
-225
lines changed

src/doc/oiiotool.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4212,13 +4212,17 @@ current top image.
42124212
Optional appended modifiers include:
42134213

42144214
`pattern=` *name*
4215-
sensor pattern. Currently supported patterns: "bayer"
4215+
sensor pattern. Currently supported patterns: "bayer", "xtrans".
42164216
`layout=` *name*
4217-
photosite order of the specified pattern. For layouts of the Bayer
4218-
pattern supported: "RGGB", "GRBG", "GBRG", "BGGR".
4217+
photosite order of the specified pattern. The default value is "RGGB"
4218+
for Bayer, and "GRBGBR BGGRGG RGGBGG GBRGRB RGGBGG BGGRGG" for X-Trans.
42194219
`algorithm=` *name*
4220-
the name of the algorithm to use: "linear"(simple bilinear demosaicing),
4221-
"MHC"(Malvar-He-Cutler algorithm)
4220+
the name of the algorithm to use.
4221+
The Bayer-pattern algorithms:
4222+
"linear"(simple bilinear demosaicing),
4223+
"MHC"(Malvar-He-Cutler algorithm).
4224+
The X-Trans-pattern algorithms:
4225+
"linear"(simple bilinear demosaicing).
42224226
`white-balance=` *v1,v2,v3...*
42234227
optional white balance weights, can contain either three (R,G,B) or four
42244228
(R,G1,B,G2) values. The order of the white balance multipliers is as

src/doc/pythonbindings.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3701,9 +3701,10 @@ Color manipulation
37013701
bool ImageBufAlgo.demosaic (dst, src, pattern="", algorithm="", layout="", white_balance=py::none(), roi=ROI.All, nthreads=0)
37023702
Demosaic a raw digital camera image.
37033703
3704-
`demosaic` can currently process Bayer pattern images (pattern="bayer")
3704+
`demosaic` can currently process Bayer-pattern images (pattern="bayer")
37053705
using two algorithms: "linear" (simple bilinear demosaicing), and "MHC"
3706-
(Malvar-He-Cutler algorithm). The optional white_balance parameter can take
3706+
(Malvar-He-Cutler algorithm); or X-Trans-pattern images (pattern="xtrans")
3707+
using "linear" algorithm. The optional white_balance parameter can take
37073708
a tuple of three (R,G,B), or four (R,G1,B,G2) values. The order of the
37083709
white balance multipliers is as specified, it does not depend on the matrix
37093710
layout.

src/include/OpenImageIO/imagebufalgo.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,7 +2164,7 @@ bool OIIO_API repremult (ImageBuf &dst, const ImageBuf &src,
21642164
///
21652165
/// - "pattern" : string (default: "bayer")
21662166
///
2167-
/// The type of image sensor color filter array. Currently only the Bayer-pattern images are supported.
2167+
/// The type of image sensor color filter array. Currently only the Bayer-pattern or X-Trans-pattern images are supported.
21682168
///
21692169
/// - "algorithm" : string (default: "linear")
21702170
///
@@ -2173,8 +2173,10 @@ bool OIIO_API repremult (ImageBuf &dst, const ImageBuf &src,
21732173
/// - `linear` - simple bilinear demosaicing. Fast, but can produce artefacts along sharp edges.
21742174
/// - `MHC` - Malvar-He-Cutler linear demosaicing algorithm. Slower than `linear`, but produces
21752175
/// significantly better results.
2176+
/// The following algorithms are supported for X-Trans-pattern images:
2177+
/// - `linear` - simple linear demosaicing. Fast, but can produce artefacts along sharp edges.
21762178
///
2177-
/// - "layout" : string (default: "RGGB")
2179+
/// - "layout" : string (default: "RGGB" for Bayer, "GRBGBR BGGRGG RGGBGG GBRGRB RGGBGG BGGRGG" for X-Trans)
21782180
///
21792181
/// The order the color filter array elements are arranged in, pattern-specific.
21802182
///

0 commit comments

Comments
 (0)