Skip to content

Conversation

HaleySchuhl
Copy link
Contributor

@HaleySchuhl HaleySchuhl commented May 19, 2025

Describe your changes
Adds pcv.filters.color_card which takes an RGB image as input, uses the same algorithm as pcv.transform.detect_color_card by moving it into a helper function that gets called by both filters.color_card and transform.detect_color_card. The function returns a binary mask created by taking a bounding box of the detected color card chips. This aims to assist with object mask cleanup when regional filters are not sufficient for filtering out color card chips.

Type of update
Is this a:

  • New feature or feature enhancement

Associated issues

Additional context
This function might get used in the tripsacum seed head tutorial. It was used in the analysis of 2024 seedhead images taken at Shaw.

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

Copy link

deepsource-io bot commented May 19, 2025

Here's the code health analysis summary for commits 89ea5ea..5dde1f0. 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 self-assigned this May 19, 2025
@HaleySchuhl HaleySchuhl added new feature New feature ideas and solutions ready to review update Updates an existing feature/method labels May 19, 2025
@github-project-automation github-project-automation bot moved this to Pull Requests in PlantCV4 May 19, 2025
@HaleySchuhl HaleySchuhl added this to the PlantCV v4.x milestone May 19, 2025
@HaleySchuhl HaleySchuhl added work in progress Mark work in progress and removed ready to review labels May 23, 2025
@HaleySchuhl HaleySchuhl changed the title Add pcv.filters.color_card function Add pcv.transform.mask_color_card function May 23, 2025
@HaleySchuhl HaleySchuhl added ready to review and removed work in progress Mark work in progress labels May 27, 2025
@k034b363 k034b363 self-requested a review May 30, 2025 16:54
Copy link
Contributor

@k034b363 k034b363 left a comment

Choose a reason for hiding this comment

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

Tried on a couple of different color card layouts from bellwether and pi chambers, and it works the way I expect on all of them. Looks good to me!

@nfahlgren nfahlgren modified the milestones: PlantCV v4.x, PlantCV v4.8 Jun 2, 2025
@nfahlgren nfahlgren merged commit ff26d6d into main Jun 2, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Pull Requests to Done in PlantCV4 Jun 2, 2025
@nfahlgren nfahlgren deleted the visualize_detect_color_card branch June 2, 2025 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Add function pcv.filters.color_card for mask cleanup
3 participants