In a digital photo, how can I detect if a mountain is obscured by clouds?

前端 未结 3 886
说谎
说谎 2021-01-31 09:39

The problem

I have a collection of digital photos of a mountain in Japan. However the mountain is often obscured by clouds or fog.

What techniqu

3条回答
  •  我在风中等你
    2021-01-31 10:23

    A few specific recommendations, building upon what you've got already:

    1. 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.
    2. 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).
    3. 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.
    4. Whatever you do, there will be false positives and false negatives. Be prepared.

提交回复
热议问题