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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:55:17+00:00 2026-05-25T01:55:17+00:00

I’ve been reading the formulas on how to compute the affinity matrix of an

  • 0

I’ve been reading the formulas on how to compute the affinity matrix of an image and I’m a bit confused. Ideally, I would like to use color intensity as a distance metric.

I found this reference: http://spectrallyclustered.wordpress.com/2010/06/05/sprint-1-k-means-spectral-clustering/

Which seems to do a great job of explaining the general process. My question is with respect to the affinity matrix.

When constructing the affinity matrix (I’ll call it A), they mention the affinity matrix should be KxK sized for a Kxn image. Other reference implementations say the affinity matrix for an MxN image should be (M*N) x (M*N):

http://www.mathworks.com/matlabcentral/fileexchange/26354-spectral-clustering-algorithms

Which one is the traditional approach?

When computing the affinity matrix, I wanted to know if each entry A(i,j) be a neighborhood computation (like the affinity of a 3×3 neighborhood or the pixels in the entire image)?

Or do I linearize the image into a 1 dimensional array.

Constructs an (m*n) x (m*n) matrix (the affinity matrix) and while iterating across the 1 dimensional image array, apply an affinity function to pixel i and every other pixel j. and stores the result into the affinity matrix.

(basically a double nested for loop)

am i off base? or is that about how it looks?

Thanks in advance,

ct

  • 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-05-25T01:55:18+00:00Added an answer on May 25, 2026 at 1:55 am

    I think you are trying to use two distance metrics with a method that only supports one metric. An image has an implicit spatial metric between pixels, but the spectral clustering method does not handle this. It views an image as a bag of pixels.

    Regarding M, N and K; M * N = K. Both expressions describe the number of objects that will be clustered, which in your case is the number of pixels.

    The affinity matrix, A is a decimated version of the similarity matrix, S. E.g. if two objects/pixels are not similar enough, they are not adjacent.

    One way tho construct the adjacency matrix is the following:

    S(i, j) = color_intensity_distance( pixel(i), pixel(j) )
    
    A(i, j) = exp( - S(i,j) ), if S(i,j) <= epsilon
    A(i, j) = 0, otherwise
    

    To improve your performance, you should search for a sparse matrix library. They are very efficient at handling matrices with many zeroes.

    A link about spectral clustering.

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

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
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
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the

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.