Image Processing. Bilkent University. CS554 Computer Vision Pinar Duygulu

Similar documents
Binary Image Analysis. Binary Image Analysis. What kinds of operations? Results of analysis. Useful Operations. Example: red blood cell image

From Pixels to Blobs

CS443: Digital Imaging and Multimedia Binary Image Analysis. Spring 2008 Ahmed Elgammal Dept. of Computer Science Rutgers University

CS534 Introduction to Computer Vision Binary Image Analysis. Ahmed Elgammal Dept. of Computer Science Rutgers University

EE 584 MACHINE VISION

Processing of binary images

Binary Image Processing. Introduction to Computer Vision CSE 152 Lecture 5

EE795: Computer Vision and Intelligent Systems

Previously. Edge detection. Today. Thresholding. Gradients -> edges 2/1/2011. Edges and Binary Image Analysis

CITS 4402 Computer Vision

Edges and Binary Images

Edges and Binary Image Analysis April 12 th, 2018

EECS490: Digital Image Processing. Lecture #22

[ ] Review. Edges and Binary Images. Edge detection. Derivative of Gaussian filter. Image gradient. Tuesday, Sept 16

Filtering and Enhancing Images

Digital Image Processing COSC 6380/4393

Analysis of Binary Images

Counting Particles or Cells Using IMAQ Vision

C E N T E R A T H O U S T O N S C H O O L of H E A L T H I N F O R M A T I O N S C I E N C E S. Image Operations I

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

Image Analysis Lecture Segmentation. Idar Dyrdal

Morphological Image Processing

EE 701 ROBOT VISION. Segmentation

COMPUTER AND ROBOT VISION

Robot vision review. Martin Jagersand

Digital Image Processing. Prof. P.K. Biswas. Department of Electronics & Electrical Communication Engineering

09/11/2017. Morphological image processing. Morphological image processing. Morphological image processing. Morphological image processing (binary)

Region-based Segmentation

CSE 152 Lecture 7. Intro Computer Vision

CS4733 Class Notes, Computer Vision

CHAPTER 3 IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN

Edges and Binary Image Analysis. Thurs Jan 26 Kristen Grauman UT Austin. Today. Edge detection and matching

Binary Image Proc: week 2

Morphological Image Processing

Announcements. Binary Image Processing. Binary System Summary. Histogram-based Segmentation. How do we select a Threshold?

Image Segmentation. Schedule. Jesus J Caban 11/2/10. Monday: Today: Image Segmentation Topic : Matting ( P. Bindu ) Assignment #3 distributed

ECG782: Multidimensional Digital Signal Processing

Morphological Image Processing

Segmentation

Segmentation

Topic 6 Representation and Description

Problem definition Image acquisition Image segmentation Connected component analysis. Machine vision systems - 1

ECG782: Multidimensional Digital Signal Processing

Operators-Based on Second Derivative double derivative Laplacian operator Laplacian Operator Laplacian Of Gaussian (LOG) Operator LOG

Morphological Image Processing

Image Analysis Image Segmentation (Basic Methods)

Image Processing Fundamentals. Nicolas Vazquez Principal Software Engineer National Instruments

Vivekananda. Collegee of Engineering & Technology. Question and Answers on 10CS762 /10IS762 UNIT- 5 : IMAGE ENHANCEMENT.

VC 16/17 TP5 Single Pixel Manipulation

Motivation. Gray Levels

Mathematical Morphology and Distance Transforms. Robin Strand

6. Object Identification L AK S H M O U. E D U

Idea. Found boundaries between regions (edges) Didn t return the actual region

Lecture 2 Image Processing and Filtering

Image processing. Reading. What is an image? Brian Curless CSE 457 Spring 2017

Introduction. Computer Vision & Digital Image Processing. Preview. Basic Concepts from Set Theory

Biometrics Technology: Image Processing & Pattern Recognition (by Dr. Dickson Tong)

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

Biomedical Image Analysis. Mathematical Morphology

EXAM SOLUTIONS. Image Processing and Computer Vision Course 2D1421 Monday, 13 th of March 2006,

C E N T E R A T H O U S T O N S C H O O L of H E A L T H I N F O R M A T I O N S C I E N C E S. Image Operations II

Sampling and Reconstruction

Announcements. Analysis of Binary Images. Color Reflectance

Reading. 2. Fourier analysis and sampling theory. Required: Watt, Section 14.1 Recommended:

Chapter 3: Intensity Transformations and Spatial Filtering

Histograms. h(r k ) = n k. p(r k )= n k /NM. Histogram: number of times intensity level rk appears in the image

Connected components - 1

Digital Image Fundamentals

Image Segmentation. Selim Aksoy. Bilkent University

Image Segmentation. Selim Aksoy. Bilkent University

Texture. Texture is a description of the spatial arrangement of color or intensities in an image or a selected region of an image.

Massachusetts Institute of Technology. Department of Computer Science and Electrical Engineering /6.866 Machine Vision Quiz I

