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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:32:10+00:00 2026-06-15T09:32:10+00:00

I’ve been going through posts and examples for the past two days and all

  • 0

I’ve been going through posts and examples for the past two days and all snippets Ive tried and extensively tested have proven to be quite useless, at least for my purposes.

What I want to do is compare a black vector symbol photographed off a wall or piece of paper (quality akin to badly scanned images one might say) and compare that to an electronic version of the same or similar symbol (which would be stored locally and compared to the photograph). Please take a look at the two attached images, the first clean one (reference image) is the database version of the symbol and the second is a crappy drawing I made on a piece of paper which I then photographed with my iPad.

Reference Image

Test Image

I wanted the procedure to go as follows:

  • The two images are loaded and then trimmed using a modified version of this trimming algorithm I found here: Trimming images with PIL. I found that a ‘threshold’ value of 50 and an ‘obviousness’ value of 20 (parameters in the linked script) give good results for these images
  • The images would then be resized to the same size and compared

Now for the comparison, I’ve tried a ton of different suggested approaches but so far the results are terrible. I can actually get better comparison results with a random image than the tested one. I’ve tried RMS difference comparison based on the actual images, their edges (created with the ‘filter’ function with ImageFilter.CONTOUR or ImageFilter.FIND_EDGES), Pixel-Based Comparison but so far nothing Ive found online (despite my incessant googling) or here in StackOverflow has given me decent results.

I believe that the problem lies in the noisy backdrop of the test image but I havent been able to prove it. Does anyone know if there’s a way to get a vectorial outline out of the edges in these images and compare them not merely as images but as image-vectors?
Despite my crappy drawing, I find that these two images are fairly similar and it should be possible to get a good comparison out of it.

  • 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-15T09:32:12+00:00Added an answer on June 15, 2026 at 9:32 am

    To get a better response you need to better limit the scope of your application. Here is something that might help you. I suppose your “crappy drawing” input is always similar to the one you provided in the sense that it has strong edges, and the color present on it is irrelevant. To solve (or, better, to get closer to a solution for) your problem in a simple way, you need to describe both images in terms of scale invariant descriptors.

    My take on it: binarize both images, count number of connected components (CCs) inside both, discard CCs of irrelevant size (too far from the median, mean, related to stddev, etc, you decide). You will possibly want to supplement the second step, to better discriminate your image from other inputs, i.e., the more powerful you want your approach to be, the more discriminant descriptors you will need. At some point you might also want to consider using SVM, or other machine learning techniques.

    So, the binarize step: perform a morphological gradient and discard weak gradient. This is very easy if the inputs are similar to what was posted. Here is what I get with a threshold at intensity 60 (I’m also assuming your input is in the range [0, 255]):

    enter image description here
    enter image description here

    I quickly experimented with thresholds ranging till 90, and all them worked for these images. Cropping these is easy, and you can also flood fill the background and the object:

    enter image description here
    enter image description here

    Now you can extract the connected components in white and do the analysis on them. In this case, the simplest thing to do is to count them. For these inputs, we get 12 in the “perfect” image and 14 in the “bad” one. But, in the “bad” one, we have 2 components of size 1 (there is only one pixel in each one of them), which are trivially eliminated. There are many other ways to compare the connected components, but I hope this can get you started. If you need the code for these tasks I can include it.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I've tracked down a weird MySQL problem to the two different ways I was
I have a text area in my form which accepts all possible characters from
I have been unable to fix a problem with Java Unicode and encoding. The
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

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.