shape

OpenCV and C++ - Shape and road signs detection

旧时模样 提交于 2019-12-23 04:07:14
问题 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

How to convert SVG Path (SVGOMPathElement) to array of points? [duplicate]

梦想与她 提交于 2019-12-23 03:07:43
问题 This question already has an answer here : How to load and parse SVG documents (1 answer) Closed 9 months ago . What I'm trying to do: convert an SVG path to an array of (x,y) points. I have this at the moment: public Point[] strokeToPoints(Node n){ SVGOMPathElement path = (SVGOMPathElement) n; System.out.println(path.getAttribute("d")); System.out.println(path.getTotalLength()); return null; } Node n is always a path element extracted from an SVG file which looks something like this: <path

How to mask out a simple region when painting in Android?

我的梦境 提交于 2019-12-22 08:14:42
问题 Here is a simplified description: Imagine that I'm given a View class that draws a picture of a wall and I want to draw it with a window cut out. Assume that I extend that View class and override its dispatchDraw() method to do the following. First draw the background if any to be seen through the window. Next I want to mask out the rectangular window region somehow and then call super.dispatchDraw(). Finally I want to remove the mask and draw a person standing at the window so that they are

Curved sail shape using HTML and CSS only?

。_饼干妹妹 提交于 2019-12-22 05:23:14
问题 Is it possible to create the curved sail shape below using HTML and CSS only? I can see from this answer that I could create a straight-sided sail using: #triangle { width: 0; height: 0; border-right: 50px solid transparent; border-bottom: 100px solid red; } which looks like: or I can get a bit closer with border radius: #sail { background: #ff0000; width: 50px; height: 100px; border-top-right-radius: 50px 100px; -moz-border-radius-topright: 50px 100px; -webkit-border-top-right-radius: 50px

Text with shapes in drawable resource

为君一笑 提交于 2019-12-22 03:35:09
问题 Can i create text-shape in drawable resource? I was googling much but found nothing... Here is my drawable file: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="oval"> <stroke android:width="3dp" android:color="#QQffQQ"/> <size android:width="120dp" android:height="120dp"/> </shape> </item> <item android:right="59dp" android:left="59dp"> <shape android:shape="rectangle"> <solid android:color="£22££20"/

WPF User Control - Round corners programmatically

血红的双手。 提交于 2019-12-22 01:34:50
问题 Another WPF question... <UserControl x:Class="TKEApp.Components.UserControls.ButtonControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Grid Background="Black"> <TextBlock Foreground="White" Background="Brown" Name="lblCaption" TextAlignment="Center"></TextBlock> </Grid> </UserControl> Somwhere in the application code I have an instance of this control and I need to make it's corners rounded programmatically. Is

Using reshape in Python to reshape an array

耗尽温柔 提交于 2019-12-21 20:04:02
问题 I have an array that looks like below: array([[0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1], [2, 2, 2, 2, 2, 2, 2, 2], [3, 3, 3, 3, 3, 3, 3, 3], [4, 4, 4, 4, 4, 4, 4, 4], [5, 5, 5, 5, 5, 5, 5, 5], [6, 6, 6, 6, 6, 6, 6, 6], [7, 7, 7, 7, 7, 7, 7, 7]]) How can I use reshape to divide it into 4 chucks, such that it looks like array([[[0, 0, 0, 0], [1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3]], [[0, 0, 0, 0], [1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3]], [[4, 4, 4, 4], [5, 5, 5, 5], [6, 6, 6, 6], [7

Rectangle shape with two solid colors

蹲街弑〆低调 提交于 2019-12-21 04:16:38
问题 I'd like to create a rectangle shape with two solid colors (horizontally) to achieve something like this: I heard about layer-list , i though i could use it to contains two rectangle with a different color but it seems that it only lays shapes vertically. Is there a way to achieve this using lalyer-list or should i use something totally different? I'd like to keep it simple with ability to change the shape colors at runtime. Thanks. 回答1: You can create custom drawable for this. Just extend

Android shape within a shape

匆匆过客 提交于 2019-12-20 12:22:26
问题 I want to have a shape element with a two color border outline. I can do a single color outline using the solid element, but this only allows me to draw a single line. I tried using two stroke elements within my shape, but that didn't work either. Is there a way to either draw a shape within a shape or draw two lines around my shape (which has rounded corners, BTW). 回答1: I found that the <layer-list> is the best approach. Like this: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns

CSS apply border to a cloud shape?

淺唱寂寞╮ 提交于 2019-12-20 11:25:09
问题 I drew a cloud via CSS3 using different div tags I am trying to add a border to the whole shape but I am having trouble since every shape get its own border how can I apply a border to the whole cloud? HTML: <div id="cloud"> <div id="bottom_c"></div> <div id="right_c"></div> <div id="left_c"></div> </div> CSS: * { margin: 0; padding: 0; border: 0; } body{ background-color: #4ca3ff; } #cloud { position: absolute; } #bottom_c { position: relative; top: 200px; left: 500px; width: 350px; height: