How to Apply Sepia Filter to Images Using OpenCV

Posted on Posted in OpenCV Tutorials, Tutorials

You can use OpenCV to easily and quickly apply a Sepia filter to your images, as seen in these pictures. Here is how:

First of all create a Kernel Matrix, like this:

cv::Mat kernel =
0.272, 0.534, 0.131,
0.349, 0.686, 0.168,
0.393, 0.769, 0.189);

Next, just apply this Kernel using transform OpenCV transform function to your image.

cv::transform(input_img, output_img, kernel);

Leave a Reply

Your email address will not be published. Required fields are marked *