Skip to content

Conversation

NMiklave
Copy link
Collaborator

@NMiklave NMiklave commented Jul 8, 2025

Describe your changes
The rotate function finds the center of rotation as half the length and width of an image. This is offset from the actual center by half a pixel, and in some specific use-cases can significantly reduce the average color value of a rotated region. This PR updates rotate to account for the half-pixel offset to re-center rotation transformations.

Type of update
This is a:

  • Bug fix

Associated issues
None

Additional context
An example figure illustrating the effect of off-center rotation and 0 values being inserted, as well as the behavior with this bugfix, is shown here:
image

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

@NMiklave NMiklave added the bugfix Bug fixes label Jul 8, 2025
Copy link

deepsource-io bot commented Jul 8, 2025

Here's the code health analysis summary for commits 22bc25e..bfec0f7. 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.

@github-project-automation github-project-automation bot moved this to Pull Requests in PlantCV4 Jul 9, 2025
@nfahlgren nfahlgren added this to the PlantCV v4.9 milestone Jul 9, 2025
@nfahlgren nfahlgren merged commit 1d4c3d5 into main Jul 9, 2025
5 checks passed
@nfahlgren nfahlgren deleted the recenter-rotation branch July 9, 2025 20:21
@github-project-automation github-project-automation bot moved this from Pull Requests to Done in PlantCV4 Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants