shape

Shape Transformers and Interfaces OpenCV3.0

一笑奈何 提交于 2019-11-29 12:43:33
I was trying to make use of the new Shape Transformers and Interfaces of OpenCV3.0. Unfortunately it doesn't work as expected. To ensure not making any fancy warps and getting strange results cause of that reason I initialized a transformation where nothing at all should happen. But output of the transformation for a testpoint is always [0,0] and the warped image is always completley gray. Any suggestions what could be wrong are welcome. int main(void){ Mat img1 = imread("C:\\opencv\\sources\\samples\\data\\graf1.png", IMREAD_GRAYSCALE); std::vector<cv::Point2f> points1, testpoints; vector

Android ring shape for radio button

别等时光非礼了梦想. 提交于 2019-11-29 10:56:43
I need to create 2 ring shapes for my radio buttons: white circle white circle with another circle inside it with a different color I dont have much clue on how to do this. What I tried so far: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="false"><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="ring"> <android:solid android:color="@color/white" /> <android:size android:height="10dp" android:width="10dp" /> <corners android:radius="10dp" /> </shape></item> </selector>

How to Calculate Centroid in python

百般思念 提交于 2019-11-29 10:48:57
I'm beginner to python coding. I'm working over structural coordinates. I have pdb structure which have xyz coordinate information (last three col) ATOM 1 N SER A 1 27.130 7.770 34.390 ATOM 2 1H SER A 1 27.990 7.760 34.930 ATOM 3 2H SER A 1 27.160 6.960 33.790 ATOM 4 3H SER A 1 27.170 8.580 33.790 ATOM 5 CA SER A 1 25.940 7.780 35.250 ATOM 6 CB SER A 1 25.980 9.090 36.020 ATOM 7 OG SER A 1 26.740 10.100 35.320 ATOM 8 HG SER A 1 26.750 10.940 35.860 ATOM 9 C SER A 1 24.640 7.790 34.460 ATOM 10 O SER A 1 24.530 8.510 33.500 ATOM 11 N CYS A 2 23.590 7.070 34.760 ATOM 12 H CYS A 2 23.590 6.550 35

Link cell with Excel Shape

↘锁芯ラ 提交于 2019-11-29 07:24:13
In excel, we insert a shape, and we can link it to a cells value, by selecting shape and typing the cell reference in formula bar. I want to know: How can we do that programmatically. Like For Each shape As Excel.Shape In workshet.Shapes 'is there something like shape.Formula or any method from which I can do the above task. Next Here is what I want to do programmatically It's been days now , I am searching it. Really Need help, Thanks Alot. You don't need to use Select to apply formulas to Shapes. Select should be avoided wherever possible as it bloats code, and can have unintended

Performance wise, what is typically better, using an image or a xml created shape as a drawable?

拈花ヽ惹草 提交于 2019-11-29 03:48:09
For example, if each row in a list had a background that was a gradient, would it be better to use a image of a gradient or to define that gradient in a shape drawable in xml? Is there is significant performance difference between the two methods? I just asked a similar question and it sounded like that using an image drawable is more efficient computationally than using a vector.(but i'm not expert so don't quote me on that) It really depends on what your trying to set out to achieve in the first place. If you have completed creative assets that aren't going to change then it would make sense

How to create ring shape drawable in android?

南笙酒味 提交于 2019-11-29 02:31:37
问题 with this code I get just a border: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="ring" android:innerRadius="15dp" android:thickness="2dp" android:useLevel="false"> <solid android:color="#4d4d4d" /> </shape> how can I make a ring shape like below image : 回答1: 2dp outer ring with a 2dp gap: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:top="4dp" android:right="4dp" android:bottom=

Android bottom zig-zag shape

只愿长相守 提交于 2019-11-29 00:45:16
I need to achieve below attached image programatically, is there any way? I know how to draw rectangle in layer-list but for the particular zig-zag texture in bottom I don't have any idea Please help me to achieve this shape Thanks in advance to draw a dashed line you can use a shape <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line"> <stroke android:color="#FF00" android:dashWidth="5dp" android:dashGap="5dp" /> </shape> if you want to combine more than one shape then you can use a layer-list and define a shape for every item 来源: https://stackoverflow.com

Cutting a multipoint ploygon out of Bitmap and placing it on transparency

寵の児 提交于 2019-11-29 00:34:37
I have a bitmap out of which I'm cutting out a multipi point polygon. I'm curious what the correct process is for taking the pixels within the arbitrary shape and copying them onto a new bitmap where the rest of the pixels are transparent. The objective is to allow the user to trace the shape and then remove everything outside the polygon. I have the polygon part worked out (as a an array of points), but now am stumped as to how to transfer just the selected pixels to a new Bitmap. TIA Not sure how your code works, but here's an idea on how to do it: Calculate the bounding rectangle of the

Drawing top border on a shape on Android

好久不见. 提交于 2019-11-29 00:28:52
问题 I'm creating a custom progress bar (positioned under a WebView ) and what I would like to draw is a 1dp-wide line between the WebView and the ProgressBar . I'm modifying existing drawable, namely progress_horizontal.xml , and tried something like this: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> (...) <item> <shape android:shape="line"> <stroke android:width="1dp" android:color="#FF000000" /> </shape> </item> </layer-list>

Drawable shape not showing when used in combination with android:drawableBottom attribute.

安稳与你 提交于 2019-11-28 23:31:21
XML file saved at res/drawable/gradient_box.xml: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#FFFF0000" android:endColor="#80FF00FF" android:angle="45"/> <padding android:left="7dp" android:top="7dp" android:right="7dp" android:bottom="7dp" /> <corners android:radius="8dp" /> </shape> (The above shape definition is is taken from then Android developer guide. There's no errors in it.). Let's try to use it together with a TextView: <TextView android:layout_width="match_parent"