Skip to content

Commit

Permalink
Fix 1072 sunflare dump better (#1333)
Browse files Browse the repository at this point in the history
* simple fix

* generate additional centers on a line

* formatting

Co-authored-by: Mikhail Druzhinin <dipetm@gmail.com>
  • Loading branch information
jasonrock-a3 and Dipet committed Nov 24, 2022
1 parent 57988c2 commit b7877b7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions albumentations/augmentations/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,10 +685,13 @@ def get_params_dependent_on_targets(self, params):
x = []
y = []

for rand_x in range(0, width, 10):
rand_y = math.tan(angle) * (rand_x - flare_center_x) + flare_center_y
def line(t):
return (flare_center_x + t * math.cos(angle), flare_center_y + t * math.sin(angle))

for t_val in range(-flare_center_x, width - flare_center_x, 10):
rand_x, rand_y = line(t_val)
x.append(rand_x)
y.append(2 * flare_center_y - rand_y)
y.append(rand_y)

for _i in range(num_circles):
alpha = random.uniform(0.05, 0.2)
Expand Down

0 comments on commit b7877b7

Please sign in to comment.