bounding-box

How can I enclose some XML elements in a bounding box?

丶灬走出姿态 提交于 2019-12-24 05:01:09
问题 I want to enclose the pair of checkboxes and the radio buttons here: ...in a rectangle or "bounding box" so that it look something like this: ...but less ugly, of course. How can I do that with the following XML as a starting point: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingLeft="@dimen/activity

Matlab: How to find a point in a bounding box

守給你的承諾、 提交于 2019-12-23 06:30:22
问题 I have an array of points or locations that are scattered throughout a big matrix, and I have a small bounding box inside the matrix. I need a way to check if the points in the array are within the bounding box. Thanks for your suggestions. BoundingBox = [BB1,BB2,BB3,BB4]; Array = [x1,y1;x2,y2;x3,y3;x4,y4;x5,y5;x6,y6]; I have tried ismember([BB1,BB2,BB3,BB4],Array); and ismember(rectangle('Position',[BB1,BB2,BB3,BB4]),Array); but nothing is working 回答1: You should read ismember()'s

Labeling object in a binary image MATLAB

放肆的年华 提交于 2019-12-23 03:11:16
问题 I am trying to label white objects in a binary image using MATLAB. Basically, my aim is to detect water bodies in a aerial map image and then convert the cimage to binary and then label the bodies. Here is an image example of my output after detecting the bodies and converting to binary. How can I now possibly create a create rectangle around the white objects and label them with text(using connected components)? Thank you! 回答1: Try this - %%// Read in the image file img = im2bw(imread(FILE))

Find bounding rectangle of objects in monochrome bitmaps

≡放荡痞女 提交于 2019-12-23 02:57:22
问题 Given a monochrome bitmap: 000000000000000000000000000000000000000 001000100000000000000000000000000000000 000101000000000000000000000000000000000 000010000000001000000000000000000000000 000101000000010100000000000000000000000 001000100000100010000000000000000000000 000000000000010100000000000000000000000 000000000000001000000000000000000000000 000000000000000000000000000000000000000 000000000000001111110000000000000000000 000000000000001000010000000000000000000

Improve text area detection (OpenCV, Python)

流过昼夜 提交于 2019-12-22 18:45:12
问题 I am working on a project which ask me to detect text area in an image. This is the result I achieved until now using the code below. Original Image Result The code is the following: import cv2 import numpy as np # read and scale down image img = cv2.pyrDown(cv2.imread('C:\\Users\\Work\\Desktop\\test.png', cv2.IMREAD_UNCHANGED)) # threshold image ret, threshed_img = cv2.threshold(cv2.cvtColor(img, cv2.COLOR_BGR2GRAY), 127, 255, cv2.THRESH_BINARY) # find contours and get the external one image

How to efficiently find the bounding box of a collection of points?

◇◆丶佛笑我妖孽 提交于 2019-12-21 20:54:36
问题 I have several points stored in an array. I need to find bounds of that points ie. the rectangle which bounds all the points. I know how to solve this in plain Python. I would like to know is there a better way than the naive max, min over the array or built-in method to solve the problem. points = [[1, 3], [2, 4], [4, 1], [3, 3], [1, 6]] b = bounds(points) # the function I am looking for # now b = [[1, 1], [4, 6]] 回答1: My approach to getting performance is to push things down to C level

How to efficiently find the bounding box of a collection of points?

╄→尐↘猪︶ㄣ 提交于 2019-12-21 20:54:05
问题 I have several points stored in an array. I need to find bounds of that points ie. the rectangle which bounds all the points. I know how to solve this in plain Python. I would like to know is there a better way than the naive max, min over the array or built-in method to solve the problem. points = [[1, 3], [2, 4], [4, 1], [3, 3], [1, 6]] b = bounds(points) # the function I am looking for # now b = [[1, 1], [4, 6]] 回答1: My approach to getting performance is to push things down to C level

How to calculate geography bounding box in iOS?

情到浓时终转凉″ 提交于 2019-12-21 12:59:46
问题 I'd like to make a Geographic Bounding box Calculation in iOS. It can be aprox. Input Parameters: Current Location (Example: 41.145495, −73.994901) Radius In Meters: (Example: 2000) Required Output: MinLong: (Example: 41.9995495) MinLat: (Example: −74.004901) MaxLong: (Example: 41.0005495) MaxLat: (Example: −73.004901) Requirement: No Network Call Any Ideas? Mapkit / CoreLocation does not seem to offer this type of thing? Any other Geographic SDK that i could use? Thanks 回答1: I think you can

What is the proper way to get bounding box for HTML elements relative to the Window?

独自空忆成欢 提交于 2019-12-21 12:00:57
问题 I'm writing a Firefox extension. I'm trying to limit it to just XUL+Javascript (no XPCOM). When I get a mouseover event for an HTML element, I need to get its bounding box in the windows coordinate system (that is the built-in XUL document browser.xul). The obvious place to start is to put something like this in the mouseover event handler: var rect = e.target.getBoundingClientRect(); Which is great, but that gives me the rect in the HTML document's coordinate system, which is relative to the

Port MATLAB bounding ellipsoid code to Python

南笙酒味 提交于 2019-12-20 12:16:23
问题 MATLAB code exists to find the so-called "minimum volume enclosing ellipsoid" (e.g. here, also here). I'll paste the relevant part for convenience: function [A , c] = MinVolEllipse(P, tolerance) [d N] = size(P); Q = zeros(d+1,N); Q(1:d,:) = P(1:d,1:N); Q(d+1,:) = ones(1,N); count = 1; err = 1; u = (1/N) * ones(N,1); while err > tolerance, X = Q * diag(u) * Q'; M = diag(Q' * inv(X) * Q); [maximum j] = max(M); step_size = (maximum - d -1)/((d+1)*(maximum-1)); new_u = (1 - step_size)*u ; new_u(j