digital image processing:...

58
TOT Dosen D3-MI Universitas Gunadarma 2012 (21Sep2012) Digital Image Processing: Pendahuluan Dr. Mohammad Iqbal

Upload: lediep

Post on 30-Jun-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

TOT Dosen D3-MI Universitas Gunadarma 2012 (21Sep2012)

Digital Image Processing:Pendahuluan

Dr. Mohammad Iqbal

2of58

Introduction

“One picture is worth more than ten thousand words”

Anonymous

3of58

Buku Referensi

“Digital Image Processing”, Rafael C. Gonzalez & Richard E. Woods, Addison-Wesley, 2002

– Buku wajib“Machine Vision: Automated Visual Inspection and Robot Vision”, David Vernon, Prentice Hall, 1991

– Ada di situs :homepages.inf.ed.ac.uk/rbf/BOOKS/VERNON/

4of58

Konten Hari ini

Akan membahas:– Apakah Citra Digital ?– Apakah Pengolahan Citra Digital ?– Contoh dari Pengolahan Citra Digital– Langkah2 dalam Pengolahan Citra Digital– Utilitas Pengolahan Citra Digital

5of58

Apakah citra digital ?

Citra digital adalah representasi citra dua-dimensi sebagai kumpulan terhitung (set finite) dari nilai digital, yang disebut picture elements atau pixels

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

6of58

Apakah citra digital ? (Lanjutan…)

Nilai Pixel umumnya merepresentasikan level keabuan (gray levels), warna, tinggi, opasitas dllIngat : digitization menyebabkan citra digital sebagai approximasi dari real scene

1 pixel

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

7of58

Apakah citra digital ? (Lanjutan…)

Format citra Umum:– 1 sampel per poin (B&W atau Grayscale)– 3 sampel per poin (Red, Green, dan Blue)– 4 sampel per poin (Red, Green, Blue, dan “Alpha”,

atau Opasitas)

8of58

Apakah Pengolahan citra digital ?

Pengolahan citra digital berfokus pada dua Tugas utama :

– Meningkatkan informasi citra untuk interprestasi oleh manusia

– Mengolah data citra untuk penyimpanan, transmisi dan representasi dalam autonomous machine perception

Argumen wilayah bahasan Pengolahan citra dan Analisis Citra dan Computer vision masih bervariasi.

9of58

Apakah Pengolahan citra digital ? (Lanjutan…)

Keberlanjutan dari pengolahan citra ke computer vision dapat dibagi atas proses low-, mid- dan high-level

Low Level ProcessInput: ImageOutput: Image

Examples: Noise removal, image sharpening

Mid Level ProcessInput: Image Output: Attributes

Examples: Object recognition, segmentation

High Level ProcessInput: Attributes Output: Understanding

Examples: Scene understanding, autonomous navigation

10of58

Contoh : Image Enhancement

Kebanyakan penggunaan teknik DIP : improve quality, remove noise etc

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

11of58

Contoh : The Hubble Telescope

Diluncurkan tahun 1990 Teleskop the Hubble dapatmenangkap citra yang sangat Jauh. Namun, incorrect mirrormembuat banyak citra jadi tidak berguna.

teknik DIP

12of58

Contoh : Artistic Effects

Efek Artistik digunakan untuk membuat citra lebih menarik secara visual

DIP utk membuat special efek & utk membuat citra komposit

13of58

Contoh : Medicine

Ambil slice menggunakan MRI scan dari jantung, dan mencoba menemukan batas antara tipe tissue jantung

– Citra dengan gray levels representasikan tissue density

– Gunakan filter untuk meng-highlight tepinya

Original MRI Image of a Dog Heart Edge Detection ImageImag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

14of58

Contoh : GIS

Geographic Information Systems– Teknik DIP digunakan untuk memanipulasi

satellite imagery– Klasifikasi Terrain– Meteorology

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

15of58

Contoh : Industrial Inspection

Operators manusia sangat mahal, lambat dan kurang handal.Dibuatlah mesin untuk menggantikan tugas tersebut Industrial vision systems

Can we trust them?

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

16of58

Contoh : PCB Inspection

Printed Circuit Board (PCB) inspection– Machine inspection digunakan untuk melihat semua

komponen sudah ada dan hasil solder dapat diterima– Teknik conventional imaging dan x-ray imaging

digunakan di sini.

17of58

Contoh : Law Enforcement

Teknik DIP digunakan Oleh para penegakhukum

– Pengenalan no mobil recognition pada speed cameras/automated toll systems

– Fingerprint recognition– Enhancement citra

CCTVImag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

18of58

Contoh : HCI

Membuat human computer interfaces lebih natural

– Face recognition– Gesture recognition

Lihat contoh user interface di film “Minority Report”

19of58

Langkah2 dalam Pengolahan Citra Digital

Image Acquisition

Discretization/Digitization Quantization Compression

Image enhancement and restoration

Image Segmentation

Feature Selection

Image Representation

Image Interpretation

Partition image into objects or constituent parts

Extracting pertinent features (or descriptors) from an image that are important for differentiating one class of objects from another

Assigning labels to an object based on information provided by descriptors

Assigning meaning to an ensemble of recognized objects

Capturing visual data by an imaging sensor Convert data into discrete form

Compress for efficient storage/transmission

Improving image quality (low contrast, blur, noise)

20of58

Langkah2 dalam Pengolahan Citra Digital : Level Pengolahan citra

• Level 0: Representasi citra (akuisisi, sampling, kuantisasi, kompresi)

• Level 1: transformasi Image-to-image (enhancement, restoration, segmentation)

• Level 2: Transformasi Image-to-parameter (feature selection)

• Level 3: transformasi Parameter-to-decision (recognition and interpretation)

21of58

Langkah2 dalam Pengolahan Citra Digital : Kedudukan DIP, ComVis

• Image Processing: Levels 0 and 1

• Image Analysis: Levels 1 and 2

• Computer/Robot Vision: Levels 2 and 3

• Computer Graphics/Animation ?– Pendekatan dalam “creating images” atau membuat

“visual effects” dari deksripsi yang diberikan pada level sebelumnya.

22of58

Langkah2 dalam Pengolahan Citra Digital : Problem Domain

Image Acquisition

Image Restoration

Morphological Processing

Segmentation

Representation & Description

Image Enhancement

Object Recognition

Problem Domain

Colour Image Processing

Image Compression

23of58

Langkah2 dalam Pengolahan Citra Digital : Image Aquisition

Image Acquisition

Image Restoration

Morphological Processing

Segmentation

Representation & Description

Image Enhancement

Object Recognition

Problem Domain

Colour Image Processing

Image Compression

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

24of58

Langkah2 dalam Pengolahan Citra Digital : Image Enhancement

Image Acquisition

Image Restoration

Morphological Processing

Segmentation

Representation & Description

Image Enhancement

Object Recognition

Problem Domain

Colour Image Processing

Image Compression

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

25of58

Langkah2 dalam Pengolahan Citra Digital : Image Restoration

Image Acquisition

Image Restoration

Morphological Processing

Segmentation

Representation & Description

Image Enhancement

Object Recognition

Problem Domain

Colour Image Processing

Image Compression

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

26of58

Langkah2 dalam Pengolahan Citra Digital : Morphological Processing

Image Acquisition

Image Restoration

Morphological Processing

Segmentation

Representation & Description

Image Enhancement

Object Recognition

Problem Domain

Colour Image Processing

Image Compression

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

27of58

Langkah2 dalam Pengolahan Citra Digital : Segmentation

Image Acquisition

Image Restoration

Morphological Processing

Segmentation

Representation & Description

Image Enhancement

Object Recognition

Problem Domain

Colour Image Processing

Image Compression

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

28of58

Langkah2 dalam Pengolahan Citra Digital : Object Recognition

Image Acquisition

Image Restoration

Morphological Processing

Segmentation

