How to measure snow depth?

Hi,
I have a collection of images for which I’d like to measure snow depth. At each of our sites we have a snow stick painted bright red with a known height. How can I go about measuring what fraction of the stick is visible in each image (as snow pack increases and begins to obscure the stick more and more) vs not? What tools are available to help me automate this process?
Thanks for any help!

Attached are two images of the same snow stick with and without snow. They’re unfortunately low res as I’m still working on obtaining higher res images.

177114-20200303190331-101MFCAM_MFDC0251 177114-20200118210325-101MFCAM_MFDC0162

Hi
@Kevin_Callahan
A little help: (See the results windows).

//setTool("rectangle");
makeRectangle(0, 0, 640, 336);
run("Duplicate...", "title=1");
run("Lab Stack");
run("Stack to Images");
close("L*");
close("b*");
selectWindow("a*");
run("Set Measurements...", "area bounding display add redirect=None decimal=2");
setAutoThreshold("Yen dark");
//run("Threshold...");
setOption("BlackBackground", true);
run("Convert to Mask");
run("Analyze Particles...", "  circularity=0.00-0.07 display exclude add");

Obviously the macro will have to be improved.
Greetings

Hi @Kevin_Callahan

Below the developed macro

requires("1.52t")
setBackgroundColor(0,0,0);
setOption("BlackBackground",true);
dir=getDirectory("Choose a Source Directory");
setBatchMode(true);
print("The name of the folder is:"+dir);
list=getFileList(dir);
n=lengthOf(list);
print("The number of images is: ="+n);
for(i=0;i<n;i++)
{
if(endsWith(list[i],".jpeg"))
open(dir+list[i]);

//setTool("rectangle");
makeRectangle(0, 0, 640, 336);
run("Duplicate...", "title=1");
run("Lab Stack");
run("Stack to Images");
close("L*");
close("b*");
selectWindow("a*");
run("Set Measurements...", "area bounding display add redirect=None decimal=2");
setAutoThreshold("Yen dark");
//run("Threshold...");
setOption("BlackBackground", true);
run("Convert to Mask");
run("Analyze Particles...", "  circularity=0.00-0.07 display exclude add");
print(list[i]+"........"+"height="+getResult("Height",i));
close();
}
setBatchMode(false);
run("Close All")
exit("It's Over");

Please, test this macro command and report results.

1 Like

Awesome, I’ll keep you posted! Thanks a ton!

1 Like

This works perfectly. Thanks a ton!!