Showing posts with label opening. Show all posts
Showing posts with label opening. Show all posts

Thursday 16 November 2023

Morphological Operations

Morphological operations are a set of image processing techniques that operate on the shape or morphology of features in an image. These operations are particularly useful for processing binary or grayscale images to extract important information such as boundaries, shapes, and other structural properties. Morphological operations are commonly used in computer vision, image analysis, and pattern recognition. 

The basic morphological operations include:

  1. Erosion: 
    • Erosion is used to shrink the boundaries of objects in a binary image. 
    • It works by placing a structuring element (a small, simple shape) at each pixel in the image and determining whether the pixel at the center of the structuring element should be set to 0 (black) based on the presence of foreground pixels in the neighborhood defined by the structuring element.
  2. Dilation:
    • Dilation is used to expand the boundaries of objects in a binary image. 
    • Similar to erosion, dilation involves placing a structuring element at each pixel and setting the center pixel to 1 (white) if any part of the structuring element overlaps with a foreground pixel in the image. 
  3. Opening: 
    • Opening is a combination of an erosion operation followed by a dilation operation. 
    • It is useful for removing small objects and smoothing the boundaries of larger objects. 
  4. Closing: 
    • Closing is a combination of a dilation operation followed by an erosion operation. 
    • It is useful for closing small gaps in between objects and filling in small holes. 
  5. Morphological Gradient: 
    • The morphological gradient is obtained by subtracting the result of an erosion operation from a dilation operation. 
    • It highlights the boundaries of objects in the image. 
  6. Top Hat and Black Hat
    • Top Hat and Black Hat operations are variations of morphological operations that involve subtracting the original image from the result of opening or closing operations, respectively. 
    • Top Hat highlights bright features against a dark background, and Black Hat highlights dark features against a bright background.

These operations are typically applied using a structuring element, which is a small matrix or kernel that defines the neighborhood around each pixel. The choice of structuring element and the number of iterations of these operations can be adjusted based on the specific requirements of the image processing task. Morphological operations are powerful tools for preprocessing images and extracting important information for further analysis.

Monday 23 May 2016

Opening

Operasi Morfologi Opening
Operasi morfologi opening merupakan operasi erosi yang diikuti dengan dilasi dimana digunakan SE yang sama. Operasi opening akan menghilangkan seluruh piksel di area yang terlalu kecil untuk ditempati oleh SE dan menghaluskan kontur objek. Operasi opening A dengan strel B dengan notasi A○B yaitu seperti pada persamaan:
                                                        A B = (AB)B
Contoh opening:
Langkah pertama adalah erosi;
A         = {(1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)}
B         = {(0,0),(0,1),(1,0)}
AB  = {(1,1),(1,2),(2,1),(2,2)}       

Langkah kedua adalah dilasi;
AB              = {(1,1),(1,2),(2,1),(2,2),(4,4)}    
B                     = {(0,0),(0,1),(1,0)}
(AB)B     = {(1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2)}
Gambar  Opening A dengan B


referensi;
  1. Gonzalez, R.C. dan Woods, R.E., 2008, Digital Image processing, Addison- Wesley Publishing Company, USA.
  2. Pujiastuti, A., 2016, Sistem Perhitungan Lama Penyinaran Matahari Dengan Metode Otsu Threshold (Studi kasus: St. Klimatologi Barongan), Tesis, Program Studi S2 Ilmu Komputer Fakultas Matematika dan Ilmu Pengetahuan Alam Universitas Gadjah Mada Yogyakarta
  3. Putra, D.,2010, Pengolahan Citra Digital, Andi Yogyakarta, Yogyakarta