Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6825829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:04:39+00:00 2026-05-26T22:04:39+00:00

I am looking for a way to join together 2D line segments. A line

  • 0

I am looking for a way to join together 2D line segments. A line segment is made of up two vector points, the start of the line segment and the end point of the line segment.

I want to join line segments that look like they should form the same straight line, I don’t want to join the line segments if they are of completely different orientations but happen to have 2 points close to each other. The system I am going to use this in is a computer vision system so the line segments obtained are not going to be perfect i.e. the orientations might be slightly off, the segments might not be full length e.t.c.

I think the following 3 examples cover the sort of line segments I want to join together:

Example

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:04:39+00:00Added an answer on May 26, 2026 at 10:04 pm

    This is computational geometry problem there might be some solutions in related textbooks, but be warned these problems are usually very difficult to solve and finite precision is a real problem. With regard to this problem (in 2D) the term you are likely looking for is that the lines are near collinear. Typically what you do to determine if lines are collinear is to first put them in a vector representation, then take the dot product between the vectors, which will equal the cosine of the angle between the lines. So, if this value is near one they are close to collinear and should be joined.

    The next problem is determining if lines are close enough to need to be joined. You could do this by finding lines that intersect or finding lines that have start and end points that are very close… This is not all that easy in general, but you can probably get 95% of them this way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I looking for a way to programmatically start a VOIP call using the SIP
I have two tables that I am outer joining together: Post left outer join
I am Looking for a way to fetch the data between two date, for
I'm looking for a way to join a series of SQL tables based on
To state it in a general form, I'm looking for a way to join
I'm looking for way to PHP to detect if a script was run from
I'm looking a way to enable IP logging with log4net in ASP.NET. I found
I'm looking for way to write Javascript programs / scripts on desktop, not inside
I'm looking a way to build conditional assignments in bash: In Java it looks
I am using codeigniter and looking a way to enable directly editting of doc

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.