Without a person doing a visual presorting or prebinning of similar files together to start with, what you are asking for is an incredibly computationally intensive process.
If you are not adverse to some programming (even scripting programming, such as Python), take a look at ImageMagick command-line tools, especially the ImageMagick
compare command. It has a
-subimage-search option to determine if one image is contained within another. Note that for
subimage-search, the subimage must be the same size in the large image; they cannot differ by scaling.
subimage-search will help with determining if one photo is a crop from another photo, as long as the crop was not also resized.
Now, if the photos are of the same scene, but just resized, in order to compare them with ImageMagick, you'd have to use the
convert command to make them the same size, then use the
compare command to determine their relative difference (there are many different metric type options for the
Why is this computationally intensive?
Assume you have n photos you want to check for comparison. So the first photo is compared with n-1 remaining photos, the second photo is compared with n-2 remaining photos (besides itself and the first photo, which has already been compared), on up to the n-1th photo being compared to the nth photo. This is a partial sum of the first n natural numbers, which comes out to (n² - n)/2 comparisons.
There are image processing algorithms that can do both scaling and subimage finding in the same process. These algorithms typically rely on frequency-domain or wavelet-domain compression techniques to identify similar regions in images. But these algorithms are also computationally intensive, roughly proportional in complexity (time) to the square of the size of the files being compared (i.e., αk² seconds/KiB, where k is in kilobytes, and α is some proportionality constant for your algorithm and computer system).
But since there are Ω(n²) (a computer science notation called "Big-O notation", meaning "on the order of", or "roughly") comparisons each being quadratic in time, you have an algorithm that is, in computer terms, of "Ω(n²)×Ω(s²)" complexity. That means, this can take a long while, and is very sensitive to increases in the number of files to compare and the average file size.