Just tried it on my old app and it worked well :)
I think you'll have to roll your own rectangle detection and use heuristics to make it better.
So in mine I assume that the connected object in the thresholded image with the largest number of pixels must be the puzzle. That makes it a lot easier.
Good luck!