Image Processing¶
-
template<typename E, EnableIf<std::decay_t<E>, IsImageArray> = false>
inline auto foam::nanmeanImageArray(E &&src, const std::vector<size_t> &keep)¶ Calculate the nanmean of the selected images from an array of images.
- Parameters
src – image data. shape = (indices, y, x)
keep – a list of selected indices.
- Returns
: the nanmean image. shape = (y, x)
-
template<typename E, EnableIf<std::decay_t<E>, IsImageArray> = false>
inline auto foam::nanmeanImageArray(E &&src)¶ Calculate the nanmean of an array of images.
- Parameters
src – image data. shape = (indices, y, x)
- Returns
: the nanmean image. shape = (y, x)
-
template<typename E>
inline auto foam::nanmeanImageArray(E &&src1, E &&src2)¶ Calculate the nanmean of two images.
- Parameters
src1 – image data. shape = (y, x)
src2 – image data. shape = (y, x)
- Returns
: the nanmean image. shape = (y, x)
-
template<typename Policy, typename E, EnableIf<E, IsImageArray> = false>
inline void foam::correctImageData(E &src, const E &constants)¶ Inplace apply either gain or offset correct for an array of images.
Inplace apply either gain or offset correct for an image.
- Template Parameters
Policy – correction policy (OffsetPolicy or GainPolicy)
Policy – correction policy (OffsetPolicy or GainPolicy)
- Parameters
src – image data. shape = (indices, y, x)
constants – correction constants, which has the same shape as src.
src – image data. shape = (y, x)
constants – correction constants, which has the same shape as src.
-
template<typename Policy, typename E, EnableIf<E, IsImageArray> = false>
inline void foam::correctImageData(E &src, const E &gain, const E &offset)¶ Inplace apply both gain and offset correct for an array of images.
Inplace apply both gain and offset correct for an image.
- Parameters
src – image data. shape = (indices, y, x)
gain – gain correction constants, which has the same shape as src.
offset – offset correction constants, which has the same shape as src.
src – image data. shape = (y, x)
gain – gain correction constants, which has the same shape as src.
offset – offset correction constants, which has the same shape as src.
-
template<typename E, EnableIf<E, IsImageArray> = false>
inline void foam::correctImageData(E &src)¶ Inplace apply interleaved intra-dark correction for an array of images. In other words, for every other image in the array starting from the first one, it will be subtracted by the image next to it.
- Parameters
src – image data. shape = (indices, y, x)