This Mathematica notebook unshreds shredded images using an edge-matching method and sorting algorithm.
It can be used to solve puzzles in which an image has been shredded, as if through a paper shredder, into vertical slices, and each slice has been arbitrarily flipped and/or rotated.
A slightly modified version of this problem was the final project for ECE 533, Image Processing, at UW-Madison, in the Fall 2023 semester.
I have generalized it to work for any image and any arbitrary number of shreds.