# Percentage of overlap

Hi all, how can I calculate the percentage of 2 overlapping images? If the result is 100 the 2 images are completely overlapped, if 0 they're completely disjoined.

PS: Because I'm doing stitch of images, I'm calculating the orb features,I don't know if it helps!

edit retag close merge delete

Sort by ยป oldest newest most voted

Hi.

The percentage of overlapping is: area_of_intersection / area_of_union * 100.

To get the intersection rectangle and thus the area of intersection (from this link) with an origin point at the top left:

left = max(r1.left, r2.left)
right = min(r1.right, r2.right)
bottom = min(r1.bottom, r2.bottom)
top = max(r1.top, r2.top)


Verify that the intersection is not empty:

left < right && bottom > top


A picture to show the problem:

more

Thanks for the answer, I misunderstood the problem. I need to check the percentage of similarity between two images. How can I proceed? For now I'm extracting features with orb!

( 2015-04-14 02:31:15 -0500 )edit

Maybe you check could this link.

( 2015-04-14 13:09:57 -0500 )edit

thanks man,I'll give a try and let you know!

( 2015-04-15 02:10:05 -0500 )edit

Official site

GitHub

Wiki

Documentation