![[Learning notes and hw] getting started with R-cnn: Manually implementing Intersection over Union (IoU)](/_next/image?url=https%3A%2F%2Fmedia2.dev.to%2Fdynamic%2Fimage%2Fwidth%3D800%252Cheight%3D%252Cfit%3Dscale-down%252Cgravity%3Dauto%252Cformat%3Dauto%2Fhttps%253A%252F%252Fdev-to-uploads.s3.amazonaws.com%252Fuploads%252Farticles%252Favit2emoxc0g68e5ltqj.jpg&w=1200&q=75)
[Learning notes and hw] getting started with R-cnn: Manually implementing Intersection over Union (IoU)
The first thing we're tasked with is to implement manually a function that calculates the intersection over union between 2 boxes, let's assume each box comes with a list of coordinates, [x1, y1, x2, y2] such as (x1, y1) are the coordinates of the top-left point and (x2, y2) are the bottom-right one note: just learned that, unlike the cartesian axes we used to in math, where the center (0,0) starts at the bottom left and the y-axis increases as we go up, here, when working with computer vison and image processing, the center starts at the top-left and the y increases as we go downward, the x-axis stays and behaves the same, which kinda makes sense when u think of how images are 2D matrices, we start reading them from the top left pixel and we proceed right and then down so it makes sense that indeces moves like that, increase as we go down for the y-axis now for how we actually calculate this IoU, let me try rephrasing the logic of this, so why intersection over union, we want the box
Continue reading on Dev.to Beginners
Opens in a new tab


