Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: IBA:demosaic add X-Trans demosaicing #4579

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
11 changes: 8 additions & 3 deletions src/include/OpenImageIO/imagebufalgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -2164,7 +2164,9 @@ 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 suported patterns:
/// - `bayer` - Bayer-pattern image.
/// - `xtrans` - X-Trans-pattern image.
///
/// - "algorithm" : string (default: "linear")
///
Expand All @@ -2174,11 +2176,14 @@ bool OIIO_API repremult (ImageBuf &dst, const ImageBuf &src,
/// - `MHC` - Malvar-He-Cutler linear demosaicing algorithm. Slower than `linear`, but produces
/// significantly better results.
///
/// - "layout" : string (default: "RGGB")
/// 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" for Bayer, "GRBGBR BGGRGG RGGBGG GBRGRB RGGBGG BGGRGG" for X-Trans)
Comment on lines +2179 to +2182
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the text alignment is correct here. Can you double check this whole surrounding area? Also might be good to look at the artifacts saved by the "docs CI" to be sure that the resulting documentation definitely look as you imagine it should.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I had checked the artefacts, those looked fine.
I think I've spent a few hours fixing that bit, as I can't build the docs locally. The reason that alignment looks weird is because there are nested bullet point lists, and the 'linear' thingy is a single entry list (made it that way to be consistent with other things) belonging to the previous parameter ('algorithm').

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks, I was just making sure since it was a 2-level list and I wasn't sure from looking these diffs whether everything was aligned as you intended. If they looked ok when viewing the artifacts, then all is fine.

///
/// The order the color filter array elements are arranged in, pattern-specific.
///
/// - "white-balance" : float[3] or float[4] (default: {1.0, 1.0, 1.0, 1.0})
/// - "white-balance" : float[3] or float[4], (default: {1.0, 1.0, 1.0, 1.0})
///
/// Optional white-balancing weights. Can contain either three (R,G,B), or four (R,G1,B,G2) values.
/// The order of the white balance multipliers does not depend on the matrix layout.
Expand Down
Loading
Loading