Closed Youjose closed 1 year ago
Can you please post the image directly here (if the link goes away, etc?) I suspect you are choosing a piece size that isn't working with the dimension, and I agree we need better docs for that! I'm going out for a bit but I can take a look and test with the image later. Thanks for posting the issue!
Thanks for replying! And after some thought I think this is rather my problem, as the image seems (probably) impossible to be reshuffled due to excess of white edges and so on, noticed this after I read your pull requests comment.
This is a quick 30 minutes of programming to add support for creating (and solving) a puzzle from already generated square pieces! Since the algorithm is based on edge matching, this will not work for images with constant/uniform color at most edges, or those that don't fit nicely into squares/rectangles of equal size.
which basically describes our image in question.
Thank you! And indeed we should handle the white edges (and not divide by 0 but a very small number). Thanks for sharing the images we will have a look tonight! Ping @tabakg
okay please see https://github.com/vsoch/puzzles/pull/101! We will need more work to handle dimensions, but this is a start. Thanks for opening the issue - we had only developed this for simple images (without a lot of white) and will try to improve it. If you want to contribute please also feel free to go ahead!
Hi @LittleChungi ! We've adopted the edge matching algorithm so there is improved performance for your image! Please see https://github.com/vsoch/puzzles/pull/11. Note that we still recommend that you use images without significant white borders. Please see the branch and let us know if you see an improvement. Minimally, the bug should be fixed. Thanks!
Thank you as well as @vsoch ! I've seen the new updates and both look promising! I apologize for the extremely late reply, but I will check those and go over the code as well, and reply back to you as soon as possible!
Works very well! I improved the script for my use case since I know the exact x and y lines per block, calculate the border cost and sort that way, it gets results fairly well, although sometimes it gets image rotation wrong, which is expected, could be fixed with manual tweaking.
There's a lot of hardcoding in my script, was wishing to contribute on this project, but its not feasible, since it's specifically tuned for my use case at this point. Thanks for the help tabakg and vsoch!
Hello there! Amazing library here on what this can, however I am getting runtime errors on certain images, perhaps due to blank white images as pieces existing in the segments.
I have 120 image pieces of a size, I used the pull request branch to load these in as given by the guide.
It's also good to note that I don't know what min_piece_size actually us, as the documentation didn't make it clear (I just assumed it's the minimum rect dimension) Here are is the link to the pieces in question:
Moreover, I think matplotlib loading pure white images and other similar images break them inn output, as seen here by pure purple segments, and also notice the broken segments with yellow outline. I am not sure if this affects how the lib works internally, looking over the code.
however this errors is produced:
and also the output image is not what I expect, as we know for sure that the output image should be 10x12 pieces. But this is perhaps the result of the errors above.