Skip to content

Conversation

@Avid29
Copy link
Contributor

@Avid29 Avid29 commented Oct 10, 2025

The DBScan step runs after KMeans to merge clusters that are too similar.

KMeans cannot be refined on its own to not have this issue, since it simply clusters to K points. Determining the right number for K is no better than just merging the results with another clustering method.

@Arlodotexe Arlodotexe requested a review from Copilot October 13, 2025 17:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Enhances the ColorPaletteSampler by integrating DBScan clustering to merge similar KMeans results, addressing the limitation where KMeans clusters to K points regardless of color similarity.

  • Added DBScan clustering post-processing to merge KMeans clusters that are too similar
  • Introduced a configurable merge distance parameter for similarity threshold
  • Modified weight calculation to properly handle cluster merging

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
ColorPaletteSampler.cs Added DBScan post-processing step with merge distance parameter and updated weight handling
ColorPaletteSampler.KMeans.cs Changed method visibility from private to internal to support DBScan integration
ColorPaletteSampler.DBScan.cs Implemented complete DBScan clustering algorithm as a ref struct with weighted centroid calculation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Arlodotexe Arlodotexe merged commit b094c4c into CommunityToolkit:main Dec 12, 2025
24 checks passed
@Avid29 Avid29 deleted the ColorAnalysis/Clustering_Refinement branch December 12, 2025 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants