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

  • SEARCH
  • Home
  • 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 9040251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:56:29+00:00 2026-06-16T09:56:29+00:00

I used standard hough transforms to obtain the straight lines in an image using

  • 0

I used standard hough transforms to obtain the straight lines in an image using OpenCV. Now, I need to find the x and y coordinates of the point of intersection of most of the lines in the image. My idea was to divide the image into several 8*8 pixel segments( I haven’t decided on the size yet) and then search the region for lines. But I am not sure as to how I count the lines in the segments. I am struck at this point. So the things I am unable to do( using openCV) are
1.Divide the image into 8*8 pixel segments( i don’t know if there is a function for it and if not what do I do)
2.Count the number of lines in each segment.
Any reading material or hints for the code will be of really helpful.

  • 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-06-16T09:56:31+00:00Added an answer on June 16, 2026 at 9:56 am

    Your way of detecting intersection points is totally wrong. There is a simple mathematical formula for that. I am giving you an example code in plain C. :

    // This is a point
    typedef struct{
       int x,y;
    } MYintPOINT;
    
    // This is line
    typedef struct {
        MYintPOINT  pStart;
        MYintPOINT  pEnd;
    } MyLine;
    
    #define PointMinusPoint(P,Q,R)      {(P).x = (Q).x - (R).x; (P).y = (Q).y - (R).y;}
    #define PointCross(P,Q)             (((P).x*(Q).y)-((P).y*(Q).x))
    #define SIGN(X)             (((X)>=0)? 1:-1 )
    #define ABS(a)              ((a) >= 0 ? (a) : (-(a)))
    #define ROUND(a)            ((SIGN(a)) * ( ( int )( ABS(a) + 0.5 ) ) ) 
    
    // Given 2 line segments, find their intersection point
    // rerurns [Px,Py] point in 'res' or FALSE if parallel. Uses vector cross product technique.
    int findLinesIntersectionPoint(const MyLine*l1, const MyLine*l2, MYintPOINT *res){
        MYintPOINT  p  = l1->pStart;
        MYintPOINT  dp;
        MYintPOINT  q  = l2->pStart;
        MYintPOINT  dq;
        MYintPOINT  qmp;            // q-p
        int         dpdq_cross;     // 2 cross products
        int         qpdq_cross;     // dp with dq,  q-p with dq
        float       a;
    
        PointMinusPoint(dp,l1->pEnd,l1->pStart);
        PointMinusPoint(dq,l2->pEnd,l2->pStart);
        PointMinusPoint(qmp,q,p);
    
        dpdq_cross = PointCross(dp,dq);
        if (!dpdq_cross){
            // Perpendicular Lines
            return 0;
        }
    
        qpdq_cross = PointCross(qmp,dq);
        a = (qpdq_cross*1.0f/dpdq_cross);
    
        res->x = ROUND(p.x+a*dp.x);
        res->y = ROUND(p.y+a*dp.y);
        return 1;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used to have my permalinks to standard format, something like http://example.com/?page_id=2 . Now
I've used standard WPF Labels throughout my project. Now that I'm including the Telerik
I need to add gallery to my android app. I used gallery in standard
I have used all the Standard Network related code for Getting Images of about
I have a set of triangles in the standard format used in matlab, i.e
I used to have a standard ASP.NET MVC 3 application that was Ninject-wired via
I have used CAPTCHA on my various web sites in the standard manner where
Is it possible to used ggplot to color points based on predefinded standard color
Does the system come with a standard control that can be used for drawing
To localitie items in the standard directories, I have just used either one of

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.