CT 03 6 - 3 - 3 - I P PR: Image Pro c essing, Co m pute r Vision and Pattern Rec o gnition (V E 1 ) Week 8 I m age Se g me ntation
T o pic & S t ruc t ure of the Lesson I mage S e gm e n t a t ion S L I DE 2 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition What is image seg men t ation Algorithms on image segmentation Thresholding Bi/Multi-modal Thresholding Implementation of segmentation algorithms
Learning Out c omes I mage S e gm e n t a t ion S L I DE 3 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition Student should be able to: Describe the segmentation techniques Und e r s tand t he prin c iple s teps in v ol v ed in the se g me n tat i on process.
Key Te r ms I mage S e gm e n t a t ion S L I DE 4 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition Student should be able to use the following terms correctly in your future works: Segmentation Thresholding Bimodal/Multimodal Thresholding
What is Im a ge Segme ntation? I mage S e gm e n t a t ion S L I DE 5 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition Segm e nta tion di v ides a n im a ge i n to its constituent regions or objects; Segm e nta tion of i ma g es i s a d iff i c u l t task in image processing and it is still under research; Segmentation allows to extract objects in images; The segmentation is based on measurements taken from the image and might be grey level , colour , texture , depth or motion .
Image segmentation - Application I mage S e gm e n t a t ion S L I DE 6 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition Applications of image segmentation include: Identifying objects in a scene for object-based measurements such as size and shape; Identifying objects in a moving scene for object-based video compression; Identifying objects which are at different distances from a sensor using depth measurements.
Image segmen t atio n - Exa m ples Example 1 Se g me nt a t i o n based o n gr e y - s c al e ; Very simple ‘ model ’ of grey-scale leads to inaccuracies in object labelling. I mage S e gm e n t a t ion S L I DE 7 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition
Image segmen t atio n - Exa m ples Example 2 Se g me nt a t i o n based on te xture; Enables object surfaces with varying patterns of grey to be segmented. I mage S e gm e n t a t ion S L I DE 8 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition
Image segmen t atio n - Exa m ples I mage S e gm e n t a t ion S L I DE 9 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition Example 3 Se g me nt a t i o n based o n m o t i o n ; The main difficulty of motion segmentation is that an intermediate step is required to estimate an optical flow field; The segmentation must be based on this estimate and not , in general, the true flow .
Image segmen t atio n - Exa m ples I mage S e gm e n t a t ion S L I DE 10 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition
Image segmen t atio n - Exa m ples I mage S e gm e n t a t ion S L I DE 11 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition Example 4 Se g me nt a t i o n based o n depth ; A segmentation based on the range (the object distance from the sensor) is useful in guiding mobile robots.
Image segmen t atio n - Exa m ples Ori g in a l image I mage S e gm e n t a t ion S L I DE 12 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition R an g e image S e gme n ted image
Segmentation Algorithms I mage S e gm e n t a t ion S L I DE 13 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition Segmentation algorithms are based on one of two basic properties of color, gray values, or texture: discontinuity and similarity ; First category is to partition an image based on abrupt changes in intensity , such as edges in an image; Second category are based on partitioning an image into regions that are similar according to a predefined criteria . Threshold approach falls under this category.
S e gmentation Algo r ithms Texture-based Edge-based Color-based Disparity-based Motion-based I mage S e gm e n t a t ion S L I DE 14 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition
Segme n ta t ion by Th r es h olding I mage S e gm e n t a t ion S L I DE 15 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition The gray-level histogram corresponds to an image f(x,y) composed of dark objects on the light background , in such a way that object and background pixels have gray levels grouped into two dominant modes. One obvious way to extract the objects from the background is to select a threshold ‘ T ’ that separates these modes. Then any point (x,y) for which f(x,y) < T is called an object point, otherwise, the point is called a background point.
Grey - sca l e Image: Example Image of a Finger Print with light background I mage S e gm e n t a t ion S L I DE 16 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition
Histogram I mage S e gm e n t a t ion S L I DE 17 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition
S e gmented Image Image after Segmentation I mage S e gm e n t a t ion S L I DE 18 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition
In Matlab histograms for images can be constructed using the imhist command. I mage S e gm e n t a t ion S L I DE 19 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition I = imread('pout.tif'); figure, imshow(I); figure, imhist(I) %look at the hist to get a threshold, e.g., 110 BW=roicolor(I, 110, 255); % makes a binary image figure, imshow(BW) % all pixels in (110, 255) will be 1 and white % the rest is which is black roicolor returns a region of interest selected as those pixels in I that match the values in the gray level interval. Matlab Code
Th r es h olding Bim o dal Hi s t o grams I mage S e gm e n t a t ion S L I DE 20 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition Basic Global Thresholding : 1)Select an initial estimate for T Segment the image using T. This will produce two groups of pixels. G1 consisting of all pixels with gray level values >T and G2 consisting of pixels with values <=T. Compute the average gray level values mean1 and mean2 for the pixels in regions G1 and G2. Co m pute a new thresho l d va l ue T=( 1 / 2 )(m e a n 1 +mea n 2 ) Repeat steps 2 through 4 until difference in T in successive iterations is smaller than a predef ined paramet e r T .
Gray Scale Image - Bi m odal Image of rice with black background I mage S e gm e n t a t ion S L I DE 21 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition
S e gmented Image Image histogram of rice I mage S e gm e n t a t ion S L I DE 22 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition Image after segmentation
Images having uneven illumination makes it difficult to segment using histogram, this approach is to divide the original image into sub images and use the thresholding process to each of the sub images. I mage S e gm e n t a t ion S L I DE 23 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition Basic Adaptive Thresholding:
Multimodal Histog r am I mage S e gm e n t a t ion S L I DE 24 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition If there are three or more dominant modes in the image histogram, the histogram has to be partitioned by multiple thresholds. Multilevel thresholding classifies a point (x,y) as belonging to one object class i f T 1 < (x,y) <= T 2 , to the other object class i f f ( x , y) > T 2 a n d t o th e back g round i f f ( x , y) < = T 1 .
Gray Scale Image - Multimodal Original Image of Lena I mage S e gm e n t a t ion S L I DE 25 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition
Multimodal Histog r am Histogram of Lena I mage S e gm e n t a t ion S L I DE 26 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition
S e gmented Image Image after segmentation – we get a outline of her face, hat, shadow etc I mage S e gm e n t a t ion S L I DE 27 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition
Color Im a ge - bim o dal Colour Image having a bimodal histogram I mage S e gm e n t a t ion S L I DE 28 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition
Histog r am Histograms for the three colour spaces I mage S e gm e n t a t ion S L I DE 29 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition
S e gmented Image Segmented image, skin color is shown I mage S e gm e n t a t ion S L I DE 30 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition
Pro blem of Segmen t ation I mage S e gm e n t a t ion S L I DE 31 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition The goal of Image Segmentation is to find regions that represent objects or meaningful parts of objects. Major problems of image segmentation are result of noise in the image; Now, we have to implement segmentation algorithm in Matlab
NEXT WEEK Morp h ologic a l Im a ge Proces s ing I mage S e gm e n t a t ion S L I DE 32 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition
Question and A n swer Session I mage S e gm e n t a t ion S L I DE 33 CT036-3-3-IPPR: Image Processing, Computer Vision and Pattern Recognition Q & A