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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:34:33+00:00 2026-06-18T07:34:33+00:00

Say I have a two 4*4 matrices (representing binary images) and I want to

  • 0

Say I have a two 4*4 matrices (representing binary images) and I want to compute a similarity score (from 0 to 1) of the pattern displayed on the two matrices. The number of ‘on’ pixels is always the same between the two matrices eg:

M1
0 1 1 1
0 0 0 1
0 0 0 0
0 0 0 0

M2
0 0 0 0
0 0 0 0
1 1 1 0
0 0 1 0

M3
1 0 0 1
0 0 0 0
0 0 0 0
1 0 0 1

M4
0 0 0 0
1 1 1 0
0 0 0 1
0 0 0 0

In this case, I want M1:M2 to give a perfect score (1) because positioning of the pattern is irrelevant. M1:M3 should give a very poor score, and M1:M4 would get a good, but imperfect, score. For now, I’m only interested in patterns in the same orientation, so checking pattern orientation is not needed.

Any help or recommendations for relevant algorithms would be much appreciated!

The final implementation of this will be written in Matlab, but I’m writing up an initial test implementation in Python, so libraries in either are fine 🙂

  • 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-18T07:34:34+00:00Added an answer on June 18, 2026 at 7:34 am

    seems like an operation on conv2 will be related , but that was just suggested. Here’s a different approach, since M1 and M2 are identical they have the same principal components, so svd can be helpful as a measure of similarity, for example:

    abs(sum(svd(M1)-svd(M2)))
    ans =
       1.1102e-16
    
    abs(sum(svd(M1)-svd(M4)))
    ans =
       0.1189
    
    abs(sum(svd(M3)-svd(M4)))
    ans =
        0.7321
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two 50 x 6 matrices, say A and B . I want
say I want to multiply two matrices together, 50 by 50. I have 2
lets say I have two matrices, of a different size: a = zeros(1,100); b
Say I have two programs X and Y asking for input from stdin .
Say I have two (positive) arbitrary decimal numbers, a and b. I want to
Say you have two hashes H(A) and H(B) and you want to combine them.
I have two matrices in MATLAB lets say arr1 and arr2 of size 1000*1000
Say we have two sequences and we and we want to combine them using
I have two vectors of integers, say v1=c(1,2) and v2=c(3,4) , I want to
Say I have two tables I want to join. Categories: id name ---------- 1

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.