Aftermath of the solar eclipse

Hi Tanvi and Vitaliy,

I know that this does not work quite well yet, but if I take the photo that Tanvi posted

img = Import["~/Desktop/Eclipse.jpg"]

and crop it a bit:

img2 = ImageTrim[img, {{447.386`, 409.278`}, {513.381`, 344.818`}}]

I get:

The question that also relates to Sander’s question in Vitaliy’s post is: how much of the sun was covered. The idea is to cover the crescent by a disk:

MorphologicalComponents[Binarize[img2, 0.4], Method -> "BoundingDisk"] // Colorize

then determine the shape of the crescent itself:

MorphologicalComponents[Binarize[img2, 0.4]] // Colorize

and then calculate the respective areas:

full = ComponentMeasurements[MorphologicalComponents[Binarize[img2, 0.4], Method -> "BoundingDisk"], "Area"][[1, 2]]
(*1206.5*)
crescent = ComponentMeasurements[MorphologicalComponents[Binarize[img2, 0.4]] // Colorize, "Area"][[1, 2]]
(*311.75*)

The ratio of which is:

crescent/full

This gives a covering of about 74\%. This number is only a rough estimate. The fitted disk is not quite right as you can see in this plot:

ImageMultiply[img2, ColorNegate@(MorphologicalPerimeter[MorphologicalComponents[Binarize[img2, 0.4], Method -> "BoundingDisk"], 0.2] // Colorize)]

The black circle is the estimate of the shape of the full sun, which is obviously not quite what we want.

Cheers,

M.

PS: Tanvi, thanks a lot for posting the photos!

5 Likes