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

code error #16

Open
caiyingchun opened this issue Apr 20, 2018 · 2 comments
Open

code error #16

caiyingchun opened this issue Apr 20, 2018 · 2 comments

Comments

@caiyingchun
Copy link

caiyingchun commented Apr 20, 2018

In project photomosaic.py, in line 180:

if not reuse_images: 
    input_images.remove(match)

I wonder variable ‘match' is miswritten. it is never defined in codes. But I don't know what it should be replaced?

@Co5moDr0ne17
Copy link

I just finished working through the photomosaic tutorial the other day. This is how I altered the code to account for the 'match' and it seems to work fine.

if not reuse_images:
input_images.remove(input_images[match_index])
avgs.remove(avgs[match_index])

*Once you remove the image that is stored at match_index you have to also remove its average rbg value too otherwise you'll get an error.

@caiyingchun
Copy link
Author

Thank you very much! It works!

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

2 participants