Skip to content
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

Seam insertion with delta_col >= self.in_height #5

Open
thierrypin opened this issue Oct 4, 2018 · 0 comments
Open

Seam insertion with delta_col >= self.in_height #5

thierrypin opened this issue Oct 4, 2018 · 0 comments

Comments

@thierrypin
Copy link

I've found an issue that happens when I want to double an image's size. I had no problem finding the bug:

In SeamCarver.seams_insertion, there is a loop which chooses the seams to insert by removing them from a copy of the image, storing in a list, and adding them in to the output. But self.delete_seam(seam_idx) crashes when it comes to the last column. It happens when num_pixel >= self.in_height.

for dummy in range(num_pixel): energy_map = self.calc_energy_map() energy_map[np.where(self.mask[:, :] > 0)] *= self.constant cumulative_map = self.cumulative_map_backward(energy_map) seam_idx = self.find_seam(cumulative_map) seams_record.append(seam_idx) self.delete_seam(seam_idx) self.delete_seam_on_mask(seam_idx)

I thought maybe when the image is small enough (how small, I don't know) it could just feed the list with its first seams in a cycle. Or it could proceed to add seams and go back to add the remaining columns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant