# Laplacian kernel for ksize=5?

**URL:** <https://forum.opencv.org/t/laplacian-kernel-for-ksize-5/6820>\
**Category:** C++\
**Tags:** imgproc\
**Created:** [December 21, 2021, 1:47pm UTC](https://forum.opencv.org/t/laplacian-kernel-for-ksize-5/6820 "2021-12-21T13:47:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pedrocg42](https://avatars.discourse-cdn.com/v4/letter/p/f17d59/32.png) [@pedrocg42](https://forum.opencv.org/u/pedrocg42)\
**Post date:** [December 21, 2021, 1:47pm UTC](https://forum.opencv.org/t/laplacian-kernel-for-ksize-5/6820/1 "2021-12-21T13:47:07Z")

</div>

The problem is simple. I want to replicate the laplacian filter for ksize=5 in c++ with a simple kernel and a convolution afterwards, but the output using a normal Laplacian Kernel of size 5 and the output given by the opencv function cv2.laplacian is different. It looks like the image returned by the OpenCV function has some kind of posprocessing. I tried to follow the steps in the c++ code but it is impossible to follow when ksize is not 1 or 3. Can someone tell me exactly what the laplacian function does please? Thank you

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [December 21, 2021, 7:06pm UTC](https://forum.opencv.org/t/laplacian-kernel-for-ksize-5/6820/2 "2021-12-21T19:06:28Z")

</div>

please _show_, what you tried (code, input/output images)
