Help calculate area percentage groundmass vs. crystals in image

I am new to ImageJ.
I have SEM images of volcanic rock. I need to calculate what area of this image is crystals and what percentage is groundmass. The easiest to spot crystals are the dark elongated ones. However, sometimes there are crystals which appear almost white, and others which are the same gray as the background groundmass, which makes separating them out by thresholding by color hard. The main way we know they are crystals is that they are large and consistent in color, while the background is composed of many tiny specks.
What I want to do is somehow use noise to separate out what is crystal vs. the background (the background will be noisy compared to a crystal which is relatively the same color throughout).
Please help.
I have uploaded 2 .TIF images at different scales in this google drive to show you what I am working with (SEM Images - Google Drive).

Hi,

You could use a filtering method based on variance: Process>Filter>Variance…
Thereafter, run a Median blur: Process>Filter>Median
Threshold the dark areas : Image>Adjust>Threshold
Fill the holes : Process>Binary>Fill holes
Run Analyze particles with an appropriate size filter (I used 1000-infinity, pixel sized ticked): Analyze>Analyze Particles. Make sure you tick “Summarize” and “Add to manager”
The summary will tell you what percentage of the image is made of the crystals. Each Crystal will be a ROI in the manager so you can get individual statistics if you want.

This works well on your LJ_900_6 file, but not on the LJ_900_1 which is blurred on the periphery, making the variance filter useless .

Sincerely,

Matthieu

Hi
@dc1219

I used this macro for the second image.
Your turn to judge.
Thank you for reporting me.


rename("1");
setBackgroundColor(0,0,0);
run("Set Measurements...", "area mean display redirect=None decimal=2");
run("Duplicate...", "title=2");
run("Gaussian Blur...", "sigma=20");
run("Duplicate...", "title=3");
setAutoThreshold("Default");
//run("Threshold...");
//setThreshold(0, 139);
setOption("BlackBackground", true);
run("Convert to Mask");
run("Analyze Particles...", "summarize add");
roiManager("Show All without labels");
roiManager("reset");
run("Create Selection");
selectWindow("1");
run("Restore Selection");
waitForUser("It's OK for the  the dark elongated crystals?");
run("Select None");
selectWindow("3");
run("Create Selection");
selectWindow("2");
run("Restore Selection");
setBackgroundColor(0, 0, 0);
run("Clear", "slice");
run("Select None");
//run("Threshold...");
//setThreshold(167, 255);
run("Convert to Mask");
run("Analyze Particles...", "summarize add");
roiManager("Show All without labels");
roiManager("reset");

run("Create Selection");
selectWindow("1");
run("Restore Selection");
waitForUser("It's OK for the others crystals?");
run("Select None");
close("ROI Manager");
run("Tile");
selectWindow("Summary");