Skip to content

Add support for automatic size scaling using color cards #1726

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

Merged
merged 30 commits into from
Jul 29, 2025

Conversation

HaleySchuhl
Copy link
Contributor

@HaleySchuhl HaleySchuhl commented Jun 26, 2025

Describe your changes
Add support for automatic size scaling using supported color cards, by setting the pcv.params.unit, pcv.params.px_width, and pcv.params.px_height automatically when a color_chip_size is provided to pcv.transform.detect_color_card or pcv.transform.auto_correct_color. Current support includes "classic", "CameraTrax", or "passport" (the parameter is case insensitive and defaults to None). Users can also set this parameter to a tuple e,g, color_chip_size=(40,40) where dimensions should be provided in millimeters.

Type of update
Is this a:

  • New feature or feature enhancement

Associated issues

Additional context
Does not currently support "nano" type color cards, since the rectangular chip dimensions have the added complexity of being orientation specific. This can get added in a future update, though, since we are detecting orientation through locating the white color card chip.

For the reviewer
See this page for instructions on how to review the pull request.

  • PR functionality reviewed in a Jupyter Notebook
  • All tests pass
  • Test coverage remains 100%
  • Documentation tested
  • New documentation pages added to plantcv/mkdocs.yml
  • Changes to function input/output signatures added to updating.md
  • Code reviewed
  • PR approved

add to docs for auto_correct_color and detect_color_card
add helper that can set size scaling factors based on known color card chip dimensions of supported card types, and utilize in detect_color_card and therefore auto_correct_color
@HaleySchuhl HaleySchuhl added the enhancement Enhancements to existing features label Jun 26, 2025
@github-project-automation github-project-automation bot moved this to Pull Requests in PlantCV4 Jun 26, 2025
@HaleySchuhl HaleySchuhl added the new feature New feature ideas and solutions label Jun 26, 2025
Copy link

deepsource-io bot commented Jun 26, 2025

Here's the code health analysis summary for commits 15300b5..1cf6a44. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython✅ SuccessView Check ↗
DeepSource Test coverage LogoTest coverage✅ SuccessView Check ↗

Code Coverage Report

MetricAggregatePython
Branch Coverage100%100%
Composite Coverage100%100%
Line Coverage100%100%
New Branch Coverage100%100%
New Composite Coverage100%100%
New Line Coverage100%, ✅ Above Threshold100%, ✅ Above Threshold

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@HaleySchuhl HaleySchuhl added work in progress Mark work in progress and removed ready to review labels Jun 27, 2025
@HaleySchuhl HaleySchuhl requested a review from k034b363 July 8, 2025 18:23
@HaleySchuhl HaleySchuhl added ready to review update Updates an existing feature/method and removed work in progress Mark work in progress labels Jul 8, 2025
@joshqsumner joshqsumner self-requested a review July 16, 2025 18:32
@HaleySchuhl HaleySchuhl removed the request for review from k034b363 July 23, 2025 14:15
@HaleySchuhl HaleySchuhl added this to the PlantCV v4.9 milestone Jul 25, 2025
@nfahlgren
Copy link
Member

@HaleySchuhl one question, why are there two pictures of the Passport in the detect_color_card documentation?

@nfahlgren nfahlgren merged commit 6068df3 into main Jul 29, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Pull Requests to Done in PlantCV4 Jul 29, 2025
@nfahlgren nfahlgren deleted the add_color_card_size_scaling branch July 29, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancements to existing features new feature New feature ideas and solutions ready to review update Updates an existing feature/method
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants