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

The Archive Base Latest Questions

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

I am currently working on a project involving manipulation of binary images on pixel

  • 0

I am currently working on a project involving manipulation of binary images on pixel level (thinning, clustering etc.). Many of the algorithms used involve checking the attributes of neighboring pixels. A pixel object defined as:

Public class pixel
{
int x, y;
int NumberOfNeighbours;
int ConnectivityNumber;
int ClusterNumber;
}

I can create a list containing all the pixels in the image for processing them sequentially but I want to link each of the pixels in the list to their position on a grid to efficiently get properties of its neighbor pixels.

For example, if I have a map[7,7] with 9 pixels [A to I] in the map,
https://i.stack.imgur.com/UwHTn.jpg
and I want to check the value of the ClusterNumber of each neighbour of each pixel. It seems very inefficient to run through the list 8 times to find the neighbors of each pixel and it would be easier to use the grid to just check the neighbors. Is there a way to reference a pixel in the grid so that I can access its properties as a neighbor of the current pixel in the list? I’ve thought about creating a int[,] map = new int[width,height] containing the indexes of the pixels in the list, but this creates a problem when a pixel is removed from the list and map would need to be updated every time a pixel is removed from the list.

Alternatively, is there a way I can link/point to the neighbors of a pixel in the class itself such that (schematically) I could access a neighbor’s properties

//list[0].NeighborE  == null
//list[0].NeighborNE == B
//list[0].neighborN  == null
//...
//list[1].NeighborE  == G
//list[1].NeighborNE == D
//list[1].NeighborN  == C
//list[1].NeighborNW == null
...
if (list[i].NeighborE.ClusterNumber > 2)
    list[i].ClusterNumber = 2;

Any advice/guidance would be appreciated.

  • 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-26T05:30:36+00:00Added an answer on May 26, 2026 at 5:30 am
    Public class pixel
    {
        int x, y;
        int NumberOfNeighbours;
        int ConnectivityNumber;
        int ClusterNumber;
    
        //neighbors:
        Pixel _neighborN;
        Pixel _neighborNE;
        ...
        Pixel _neighborNW;
    }
    

    Here you need to assign all neighbors pixels during initialization. If current pixels is near the edge, you just assign it to null. But do not forget to check null-values when you operate with them.

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

Sidebar

Related Questions

I'm currently working on a project involving a form generator. The user can switch
I am currently working on a small ASP.NET project involving authentication of users against
I am currently working on a project involving the canvas element and have come
I am currently working on a project involving the Lucene library within C# however
I'm currently working on a project (database implementation) involving an enum class called ElementType
I'm currently working on a project involving saving/loading quite big MAT files (around 150
I am currently working on a project involving interaction with Bluetooth Low Energy tag
all! I'm currently working for a project involving deploying netbooks to the villages for
I am currently working on a small ASP.NET project involving authentication of users against
I'm currently working on project, Android Internet Download Manager. In order to download 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.