CSE 152 Lecture 7` Intro Computer Vision

Motivation. Intensity Levels

Filtering Images. Contents

Final Exam Schedule. Final exam has been scheduled. 12:30 pm 3:00 pm, May 7. Location: INNOVA It will cover all the topics discussed in class

(Refer Slide Time 00:17) Welcome to the course on Digital Image Processing. (Refer Slide Time 00:22)

Introduction to Medical Imaging (5XSA0) Module 5

Announcements. The principle of trichromacy. Color Matching Functions. The appearance of colors

Types of Edges. Why Edge Detection? Types of Edges. Edge Detection. Gradient. Edge Detection

morphology on binary images

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

EE795: Computer Vision and Intelligent Systems

Image segmentation. Stefano Ferrari. Università degli Studi di Milano Methods for Image Processing. academic year

Image Analysis. Morphological Image Analysis

EECS490: Digital Image Processing. Lecture #17

Topic 4 Image Segmentation

Chapter 9 Morphological Image Processing

Chapter - 2 : IMAGE ENHANCEMENT

Machine vision. Summary # 5: Morphological operations

Ulrik Söderström 16 Feb Image Processing. Segmentation

Edge and Texture. CS 554 Computer Vision Pinar Duygulu Bilkent University

Lecture 4: Spatial Domain Transformations

Digital Image Processing

Digital Image Processing Chapter 11: Image Description and Representation

Image Acquisition + Histograms

Basic relations between pixels (Chapter 2)

Image Enhancement: To improve the quality of images

Local Features: Detection, Description & Matching

CS 490: Computer Vision Image Segmentation: Thresholding. Fall 2015 Dr. Michael J. Reale

Transcription:

Image Processing CS 554 Computer Vision Pinar Duygulu Bilkent University

Today Image Formation Point and Blob Processing Binary Image Processing Readings: Gonzalez & Woods, Ch. 3 Slides are adapted from Alyosha Efros and Shapiro & Stockman 2

3 Imaging Process

Image Formation 4

Sampling and Quantization 5

Sampling and Quantization 6

What is an image? We can think of an image as a function, f, from R2 to R: f( x, y ) gives the intensity at position ( x, y ) Realistically, we expect the image only to be defined over a rectangle, with a finite range: f: [a,b]x[c,d] [,] A color image is just three functions pasted together. We can write this as a vector-valued function: f(x,y) = [r(x,y) g(x,y) b(x,y)] 7

Images as functions 8

What is a digital image? We usually operate on digital (discrete) images: Sample the 2D space on a regular grid Quantize each sample (round to nearest integer) If our samples are apart, we can write this as: f[i,j] = Quantize{ f(i, j ) } The image can now be represented as a matrix of integer values 9

Point Processing An image processing operation typically defines a new image g in terms of an existing image f. The simplest kind of range transformations are these independent of position x,y: g = t(f) This is called point processing. Important: every pixel for himself spatial information completely lost!

Basic Point Processing

Negative 2

Image Enhancement 3

Contrast Streching 4

Image Histograms 5

Neighborhood Processing (filtering) Q: What happens if I reshuffle all pixels within the image? A: It s histogram won t change. No point processing will be affected Need spatial information to capture this. 6

Goal: Extract Blobs What are blobs? Regions of an image that are somehow coherent Why? Object extraction, object removal, compositing, etc. but are blobs objects? No, not in general 7

8 Blob s coherence Simplest way to define blob coherence is as similarity in brightness or color: The tools become blobs The house, grass, and sky make different blobs

9 The meaning of a blob Other interpretations of blobs are possible, depending on how you define the input image: Image can be a response of a particular detector Color Detector Face detector Motion Detector Edge Detector gx2+gy2

2 Why is this useful? AIBO RoboSoccer (VelosoLab)

Ideal Segmentation 2

Result of Segmentation 22

Thresholding Basic segmentation operation: mask(x,y) = if im(x,y) > T mask(x,y) = if im(x,y) < T T is threshold User-defined Or automatic Same as histogram partitioning: 23

24 As Edge Detection gx2+gy2 gx2+gy2 > T

25 Sometimes works well What are potential Problems?

but more often not Adaptive thresholding 26

Region growing Start with initial set of pixels K Add to K any neighbors, if they are within similarity threshold Repeat until nothing changes Is this same as global threshold? What can go wrong? 27

Color-Based Blob Segmentation Automatic Histogram Partitioning Given image with N colors, choose K Each of the K colors defines a region not necessarily contiguous Performed by computing color histogram, looking for modes This is what happens when you downsample image color range, for instance in Photoshop 28

29 Finding modes in a histogram

3 Mean-Shift (Comaniciu & Meer)

3 Mean-Shift (Comaniciu & Meer)

Issues: Although often useful, all these approaches work only some of the time, and are considered rather hacky. Can t even handle our tiger: Problem is that blobs!= objects! 32

Binary Image Processing Binary images are handy in many cases (sprite extraction, compositing, etc). Binary image processing is a well-studied field, based on set theory, called Mathematical Morphology consists of a set of image analysis operations that are used to produce or process binary images, usually images of s and s. represents the background represents the foreground 33

34 Application Areas Document Analysis Industrial Inspection Medical Imaging

35 Operations Separate objects from background and from one another Aggregate pixels for each object Compute features for each object

36 Example red blood cell image Many blood cells are separate objects Many touch to each other bad! Salt and pepper noise from thresholding How usable is this data? 63 separate objects detected Single cells have area about 5 Noise spots Gobs of cells

37 More controlled images More uniform objects More uniform background Objects actually separated 5 objects detected Location known Area known 3 distinct clusters of 5 values of area; 85, 45, 293

38 Thresholding Binary images can be obtained from gray level images by thresholding

39 Assumptions for thresholding Object region of interest has intensity distribution different from background Region pixel likely to be identified by intensity alone: intensity > a intensity < b a < intensity < b Works OK with flat-shaded scenes or engineered scenes. Does not work well with natural scenes.

4 Use of histograms for threshold selection Cherry image with 3 regions Background is black Healthy cherry is bright Bruise is medium dark Histogram shows two cherry regions (black background has been removed)

4 Histogram-directed thresholding How can we use a histogram to separate an image into 2 (or several) different regions? Is there a single clear threshold? 2? 3?

42 Choosing Threshold Detect peaks and valleys Two distinct modes Overlapped modes

43 Choosing threshold Find the deepest valley between two modes of bimodal histogram Fit two or more Gaussian curves to the histogram Dynamic thresholding

44 Cleaning up thresholding results Delete object pixels on boundary to better separate parts. Fill small holes Delete tiny objects (last 2 are salt-andpepper noise)

45 Mathematical Morphology Binary mathematical morphology consists of two basic operations dilation and erosion and several composite relations closing and opening conditional dilation...

46 Dilation Dilation expands the connected sets of s of a binary image. It can be used for. growing features 2. filling holes and gaps

47 Erosion Erosion shrinks the connected sets of s of a binary image. It can be used for. shrinking features 2. Removing bridges, branches and small protrusions

48 Structuring Elements A structuring element is a shape mask used in the basic morphological operations. They can be any shape and size that is digitally representable, and each has an origin. box hexagon box(length,width) disk disk(diameter) something

49 Dilation with structuring elements The arguments to dilation and erosion are. a binary image B 2. a structuring element S dilate(b,s) takes binary image B, places the origin of structuring element S over each -pixel, and ORs the structuring element S into the output image at the corresponding position. B S origin dilate B S

Dilation 5

Dilation 5

52 Erosion with structuring elements erode(b,s) takes a binary image B, places the origin of structuring element S over every pixel position, and ORs a binary into that position of the output image only if every position of S (with a ) covers a in B. origin B S erode B S

Erosion 53

54 Erosion Original image Eroded image

55 Erosion Eroded once Eroded twice

56 Opening and Closing Closing is the compound operation of dilation followed by erosion (with the same structuring element) Opening is the compound operation of erosion followed by dilation (with the same structuring element)

Opening and Closing 57

58 Example

59 Example 2: try B S

6 Opening and Closing OPENING: The original image eroded twice and dilated twice (opened). Most noise is removed CLOSING: The original image dilated and then eroded. Most holes are filled.

Opening and Closing 6

Boundary Extraction 62

Boundary Extraction 63

Region Filling 64

65 Connected Component Labeling Once you have a binary image, you can identify and then analyze each connected set of pixels. The connected components operation takes in a binary image and produces a labeled image in which each pixel has the integer label of either the background () or a component.

Extraction of Connected Components 66

67 Labeling shown as pseudo-color connected components of s from thresholded image connected components of cluster labels

68 Connectivity 4-neighborhood 8-neighborhood

69 Recursive labeling

First Step : Run Length Encoding Segment each image row into groups of similar pixels called runs Runs store a start and end point for each contiguous row of color Original image RLE image 7

Second Step : Merging Regions 7

Final Results Runs are merged into multi-row regions Image is now described as contiguous regions instead of just pixels 72

Blob Properties Now that we have nice, clean blobs, what can we do with them? Compute Statistics: Area Perimeter Aspect ratio Center of mass best-fitting ellipse Average color Etc. All this can be used to classify blobs and decide if they hold the objects we are interested in. 73

74 Area an Centroid

75 Perimeter pixels and length

76 Circularity or elongation

77 Circularity as variance of radius

78 Bounding box

79 Second moments These are invariant to object location in the image.

8 Axis of least inertia An axis which we could spin the pixels with least energy input The axis about which the pixels have least second moment

8 Region Adjacency Graph A region adjacency graph (RAG) is a graph in which each node represents a region of the image and an edge connects two nodes if the regions are adjacent.