Potsherds anlysis

Hello everyone
I am currently working on archaeology project, trying to find a method to count and measure large amount of potshreds.
Planning to lay them out on a piece of paper with a scale bar, take orthophotos and process them in ImageJ
Is it possible to automatically detect a scale bar and set scale for each image?
How can i measure length, width and area of each potsherd the best possible way? (marked it out on an image)

https://drive.google.com/drive/folders/1B1Evtp7ck6-2LVkIOpFd94LNhzLxeCeV?usp=sharing

Hi @artyomtarakanov ,

It is quite possible to detect a scale bar. Can you post a picture of the actual one you are going to use? Is it a physical ruler, or will it be printed on the paper? Do you get to choose on that case?

Regarding the measurements, it should be simple to automatically detect the pieces and list the areas and major and minor Feret diameters using particle analysis, but I’m not sure that they will fit your criteria of “best way possible”. Specifically, the criteria you used to mark the diameters in the piece numbered as 57 should be translated into some kind of rules or heuristics, as they seem to differ from the rest.

Cheers,
Nico

1 Like

Here is a macro (tested with loaded image 01-2.jpeg) which:

  1. Extracts the scale bar in a first particle analysis run (excluded by circularity which can be adjusted)
  2. Sets a line according to the width of the selected particle
  3. Sets the scale (Please adjust with your known distance and unit!)
  4. Removes the line selection and the ROI Manager ROI entry.
  5. Measures the fragments with the correct scale (number annotations are excluded by size)
run("8-bit");
setAutoThreshold("Default");
run("Set Measurements...", "area mean centroid bounding shape feret's display redirect=None decimal=3");
run("Analyze Particles...", "  circularity=0.17-0.19 display exclude clear include add");
roiManager("Select", 0);
Roi.getBounds(x,y,width,height);
makeLine(x,y,x+width,y);
run("Set Scale...", "known=5 unit=cm");
run("Select None");
roiManager("Delete");
run("Analyze Particles...", "size=10-Infinity display exclude clear include add");

In the future please avoid jpg, see:

For a customization of measurements, see:

https://imagej.nih.gov/ij/docs/guide/146-30.html#sub:Analyze-Particles

https://imagej.nih.gov/ij/docs/guide/146-30.html#toc-Subsection-30.7

To record your GUI commands use the macro recorder:

https://imagej.nih.gov/ij/docs/guide/146-31.html#toc-Subsection-31.1

4 Likes

Yes, it is possible to use any scale bar. Maybe the coloured ones will work, but I don’t know how to make imgej recognized it
Another idea is to print cells with specific size, on which i can put the fragments
I guess Feret diameters is what I need, ignore the piece 57

Thank you! Will try it and post about results later

Thank you! I tried to send tif images but they were too large. Will use them for the analysis

Hi
I have adjusted and tested the macro you sent for tif images and it works fine except 2 images (img247.tif and img250.tif)
Tif Images
Here is the macro

run("8-bit");
setThreshold(0, 210);
run("Set Measurements...", "area mean centroid bounding shape feret's display redirect=None decimal=3");
run("Analyze Particles...", "  circularity=0.17-0.19 display exclude clear include add");
roiManager("Select", 0);
Roi.getBounds(x,y,width,height);
makeLine(x,y,x+width,y);
run("Set Scale...", "known=3 unit=cm");
run("Select None");
roiManager("Delete");
run("Analyze Particles...", "size=3-Infinity display exclude clear include add");

The error i get

Error: Index (0) is outside of the 0–1 range in line 5:
roiManager ( “Select” , 0 <)> ;

Can’t understand why it doesn’t work. May i ask you to help me again?

Try to use this setting with your custom scale to measure all potshreds (which is 3 cm):

run("Analyze Particles...", "size=1.0-Infinity display exclude clear include add");

For me this worked with the described images.

The error indicates however indicates that the scale bar hasn’t been detected (your ROI Manager is empty) with the circularity of 0.17-0.19 which of course could be changed, too in line 4.

Please close all windows for a new measurement.

1 Like

Thank you, it works now