Sepia

Applies sepia effect to image.

int sepia(cv::InputArray src, cv::OutputArray dst)
Parameters:
  • src – Source 8-bit single-channel image.
  • dst – Destination image of the same size and the same type as src.
Returns:

Error code.

The algorithm.

  1. Create 3-channel image, which is interpreted as HSV image.

    1. 1st channel is the matrix, each element equals hue = 19.
    2. 2nd channel is the matrix, each element equals saturation = 78.
    3. 3rd channel is the matrix of brightness (src + value = src + 20).
  2. Convert resulting image to BGR format.

Example.

srcImage dstImage