Representation & Description

Image Enhancement

Object Recognition

Problem Domain

Colour Image Processing

Image Compression

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

29of58

Langkah2 dalam Pengolahan Citra Digital : Representation & Description

Image Acquisition

Image Restoration

Morphological Processing

Segmentation

Representation & Description

Image Enhancement

Object Recognition

Problem Domain

Colour Image Processing

Image Compression

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

30of58

Langkah2 dalam Pengolahan Citra Digital : Image Compression

Image Acquisition

Image Restoration

Morphological Processing

Segmentation

Representation & Description

Image Enhancement

Object Recognition

Problem Domain

Colour Image Processing

Image Compression

31of58

Langkah2 dalam Pengolahan Citra Digital : Colour Image Processing

Image Acquisition

Image Restoration

Morphological Processing

Segmentation

Representation & Description

Image Enhancement

Object Recognition

Problem Domain

Colour Image Processing

Image Compression

32of58

Utilitas Pengolahan Citra Digital

Photo EditorsDrawing Tools

Utilitas DIP

Picture ManagersSmartDraw, Edraw, Coreldraw, Adobe

Illustrator, InkScape

PhotoShop, PaintShop,

PhotoPrush, Painter, PhotStudio, GIMP,

Photofiltre, PhotoScape

Picasa, MS Picture Manager, IrfanView

33of58

Utilitas Pengolahan Citra Digital

Photoshop – amount of features that help you manipulate and enhance photos as well as create web graphics, all while helping you manage your workflow and image editing environment

34of58

Utilitas Pengolahan Citra Digital

GIMP – which stands for the GNU Image Manipulation Program – is a feature-packed and powerful open source image editor that can be used in all major operating systems (Linux, Mac, and Windows). It has a customizable interface so that you can easily set the view and behavior of GIMP.

It has a huge set of retouching tools that will allow you to perform advanced image retouching and manipulation. The GIMP outputs your work in many common formats like JPG, GIF, PNG, TIFF, and even PSD (Photoshop’s native file format).

35of58

Utilitas Pengolahan Citra Digital

Inkscape is an open source vector graphics editor much like Adobe Illustrator, CorelDraw, and Xara X. Its default file format is web standards compliant Scalable Vector Graphics (SVG) under W3C’s specifications.

CorelDraw - Superior vector illustration & page layout. Versatile drawing and tracing tools

Professional photo editing-capabilities Powerful website design software

36of58

Utilitas Pengolahan Citra Digital

Untuk Riset & Perkuliahan :• Image Processing Toolbox Matlab

