Image Processing Functions

blur

template<std::uint32_t filterSize = 1>
qVar_t<FixedPoint32<16>> chimera::image::blur(qVar_t<FixedPoint32<16>> qFrame)

Applies a 3x3 blur function on a qVar. The filter is.

* ┌           ┐
* │   1 2 1   │
* │   2 4 2   │  / 16
* │   1 2 1   │
* └           ┘
*
Return

qVar_t<FixedPoint32<16>> The blurred output of the tile

Parameters
  • qFrame: The input Frame tile

sobel

template<std::uint32_t filterSize = 1>
qVar_t<FixedPoint32<16>> chimera::image::sobel(qVar_t<FixedPoint32<16>> qFrame)

Applies a 3x3 sobel vertical edge detection. The filter is Vertical edge filter.

* ┌            ┐
* │  -1 -2 -1  │
* │   0  0  0  │  / 4
* │   1  2  1  │
* └            ┘
*
Horizontal edge filter
* ┌          ┐
* │  -1 0 1  │
* │  -2 0 2  │  / 4
* │  -1 0 1  │
* └          ┘
*
Return

qVar_t<FixedPoint32<16>> The vertical edges in the tile

Parameters
  • qFrame: The input Frame tile

edge3x3

qVar_t<FixedPoint32<16>> chimera::image::edge3x3(qVar_t<FixedPoint32<16>> qFrame)

Gets an image of all the adges in a tile calculated using the sobel filter.

Return

qVar_t<FixedPoint32<16>> The edge image tile

Parameters
  • qFrame: The input image tile

resize

Warning

doxygenfunction: Unable to resolve function “resize” with arguments (OcmInputImageShape&, OcmOutputImageShape&) in doxygen xml output for project “quadric.io SDK” from directory: _build/xml/. Potential matches:

- template<typename OcmInputImageShape, typename OcmOutputImageShape> void resize(OcmInputImageShape &ocmInputImage, OcmOutputImageShape &ocmOutputImage, MemAllocator &ocmMemAlloc)
- template<typename OcmInputTensorShape, typename OcmOutputTensorShape, typename T, UpsamplingMethod upsamplingMethod, bool generateSingleTileOutput = false, isOcmTensor<OcmInputTensorShape> = 0, isOcmTensor<OcmOutputTensorShape> = 0, std::enable_if_t<!generateSingleTileOutput, std::int32_t> = 0> INLINE void resize(OcmInputTensorShape &ocmInp, OcmOutputTensorShape &ocmOut)

grayscale

template<typename OcmInputImageShape, typename OcmOutputImageShape>
void chimera::image::grayscale(OcmInputImageShape &ocmInputImage, OcmOutputImageShape &ocmOutputImage, FixedPoint16<12> fxChannel1Weight = 0.114, FixedPoint16<12> fxChannel2Weight = 0.587, FixedPoint16<12> fxChannel3Weight = 0.299)

Converts a 3 channel image to grayscale, default values work best for a BGR input image.

Assuming a BGR input image would look like

* ┌------------------------------...-┐
* |BGR,BGR,BGR,BGR,BGR,BGR, ...      |
* |BGR,BGR,BGR,BGR,BGR,BGR, ...      |
* |------------------------------...-|
* |BGR,BGR,BGR,BGR,BGR,BGR, ...      |
* |.                                 |
* |.                                 |
* |.                                 |
* └------------------------------...-┘
*

The ouput is a weighted sum of the 3 channels for each pixel. Enough rows of the image are processed to fill out maxOutTilesInBuffer(128) unless one row does not fit into the buffer. In that case each row is broken up into multiple buffers to fill out maxOutTilesInBuffer

Template Parameters
  • OcmInputImageShape: The input image shape in (b,g,r) format

  • OcmOutputImageShape: The output image shape in (b,g,r) format

Parameters
  • ocmInputImage: The input image tensor

  • ocmOutputImage: The output image tensor

  • fxChannel1Weight: The weight given to the blue channel. Default 0.114

  • fxChannel2Weight: The weight given to the green channel. Default 0.587

  • fxChannel3Weight: The weight given to the red channel. Default 0.299