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 5973219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:46:09+00:00 2026-05-22T20:46:09+00:00

How do I locate the end points of a bridge-like structure in an image?

  • 0

How do I locate the end points of a bridge-like structure in an image?

Below is a generalized representation.

Enter image description here

I have a set of images that look like what you see on the left hand column as shown in the above picture. What I am trying to detect/locate is actually the two endpoints that are shown on the right hand column in the above picture. It’s quite like locating the “two ends points” of the ‘bridge’.

I have applied some basic morphological operations; however, either I’m doing it wrong or those basic morphological operations aren’t working in this scenario. (I have tried making it into skeletons; however, once the skeletons are formed, I can’t seem to detect the cross with three edges).

EDITS

Thanks for the previous suggestion; however, it looks like the original sets of images cannot be completely generalized like what I’d previously drawn.

I have attached the latest updates to this question. Below is a more detailed representation that includes the original segmented regions and the corresponding images that’d undergone a “thinning” morphological operation. Again, the left side is the originally segmented region; while on the right would be the points to be detected.

Enter image description here

  • 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-22T20:46:10+00:00Added an answer on May 22, 2026 at 8:46 pm

    Here is a code example to locate branch points after skeletonizing the image:

    import pymorph as m
    import mahotas
    from numpy import array
    
    image = mahotas.imread('1.png') # load image
    
    b1 = image[:,:,1] < 150 # make binary image from thresholded green channel
    
    b2 = m.thin(b1) # create skeleton
    b3 = m.thin(b2, m.endpoints('homotopic'), 15) # prune small branches, may need tuning
    
    # structuring elements to search for 3-connected pixels
    seA1 = array([[False,  True, False],
           [False,  True, False],
           [ True, False,  True]], dtype=bool)
    
    seB1 = array([[False, False, False],
           [ True, False,  True],
           [False,  True, False]], dtype=bool)
    
    seA2 = array([[False,  True, False],
           [ True,  True,  True],
           [False, False, False]], dtype=bool)
    
    seB2 = array([[ True, False,  True],
           [False, False, False],
           [False,  True, False]], dtype=bool)
    
    # hit or miss templates from these SEs
    hmt1 = m.se2hmt(seA1, seB1)
    hmt2 = m.se2hmt(seA2, seB2)
    
    # locate 3-connected regions
    b4 = m.union(m.supcanon(b3, hmt1), m.supcanon(b3, hmt2))
    
    # dilate to merge nearby hits
    b5 = m.dilate(b4, m.sedisk(10))
    
    # locate centroids
    b6 = m.blob(m.label(b5), 'centroid')
    
    outputimage = m.overlay(b1, m.dilate(b6,m.sedisk(5)))
    mahotas.imsave('output.png', outputimage)  
    

    sample output
    sample output

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

Sidebar

Related Questions

I have a plot that has data that runs into the area I'd like
I am trying to locate in the HL7 Stream for the segment that will
How do I locate the current file in the project structure? (Similar to Visual
I need to locate a command line tool that would allow me to write
I have a very simple mail merge that is connected to an SQL server
I have a WCF that is in use now for over a year, coded
I have a WCF SOAP 1.1 Webservice with the configuration specified below. A concurrent
I have a Visual Basic 6.0 application that I want to install for All
I have a table that I wish to select a subset of columns from
I have a WPF application where I added the images as resources to the

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.