{
  "id": "enwiki-001319047607",
  "slug": "top-hat-transform",
  "title": "Top-hat transform",
  "qid": "",
  "lead": "In mathematical morphology and digital image processing, a top-hat transform is an operation that extracts small elements and details from given images. There exist two types of top-hat transform: the white top-hat transform is defined as the difference between the input image and its opening by some structuring element, while the black top-hat transform is defined dually as the difference between the closing and the input image. Top-hat transforms are used for various image processing tasks, such as feature extraction, background equalization, image enhancement, and others.",
  "body": "In mathematical morphology and digital image processing, a top-hat transform is an operation that extracts small elements and details from given images. There exist two types of top-hat transform: the white top-hat transform is defined as the difference between the input image and its opening by some structuring element, while the black top-hat transform is defined dually as the difference between the closing and the input image. Top-hat transforms are used for various image processing tasks, such as feature extraction, background equalization, image enhancement, and others. ==Mathematical definitions== Let f:E\\mapsto \\mathbb{R} be a grayscale image, mapping points from a Euclidean space or discrete grid E (such as \\mathbb{R}^2 or \\mathbb{Z}^2 ) into the real line. Let b(x) be a structuring element of grayscale. Then, the white top-hat transform of f is given by: T_w(f)=f-f \\circ b , where \\circ denotes the opening operation. The black top-hat transform of f (sometimes called the bottom-hat transform ) is given by: T_b(f)=f\\bullet b-f , where \\bullet is the closing operation. ==Properties== The white top-hat transform returns an image, containing those \"objects\" or \"elements\" of an input image that: Are \"smaller\" than the structuring element (i.e., places where the structuring element does not fit in), and are brighter than their surroundings. The black top-hat returns an image, containing the \"objects\" or \"elements\" that: Are \"smaller\" than the structuring element, and are darker than their surroundings. The size, or width, of the elements that are extracted by the top-hat transforms can be controlled by the choice of the structuring element b . The bigger the latter, the larger the elements extracted. Both top-hat transforms are images that contain only non-negative values at all pixels. One of its most important uses in image segmentation is to adjust nonuniform lighting conditions on an image and provide a better threshold value for separating objects. ==References== Image Analysis and Mathematical Morphology by Jean Serra, (1982) Image Analysis and Mathematical Morphology, Volume 2: Theoretical Advances by Jean Serra, (1988) An Introduction to Morphological Image Processing by Edward R. Dougherty, (1992) Hands-on Morphological Image Processing by Edward R. Dougherty and R. Lotufo, (2003) Digital Image Processing (Third Edition) by Rafael C. Gonzalez and Richard E. Woods, (2008)",
  "categories": [
    "109374075",
    "23603337",
    "26220375",
    "29176288"
  ],
  "license": "CC BY-SA 4.0",
  "source_uri": "https://en.wikipedia.org/w/index.php?oldid=1319047607",
  "content_hash": "",
  "created_at": null,
  "updated_at": 1761570109.0,
  "claims": [],
  "contradictions": [],
  "confidence": 0.6,
  "csl": {
    "id": "enwiki-001319047607",
    "type": "webpage",
    "title": "Top-hat transform",
    "author": [
      {
        "family": "Anticloud FZ LLE",
        "literal": "Anticloud FZ LLE"
      }
    ],
    "container-title": "encyclopegia.org",
    "publisher": "Anticloud FZ LLE",
    "publisher-place": "Dubai, United Arab Emirates",
    "URL": "https://encyclopegia.org/a/top-hat-transform",
    "issued": {
      "date-parts": [
        [
          2026,
          11,
          15
        ]
      ]
    },
    "accessed": {
      "date-parts": [
        [
          2026,
          11,
          15
        ]
      ]
    },
    "license": "CC BY-SA 4.0",
    "DOI": "eo1:enwiki-001319047607",
    "isBasedOn": "https://en.wikipedia.org/w/index.php?oldid=1319047607",
    "note": "Immutable snapshot enwiki-001319047607"
  }
}