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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:29:33+00:00 2026-06-17T18:29:33+00:00

This is the original image. I changed it into 1) grayscale and apply 2)

  • 0

This is the original image.

enter image description here

I changed it into 1) grayscale and apply 2) threshold.

As seen in the original image, there are some shadow that still exist after apply two method above.

But most of the image are perfect after 2 method.

enter image description here

I need to extract the text, so I need to get rid of the noise. I almost finish the work but the problem is some cases have a black border and I wanted to replace that into white color.

And I insist that I want just only border to turn into white

I think of create some white rectangle and fill the border with those rectangle but I don’t know how to do it.

How can I achieve that using Matlab?
Any other method would be appreciate too!

  • 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-17T18:29:34+00:00Added an answer on June 17, 2026 at 6:29 pm

    If you can be sure only the borders will be black, why not simply crop the image until all isolated shapes are recognizable characters? Something along the lines of

    done = false;
    ii = 1;
    while (~done)
    
        % fill the outer border
        img(:,ii)       = 255;    img(ii,:)       = 255;
        img(:,end-ii+1) = 255;    img(end-ii+1,:) = 255;
    
        % (run your algorithms here. It positive match, done = true)
    
    end
    

    That could be computationally intensive, since you have to do pattern recognition on each iteration, but you indicated it only occurs in “some cases”.

    Otherwise, I suspect some morphological operation can also be used, probably erosion or thinning or similar. But that has the drawback of altering the characters you want to match. But, if all images you have to process look like the one you show, I hardly suspect that’ll give you any problems.

    Some ways to detecting straight lines are mentioned in this question. I’d say you could detect all lines, and remove those (with a small tolerance around it) that are perfectly horizontal/vertical and on one of the edges.

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

Sidebar

Related Questions

this is an edit of the original post now that I better understand the
At this present point in time I have some code that does the following:
Original question: This method is supposed to change the image being displayed on a
I have stored images from the net like this Documents/imagecache/domain1/original/path/inURI/foo.png Documents/imagecache/domain2/original/path/inURI/bar.png Documents/imagecache/... Documents/imagecache/... Now
I have this original formula from a medical research book: Log(e) (EFW) = (-4.564+(0.282*AC)-(0.00331*AC^2))*1000
I got the JSON from apple like this { original-purchase-date-pst = 2012-06-28 02:46:02 America/Los_Angeles;
This is a continuation of this question: Original Question (SO) The answer to this
I'm curious why is method fillInStackTrace of java.lang.Throwable public? This method replaces original stack
This is a slightly original variation on a common problem. I have a fairly
Original SQL query is this; SELECT id,post_title,post_date FROM wp_posts where id='1' When I retrieve

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.