Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates to aggregateColor() #98

Closed
dylanbeaudette opened this issue Sep 25, 2019 · 2 comments
Closed

updates to aggregateColor() #98

dylanbeaudette opened this issue Sep 25, 2019 · 2 comments

Comments

@dylanbeaudette
Copy link
Member

dylanbeaudette commented Sep 25, 2019

Performance and accuracy updates:

  1. when snapping to k colors, clustering should be applied to unique colors
  2. clustering should be performed on delta-E00 distances
  3. use new pamonce=5 argument to cluster::pam for better performance
  4. add option for weighting by site-level attributes
  5. input column names should be checked for better error reporting
  6. output should include sigma from rgb2munsell back-transform, or re-generate a representative color based on the closes Munsell chip
  7. standardization in pam(LAB, ..., stand=TRUE) is not correct

An example for item 6:

library(aqp)

# two slightly different colors, same chip
cols <- t(col2rgb(c('#5F5345', '#554636'))) / 255
rgb2munsell(cols)
hue value chroma sigma
10YR 3 2 0.0420
10YR 3 2 0.0016
@dylanbeaudette
Copy link
Member Author

dylanbeaudette commented Sep 25, 2019

Initial testing of no. 1,2,3,7 above.
image

image

image

The results are reasonable and 40x speed improvement. Using stand=TRUE was clearly a mistake.

dylanbeaudette added a commit that referenced this issue Sep 25, 2019
@dylanbeaudette
Copy link
Member Author

Added testing code to aqp/misc/test_suite/aggregateColor-dev.R.

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

No branches or pull requests

1 participant