# Measuring average crack length and aperture in 2D 8-bit image

Hi there,
I am currently writing a thesis on crack characterization in drying shale and have many images of samples being dried at different temperatures. I am supposed to use imagej to help me calculate the permeability yet I need few more parameters i.e. average crack length and aperture before I can do so.
I do not know how I would go about achieving this and any help would be greatly appreciated.
(I have attached one of the images.The image has been cropped, converted to 8-bit grayscale, enhanced the contrast then a threshold applied.)

Hi
@Think90

Use the â€śRidge detectionâ€ť plug-in.

Greetings

@Mathew
Thank you for the quick reply.
I will apologize for my ignorance with regards to all of this, Iâ€™ve never used this program before.

Hi @Think90,

I guess the aperture is the number that emerges from a Euclidian Distance Transform?

The solid has value 0, the further from the solid toward the center of a crack, the higher the number.

The idea being that the further from the edge of a crack, the less resistance (or adherence?) fluid has when trying to pass a crack. Maybe you need to calibrate against a model where you can set the aperture and measure the flow. That delivers data points which eventually allows you to do a â€śdensityâ€ť or â€śabsorbanceâ€ť `Analyse>Calibrate` type of calibration with a series of known apertures in the right column and measured accompanying flow values in the left, fitted with an appropriate function. A measurement of the image will then, pixel by pixel, look up the â€śdensityâ€ť (ie. â€śflowâ€ť in your case) and sum this for the entire image.

You would feed the ridges @Mathew talks about as a startpoint, but you might even have sufficient information in your binary image already (although with me, it looked like RGB, so I had to re-convert it to 8-bit, then do a threshold and invert before I could do the Process>Binary>Distance Map)
But then, Iâ€™m not an expert in fluidics.

Hi
@Think90

For the PlugIn:

@Think90
Have you recorded Ridge Detection?
Have you recorded â€śCommons Lang-3â€ť?
The plugin is in â€śpluginâ€ť â€”> â€ś. Jarsâ€ť.

But I have a weak computer)
Above: the average lengths and widths of the cracks.

Greetings

@Mathew
still having trouble getting the plugin.
This is the error I am getting.

You could also use the Lines8 plugin in the Morphology collection:
https://blog.bham.ac.uk/intellimic/g-landini-software/

That has two different algorithms to measure the length of a line/skeleton.

1 Like

@eljonco
Thank you for you reply also.

I wonâ€™t lie a lot of what you have said has gone over my head. But from what I did get. I canâ€™t compare or calibrate against another image as due to lockdown I no longer have access to the labs so have to deal with what images I currently have.
I just a single value for max crack length and min crack length (got this wrong in my first post) per image, ideally aperture too but I can approximate that push come to shove.

@gabriel
Thank you.
I have managed to get this plugin to work yet I think I might be doing something wrong.
I had to re-edit the original image as the one I uploaded wouldnâ€™t work. I cropped the image after converting to 8-bit then applied the a threshold. This allowed me to use the lines8 plugin but it produced this.

It gave me values etc. But from the new image I am not sure that I have done it correctly or something has gone wrong.

I think you might have the image inverted. Try Edit>Invert and make sure your object (the cracks) are white and the background is black. And yes, you need a binary image. Please report back if you still have a problem.