A few specific recommendations, building upon what you've got already:
- Take your best image (something like image 1), run it through edge detection, open the result in any graphic editor (MS Paint will do) and clean everything except the mountain top boundary (the "chinese hat" line). This is you convolution kernel. You can crop it (not resize!) from above and below to save some time in the next step.
- Use the
Convolve function from PerlMagick (you seem already comfortable with Perl and ImageMagick) to convolve the kernel with a few images. On the resulting image you should see a sharp spike corresponding to the "correct" position of the kernel (coinciding with the mountain in the image).
- The relative (to the level of surrounding noise) height of this spike will be larger when the mountain is better visible. By taking several representative images you might be able to determine a threshold that will separate good images from the bad ones.
- Whatever you do, there will be false positives and false negatives. Be prepared.