# Detect inpainting

**URL:** <https://forum.opencv.org/t/detect-inpainting/6794>\
**Category:** Python\
**Created:** [December 19, 2021, 11:29am UTC](https://forum.opencv.org/t/detect-inpainting/6794 "2021-12-19T11:29:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![underscore](https://avatars.discourse-cdn.com/v4/letter/u/51bf81/32.png) [@underscore](https://forum.opencv.org/u/underscore)\
**Post date:** [December 19, 2021, 11:29am UTC](https://forum.opencv.org/t/detect-inpainting/6794/1 "2021-12-19T11:29:08Z")

</div>

It is not so difficult [to inpaint regions](https://docs.opencv.org/4.x/d7/d8b/group __photo__ inpaint.html) but how can I detect inpainted regions in tampered images?

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [December 19, 2021, 12:26pm UTC](https://forum.opencv.org/t/detect-inpainting/6794/2 "2021-12-19T12:26:08Z")

</div>

OpenCV’s two methods don’t replicate the frequency distribution. they look blurry. you can detect that in a laplacian pyramid, or even just a sobel.

that doesn’t mean _anything blurry_ was necessarily inpainted. it just means what it means.

the two methods in OpenCV also show some directionality. they look almost like BORDER\_REPLICATE. that’s another thing you can look for.

---

<div class="post-metadata">

**Author:** ![underscore](https://avatars.discourse-cdn.com/v4/letter/u/51bf81/32.png) [@underscore](https://forum.opencv.org/u/underscore)\
**Post date:** [December 20, 2021, 10:58am UTC](https://forum.opencv.org/t/detect-inpainting/6794/3 "2021-12-20T10:58:13Z")

</div>

thank you - I wonder also about compression artifacts, noise pattern and color consistency or even a deep network to detect all of this.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [December 20, 2021, 11:34am UTC](https://forum.opencv.org/t/detect-inpainting/6794/4 "2021-12-20T11:34:33Z")

</div>

now that goes into “[literature review](https://en.wikipedia.org/wiki/Literature_review)”, i.e. research. you seem to be looking for a discussion and ideas.

---

<div class="post-metadata">

**Author:** ![underscore](https://avatars.discourse-cdn.com/v4/letter/u/51bf81/32.png) [@underscore](https://forum.opencv.org/u/underscore)\
**Post date:** [December 20, 2021, 12:21pm UTC](https://forum.opencv.org/t/detect-inpainting/6794/5 "2021-12-20T12:21:13Z")

</div>

unfortunately yes - I hoped that the 2 OpenCV methods would leave clear trace
