area

Getting the area occupied by a certain color onscreen - iOS

若如初见. 提交于 2019-12-09 14:00:22
问题 I'm trying to do something similar to what is asked in this question, but I don't really understand the answer given to that question and I'm not sure if it is what I need. What I need is simple, though I'm not so sure it's easy. I want to calculate the number of pixels on the screen that are a certain color. I understand that each 'pixel' that we see is actually a combination of pixels of different colors that appear to be, say, green. So what I need is that actual color- the one that the

Area covered by a point cloud with R

自古美人都是妖i 提交于 2019-12-09 09:52:05
问题 I have a cloud of points scattered in a 2D Euclidean space. I would like to calculate the area inside the polygon linking the most extreme (=peripheral) points of the cloud. In other words, I would like to estimate the area covered by the cloud in this space. Is there a formula in R? Thanks a lot for any response Julien 回答1: This is called the convex-hull problem; R built-in chull function should do the work. To count area, you may use a formula from here. EDIT: Even better; splancs package

distance between two Shapes/Areas in Java?

蹲街弑〆低调 提交于 2019-12-08 21:38:28
问题 If I have two java.awt.geom.Area 's made out of the union of various simple Shapes (Polygons and Ellipses), is there a method out there to find the distance (i.e. closest distance) between the two Areas? To clarify: suppose I have two arbitrary Areas, each of which is created from the union of shapes of any sort: //Define the first area Area a = new Area(new Ellipse2D.Double(50, 50, 100, 100)); a.add(new Area(new Rectangle2D.Double(100, 100, 100, 100))); //Define the second area Area b = new

Pyqt take screenshot of certain screen area

余生颓废 提交于 2019-12-08 09:39:22
问题 I have this app written in pyqt. You can view the source at http://www.pasteall.org/62739/python It takes screen shots of the desktop. what I want to know is how to make it also take a screen shot of a certain area on the screen like window's snipping tool can do (http://sjcblogs.sanjac.edu/its/files/2011/09/Snipping-Tool-selection-types1.jpg and gilsmethod.wpengine.netdna-cdn.com/images/snipping-tool-windows-73.png). How do I write this? Thank you in advance! 回答1: You should use img =

How to measure the area of a polygon in ggplot2?

半腔热情 提交于 2019-12-08 08:08:04
问题 Hi everyone, I have a number of samples that I would like to draw a polygon for each of them to illustrate the shape of the data. My data look likes this: 01 0.31707317 02 0.12195122 03 0.09756098 04 0.07317073 05 0.07317073 06 0.07317073 07 0.07317073 08 0.07317073 09 0.04878049 10 0.04878049 I can easily draw a radar chart using radarchart, which looks like this: But I am trying to measure the area of the results shape and use that as a measure of data shape. This is where I struggle. I

Calculate area of cross section for varying height

隐身守侯 提交于 2019-12-07 22:51:51
问题 I'm trying to figure out how to calculate the area of a river cross section. For the cross section I have the depth at every 25 cm over the 5 m wide river. x_profile <- seq(0, 500, 25) y_profile = c(50, 73, 64, 59, 60, 64, 82, 78, 79, 76, 72, 68, 63, 65, 62, 61, 56, 50, 44, 39, 25) If anyone have some suggestions of how this could be done in r it's highly appreciated. 回答1: We can use the sf package to create a polygon showing the cross-section and then calculate the area. Notice that to

Python adding extra area to image

房东的猫 提交于 2019-12-07 15:20:33
问题 So I have a table with image sizes. There are multiple images of different sizes (66x66, 400x400, etc.). I have one example of image (the original) that always has a size of 600x532, and on this image is a product (a TV, a PC, etc.). I have to resize this image, which isn't a problem. But if I do this with proportion I get something like 66x55. If I don't do this with proportion the image doesn't look good. So the background of the original is always white. Is there a way to extend the area

Why am I getting a value of zero for my circle?

微笑、不失礼 提交于 2019-12-07 14:33:35
问题 Here is my Circle class code. class Circle { private double radius; private double area; public Circle(double radius) { this.radius = radius; } public double Area { set { area = Math.PI * Math.Pow(radius, 2); } get { return area; } } } This is test code. Circle circle1 = new Circle(3); MessageBox.Show("Circle 1 Area: " + circle1.Area); So for some reason, when I use the MessageBox.Show(), it seems to give me values of zero instead. I gave the circle a value of 3 so shouldn't my constructor

Algorithm for fitting 2D polygons in an area?

不羁岁月 提交于 2019-12-07 10:33:06
问题 Is there a standard for this? Algorithm name? Say: I have 10 polygons of different sizes. I have an area of specific size. I want to know how to fill the most polygons in that area, and how they are fitted. Note: Polygons may be rotated depending on the restriction set. 回答1: One possible name is a Packing Problem. It is related to the Knapsack Problem. These problems tend to be NP-hard, and many require heuristics. If you can constrain the allowed forms of polygons and of the area, there may

Restrict Area to a given role

此生再无相见时 提交于 2019-12-07 07:05:34
问题 I have an area setup in MVC2, called Admin/ , which I want I only want Users who belong to the role "admins" to have access. I know I can decorate each of the methods with [Authorize(Roles="admins")] , but this seems tedious when your talking about multiple controllers with multiple actions. Is there an better and cleaner way? 回答1: You could define a base controller decorated with this attribute that all controllers in the area derive from. 来源: https://stackoverflow.com/questions/3291385