Skip to content

Delta E#1905

Merged
nfahlgren merged 19 commits into
v5.0from
deltaE
Jun 9, 2026
Merged

Delta E#1905
nfahlgren merged 19 commits into
v5.0from
deltaE

Conversation

@joshqsumner

@joshqsumner joshqsumner commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Describe your changes
Adds delta E calculation as part of color card detection and as a standalone function in plantcv.plantcv.transform. The main function is kept as a helper in transform which is called by a user-facing function with the intent of being used on calibrated images to show a calibrated difference from the expectation and is called by detect_color_card with the intent of showing the starting difference.

Type of update
This is a new feature.

Associated issues
Closes #1770

Additional context
Currently this only compares against expected values for color chips, we could have something where you give it one image, run the correction, then compare the delta E raw vs corrected. I did it this way because I don't think it's as useful to say "the color correction changed the image" to X degree when we don't know if the change is good or bad so to speak. I'd like to hear argument against that if anyone has it. I think we could add that functionality in the piece I already wrote with some logic to handle if card_type is an image.

this also does not make a bar plot like the one from imageZebra but it could if we wanted that. There is an example in my last comment in #1770 about what that might look like.

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

@joshqsumner joshqsumner changed the base branch from main to v5.0 April 28, 2026 15:54
@deepsource-io

deepsource-io Bot commented Apr 28, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in ce0b36e...8a6996b on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Coverage  

Code Review Summary

Analyzer Status Updated (UTC) Details
Python Jun 9, 2026 8:15p.m. Review ↗
Code coverage Jun 9, 2026 8:15p.m. Review ↗

Code Coverage Summary

Language Line Coverage (New Code) Line Coverage (Overall)
Aggregate
100%
[✓ above threshold]
99.9%
[▼ down 0.1% from main]
Python
100%
[✓ above threshold]
99.9%
[▼ down 0.1% from main]

➟ Additional coverage metrics may have been reported. See full coverage report ↗


Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@joshqsumner joshqsumner added new feature New feature ideas and solutions ready to review labels Apr 28, 2026
@joshqsumner joshqsumner added this to the PlantCV v5.0 milestone Apr 28, 2026
This was referenced May 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds Delta E color-difference reporting for detected color cards, exposing a new pcv.transform.deltaE function and integrating automatic Delta E metadata generation into color-card detection.

Changes:

  • Adds _delta_e calculation logic and exports user-facing deltaE.
  • Updates detect_color_card to optionally compute Delta E metadata.
  • Adds tests and documentation for the new Delta E workflow.

Reviewed changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
plantcv/plantcv/transform/delta_e.py Adds Delta E computation, metadata output, and debug plotting.
plantcv/plantcv/transform/detect_color_card.py Adds deltaE wrapper and automatic Delta E calculation option.
plantcv/plantcv/transform/__init__.py Exports deltaE from the transform namespace.
tests/plantcv/transform/test_deltaE.py Adds tests for Macbeth, Astro, and debug plotting behavior.
docs/transform_deltaE.md Adds documentation page for Delta E usage.
docs/transform_detect_color_card.md Updates color-card detection docs for Delta E metadata.
docs/updating.md Records new/updated transform signatures.
mkdocs.yml Adds Delta E documentation to navigation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plantcv/plantcv/transform/detect_color_card.py Outdated
Comment thread plantcv/plantcv/transform/delta_e.py Outdated
Comment thread plantcv/plantcv/transform/delta_e.py Outdated
Comment thread tests/plantcv/transform/test_deltaE.py Outdated
Comment thread tests/plantcv/transform/test_deltaE.py Outdated
Comment thread tests/plantcv/transform/test_deltaE.py
Comment thread docs/transform_detect_color_card.md Outdated
Comment thread docs/transform_deltaE.md Outdated
joshqsumner and others added 8 commits May 29, 2026 13:38
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@nfahlgren nfahlgren merged commit c17f75d into v5.0 Jun 9, 2026
5 checks passed
@nfahlgren nfahlgren deleted the deltaE branch June 9, 2026 20:23
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Color Card evaluation metrics and visuals

3 participants