Skip to content

Commit

Permalink
fix cascading errors hw4
Browse files Browse the repository at this point in the history
  • Loading branch information
maximevo committed Oct 22, 2019
1 parent 939831a commit f8f0b68
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hw4_release/seam_carving.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def find_seams(image, k, axis=1, efunc=energy_function, cfunc=compute_cost, bfun
return seams


def enlarge(image, size, axis=1, efunc=energy_function, cfunc=compute_cost, dfunc=duplicate_seam):
def enlarge(image, size, axis=1, efunc=energy_function, cfunc=compute_cost, dfunc=duplicate_seam, bfunc=backtrack_seam, rfunc=remove_seam):
"""Enlarges the size of the image by duplicating the low energy seams.
We start by getting the k seams to duplicate through function find_seams.
Expand All @@ -358,6 +358,8 @@ def enlarge(image, size, axis=1, efunc=energy_function, cfunc=compute_cost, dfun
- efunc (instead of energy_function)
- cfunc (instead of compute_cost)
- dfunc (instead of duplicate_seam)
- bfunc (instead of backtrack_seam)
- rfunc (instead of remove_seam)
- find_seams
Args:
Expand All @@ -367,6 +369,8 @@ def enlarge(image, size, axis=1, efunc=energy_function, cfunc=compute_cost, dfun
efunc: energy function to use
cfunc: cost function to use
dfunc: duplicate seam function to use
bfunc: backtrack seam function to use
rfunc: remove seam function to use
Returns:
out: numpy array of shape (size, W, C) if axis=0, or (H, size, C) if axis=1
Expand Down

0 comments on commit f8f0b68

Please sign in to comment.