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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:04:11+00:00 2026-05-13T18:04:11+00:00

I am working on a Computer Vision problem, in which I have to merge

  • 0

I am working on a Computer Vision problem, in which I have to merge regions of an image. A region (or blob) is defined by its lines, i.e. the following region of O:

  0123456789
0 XXXXOXXXXX
1 XXXOOOXXXX
2 XXXOOXXXXX
3 XXXOXXXXXX
4 XXXXXXXXXX

is defined by :

row: 0, cols: 4-4
row: 1, cols: 3-5
row: 2, cols: 3-4
row: 3, cols: 3-3

I chose this datastructure because I need to be able to find quickly the neighbors of a region, i.e. all the pixels that “touch” it.

Now, my problem is that I want to merge two regions, i.e. compute the union of them. This means that I may end up with several ranges of columns in my data structure shown above.

With this setup, I have two questions:

  1. In C, what is the best datastructure for this data ? A typical image is 16×16, which means not that many rows/columns. I will do a lot of merging (the goal of the thing is to start with one region per pixel and end with one big region, i.e. 16×16 – 1 merges). I could go with a pointer and allocate/free the things, or use a char* to store the cols and parse it afterwards, for instance.

  2. How to efficiently merge two regions? I need to find potential columns that are adjacent to merge them (e.g., 3-5 and 6-9 become 3-9), preferably without always reallocating and copying things.

  • 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-13T18:04:11+00:00Added an answer on May 13, 2026 at 6:04 pm

    If your data is for a two color image…black and white, why not just use an array of unsigned shorts that is 16 elements long?

    unsigned short image[16]
    

    The merging could be done with bitwise logic which is pretty efficient over a 16 element array.

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

Sidebar

Related Questions

I'm working on a computer vision problem which requires rendering a 3d model using
I have a computer working as a server with many SQL Server 2005 databases
So I'm working on one computer with some ruby/rails code and its working fine.
I have IE8 installed on my computer and have been working on automating some
I'm working on a vision application and I need to have a Live View
I'm working on my task in computer vision course. One of sub-tasks is gradient
Where can I find working code of object detection (part of computer vision) written
I am working on a C++ application that uses computer vision techniques to identify
i have cygwin and netbeans installed on my computer working compatibly. I want to
I've been working through a recent Computer Science homework involving recursion and big-O notation.

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.