bounding-box

I want to sort the words extracted from image in order of their occurence using contours detection

五迷三道 提交于 2020-06-27 06:21:15
问题 I am making an OCR, I am using contours detection, I have extracted words and drawn bounding boxes but the problem is that when I crop the individual word, they are not in sorted order. I have tried sorting methods mentioned in this link to sort the contours but they work best on objects but in my case i want to make the order exact. sometimes the sorting is not the best solution it changes pattern of words as different words have different size of bounding boxes in same line and values of 'x

I want to sort the words extracted from image in order of their occurence using contours detection

早过忘川 提交于 2020-06-27 06:20:36
问题 I am making an OCR, I am using contours detection, I have extracted words and drawn bounding boxes but the problem is that when I crop the individual word, they are not in sorted order. I have tried sorting methods mentioned in this link to sort the contours but they work best on objects but in my case i want to make the order exact. sometimes the sorting is not the best solution it changes pattern of words as different words have different size of bounding boxes in same line and values of 'x

How to find all neighbour values near the edge in array?

别等时光非礼了梦想. 提交于 2020-06-27 04:02:08
问题 I have an array consisting of 0 s and 1 s. Firstly, I need to find all neighbour 1 . I managed to do this (the solution is in the link below). Secondly, I need to choose those, where any element of cluster located near the top boundary. I can find neighbours with code from here. But I need to select only those that are in contact with the top boundary. Here is an example with a 2D array: Input: array([[0, 0, 0, 0, 1, 0, 0, 0, 1, 0], [0, 0, 0, 1, 1, 0, 0, 0, 1, 0], [0, 0, 0, 0, 1, 1, 0, 0, 0,

How to find bounding boxes coordinates in Tensorflow Object Detection API

假如想象 提交于 2020-06-17 00:51:06
问题 I'm using Tensorflow object detection API code. I trained my model and got great detection percentages. I have been trying to get the bounding boxes coordinates but it keeps on printing out a list of 100 bizarre arrays. after a wide search online I found out what the numbers in the arrays meant (The bounding box coordinates are floats in [0.0, 1.0] relative to the width and height of the underlying image.) But still, my arrays are very different than the ones shown in examples online. Another

minimal bounding box of a clipped point cloud

假如想象 提交于 2020-05-27 07:24:12
问题 I am trying to find the minimal bounding box of a 2d point cloud, where only a part of the point cloud is visible. Given a point cloud with a rough rectangular shape, clipped so that only one corner is visible: The point cloud is clipped at the green border. I know the position of the border in the image, and I know that there will always be exactly one corner of the rectangular shape visible within this border. I also know the size of the rectangular shape. Now I want to find the minimal

Traversal of Bounding Volume Hierachy in Shaders

ぐ巨炮叔叔 提交于 2020-05-13 05:30:05
问题 I am working on a path tracer using vulkan compute shaders. I implemented a tree representing a bounding volume hierachy. The idea of the BVH is to minimize the amount of objects a ray intersection test needs to be performed on. #1 Naive Implementation My first implementation is very fast, it traverses the tree down to a single leaf of the BVH tree. However, the ray might intersect multiple leaves. This code then leads to some triangles not being rendered (although they should). int box_index

getbbox method from python image library (PIL) not working

不想你离开。 提交于 2020-03-17 07:23:07
问题 I want to crop an image to its smaller size, by cutting the white areas on the borders. I tried the solution suggested in this forum Crop a PNG image to its minimum size but the getbbox() method of pil is returning a bounding box of the same size of the image, i.e., it seems that it doesn't recognize the blank areas around. I tried the following: >>>import Image >>>im=Image.open("myfile.png") >>>print im.format, im.size, im.mode >>>print im.getbbox() PNG (2400,1800) RGBA (0,0,2400,1800) I

getbbox method from python image library (PIL) not working

半世苍凉 提交于 2020-03-17 07:23:06
问题 I want to crop an image to its smaller size, by cutting the white areas on the borders. I tried the solution suggested in this forum Crop a PNG image to its minimum size but the getbbox() method of pil is returning a bounding box of the same size of the image, i.e., it seems that it doesn't recognize the blank areas around. I tried the following: >>>import Image >>>im=Image.open("myfile.png") >>>print im.format, im.size, im.mode >>>print im.getbbox() PNG (2400,1800) RGBA (0,0,2400,1800) I

Detect multiple colored regions in image and produce individual crops for each

纵饮孤独 提交于 2020-03-11 13:30:29
问题 I have an image like this: And I want to crop the image anywhere there is red . So with this image I would be looking to produce 4 crops : Obviously I first need to detect anywhere there is red in the image . I can do the following: import cv2 import numpy as np from google.colab.patches import cv2_imshow ## (1) Read and convert to HSV img = cv2.imread("my_image_with_red.png") hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) ## (2) Find the target red region in HSV hsv_lower = np.array([0,50,50])

Algorithm to create minimal bounding-box composition of point cloud

若如初见. 提交于 2020-03-03 06:58:03
问题 I have a set of 2D points. I want to find a set of (possibly overlapping and arbitrarily oriented) bounding-boxes for subsets of these points such that each point lies within at least one box, each box contains at least k points and such that the combined area of the boxes is minimized. One idea for an algorithm I have is: use a concave-hull algorithm to find a concave hull for the points. use convex decomposition algorithm to find a set of convex hulls. compute arbitrarily oriented minimum