Ask Your Question

Percentage of overlap

asked 2015-04-11 04:32:30 -0500

bjorn89 gravatar image

updated 2016-06-14 08:40:59 -0500

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 flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-04-11 14:22:21 -0500

Eduardo gravatar image

updated 2015-05-02 00:32:00 -0500


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(,

Verify that the intersection is not empty:

left < right && bottom > top

A picture to show the problem: image description

edit flag offensive delete link 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!

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

Maybe you check could this link.

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

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

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

Question Tools

1 follower


Asked: 2015-04-11 04:32:30 -0500

Seen: 7,009 times

Last updated: May 02 '15