(http://www.mathworks.com/products/image/?BB=1 ) dan M-Function di web (http://www.mathworks.com/matlabcentral/fileexchange/ )

• Scilab Image Processing (http://siptoolbox.sourceforge.net/ )

Buku Digital Image Processing Using MATLAB by Gonzalez, Woods, and Eddins.

37of58

Utilitas Pengolahan Citra Digital

Untuk Riset & Perkuliahan :• CVIPtools

(http://cviptools.ece.siue.edu/ )

38of58

Utilitas Pengolahan Citra Digital

Untuk Riset & Perkuliahan :• ImLab

(http://imlab.sourceforge.net/ )

Image Analyzing & measure

Bitmap, Histogram, Matrix and 3D

39of58

Utilitas Pengolahan Citra Digital

Untuk Riset & Perkuliahan :1. LabView

(http://www.ni.com/analysis/lvaddon_vision.htm )

Buku Digital Image Processing Using LabView

By Rubén Posada-Gómez, et al

40of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

1. Selection• One of the prerequisites for many of the applications is a method of

selecting part(s) of an image, thus applying a change selectively without affecting the entire picture. Most graphics programs have several means of accomplishing this, such as:

– a marquee tool for selecting rectangular or other regular polygon-shaped regions,

– a lasso tool for freehand selection of a region, – a magic wand tool that selects objects or regions in the image

defined by proximity of color or luminance, – vector-based pen tools,

41of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

2. Layers• Another feature common to many graphics applications is that of

Layers, which are analogous to sheets of transparent acetate (each containing separate elements that make up a combined picture), stacked on top of each other, each capable of being individuallypositioned, altered and blended with the layers below, without affecting any of the elements on the other layers. This is a fundamental workflow which has become the norm for the majority of programs on the market today, and enables maximum flexibilityfor the user while maintaining non-destructive editing principles and ease of use.

42of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

3. Image size alteration• Image editors can resize images in a process often called image

scaling, making them larger, or smaller. • High image resolution cameras can produce large images which are

often reduced in size for Internet use. Image editor programs use a mathematical process called resampling to calculate new pixel values whose spacing is larger or smaller than the original pixel values.

• Images for Internet use are kept small, say 640 x 480 pixels which would equal 0.3 megapixels.

43of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

4. Cropping an image• Digital editors are used to crop images. Cropping creates a new

image by selecting a desired rectangular portion from the image being cropped. The unwanted part of the image is discarded. Image cropping does not reduce the resolution of the area cropped. Best results are obtained when the original image has a high resolution. A primary reason for cropping is to improve the image composition in the new image.

44of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

5. Histogram• Image editors have provisions to create an image histogram of the

image being edited. The histogram plots the number of pixels in the image (vertical axis) with a particular brightness value (horizontal axis). Algorithms in the digital editor allow the user to visually adjust the brightness value of each pixel and to dynamically display the results as adjustments are made. Improvements in picture brightness and contrast can thus be obtained.

45of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

6. Noise reduction• Image editors may feature a number of algorithms which can add or

remove noise in an image. Some JPEG artifacts can be removed; dust and scratches can be removed and an image can be de-speckled. Noise reduction merely estimates the state of the scene without the noise and is not a substitute for obtaining a "cleaner" image. Excessive noise reduction leads to a loss of detail, and its application is hence subject to a trade-off between the undesirability of the noise itself and that of the reduction artifacts.

• Noise tends to invade images when pictures are taken in low light settings. A new picture can be given an 'antiquated' effect by adding uniform monochrome noise.

46of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

7. Removal of unwanted elements (Inpainting)• Most image editors can be used to remove unwanted branches, etc.,

using a "clone" tool. Removing these distracting elements draws focus to the subject, improving overall composition.

47of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

8. Selective color change• Some image editors have color swapping abilities to selectively

change the color of specific items in an image, given that the selected items are within a specific color range.

48of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

9. Image Orientation• Image editors are capable of altering an image to be rotated in any

direction and to any degree. Mirror images can be created and images can be horizontally flipped or vertically flopped. A small rotation of several degrees is often enough to level the horizon, correct verticality (of a building, for example), or both. Rotated images usually require cropping afterwards, in order to remove the resulting gaps at the image edges. .

49of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

10. Perspective control and distortion• Some image editors allow the user to distort (or "transform") the

shape of an image. While this might also be useful for special effects, it is the preferred method of correcting the typical perspective distortion which results from photographs being taken at an oblique angle to a rectilinear subject. Care is needed while performing this task, as the image is reprocessed using interpolationof adjacent pixels, which may reduce overall image definition. The effect mimics the use of a perspective control lens, which achieves a similar correction in-camera without loss of definition.

Perspective control: original (left), perspective distortion removed

(right).

50of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

11. Lens correction• Photo manipulation packages have functions to correct images for

various lens distortions including pincushion, fisheye and barrel distortions. The corrections are in most cases subtle, but can improve the appearance of some photographs.

12. Enhancing images• In computer graphics, the process of improving the quality of a

digitally stored image by manipulating the image with software. It is quite easy, for example, to make an image lighter or darker, or to increase or decrease contrast. Advanced photo enhancement software also supports many filters for altering images in various ways.[1] Programs specialized for image enhancement are sometimes called image editors.

51of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

13. Sharpening and softening images• Graphics programs can be used to both sharpen and blur images in

a number of ways, such as unsharp masking or deconvolution.[2]Portraits often appear more pleasing when selectively softened (particularly the skin and the background) to better make the subject stand out. This can be achieved with a camera by using a large aperture, or in the image editor by making a selection and then blurring it. Edge enhancement is an extremely common technique used to make images appear sharper, although purists frown on the result as appearing unnatural.

52of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

14. Selecting and Merging• Many graphics applications are capable of merging one or more

individual images into a single file. The orientation and placement of each image can be controlled.

• When selecting a raster image that is not rectangular, it requires separating the edges from the background, also known as silhouetting. This is the digital version of cutting out the image. Clipping paths may be used to add silhouetted images to vector graphics or page layout files that retain vector data. Alpha compositing, allows for soft translucent edges when selecting images.

Photomontage of 16 photos

53of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

16. Slicing of images• A more recent tool in digital image editing software is the image

slicer. Parts of images for graphical user interfaces or web pages are easily sliced, labeled and saved separately from whole images so the parts can be handled individually by the display medium. This is useful to allow dynamic swapping via interactivity or animating parts of an image in the final presentation.

54of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

17. Special effects 18. Change color depth

An example of converting an image from color to grayscale

55of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

19. Gamma correction• In addition to the capability of changing the images' brightness and/or

contrast in a non-linear fashion, most current image editors provide an opportunity to manipulate the images' gamma value.

• Gamma correction is particularly useful for bringing details that would be hard to see on most computer monitors out of shadows. In someimage editing software this is called "curves", usually a tool found in the color menu, and no reference to "gamma" is used anywhere in the program or the program documentation. Strictly speaking, the curves tool usually does more than simple gamma correction, since one can construct complex curves with multiple inflection points, but when no dedicated gamma correction tool is provided, it can achieve the same effect.

56of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

20. Contrast change and brightening• Image editors have provisions to simultaneously change the contrast

of images and brighten or darken the image. Underexposed images can often be improved by using this feature. Recent advances have allowed more intelligent exposure correction whereby only pixelsbelow a particular luminosity threshold are brightened, thereby brightening underexposed shadows without affecting the rest of the image. The exact transformation that is applied to each color channel can vary from editor to editor.

57of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

21. Color adjustments• An example of color adjustment using raster graphics editor• The color of images can be altered in a variety of ways. Colors can be faded in

and out, and tones can be changed using curves or other tools. The color balance can be improved, which is important if the picture was shot indoors with daylight film, or shot on a camera with the white balance incorrectly set. Special effects, like sepia and grayscale, can be added to an image. In addition, more complicated procedures such as the mixing of color channels are possible using more advanced graphics editors.

• The red-eye effect, which occurs when flash photos are taken when the pupil is too widely open (so that light from the flash that passes into the eye through the pupil reflects off the fundus at the back of the eyeball), can also be eliminated at this stage.

58of58

Apa yang dapat dilakukan menggunakan Utilitas DIP

22. Printing• Control printed image by changing pixels-per-inch.• Controlling the print size and quality of digital

images requires an understanding of the pixels-per-inch (ppi) variable that is stored in the image file and sometimes used to control the size of the printed image.

• Within Adobe Photoshop's Image Size dialog, the image editor allows the user to manipulate both pixel dimensions and the size of the image on the printed document. These parameters work together to produce a printed image of the desired size and quality. Pixels per inch of the image, pixel per inch of the computer monitor, and dots per inch on the printed document are related, but in use are very different.

• The Image Size dialog can be used as an image calculator of sorts. For example, a 1600 × 1200 image with a resolution of 200 ppi will produce a printed image of 8 ×6 inches. The same image with 400 ppi will produce a printed image of 4 ×3 inches. Change the resolution to 800 ppi, and the same image now prints out at 2 × 1.5 inches. All three printed images contain the same data (1600 × 1200 pixels), but the pixels are closer together on the smaller prints, so the smaller images will potentially look sharp when the larger ones do not. The quality of the image will also depend on the capability of the printer.