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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:33:56+00:00 2026-06-15T20:33:56+00:00

As shown in the attached image [For clarification only], there are three rows of

  • 0

As shown in the attached image [For clarification only], there are three rows of lines with random length.
I would like to delete lines which are shorter than a constant N pixels.

Assumptions:

  1. Lines are all in rows
  2. Lines are 1 pixel width
  3. Lines may be connected to borders.

I’m looking for any idea/guide which can help me with this. Thanks.enter image description here

  • 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-15T20:33:57+00:00Added an answer on June 15, 2026 at 8:33 pm

    Skipping the possibility of directly handling the binary representation of the underlying image, and thus permitting a pretty fast implementation for this specific task, let us use Mathematical Morphology to (efficiently) solve it.

    All you need here is a erosion with a horizontal line of length n followed by a morphological reconstruction. The former will completely remove lines shorter of length < n. The later will completely recover the eroded lines that were not removed.

    Here is an example with n = 25. I used ones(1, 25) instead of strel('line', 25, 0) as the structuring element because the later doesn’t guarantee that the actual line length is the one specified.

    f = im2bw(imread('https://i.stack.imgur.com/1Uw0x.png'), 0);
    g = imerode(f, strel('arbitrary', ones(1, 25)));
    h = imreconstruct(g, f);
    

    Eroded and reconstructed images:

    enter image description here enter image description here

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

Sidebar

Related Questions

As shown below the Table Recording contains three foreign keys, only one of which
I have a symmetric matrix like shown in the image attached below. I've made
Trying to get the layout shown here http://www.reversl.net/zindex/ to look like the image attached
i want to add effects for image as shown in attached image i don't
I have a form that appears as shown in the attached image. I have
I have a UITapGesture attached to an image view. I'd like to reuse the
My app consists of the screens as shown in the attached image. I added
Above attached my image that fetched it remote server its shown as row in
i want to show dialog like attached Image. an image to the left and
Please consider the scenario as shown in the attached image : The Portal(producer) will

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.