190 likes | 551 Views
Image Processing & Analysis. Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University. Outline. Introduction Image Processing Image Analysis. Introduction. Image-to-image transform
E N D
ImageProcessing & Analysis Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University Image Analysis
Outline • Introduction • Image Processing • Image Analysis Image Analysis
Introduction • Image-to-image transform • To reduce irrelevant information or noise • To enhance the image properties • Image-to-feature transformation • Extract a small number of features • Feature-to-decision transformation • Use one or more features to classify the image or objects in it Image Analysis
Introduction • Gray level histogram • A graph showing the frequency of occurrence of each gray level in the image Image Analysis
Histogram Image Analysis
Image Processing • Inverse • Reverse light and dark • g2(x,y) = K – 1 – g1(x,y) (K=256, for example) Image Analysis
Image Processing • Threshold • T – called a threshold value • Set each gray level that is less or equal to some prescribed value T to 0. • Set each gray level that is greater than T to 1. • g2(x,y) = 0 if g1(x,y) <= T • g2(x,y) = K-1 if g1(x,y) > T Image Analysis
Threshold Image Analysis
Threshold Image Analysis
Image Analysis • Divide or segment an image into a number of regions • Nonbackground regions are sometimes called objects. • Threshold is one the most simplest way. Image Analysis
4-connected Share a side 8-connected Share either a side or a corner Image Analysis 8 4 8 4 0 4 8 4 8 Image Analysis
Image Analysis Image Analysis
Labeling Algorithm • Thresholding • Dividing an image into two or more regions • Identify which pixels belong to each of these specific regions • Measure various properties • Size • Shape • Location • Color Image Analysis
Labeling Algorithm • Replaces each pixel by a negative number • Uses a list to keep track of pixels that are yet to be labeled • Insert(s,t) • insert pixel (s,t) at the end of the list • (s,t) <- remove() • remove the pixel from the front Image Analysis
Region-Labeling Algorithm L <- -1 (Initialize label.) Scan the image from left to right and top to bottom for all (x,y) If g(x.y)>0 the insert(x,y) While list is not empty do (s,t) <- remove() For each 4-neightbor (u,v) of (s,t) do If (u,v) is unlabeled and g(u,v)=g(x,y) then Insert(u,v) End if End for End while L <- L-1 (Get new label.) End scan Image Analysis
Bounding Box (Xmin, Ymin) (Xmax, Ymax) Image Analysis
list • Include • #include <list> • using namespace std; • Declaration • list <CPoint> listPoint; • Add • push_back, push_front • Remove • pop_back, pop_front Image Analysis
list • Iterate • list <CPoint>::iterator i; • for (i = listPoint.begin(); i != listPoint.end(); ++i) • Miscel • size() • clear() • front() • back() Image Analysis