shape

Transforming a custom Shape in WPF

流过昼夜 提交于 2019-12-08 19:34:30
I have a custom shape in WPF that creates two rectangles in the DefiningGeometry override and returns both as a GeometryGroup as follows: protected override System.Windows.Media.Geometry DefiningGeometry { get { System.Windows.Media.GeometryGroup group = null; System.Windows.Media.RectangleGeometry rectangle = null; group = new System.Windows.Media.GeometryGroup(); if (this.Rectangle.IsEmpty) { group.Children.Add(System.Windows.Media.Geometry.Empty); } else { rectangle = new System.Windows.Media.RectangleGeometry(new System.Windows.Rect(this.Width * 0.1, this.Height - (this.Height * 0.1), this

OpenCV Centroid of Irregular Shape

偶尔善良 提交于 2019-12-08 18:51:21
问题 how do you get the centroid of an irregular shape using OpenCV? 回答1: I'd recommend looking at the cv::Moments (C++) or cvMoments (C) function. This StackOverflow thread gives some example code for a problem very similar to yours. This post goes into some of the theory related to finding object center-points. 回答2: What do you mean by centroid? If it's the center of mass, you can compute the average of the coordinates of the points that are inside your shape. But the center of mass can be

SVG shape transparency with solid color as a background

夙愿已清 提交于 2019-12-08 17:43:47
问题 I have an svg container which I used as a background, and inside it a circle is drawn basically, this is what I've done: <svg width="200" height="200" style="background-color:green"> <circle cx="100" cy="100" r="80" stroke="black" stroke-width="2" fill="transparent" /> </svg> it creates something like this You can see the circle is transparent but it still has the green background from the svg tag, how can I make the circle really transparent so it can appear as a hole (in this case it will

OpenCV and C++ - Shape and road signs detection

寵の児 提交于 2019-12-08 13:29:25
I have to write a program that detect 3 types of road signs (speed limit, no parking and warnings). I know how to detect a circle using HoughCircles but I have several images and the parameters for HoughCircles are different for each image. There's a general way to detect circles without changing parameters for each image? Moreover I need to detect triangle (warning signs) so I'm searching for a general shape detector. Have you any suggestions/code that can help me in this task? Finally for detect the number on speed limit signs I thought to use SIFT and compare the image with some templates

Android - How to draw a transparent rectangle bordered shape with only its corners visible?

家住魔仙堡 提交于 2019-12-08 12:59:52
问题 I want to draw a shape like this in android. I used the following code <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/shape_my"> <stroke android:width="2dp" android:dashWidth="20dp" android:dashGap="20dp" android:color="#c1c1c1" /> <padding android:bottom="20dp" android:left="20dp" android:right="20dp" android:top="20dp" /> <corners android:radius="0dp" /> <solid android:color="#00000000" /> </shape> But no perfection

Arrow shape detection using OpenCV

孤者浪人 提交于 2019-12-08 12:31:14
问题 I'm currently trying to detect an arrow and its orientation using OpenCV. I've done the contour detection process that work fine but my problem is on the shape-matching side. I tried to use matchShapes function in OpenCV but my results seems really bad. I use a simple template image and a processed image (usually a photo but for the test I used a simple image) Template Image: Processed Image: Using these two, matchShapes tells me that the square on the left looks more like the template that

How to import FXG to a Shape?

流过昼夜 提交于 2019-12-08 11:53:51
问题 I can import FXG files as Sprites as follows: import graphics.mypic; // graphics/mypic.fxg var mysprite:Sprite = new mypic(); I don't always need the fancy things that come with Sprites. How can I import them to Shapes? 回答1: No, you can't cast them as Shape(s) - the internal compile-time FGX is built on top of Sprite. You can find that out by running var tig:* = new tiger(); if (tig instanceof Sprite) ... What George Profenza is referring to is runtime loading of FXG's 回答2: I don't know if

Where can I get a XAML path for an eyeball? [closed]

天大地大妈咪最大 提交于 2019-12-08 10:06:56
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 8 years ago . I have one for a Star that looks like: Data="M 61.3431396484375,0 C61.3431396484375,0 80.2991943359375,38.40919494628906 80.2991943359375,38

Fill Octagon in C#

岁酱吖の 提交于 2019-12-08 07:19:22
问题 I have created a method that draws an octagon, and it works well, as long as the size is 200 or higher public static void FillOctagon(PaintEventArgs e, Color color, int x, int y, int width, int height) { e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; var points = new [] { new Point(((x + width) / 2) - (width / 4), y), //side 1 new Point(x, ((y + height) / 2) - (height / 4)), //side 2 new Point(x, ((y + height) / 2) + (height / 4)), //side 3 new Point(((x + width) / 2) - (width / 4), y +

Create xml Chat Bubble With the Shape As in the .png File

不羁的心 提交于 2019-12-08 06:38:09
问题 Could I please ask if anyone knows how to create an xml shape of the chat bubble below? The only examples I found online were two separate shapes that were put as two separate backgrounds in a layout - a triangle and a rectangle. I tried combining the triangle and rectangle to no avail. The triangle seems to hide in the rectangle. Setting a top attribute to the triangle to move it down makes the ImageView object blank. Please see what I tried: <?xml version="1.0" encoding="utf-8"?> <layer