Skip to content

Starch scales 55 percent#54

Merged
AdenAthar merged 8 commits intodevfrom
starch-scales-55-percent
Feb 25, 2026
Merged

Starch scales 55 percent#54
AdenAthar merged 8 commits intodevfrom
starch-scales-55-percent

Conversation

@AdenAthar
Copy link
Collaborator

  • Percentage-based threshold algorithm (55% of pixel range)
  • Default threshold changed from 172 → 140
  • All 17 MSU varieties calibrated in starch_scales.yml
  • Result: 15/15 monotonic (was 6/15)

Convert threshold from absolute value to percentage of actual pixel range.
User inputs 0-255 (e.g., 172 = 67.45%), applied as: low + (high - low) * percentage.
Provides consistent detection across varying lighting conditions.
All 4 varieties have monotonically decreasing ratings and were calibrated
from MSU reference images using threshold 172.
Testing on 15 MSU starch reference varieties showed that 55% threshold
achieves perfect monotonicity (15/15 varieties) compared to 67.45%
which had 8/15 monotonic with 9 violations.

The percentage-based threshold adapts to each image's actual pixel
range, providing more consistent results across varying lighting
conditions.
- Updated 12 MSU varieties with new 55% threshold data achieving
  15/15 monotonicity with 0 violations
- Added 5 new varieties: HONEYCRISP, BRAEBURN, EVERCRISP, GALA, ROME
- All MSU varieties now use consistent integer index scales (1-8)
- Kept non-MSU varieties unchanged (HONEY_CRISP, WA38, ALLAN_BROS,
  CORNELL, PURDUE, DANJOU, MINNEISKA, ROYAL_GALA)
…EY_CRISP

StarchArea.py:
- extractImage() -> getPixelRange()
- adjustImage() -> remapToRange()
- gray -> grayscale
- Removed unused grayscale_normalized variable

starch_scales.yml:
- Removed duplicate HONEY_CRISP entry (HONEYCRISP with 55% calibration is kept)
…tarch

- Remove getPixelRange nested function and inline its histogram logic
- Remove remapToRange function (dead code - was only used for visualization)
- Remove unused grayscale_normalized variable
- Clean up comments
…hold

- CORNELL: Updated ratings from new calibration
- PURDUE: Updated ratings from new calibration
- DANJOU: Updated ratings, interpolated 1.5 and 3.5 for monotonicity, added 6.0
- WA38: Added new entry with averaged A/B sample ratings
@AdenAthar AdenAthar merged commit 0d20e9e into dev Feb 25, 2026
7 checks passed
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.

1 participant