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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:25:39+00:00 2026-06-05T20:25:39+00:00

I’m currently developing a project with Mammography and I’m trying to comprehend how I

  • 0

I’m currently developing a project with Mammography and I’m trying to comprehend how I can segment an image into two sections: a searchable area (ROI) and a non-searchable area. The focus of this question is directed at only the underlying algorithm of the actual image analysis / processing. Most of the results from Google and Stack Overflow have yielded helpful pieces of information, but none of them explain the steps of image analysis / processing and why these steps are important and what exactly they’re each doing.

I’ve written a small code segment that takes an image, re-sizes the image, and ‘binarizes’ the image. (Below.) Is there any way that I can trace a line (Contour?) on my binary image, move this line to my original image, and use it as a guideline in having my algorithm determine searchable areas (ROI) from non-searchable areas? Is there a simpler way of doing this?

// ** Main ** //
int main( int argc, char** argv )
{
  /// Load an image
  src = cvLoadImage(argv[1], CV_LOAD_IMAGE_GRAYSCALE);

  // Create Dummy Image
  Mat destination;
  destination = cvCreateMat(3328/5, 4084/5, CV_32FC1);
  resize(src, destination,cvSize(3328/5,4084/5),0,0);
  src = destination;

  /// Create a matrix of the same type and size as src (for dst)
  dst.create( src.size(), src.type() );

  /// Create a window
  namedWindow( window_name, CV_WINDOW_AUTOSIZE );

  // Binarize the Image   
  threshold(src, dst, 128, 255,CV_THRESH_BINARY | CV_THRESH_OTSU); 

  // Show the Image
  imshow( window_name, dst );

  /// Wait until user exit program by pressing a key
  waitKey(0);

  return 0;
  }

For clarification and reiteration, I’ve looked into quite a few tutorials and nothing has been of help for this, specifically. I would appreciate all the help I can get!

  • 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-05T20:25:41+00:00Added an answer on June 5, 2026 at 8:25 pm

    To find lines on a binarized image you need to use a recursive function, and create a second array the same size as the image that you can store data in. This is an example of code I have recently written to detect blobs in a binarized image (note, this is in C#, a little adaption such as using vector<> rather than list would be required).
    First, analyze a pixel to see whether it is worth tracing/hasn’t been traced:

    private List<Blob> FindBlobs(bool[] Data, int Width, int Height)
    {
        bool[] IsBlob = new bool[Data.Length];
        List<Blob> Blobs = new List<Blob>();
    
        for (int y = 0; y < Height; y++)
        {
            for (int x = 0; x < Width; x++)
            {
                if (Data[y * Width + x])
                {
                    Blob b = new Blob();
                    TrackBlob(b, Data, x, y, Width, Height);
                    Blobs.Add(b);
                }
            }
        }
        return Blobs;
    }
    

    Then trace each blob:

    private void TrackBlob(Blob blob, bool[] Data, int x, int y, int Width, int Height)
    {
        for (int i = -1; i < 2; i++)
        {
            for (int j = -1; j < 2; j++)
            {
                if ((x + i) >= 0 && (x + i) < Width && (y + j) >= 0 && (y + j) < Height)
                {
                    if (Data[(y + j) * Width + (x + i)])
                    {
                        Data[(y + j) * Width + (x + i)] = false;
                        blob.AddPoint((x + i), (y + j));
                        TrackBlob(blob, Data, x + i, y + j, Width, Height);
                    }
                }
            }
        }
    }
    

    You could adapt these easily to only search for straight lines( I don’t know whether you require circular lines). Then use intersection points of the lines to build up an object with known lines for edges.

    Alternatively, you can use Hough Lines and Circles (available in OpenCV) to trace lines and circles on the image for you. This has the benefit of giving lines in any orientation, but it does not give end points of straight lines.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am currently running into a problem where an element is coming back from
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I am trying to render a haml file in a javascript response like so:

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.