Calculating percentage of Bounding box overlap, for image detector evaluation

For axis-aligned bounding boxes it is relatively simple. “Axis-aligned” means that the bounding box isn’t rotated; or in other words that the boxes lines are parallel to the axes. Here’s how to calculate the IoU of two axis-aligned bounding boxes. def get_iou(bb1, bb2): “”” Calculate the Intersection over Union (IoU) of two bounding boxes. Parameters … Read more

What is “semantic segmentation” compared to “segmentation” and “scene labeling”?

“segmentation” is a partition of an image into several “coherent” parts, but without any attempt at understanding what these parts represent. One of the most famous works (but definitely not the first) is Shi and Malik “Normalized Cuts and Image Segmentation” PAMI 2000. These works attempt to define “coherence” in terms of low-level cues such … Read more

overlay a smaller image on a larger image python OpenCv

A simple way to achieve what you want: import cv2 s_img = cv2.imread(“smaller_image.png”) l_img = cv2.imread(“larger_image.jpg”) x_offset=y_offset=50 l_img[y_offset:y_offset+s_img.shape[0], x_offset:x_offset+s_img.shape[1]] = s_img Update I suppose you want to take care of the alpha channel too. Here is a quick and dirty way of doing so: s_img = cv2.imread(“smaller_image.png”, -1) y1, y2 = y_offset, y_offset + s_img.shape[0] … Read more