ContourDetect

ContourDetect[image]

gives a binary image in which white pixels correspond to the zeros and zero crossings in image.

ContourDetect[image,delta]

treats values in image that are smaller in absolute value than delta as zero.

ContourDetect[array,]

gives a binary sparse array in which 1 corresponds to zeros and zero crossings in array.

Details and Options

  • ContourDetect finds pixels with zero value as well as pixels with positive values that have at least one negative neighbor.
  • For color images, ContourDetect operates on the intensity averaged over all channels.
  • ContourDetect works with 3D as well as 2D images, and also with arrays of rank 1, 2, or 3.
  • ContourDetect[array,delta] effectively chops values smaller in magnitude than delta.
  • ContourDetect takes a CornerNeighbors option. The default setting is CornerNeighbors->True.
  • Using the option setting CornerNeighbors->None, ContourDetect operates on the dual grid whose pixels correspond to the corners in the original image, thereby reducing the dimensions of the resulting image by one pixel.

Examples

open allclose all

Basic Examples  (2)

Zeros and zero crossings of a list:

Find zeros and zero crossings in a real-valued image:

Scope  (3)

Find zeros and zero crossings in a matrix:

Find a thick contour of a blurred object:

Find values below a given threshold:

Options  (1)

CornerNeighbors  (1)

This operates on the dual grid:

Applications  (2)

Find a contour line in an elevation raster:

Find flat regions in an image by detecting the zero contour of its second derivative:

Properties & Relations  (2)

When converting a real-valued image to type "Byte", all negative values will be clipped to zero:

Illustrate the effect of the LoG filter:

Possible Issues  (1)

All data dimensions should be greater than 1 to construct the dual grid using CornerNeighbors->None:

Use CornerNeighborsAutomatic instead:

Wolfram Research (2010), ContourDetect, Wolfram Language function, https://reference.wolfram.com/language/ref/ContourDetect.html (updated 2014).

Text

Wolfram Research (2010), ContourDetect, Wolfram Language function, https://reference.wolfram.com/language/ref/ContourDetect.html (updated 2014).

CMS

Wolfram Language. 2010. "ContourDetect." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/ContourDetect.html.

APA

Wolfram Language. (2010). ContourDetect. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ContourDetect.html

BibTeX

@misc{reference.wolfram_2023_contourdetect, author="Wolfram Research", title="{ContourDetect}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/ContourDetect.html}", note=[Accessed: 19-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_contourdetect, organization={Wolfram Research}, title={ContourDetect}, year={2014}, url={https://reference.wolfram.com/language/ref/ContourDetect.html}, note=[Accessed: 19-March-2024 ]}