draw

Drawing fixed set of grid lines with OpenCV

断了今生、忘了曾经 提交于 2019-12-05 08:22:50
Is it possible to draw user-defined grid lines with defined points at all intersections, against the output of the color detection sample in the OpenCV sample file? Basically, the webcam will need to be detecting human head and shoulders from above you. Then when a person is detected, I need the grid lines to be there so that I am able to know from which outermost grid (left shoulder), to the next outermost grid (right shoulder), in both x and y axis (forehead and back of head). Thereafter, these points have to be sent for operation of mechanical parts like actuator and valves. I'm an entry

Draw on a canvas with Bitmap as Background

僤鯓⒐⒋嵵緔 提交于 2019-12-05 07:20:59
问题 I am trying to draw on a picture i have taken. Drawing works without the picture drawn but if i draw the bitmap i only see the bitmap but n drawing comes up. I tried a lot but nothing seems to help. Thanks in advance. private class myView extends View implements OnTouchListener{ File root = Environment.getExternalStorageDirectory(); Path path; ArrayList<Path> _graphics = new ArrayList<Path>(); Bitmap myBitmap; Paint myPaint; public myView(Context context) { super(context); File file = new

Explicit vertex position in python graph-tool

烈酒焚心 提交于 2019-12-05 06:57:53
I am using python graph-tool. To draw graphs, it uses graph_draw function . I want to send vertex positions explicitly to dot engine. It turns out that I can pass a property map named pos . I tried defining it as v_pos = g.new_vertex_property("vector<double>") where g is my graph. I am not sure if it is the right way to do it. There is one code snippet which you might find helpful. pos = gt.random_layout(g, shape=shape, dim=3) >>> pos[g.vertex(0)].a array([ 86.59969709, 1.31435598, 0.64651486]) graph_draw(g, pos=pos, output="graph-draw-random.pdf") What should I do if I were to define my

Drawing Text on monochrome Bitmap in C#

你离开我真会死。 提交于 2019-12-05 05:57:26
My problem is that I need to draw text on a monochrome bitmap. The resulting bitmap has to be printed on a thermal POS printer, so the bitmap has to be 1bpp. I'm not good in graphics, so I've tried to find some samples. Here's what I've tried: Bitmap bmp = new Bitmap(300, 300, PixelFormat.Format1bppIndexed); using (Graphics g = Graphics.FromImage(bmp)) { Font font = new Font("Arial", 20, FontStyle.Bold, GraphicsUnit.Point); g.Clear(Color.White); g.DrawString(text, font, Brushes.Black, 0, 0); } bmp.Save(@"c:\x\x.bmp", ImageFormat.Bmp); the Save at the end was just to check the result. With this

How to use ImageObserver in Graphics method drawImage()

孤人 提交于 2019-12-05 04:23:15
The method I am trying to use is the: drawImage(image, int, int, int, int, ImageObserver) method so that i can scale my image, on all the examples i've seen the ImageObserver should be this, but this doesn't seem to work(i.e. the only methods i have seen is: drawImage(image, int, int, ImageObserver), don't know if this makes a difference). Here is my main class that is the applet: import java.applet.*; import java.awt.*; public class Main extends Applet implements Runnable{ private Thread th; private Hitter hitter; //double buffering private Graphics dbg; private Image dbImage; public void

Unable to draw line over gridview elements properly through textview cells in Android

 ̄綄美尐妖づ 提交于 2019-12-05 00:47:02
问题 I would like to implement Word Search app. As part of implementation i have come across canvas and drawing line over grid view cells( letters that form the word) to indicate that user is touching finger over letters to form the word. I have succeeded partially as of now i can draw a line over letters of grid view but the line is not through center of views of grid View. Please can anyone assist me with your valuable suggestions . Have a glance on below screen shot to get a clear idea. Edited:

Draw a rectangular over an image by code

北慕城南 提交于 2019-12-04 20:42:40
I have this xml : <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/photo0" android:id="@+id/imagBackground"> <TextView android:layout_width="20dip" android:layout_height="20dip" android:layout_marginLeft="250dip" android:layout_marginTop="15dip" android:background="#FFFFFF" android:id="@+id/index" android:text="0" android:textColor="#000000"> </TextView> <ImageView android:layout_marginTop="280dip" android:layout_width="fill_parent" android

Android SurfaceHolder.unlockCanvasAndPost() does not cause redraw

◇◆丶佛笑我妖孽 提交于 2019-12-04 19:22:26
问题 I'm implementing a fairly standard app with the Android sdk that involves drawing using the SurfaceView, SurfaceHolder, Callback setup. In my main thread (UI thread) I have no drawing or handling of the SurfaceHolder (or the canvas you retrieve with it). In a separate thread I have the following: Log.i("GAME.DrawThread", "run()"); Log.i("GAME.DrawThread", Thread.currentThread().getName()); Canvas canvas = null; try { canvas = holder.lockCanvas(); synchronized(holder) { Log.i("GAME", "draw()

How to show x and y axes in a MATLAB graph?

时光怂恿深爱的人放手 提交于 2019-12-04 16:51:39
问题 I am drawing a graph using the plot() function, but by default it doesn't show the axes. How do we enable showing the axes at x=0 and y=0 on the graph? Actually my graph is something like: And I want a horizontal line corresponding to y=0 . How do I get that? 回答1: By default, plot does show axes, unless you've modified some settings. Try the following hold on; % make sure no new plot window is created on every plot command axes(); % produce plot window with axes plot(% whatever your plot

finding route directions from source to destinaton in android

ぃ、小莉子 提交于 2019-12-04 16:39:02
I am new to android, i have managed to write code that displays the google map, i can able to give source and destination addresses and place push pin over there using reverse Geocode concept... the scenario is i want to display the driving,walking,bicycling directions from source to destination point with displaying a line from source to destination.. Peter Knego AFAIK there is no route calculation functionality in Google Maps for Android. Furthermore, live route calculations for navigation are not allowed by Google Maps terms of service , article 8.7. For alternative approach take a look at: