UH-OH

It looks like you don’t have access to that feature yet

Contact sales to get upgraded to the full DevStudio experience.

UH-OH

It looks like you don't have access to that feature yet.

to select
to navigate
escto close
Chimera Compute Library (CCL) API ReferenceImage ProcessingColor Space Conversions

Color Space Conversions

RGB/BGR --> HSV

File: src/image.hppLines 3081–3112
    /**
     * @brief Converts a RGB/BGR input image to HSV in place.
     *
     * Assuming an RGB input image would look like in NCHW format:
     *
     * ```
     * ┌----------------------------...-┐             ┌----------------------------...-┐
     * |B, B, B, B, B, B, ... channel 2 |             |V, V, V, V, V, V, ... channel 2 |
     * | ┌---------------------------...-┐            | ┌---------------------------...-┐
     * | |G, G, G, G, G, G, ...channel 1 |            | |S, S, S, S, S, S, ...channel 1 |
     * | | ┌---------------------------...-┐          | | ┌---------------------------...-┐
     * | | |R, R, R, R, R, R, ...channel 0 |     =>   | | |H, H, H, H, H, H, ...channel 0 |
     * | | |R, R, R, R, R, R, ...          |          | | |H, H, H, H, H, H, ...          |
     * └ | |---------------------------...-|          └ | |---------------------------...-|
     *   | |.                              |            | |.                              |
     *   └ |.                              |            └ |.                              |
     *     |.                              |              |.                              |
     *     └---------------------------...-┘              └---------------------------...-┘
     * ```
     *
     * The ouput is HSV channels for the input image. 8bit color depth is assumed.
     * @tparam convertMethod depending upon conversion HSV TO RGB , Or BGR TO HSV
     * @tparam DdrInOutShape The in/out image shape
     * @tparam OcmAllocatorType Type of OCM memory allocator
     * @param InputImage The input image tensor. Input is in (r,g,b) or (b,g,r) format.
     * @param OutputImage The output image tensor. Output is in (h, s, v) format (0 < hue < 180 as in CV2).
     * @param ocmMemAlloc OCM memory allocator
     * @param convertMethod Options are ColorConversionMethod::BGR_TO_HSV or ColorConversionMethod::RGB_TO_HSV.
     */
    // clang-format on
    template <ColorConversionMethod convertMethod, typename DdrInOutShape, typename OcmAllocatorType>
    INLINE void colorConvert(DdrInOutShape& InputImage, DdrInOutShape& OutputImage, OcmAllocatorType& ocmMemAlloc) {

Grayscale

File: /src/image.hppLines 2832–2851
    /**
     * @brief Grayscale color conversion that accepts input in planar format, i.e. `(1, 1, height, width)`.
     *
     * @tparam OcmInputImageShape Tensor with `uint8` type and shape `(1, 3, height, width)`.
     * @tparam OcmOutputImageShape Tensor with `uint8` type and shape `(1, 1, height, width)`.
     * @param ocmInput Input tensor.
     * @param ocmOut Output tensor.
     * @param fxChannel1Weight Grayscale weight for first chanel (defaults assume BGR order).
     * @param fxChannel2Weight Grayscale weight for second chanel (defaults assume BGR order).
     * @param fxChannel3Weight Grayscale weight for third chanel (defaults assume BGR order).
     */
    template <
      typename OcmInputImageShape,
      typename OcmOutputImageShape,
      typename std::enable_if_t<OcmInputImageShape::NUM_COLS == OcmOutputImageShape::NUM_COLS, std::int32_t> = 0>
    void grayscale(OcmInputImageShape&  ocmInput,
                   OcmOutputImageShape& ocmOut,
                   FixedPoint16<12>     fxChannel1Weight = 0.114,
                   FixedPoint16<12>     fxChannel2Weight = 0.587,
                   FixedPoint16<12>     fxChannel3Weight = 0.299) {
File: /src/image.hppLines 2868–2890
    /**
     * @brief Grayscale color conversion that accepts input in interleaved format, i.e. `(1, 1, height, 3 * width)`.
     *
     * Channels are packed in width.
     *
     * @tparam OcmInputImageShape Tensor with `uint8` type and shape `(1, 1, height, 3 * width)`.
     * @tparam OcmOutputImageShape Tensor with `uint8` type and shape `(1, 1, height, width)`.
     * @param ocmInputImage Input tensor.
     * @param ocmOutputImage Output tensor.
     * @param fxChannel1Weight Grayscale weight for first chanel (defaults assume BGR order).
     * @param fxChannel2Weight Grayscale weight for second chanel (defaults assume BGR order).
     * @param fxChannel3Weight Grayscale weight for third chanel (defaults assume BGR order).
     */
    // clang-format on
    template <
      typename OcmInputImageShape,
      typename OcmOutputImageShape,
      typename std::enable_if_t<OcmInputImageShape::NUM_COLS == OcmOutputImageShape::NUM_COLS * 3, std::int32_t> = 0>
    void grayscale(OcmInputImageShape&  ocmInputImage,
                   OcmOutputImageShape& ocmOutputImage,
                   FixedPoint16<12>     fxChannel1Weight = 0.114,
                   FixedPoint16<12>     fxChannel2Weight = 0.587,
                   FixedPoint16<12>     fxChannel3Weight = 0.299) {
Table of Contents


© Copyright 2026 Quadric All Rights Reserved • Privacy Policy
This documentation is preliminary and confidential. It is subject to change. Quadric does not give any warranty express or implied that the contents will be complete or accurate or up to date. The company shall not be liable for any loss, actions, claims, proceedings, demands or costs or damages whatsoever or howsoever caused arising directly or indirectly in connection with or arising out of the use of this material.

Sign in to your account

Don't have an account? Create an Account
By signing in, you are agreeing to our Terms of Use and Privacy Policy.

Develop.

Simulate.

Profile.

Collaborate.

We use cookies to enhance your browsing experience, and analyze our traffic.
By clicking "Accept All", you consent to our use of cookies.