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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:38:32+00:00 2026-06-11T16:38:32+00:00

The following image shows what the algorithm has to do. In the case of

  • 0

The following image shows what the algorithm has to do.

enter image description here

In the case of 1D arrays, for example string matching, we can use String searching algorithms.

How can we efficiently find such matchings in bitmaps or 2d arrays?

P.S.
The given example is only for explanation purpose. Implementing Bejeweled solver does not need complex algorithms, just split the game board and make N x N table, and sample a pixel from each cell and figure out which item is in each cell by checking its RGB value, then we’re done. I want to know general image region matching algorithms that will be used in, for example, a macro program that keeps clicking on the matching bitmap regions.

  • 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-11T16:38:34+00:00Added an answer on June 11, 2026 at 4:38 pm

    It is not a simple thing to do. Most games work around the problem by using regions (as you surmised with your bejeweld example) or color maps, which maintain a second drawing, mapping position by color to a particular item.

    Outside of games, routines use matrix transformation to attempt to identify edges and verticies, which tend to reduce the amount of data under consideration for possible matching. The trivial example would be to use a filter with a kernel like

     kernel = [ -1 -1 -1 ]
              [ -1  8 -1 ]
              [ -1 -1 -1 ]
    

    To emphasize any region which doesn’t balance with its neighbours. From that you can attempt to detect lines and vertices, greatly reducing the number of items to consider in a match. If you want to detect “near” matches, then you attempt to use a linear transformation to describe the distance to a match by measuring displacement of the vertices, and set up some criteria for deciding if the match is too far from being the same.

    A trivial solution, but one that only works with “perfect” data is to just xor the bitmap against the original for every possible offset. If the image is known to be constructed with the exact bitmap, then the xor should result in a zero field the same size as the bitmap. This technique can be somewhat improved in performance by checking a few chosen pixels for exact match before attempting the more expensive xor and verify calculations, but its performance will degrade with larger spaces to consider in a very undesirable manner.

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

Sidebar

Related Questions

I have following Image as src in ImageView. I use this as background image.
Problem The following image shows an organization chart: The Full Name boxes are aligned
The following image shows the part of my web page. I am developing my
I would like to set navBar buttons like safari as following image shows. However
The following image have been uploaded to show what I am trying to do
I am using the following php script to show a random image on my
We suppose that we have the following image (is a single file with 4
Using PHP I'm trying to download/save the following image: http://www.bobshop.nl/catalog/product_image.php?size=detail&id=42428 When you load this
i want to add a data indicator line similar to the following image in
Im trying to setup my asp.net mvc page like the following image: The header

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.