line

How to count number of lines (Hough Trsnform) in OpenCV

Hi, I am successfully able to detect hair strands in an image as lines. I see that the output image detects each hair as line.I use cvHoughLines2() with method parameter as CV_HOUGH_PROBABILISTIC. Now I want to count these lines.The output image shows 1 or 2 line over each hair.I see that each line is composed of small line segments. And...

How to draw a directed arrow line in Java?

I want to draw a directed arrow line through Java. At present, I am using java.awt.Line2D.Double class to draw a line g2.setStroke(new BasicStroke(2.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL)); // g2 is an instance of Graphics2D g2.draw(new Line2D.Double(x1,y1,x2,y2)); But only the line appears and no directed arrow appears. U...

Pressing "Home" in Vim on an Indented Line

I have a bad habit of using the 'home' key to go back to the beginning of a line. As I recently started using vim (and loving it!) I noticed that when I press the home key on a lined that is indented, it returns me to the very beginning of the line. In Notepad++ (the editor I used to use) it would return me to the beginning of the code o...

How Can I minimize the HTML code by making it one line of code?

So I have made a web page of HTML, Inline CSS and JS. Since this page will be produced through JS function opened.document.write(); I would like to put all the web page code into one line that can be taken in one of the previously mention function instead of repeating the same function for every new line. I can't affors doing this man...

iphone quartz draw border around line

Hello, what's the best way to draw a (black) border around a line in quartz for iphone? I'm drawing lines on streets on map and if the line is yellow (which is a legit use case), it blends in with the street color. One thing I could do is lay my lines over a little thicker black line, but this doesn't sound very efficient. ...

Use sed to delete a matched regexp and the line (or two) underneath it

OK I found this question: http://stackoverflow.com/questions/876446/how-do-i-delete-a-matching-line-the-line-above-and-the-one-below-it-using-sed and just spent the last hour trying to write something that will match a string and delete the line containing the string and the line beneath it (or a variant - delete 2 lines beneath it). ...

iphone quartz drawing 2 lines on top of each other causes worm effect

Hi, I'm using Quartz-2D for iPhone to display a route on a map. The route is colored according to temperature. Because some streets are colored yellow, I am using a slightly thicker black line under the route line to create a border effect, so that yellow parts of the route are spottable on yellow streets. But, even if the black line is...

Remove previous lines then join when SED finds expression

Hi all, I'm trying to join sentences in a document, but some of the sentences have been split apart with an empty line in between. For example: The dog chased after a ball that was thrown by its owner. The ball travelled quite far. to: The dog chased after a ball that was thrown by its owner. The ball travelle...

What are some of the best ways to plot/draw vector graphics on a HTML page?

I'm trying out some dynamic web page background generation using lines and text. Take a look at my demo at http://74er.net/labs/lines.html (just focus on the yellow line). It's a lame and inefficient method by literally creating a <span> element with 1 X 1 size and a yellow background with the X,Y position based on an ellispe formula....

Reading specific lines only (Python)

I'm using a for loop to read a file, but I only want to read specific lines, say line #26 and #30. Is there any built-in feature to achieve this? Thanks ...

Plane equation from a line

All right, I need to do two things: I need to determine the equation of a line, with the angle given, from a point in 3D space I need to determine the equation of a plane that is perpendicular to that line, and is a set size, with the original line in it's center. I will need the plane's equation to be in a form where, given a new li...

iPhone Draw Line Thickness

My line is only 1 pixel thick. How can I thicken it? I use MontoTouch.net but Objective-C is fine in the answer. ctx.SetRGBStrokeColor (1,1,1, 1f); ctx.MoveTo(130,110); ctx.AddLineToPoint(200,200); ctx.StrokePath(); ...

How do I make vim syntax highlight a whole line?

I'd like to have vim highlight entire lines that match certain patterns. I can get all the text in a line to highlight (by doing syn match MyMatch "^.*text-to-match.*$"), but it always stops at the end of the text. I'd like to to continue to the end of the term, like highlighting CursorLine. I've tried replacing $ with a \n^, hoping t...

UITableView didSelectRow line content superposition

Hi, I have a very strange problem with my UITableViews. When the tableView contains more than ten rows and when I select a row, another row's content of the table view is displayed above the row I selected. It is the same for every tableView. Did someone experiment this issue ? Thanks for any idea. ...

Constraining the drawing of a line to 45 degree angles

I have the start point (x1,y1) and the desired length and angle of the line. If the angles were directions, 0 degrees is W, 90 is N, 180 is E and 270 is S. I can modify this if needed. How can I use the start point, length and angle to determine the end point(x2, y2)? ...

Drawing anti-aliased lines in wx?

I've got a program that draws my mouse movements on a window. The only problem is the line is very rough, and i would like it (not where two different lines link, but the actual line) to be anti-aliased and to fall-off nicely. Is there a way to do that? ...

On what line did a script exit?

I have a php script that is rather hairy and I'm trying to troubleshoot it. No errors are happening, but I'm having trouble seeing what execution path it took to create the output I've gotten. Is there a way I can see at what line the script stopped execution? Folks, sorry I didn't make this clearer. No errors are happening. No except...

Find the first point along a heading that is a specified distance away from a line segment.

Hi, Given a starting point, a heading, a distance, and a line segment, find the first point along this heading that is the specified distance away from this line segment. I covered two cases, but I haven't been able to cover the last one. First case: heading away from the line. Ignore it even if the starting point is within the specifie...

how to draw <Bar> on each 4th space

I'd like (g)vim to draw pipe symbol '|' on each 4th space of indentation to show something like vertical indentation line. I found this plugin: http://vim.sourceforge.net/scripts/script.php?script_id=628 but it works only for 'tab'. I'm using spaces instead of the tabs. My .vimrc contains: set ts=4 set sw=4 set expandtab set softtab...

Adventurous: Patching VS.NET to include line numbers in release builds

I am distributing with VS 2008 .NET and obfuscation. I am up against the frustrating problem of not being able to see line numbers in stack traces. Whilst there are workarounds eg. http://stackoverflow.com/questions/1328836/include-line-numbers-in-stack-trace-without-pdb when the stack traces are returned (holding PDB files locally et...