D10K-6C01 Pengolahan Citra PCD-ML Pengolahan Citra Menggunakan MATLAB Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran Semester Genap 2015-2016
MATLAB 2015a Image Processing and Computer Vision Products: Use graphical tools to visualize and manipulate images and video. Connect to hardware and develop new ideas using libraries of reference-standard algorithms. Products: MATLAB Computer Vision System Toolbox Image Acquisition Toolbox Image Processing Toolbox Parallel Computing Toolbox Signal Processing Toolbox Statistics and Machine Learning Toolbox
Images in Matlab Matlab is optimised for operating on matrices Images are matrices! Many useful built-in functions in the Matlab Image Processing Toolbox Very easy to write your own image processing functions
Loading and displaying images >> I=imread('mandrill.bmp','bmp'); % load image >> image(I) % display image >> whos I Name Size Bytes Class I 512x512x3 786432 uint8 array Grand total is 786432 elements using 786432 bytes image format as a string Matrix with image data image filename as a string Matlab can only perform arithmetic operations on data with class double! Display the left half of the mandrill image Dimensions of I (red, green and blue intensity information)
Ekstraksi Color Channel %----------membaca dan isi variabel----------------¬ gambar=imread(‘lena.jpg’); red=gambar; green=gambar; blue=gambar; %----------memproses per channel ---------------¬ red(:,:,2)=0; red(:,:,3)=0; green=(:,:,1)=0; green=(:,:,3)=0; blue(:,:,1)=0; blue(:,:,2)=0; %----------menampilkan gambar----------------¬ imshow(gambar) imshow(red) imshow(green) imshow(blue)
Konversi RGB ke Gray %------- Image Processing Toolbox ------ gambar=imread(‘lena.jpg’); gray=rgb2gray(gambar); imshow(gray); %------- Conventional ------ gray2 = 0.2989 * rgb(:,:,1) +0.5870 * rgb(:,:,2) + 0.1140 * rgb(:,:,3); imshow(gray2);
Tipe Image dalam Matlab Indexed Image Intensity Image RGB (truecolor) Image
Image Complement gambar=imread(‘lena.jpg’); invert=imcomplement(gambar); figure, imshow(invert); Invert/ complement
Histogram Citra %------- Histogram Seluruh Channel ------ gambar=imread(‘lena.jpg’); gray=rgb2gray(gambar); figure,imhist(gray); %------- Histogram Per Channel ------figure, imhist(gambar(:,:,1)); %---Red --- figure, imhist(gambar(:,:,2)); %---Green – figure, imhist(gambar(:,:,3)); %---Blue – %Bagaimana kalau imhist(gambar);??? Jelaskan !!!
Histogram Equalization %------- Histogram Citra ------ gambar=imread(‘lena.jpg’); gray=rgb2gray(gambar); figure,imshow(gray),figure,imhist(gray); %------- Histogram Equalization ------ grayeq=histeq(gray); figure,imshow(grayeq),figure,imhist(grayeq);
Image Crop % FORMAT x,y,w,h %------- Image Crop------ gambar=imread(‘lena.jpg’); crop=imcrop(gambar,[0 0 250 250]); imshow(gambar), figure, imshow(crop); % FORMAT x,y,w,h
Region of Interest (ROI) Menandari bagian yang menjadi pusat perhatian (region of interest) Bentuk area berupa polygon Format roipoly(I,c,r); I adalah matriks gambar c adalah matriks dari kolom ROI r adalah matriks dari baris ROI
Contoh Sederhana ROI gambar=imread(‘lena.jpg’); %------- ROI Segi Empat ------ c=[0 100 100 0]; r=[0 0 100 100]; ROI=roipoly(gambar,c,r); figure, imshow(ROI); %------- ROI Poligon------ c=[0 100 150 100 0]; r=[0 0 50 100 100]; %------- Menggunakan fungsi roifill----- g=gambar(:,:,1); ROI=roifill(g,c,r);
Region-based Processing Define and operate on regions of interest (ROI) Basic Functions roipoly Specify polygonal region of interest (ROI) poly2mask Convert region of interest (ROI) polygon to region mask regionfill Fill in specified regions in image using inward interpolation roicolor Select region of interest (ROI) based on color roifilt2 Filter region of interest (ROI) in image Interactive Functions imellipse Create draggable ellipse imfreehand Create draggable freehand region impoly Create draggable, resizable polygon imrect Create draggable rectangle imroi Region-of-interest (ROI) base class
Topik Lanjutan Pengolahan citra pada domain frekuensi FFT DCT Konversi ke Citra Biner Morphological Image Processing Dilasi Erosi Object counting Area Proses Konvolusi Filtering Edge Detection Image Reconstruction Proses Citra secara Live Koneksi Kamera Live histogram
Image Processing Toolbox Perform image processing, analysis, and algorithm development Image Processing Toolbox™ provides a comprehensive set of reference-standard algorithms, functions, and apps for image processing, analysis, visualization, and algorithm development. You can perform image analysis, image segmentation, image enhancement, noise reduction, geometric transformations, and image registration. Many toolbox functions support multicore processors, GPUs, and C-code generation. Image Processing Toolbox supports a diverse set of image types, including high dynamic range, gigapixel resolution, embedded ICC profile, and tomographic. Visualization functions and apps let you explore images and videos, examine a region of pixels, adjust color and contrast, create contours or histograms, and manipulate regions of interest (ROIs). The toolbox supports workflows for processing, displaying, and navigating large images.
Capabilities
Computer Vision Toolbox Design and simulate computer vision and video processing systems Computer Vision System Toolbox™ provides algorithms, functions, and apps for the design and simulation of computer vision and video processing systems. You can perform object detection and tracking, feature detection and extraction, feature matching, stereo vision, camera calibration, and motion detection tasks. The system toolbox also provides tools for video processing, including video file I/O, video display, object annotation, drawing graphics, and compositing. Algorithms are available as MATLAB® functions, System objects™, and Simulink® blocks. For rapid prototyping and embedded system design, the system toolbox supports fixed-point arithmetic and automatic C-code generation.
Computer Vision Toolbox Key Features Feature Detection, Extraction, and Matching Object Detection and Recognition Object Tracking and Motion Estimation Camera Calibration Stereo Vision Video Processing, Display, and Graphics Fixed Point and Code Generation
Key Features Object detection, including Viola-Jones and other pretrained detectors Object tracking, including Kanade-Lucas-Tomasi (KLT) and Kalman filters Feature detection, extraction, and matching, including FAST, BRISK, MSER, and HOG Camera calibration for single and stereo cameras, including automatic checkerboard detection and an app for workflow automation Stereo vision, including rectification, disparity calculation, and 3D reconstruction Support for C-code generation and fixed-point arithmetic with code generation products Video processing, object annotation, video file I/O, video display, graphic overlays, and compositing
Feature Detection and Extraction A feature is an interesting part of an image, such as a corner, blob, edge, or line. Feature extraction enables you to derive a set of feature vectors, also called descriptors, from a set of detected features. Computer Vision System Toolbox offers capabilities for feature detection and extraction that include: Corner detection, including Shi & Tomasi, Harris, and FAST methods BRISK, MSER, and SURF detection for blobs and regions Extraction of BRISK, FREAK, SURF, and simple pixel neighborhood descriptors Histogram of Oriented Gradients (HOG) feature extraction Visualization of feature location, scale, and orientation
Feature Detection and Extraction
Videos: Image Processing and Computer Vision Products Overview Image Processing Toolbox Computer Vision Toolbox Image Acquisition Toolbox Statistics and Machine Learning Toolbox Parallel Computing Toolbox