bounding-box

matplotlib and PyQt: Dynamic figure runs slow after several loads or looks messy

不羁岁月 提交于 2019-11-26 14:49:42
问题 EDIT: I decided to rewrite this to include a working example of my problem. Although this is pretty long, I hope that it proves to be useful for many in the future. import sys from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure from PyQt4.QtGui import * from PyQt4.QtCore import * class MainWindow(QMainWindow): def __init__(self): super(MainWindow, self).__init__() self.setGeometry(100, 100, 640, 480) showButton = QPushButton(

Calculate rotated rectangle size from known bounding box coordinates

你。 提交于 2019-11-26 12:02:47
问题 I read the Calculate Bounding box coordinates from a rotated rectangle to know how to calculate bounding box coordinates from a rotated rectangle. But in a special case as follow image: How to get the rotated rectangle size if had get the bounding box size, coordinates and rotate degree? I try write code in javascript //assume w=123,h=98,deg=35 and get calculate box size var deg = 35; var bw = 156.9661922099485; var bh = 150.82680201149986; //calculate w and h var xMax = bw / 2; var yMax = bh

Calculating bounding box a certain distance away from a lat/long coordinate in Java

只谈情不闲聊 提交于 2019-11-26 09:19:58
问题 Given a coordinate (lat, long), I am trying to calculate a square bounding box that is a given distance (e.g. 50km) away from the coordinate. So as input I have lat, long and distance and as output I would like two coordinates; one being the south-west (bottom-left) corner and one being the north-east (top-right) corner. I have seen a couple of answers on here that try to address this question in Python, but I am looking for a Java implementation in particular. Just to be clear, I intend on

How to get string width on Android?

前提是你 提交于 2019-11-26 04:01:20
I would like to get height too if possible. Frank You can use the getTextBounds(String text, int start, int end, Rect bounds) method of a Paint object. You can either use the paint object supplied by a TextView or build one yourself with your desired text appearance. Using a Textview you Can do the following: Rect bounds = new Rect(); Paint textPaint = textView.getPaint(); textPaint.getTextBounds(text, 0, text.length(), bounds); int height = bounds.height(); int width = bounds.width(); If you just need the width you can use: float width = paint.measureText(string); http://developer.android.com

Calculate Bounding box coordinates from a rotated rectangle

社会主义新天地 提交于 2019-11-26 03:54:17
I have the coordinates of the top left point of a rectangle as well as its width, height and rotation from 0 to 180 and -0 to -180. I am trying to get the bounding coordinates of the actual box around the rectangle. What is a simple way of calculating the coordinates of the bounding box Min y, max y, min x, max x? The A point is not always on the min y bound, it can be anywhere. I can use matrix the transform toolkit in as3 if needed. Transform the coordinates of all four corners Find the smallest of all four x's as min_x Find the largest of all four x's and call it max_x Ditto with the y's

Calculate Bounding box coordinates from a rotated rectangle

本小妞迷上赌 提交于 2019-11-26 03:25:07
问题 I have the coordinates of the top left point of a rectangle as well as its width, height and rotation from 0 to 180 and -0 to -180. I am trying to get the bounding coordinates of the actual box around the rectangle. What is a simple way of calculating the coordinates of the bounding box Min y, max y, min x, max x? The A point is not always on the min y bound, it can be anywhere. I can use matrix the transform toolkit in as3 if needed. 回答1: Transform the coordinates of all four corners Find

Extracting text OpenCV

こ雲淡風輕ζ 提交于 2019-11-26 03:15:07
问题 I am trying to find the bounding boxes of text in an image and am currently using this approach: // calculate the local variances of the grayscale image Mat t_mean, t_mean_2; Mat grayF; outImg_gray.convertTo(grayF, CV_32F); int winSize = 35; blur(grayF, t_mean, cv::Size(winSize,winSize)); blur(grayF.mul(grayF), t_mean_2, cv::Size(winSize,winSize)); Mat varMat = t_mean_2 - t_mean.mul(t_mean); varMat.convertTo(varMat, CV_8U); // threshold the high variance regions Mat varMatRegions = varMat >

How to get string width on Android?

若如初见. 提交于 2019-11-26 01:58:09
问题 I would like to get height too if possible. 回答1: You can use the getTextBounds(String text, int start, int end, Rect bounds) method of a Paint object. You can either use the paint object supplied by a TextView or build one yourself with your desired text appearance. Using a Textview you Can do the following: Rect bounds = new Rect(); Paint textPaint = textView.getPaint(); textPaint.getTextBounds(text, 0, text.length(), bounds); int height = bounds.height(); int width = bounds.width(); 回答2: If