-
-
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
Feature/flexible sunflare brightness #2183
Feature/flexible sunflare brightness #2183
Conversation
Reviewer's Guide by SourceryThis PR implements a flexible sunflare brightness effect by calculating a weighted brightness based on flare circles' properties. The implementation modifies the alpha calculation for sun flare spots to create a more natural-looking effect where the brightness of spots correlates with the size and intensity of flare circles. Class diagram for Sun Flare Brightness CalculationclassDiagram
class SunFlareOverlay {
+add_sun_flare_overlay(img, circles, flare_center, src_radius)
+calculate_weighted_brightness(circles)
+calculate_max_alpha(weighted_brightness, total_radius_length)
}
SunFlareOverlay : float weighted_brightness
SunFlareOverlay : float total_radius_length
SunFlareOverlay : float max_alpha
note for SunFlareOverlay "This class handles the calculation of sun flare brightness using weighted brightness and max alpha."
File-Level Changes
Assessment against linked issues
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 @momincks - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 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.
@momincks Thanks for the PR. In order to merge the PR you need to use pre-commit hook on your code. https://github.com/albumentations-team/albumentations/blob/main/docs/contributing/coding_guidelines.md#pre-commit-hooks |
fix #2067
My approach is to find the weighted brightness from the flare circles and use it to define the max alpha (max brightness) of the spots. The brighter and larger the flare circles, the brighter the spots will be. Max alpha could still be high (>0.8), meaning blocking the object behind it, but for alpha currently in range (0.05, 0.2), max alpha will mostly be around 0.5-0.7.
That should give a more natural look at the whole effect.
RandomSunFlare(
flare_roi=[0,0,1,0.5],
src_radius=400,
src_color=[255,255,255],
angle_range=[0,1],
num_flare_circles_range=[6,10],
method="overlay",
p=1))
Summary by Sourcery
New Features: