-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add thin plate spline #2156
Add thin plate spline #2156
Conversation
Reviewer's Guide by SourceryThis PR introduces a new Thin Plate Spline (TPS) transformation for creating smooth, non-rigid deformations in images. The implementation includes the core TPS algorithm with control points and interpolation, built on top of the existing BaseDistortion class. The transform allows for configurable deformation strength and control point density while maintaining image continuity. Class diagram for ThinPlateSpline transformationclassDiagram
class BaseDistortion {
<<abstract>>
+interpolation: int
+border_mode: int
+value: ColorType | None
+mask_value: ColorType | None
+p: float
+get_params_dependent_on_data(params: dict[str, Any], data: dict[str, Any]) dict[str, Any]
+get_transform_init_args_names() tuple[str, ...]
}
class ThinPlateSpline {
+scale_range: tuple[float, float]
+num_control_points: int
+interpolation: int
+mask_interpolation: int
+border_mode: int
+value: ColorType | None
+mask_value: ColorType | None
+p: float
+get_params_dependent_on_data(params: dict[str, Any], data: dict[str, Any]) dict[str, Any]
+get_transform_init_args_names() tuple[str, ...]
}
BaseDistortion <|-- ThinPlateSpline
class InitSchema {
+scale_range: tuple[float, float]
+num_control_points: int
}
ThinPlateSpline --> InitSchema
note for ThinPlateSpline "Applies TPS transformation for smooth, non-rigid deformations."
Class diagram for TPS functional methodsclassDiagram
class Functional {
+compute_tps_weights(src_points: np.ndarray, dst_points: np.ndarray) tuple[np.ndarray, np.ndarray]
+tps_transform(target_points: np.ndarray, control_points: np.ndarray, nonlinear_weights: np.ndarray, affine_weights: np.ndarray) np.ndarray
}
note for Functional "Contains core TPS algorithm methods."
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ternaus - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2156 +/- ##
=========================================
+ Coverage 0 90.12% +90.12%
=========================================
Files 0 48 +48
Lines 0 8530 +8530
=========================================
+ Hits 0 7688 +7688
- Misses 0 842 +842 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Summary by Sourcery
Add the Thin Plate Spline transformation to the library, enabling smooth, non-rigid deformations of images and other targets. Update documentation and tests to include this new feature.
New Features:
Enhancements:
Documentation:
Tests: