Does the findEdges() command in imageJ perform any kind of thresholding or edge thinning?

I know the findEdges() command in the imageProcessor API uses a Sobel function to find changes in intensity in an image but I was wondering if it also performs any kind of thresholding or filtering to the image before or afterwards?

No. Sobel filtering (like many other convolution results) can saturate the image. You might see some saturated areas with pixels in pure black or white, but that is not thresholding.

To add to @gabriel’s answer: you can find the implementation in the source code. There are different implementations for 8-bit, 16-bit and 32-bit images (with some redundant code):

  • 8-bit (ByteProcessor):

  • 16-bit (ShortProcessor):

  • 32-bit (FloatProcessor):

To avoid possible saturation, change the image type to 32-bit float before filtering.

The (type-agnostic) ImageJ2 implementation of this command is

Thanks @gabriel and @imagejan for the info! I have been using findEdges() with a combination of median or Gaussian filtering and connected component labeling to find edges in an image but I am having trouble implementing edge thinning techniques like non-maximal suppression or thresholding.

Do you guys know anything about how I would do this programatically? (I am writing a plugin to measure the thicknesses of multiple edges in an image)

Thanks very much.