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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:44:46+00:00 2026-06-09T17:44:46+00:00

i need to find the distance between the two points.I can find the distance

  • 0

i need to find the distance between the two points.I can find the distance between them manually by the pixel to cm converter in the image processing tool box. But i want a code which detects the point positions in the image and calculate the distance.
More accurately speaking the image contains only three points one mid and the other two approximately distanced equally from it…

  • 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-09T17:44:48+00:00Added an answer on June 9, 2026 at 5:44 pm

    There might be a better way then this, but I hacked something similar together last night.

    Use bwboundaries to find the objects in the image (the contiguous regions in a black/white image).

    The second returned matrix, L, is the same image but with the regions numbered. So for the first point, you want to isolate all the pixels related to it,

    L2 = (L==1)
    

    Now find the center of that region (for object 1).

    x1 = (1:size(L2,2))*sum(L2,1)'/size(L2,2);
    
    y1 = (1:size(L2,1))*sum(L2,2)/size(L2,1);
    

    Repeat that for all the regions in your image. You should have the center of mass of each point. I think that should do it for you, but I haven’t tested it.

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

Sidebar

Related Questions

I need a function to find the shortest distance between two line segments. A
I am aware that Dijkstra's algorithm can find the minimum distance between two nodes
For my game, I need to find the distance between two objects at certain
I can find plenty formulas for finding the distance between two skew lines. I
I'm trying to find the distance between two points (for which I've latitudes &
I'm am writing a code to find the shortest distance between two points. My
I need a basic function to find the shortest distance between a point and
I need to find the distance between the 2nd and 3rd elements of each
Need some help to find the number of matched tokens between two strings. I
I need to find the driving distance between 2 locations. I do not need

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.