Skip to content

Conversation

@joshqsumner
Copy link
Contributor

@joshqsumner joshqsumner commented Aug 19, 2025

This is a new feature for visualizing the distance from observed to expected colors of a color card and an RGB image and optionally a color corrected image. The idea is to make it easier to assess when a camera/image is "wrong" in a bizarre way and to have a more objective gauge of how well color correction did.

This is a new feature.

This might address 1582 but I would want @kmurphy61 to weigh in on that. If the "smaller" form in 1582 would be preferred there could be an argument to this function or another function to do that.

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 added the new feature New feature ideas and solutions label Aug 19, 2025
@deepsource-io
Copy link

deepsource-io bot commented Aug 19, 2025

Here's the code health analysis summary for commits 2fecc73..ac94226. 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.

@kmurphy61
Copy link
Contributor

Yes, this would address #1582 ! @NMiklave has also been working on something similar, so you both could compare what you are doing and see what is a good fit. Nick's tools are related to assessing color cards for if they are too worn to use, and this seems like a similar suite of quality control tools.

@NMiklave
Copy link
Collaborator

Yeah, this is in line with some of what I've been working on and I'd be happy to compare notes on this! Checking whether or not a color card is too worn to use requires some metric to quantify how "good" the color correction is, and I've been going about it by comparing the measured color matrix of an already-corrected image to the standard reference matrix, which can be built off of the changes made by this PR. Although, I think that the output plot of this function should flip the roles of the corrected image matrix and uncorrected image matrix. The uncorrected matrix can change quite a bit depending on lighting color temperature, but that shouldn't really matter as long as the calibrated values are consistent with what it is expected.

@joshqsumner
Copy link
Contributor Author

Thanks @NMiklave ! I'll be looking forward to seeing what you have for that, your plots a few weeks ago were very useful.

Although, I think that the output plot of this function should flip the roles of the corrected image matrix and uncorrected image matrix. The uncorrected matrix can change quite a bit depending on lighting color temperature, but that shouldn't really matter as long as the calibrated values are consistent with what it is expected.

I think there are two somewhat distinct use cases here. The one I was initially considering was thinking about whether there was something particularly strange in how the camera is wrong (non-linearity of error, different trends in different channels, etc) where knowing that information might help with fine tuning an imaging setup or making decisions about how the color correction should work. So the changes you mention in the uncorrected matrix are part of what I had in mind for the function to detect.
I think you're pointing out another very important setting having to do with evaluating the final quality of a color corrected image to get a handle on generalizability/accuracy.

Maybe instead of explicitly taking an uncorrected and a corrected input this could work as color_correction_plot(std_matrix, **kwargs) and you could pass arbitrary numbers and types of color matrices to kwargs then have their position/name show up in the legend? Maybe that idea is needlessly flexible and more than 2 image matrices stops being useful.

@joshqsumner joshqsumner changed the base branch from main to v5.0 October 3, 2025 15:10
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.

4 participants