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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:30:57+00:00 2026-05-26T23:30:57+00:00

Sounds to me I’ve a very basic need: extracting coordinates of the zones composing

  • 0

Sounds to me I’ve a very basic need: extracting coordinates of the zones composing a matrix.

Let me give an example. Here is some matrix:

    | A | B | D | E | F | G | H | I | J |
| 1 | 0 | 0 | 0 | 2 | 2 | 2 | 4 | 4 | 4 |
| 2 | 0 | 0 | 2 | 2 | 2 | 2 | 4 | 4 | 4 |
| 3 | 0 | 0 | 2 | 2 | 2 | 3 | 3 | 4 | 4 |
| 4 | 1 | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 |
| 5 | 1 | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 |
| 6 | 1 | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 |
| 7 | 1 | 0 | 0 | 0 | 1 | 1 | 3 | 0 | 4 |
| 8 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 |
| 9 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 |
| 10| 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 |

And I’d like to get an array with the boundaries and value of each zone (no particular order needed).

Example for the top-left zone:

  • value: 0
  • boundaries: {A1, D1, B2, B3, 13}

Do you know some library answering this need or should I code this myself?

  • 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-26T23:30:57+00:00Added an answer on May 26, 2026 at 11:30 pm

    I’d code this myself, not sure if there are libraries.

    I’d consider each point in turn, for each region. Then (i think) this should work:

    if (surrounding 8 squares has at least one with different region)
    {
        for each 3 squares, above, below, left and right
        {
            if (less than 3 are different, and the middle is different)
            {
                is a boundry
            }
        }
    
        for each 3 squares, above, below
        {
            for each 3 squares, left, right
            {
                if(all 3 from outer loop and all 3 from inner loop are different)
                {
                    is a boundry
                }
            }
        }
    
        not a boundry
    }
    else
    {
        not a boundry
    }
    

    Treat out of bounds squares as different.

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

Sidebar

Related Questions

This sounds like a really basic question. Let's say I have the following Form
Sounds like a let me google it for you question, but somehow I can't
This sounds pretty basic but I ca't think of a neat straightforward method to
This sounds like a tricky question... let me ellaborate... I have a treeView. When
Sounds simple enough, but its not working. In this example, I want to set
This sounds like a why would you do that? sort of question, but here
sounds like very easy question but very often I am confused by this. Please
This sounds easy but. I am simply not able to do it. Here is
It sounds like a similar situation to what's asked here , but I'm not
This sounds very easy, however I couldn't find it anywhere in the docs. How

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.