# Compare 2 image

**URL:** <https://forum.opencv.org/t/compare-2-image/3541>\
**Category:** C++\
**Tags:** calib3d, imgproc\
**Created:** [May 26, 2021, 4:14pm UTC](https://forum.opencv.org/t/compare-2-image/3541 "2021-05-26T16:14:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christophe\_Jacquelin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/christophe_jacquelin/32/135_2.png) [@Christophe\_Jacquelin](https://forum.opencv.org/u/Christophe_Jacquelin)\
**Post date:** [May 26, 2021, 4:14pm UTC](https://forum.opencv.org/t/compare-2-image/3541/1 "2021-05-26T16:14:48Z")

</div>

Hello,  
Which function to use to compare 2 images ?  
Thank you

---

<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:** [May 26, 2021, 5:24pm UTC](https://forum.opencv.org/t/compare-2-image/3541/2 "2021-05-26T17:24:32Z")

</div>

please show two such pictures and point out which areas you consider “different” and which you consider “same”.

---

<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:** [May 26, 2021, 8:22pm UTC](https://forum.opencv.org/t/compare-2-image/3541/4 "2021-05-26T20:22:57Z")

</div>

that is the same picture, but cropped differently, and with some pixels changed.

do you anticipate the camera panning/tilting? completely moving from its position?

you’ll need feature matching, maybe camera calibration, possibly structure from motion.

---

<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:** [May 27, 2021, 10:01am UTC](https://forum.opencv.org/t/compare-2-image/3541/5 "2021-05-27T10:01:29Z")

</div>

> [@Christophe\_Jacquelin](#):
>
> Which function to use to compare 2 images ?

sorry, but that’s far too broad.  
what exactly are you looking for in those images ?  
movement ? color/lighting changes ? tampering ? added objects ?  
please be more precise here, else we cannot help

---

<div class="post-metadata">

**Author:** ![Christophe\_Jacquelin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/christophe_jacquelin/32/135_2.png) [@Christophe\_Jacquelin](https://forum.opencv.org/u/Christophe_Jacquelin)\
**Post date:** [May 27, 2021, 10:30am UTC](https://forum.opencv.org/t/compare-2-image/3541/6 "2021-05-27T10:30:47Z")

</div>

I have solve this issue. You can delete this post. thank you.
