Showing posts with label dilation. Show all posts
Showing posts with label dilation. 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.

Wednesday, 17 February 2016

Dilasi

Operasi Dasar Morfologi Dilasi
Jika suatu objek (citra input) dinyatakan dengan A dan structuring elements (SE) dinyatakan dengan B serta Bx menyatakan translasi B sedemikian sehingga pusat B terletak pada x, maka operasi dilasi A dengan B dinotasikan (D(A,B)) dapat dinyatakan sebagai berikut;

D(A,B)= A⊕B={x:Bx∩A≠∅}               

Dengan ∅ menyatakan himpunan kosong.
Proses dilasi dilakukan dengan cara:
  1. Membandingkan setiap pixel citra input dengan nilai pusat SE dengan cara melapiskan SE dengan citra sehingga pusat SE tepat dengan posisi pixel citra yang diproses.
  2. Jika paling sedikit ada 1 pixel pada SE sama dengan nilai pixel objek (foreground) citra, maka pixel input diset nilainya dengan nilai pixel foreground dan bila semua pixel yang berhubungan adalah background maka input pixel diberi nilai pixel background,
  3. Proses yang sama dilanjutkan dengan menggerakan (tranlasi) SE pixel demi pixel pada citra input.
Contoh dilasi:
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)}
A⊕B    = {(1,1),(1,2),(1,3),(1,4),(2,1),(2,2),(2,3),(2,4),(3,1),(3,2),(3,3),(3,4),
                      (4,1),(4,2),(4,3)}

 
 
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