pp icon indicating copy to clipboard operation
pp copied to clipboard

code error

Open caiyingchun opened this issue 6 years ago • 2 comments

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?

caiyingchun avatar Apr 20 '18 02:04 caiyingchun

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.

Co5moDr0ne17 avatar Apr 20 '18 20:04 Co5moDr0ne17

Thank you very much! It works!

caiyingchun avatar Apr 23 '18 00:04 caiyingchun