Help picking depth-tied horizontal surfaces

This image is from a wellbore. The vertical axis is depth along the wellbore. The horizontal banding represents heterogeneity in the subsurface rock. I’m trying to find a way to automate picking the horizontal surfaces that separate different units.

What I’ve done so far is export the values for the vertical gray value plot into excel, calculate the second derivative and then highlight the zero values as surfaces, but it doesn’t seem to match reality. It spits out way more surfaces than there really are.

I’m not an image analysis wizard. What I’m looking for is a data set that assigns a depth to each surface. How would you guys go about solving the problem?

Good day,

if you want substantial help, we need a detailed description of what is what.

What are the vertical gray bars and why do they distort in the upper third?
It appears as if they were overlayed later.
Do you have an image without those?

What do you call horizontal surfaces and how are the defined in the image?
Are they really horizontal?

I guess that the problems you’ve encountered are due to the fact that you don’t know exactly of how to define the horizontal surfaces in your image.
Sidenote: What you did in Excel is possible in ImageJ and perhaps much easier.

Please study the ImageJ User Guide.

The spatial resolution of your image is not very good. Do you have higher resolved images. Not perfectly sure but has this image been JPG-compressed before?

Please be very specific in answering all questions.



Hi Herbie,

To answer your questions, after drilling a well, a tool with 8 spring loaded pads is lowered to the bottom of the well. The springs activate and push the pads against the rock of the wellbore, then slowly dragged to the surface. The vertical gray bands are gaps between the pads, and therefore gaps between the data in the image.The vertical gray bands distort towards the top of the image because the pads were rotating in the wellbore. The final image is an oriented flat projection of a 360 degree image of the rocks surrounding the hole.

Read more about it here ( )

I’ll see if I can find an image without the gray bands, though I don’t know if it will be any more useful. The bands represent real gaps in the data.

The resolution isn’t very high, but that is the nature of the tool, not from image processing.

The tool measures resistivity. High resistivity is yellow, low resistivity is black. Resistivity varies with rock type, so when there is a sharp boundary between a highly resistive bed and a low-resistivity bed, I can confidently say that surface represents a surface between two different rock types.

The surfaces are roughly horizontal, but some of them dip (see the wavy looking horizontal surfaces near the top of the image). Right now I am doing a vertical compression of the images to flatten the non-horizontal beds.

I hope that helps. Let me know if you have any more questions

Thanks for the details!

I think I well understand your descriptions and realize my partly wrong assumptions.

For a first attempt I would like to ask you to first convert your image to 32bit float in ImageJ, then apply “Select All” and finally produce a horizontal projection by using “Analyze >> Plot Profile” while holding down the Option-key.

The resulting plot gives you the mean gray-level profile of your image (left in the plot = top of your image).

Now try to find out which troughs in this plot correspond to the boundaries. In the end we need to evaluate this plot and we need a mathematical definition of which signal features (realiably) indicate a boundary. The definition of these faetures is up to you, because you know what a boundary is and what is not.



Here I’ve done a horizontal stretch on the image to flatten out the curved surfaces.

As you can see in the picture, the inflection points on the higher amplitude peaks and troughs are good at predicting where the bedding planes are. The smaller scale gray value wavelets are just noise, but I don’t know how to edit out the noise.

Is there a way to smooth either the image or the gray value plot to take away some of the low-amplitude, high-frequency variations?

Can I get ImageJ to automatically pick the peaks and troughs, and/or the inflection points of the high-amplitude and low-frequency curves?



Good day Preston,

the sample image you’ve posted above is different from the one you’ve posted before. It is spatially higher resolved which is surely of advantage.

Here is horizontal projection-plot of this sample image after some pre-processing:

It appears as if it becomes rather easy to extract the desired boundaries from it. What do you think?



That’s really good at picking the troughs. Would you just make a second plot to pick the peaks?

Would you just make a second plot to pick the peaks?

What for?