Image Processing (2) Point Operations and Local Spatial Operations

Similar documents
Image Processing (1) Basic Concepts and Introduction of OpenCV

Cameras and Image Sensors

Cameras and Image Sensors

Digital Image Processing. Image Enhancement - Filtering

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

Filtering and Enhancing Images

Lecture 4: Image Processing

Biomedical Image Analysis. Spatial Filtering

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

Classification of image operations. Image enhancement (GW-Ch. 3) Point operations. Neighbourhood operation

Broad field that includes low-level operations as well as complex high-level algorithms

EE795: Computer Vision and Intelligent Systems

EECS 556 Image Processing W 09. Image enhancement. Smoothing and noise removal Sharpening filters

Babu Madhav Institute of Information Technology Years Integrated M.Sc.(IT)(Semester - 7)

Image features. Image Features

What will we learn? Neighborhood processing. Convolution and correlation. Neighborhood processing. Chapter 10 Neighborhood Processing

Lecture 6: Edge Detection

Image Processing. Traitement d images. Yuliya Tarabalka Tel.

Visual Tracking (1) Tracking of Feature Points and Planar Rigid Objects

Visual Tracking (1) Pixel-intensity-based methods

Introduction. Introduction. Related Research. SIFT method. SIFT method. Distinctive Image Features from Scale-Invariant. Scale.

Outlines. Medical Image Processing Using Transforms. 4. Transform in image space

Image Processing. BITS Pilani. Dr Jagadish Nayak. Dubai Campus

Chapter 3: Intensity Transformations and Spatial Filtering

EEM 463 Introduction to Image Processing. Week 3: Intensity Transformations

Digital Image Processing, 2nd ed. Digital Image Processing, 2nd ed. The principal objective of enhancement

ME/CS 132: Introduction to Vision-based Robot Navigation! Low-level Image Processing" Larry Matthies"

Lecture 4: Spatial Domain Transformations

Coarse-to-fine image registration

Digital Image Processing. Image Enhancement in the Spatial Domain (Chapter 4)

2D Image Processing INFORMATIK. Kaiserlautern University. DFKI Deutsches Forschungszentrum für Künstliche Intelligenz

CS 534: Computer Vision Texture

Image Segmentation Image Thresholds Edge-detection Edge-detection, the 1 st derivative Edge-detection, the 2 nd derivative Horizontal Edges Vertical

Image gradients and edges April 11 th, 2017

Image gradients and edges April 10 th, 2018

SIFT - scale-invariant feature transform Konrad Schindler

COMPUTER VISION > OPTICAL FLOW UTRECHT UNIVERSITY RONALD POPPE

The SIFT (Scale Invariant Feature

Comparison between Various Edge Detection Methods on Satellite Image

Edge Detection (with a sidelight introduction to linear, associative operators). Images

3.4& Fundamentals& mechanics of spatial filtering(page 166) Spatial filter(mask) Filter coefficients Filter response

Feature Extraction and Image Processing, 2 nd Edition. Contents. Preface

CS334: Digital Imaging and Multimedia Edges and Contours. Ahmed Elgammal Dept. of Computer Science Rutgers University

SYDE 575: Introduction to Image Processing

CHAPTER 3 IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN

ECG782: Multidimensional Digital Signal Processing

Local Image preprocessing (cont d)

To Do. Advanced Computer Graphics. Discrete Convolution. Outline. Outline. Implementing Discrete Convolution

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

Computer Vision: 4. Filtering. By I-Chen Lin Dept. of CS, National Chiao Tung University

An Introduc+on to Mathema+cal Image Processing IAS, Park City Mathema2cs Ins2tute, Utah Undergraduate Summer School 2010

Scale Invariant Feature Transform

Filtering Images. Contents

Biomedical Image Analysis. Point, Edge and Line Detection

Image Enhancement in Spatial Domain (Chapter 3)

Anno accademico 2006/2007. Davide Migliore

Fractional Discrimination for Texture Image Segmentation

Feature Detection and Matching

Computer Vision 2. SS 18 Dr. Benjamin Guthier Professur für Bildverarbeitung. Computer Vision 2 Dr. Benjamin Guthier

Edge and local feature detection - 2. Importance of edge detection in computer vision

CS4733 Class Notes, Computer Vision

CS534: Introduction to Computer Vision Edges and Contours. Ahmed Elgammal Dept. of Computer Science Rutgers University

PERFORMANCE ANALYSIS OF CANNY AND OTHER COMMONLY USED EDGE DETECTORS Sandeep Dhawan Director of Technology, OTTE, NEW YORK

Scale Invariant Feature Transform

ECEN 447 Digital Image Processing

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

School of Computing University of Utah

Linear Operations Using Masks

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

Fundamentals of Digital Image Processing

Image gradients and edges

Image Processing (1) Basic Concepts and Introduction of OpenCV

Edge detection. Stefano Ferrari. Università degli Studi di Milano Elaborazione delle immagini (Image processing I)

ECG782: Multidimensional Digital Signal Processing

Neighborhood operations

JNTUWORLD. 4. Prove that the average value of laplacian of the equation 2 h = ((r2 σ 2 )/σ 4 ))exp( r 2 /2σ 2 ) is zero. [16]

INTENSITY TRANSFORMATION AND SPATIAL FILTERING

Texture. Outline. Image representations: spatial and frequency Fourier transform Frequency filtering Oriented pyramids Texture representation

Why is computer vision difficult?

Chapter 3 Image Enhancement in the Spatial Domain

EECS150 - Digital Design Lecture 14 FIFO 2 and SIFT. Recap and Outline

Texture. Frequency Descriptors. Frequency Descriptors. Frequency Descriptors. Frequency Descriptors. Frequency Descriptors

Outline 7/2/201011/6/

Sobel Edge Detection Algorithm

CHAPTER 1 Introduction 1. CHAPTER 2 Images, Sampling and Frequency Domain Processing 37

Sharpening through spatial filtering

Filtering Applications & Edge Detection. GV12/3072 Image Processing.

A Total Variation-Morphological Image Edge Detection Approach

CAP 5415 Computer Vision Fall 2012

Robotics Programming Laboratory

Computer Vision. Recap: Smoothing with a Gaussian. Recap: Effect of σ on derivatives. Computer Science Tripos Part II. Dr Christopher Town

Segmentation and Grouping

Computer Vision I. Announcements. Fourier Tansform. Efficient Implementation. Edge and Corner Detection. CSE252A Lecture 13.

CS 4495 Computer Vision. Linear Filtering 2: Templates, Edges. Aaron Bobick. School of Interactive Computing. Templates/Edges

Feature descriptors. Alain Pagani Prof. Didier Stricker. Computer Vision: Object and People Tracking

Announcements. Edge Detection. An Isotropic Gaussian. Filters are templates. Assignment 2 on tracking due this Friday Midterm: Tuesday, May 3.

Denoising and Edge Detection Using Sobelmethod

Filtering Images in the Spatial Domain Chapter 3b G&W. Ross Whitaker (modified by Guido Gerig) School of Computing University of Utah

IT Digital Image ProcessingVII Semester - Question Bank

SURVEY ON IMAGE PROCESSING IN THE FIELD OF DE-NOISING TECHNIQUES AND EDGE DETECTION TECHNIQUES ON RADIOGRAPHIC IMAGES

Transcription:

Intelligent Control Systems Image Processing (2) Point Operations and Local Spatial Operations Shingo Kagami Graduate School of Information Sciences, Tohoku University swk(at)ic.is.tohoku.ac.jp http://www.ic.is.tohoku.ac.jp/ja/swk/

Image Processing Classification input image output image (2-D data) example image to image processing Fourier trans., label image 1-D data projection, histogram scalar values position, recognition image sequence image sequence image 1-D data scalar motion image processing 2

Outline Image to Image Processing Point Operations Local Operations 3

Image to Image image image { F x,y } { G x,y } point operation G i,j depends only on F i,j local operation / neighboring operation G i,j depends on pixels within some neighborhood of F i,j global operation G i,j depends on almost all the pixels in { F i,j } 4

Point Operation Examples pixel value conversion, color conversion e.g.: binarization, pixel value inversion, gamma correction cv::mat input, output1, output2; cv::threshold(input, output1, 128, 255, THRESH_BINARY); cv::equalizehist(input, output2); (Handling of color images will be explained next week) 5

Implementation for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { output.at<uchar>(j, i) = some_func(input.at<uchar>(j, i)); } } uchar some_func(uchar val) { } Note again: img.at<uchar>(j, i) is an 8-bit value of the pixel at x = i, y = j 6

Pixel value conversion example 255 output value 0 p1 p2 input value 7

Histogram (of pixel values) H(u) 3000 2500 2000 1500 1000 500 0 0 50 100 150 200 250 u where S(u) is a set of pixels having values belonging to the bin u 8

Outline Image to Image Processing Point Operations Local Operations 9

Local operation example: Spatial Filter G x,y depends on some neighborhood (e.g. 3 3, 5 5 pixels, etc.) of the point of interest (x,y) { F i,j }, (i, j) Neighbor(x,y) G x,y { F x,y } { G x,y } Typical examples: smoothing, edge detection 10

Important Example: Smoothing Output at (x, y): some representative value of the set of neighbor pixels around (x, y), e.g. mean, weighted mean, median Used for: e.g. noise reduction, scale-space processing { F i,j }, (i, j) Neighbor(x,y) G x,y 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/16 1/8 1/16 1/8 1/4 1/8 1/16 1/8 1/16 (mean) (weighted mean) 11

Linear Spatial Filtering Smoothing with (weighted) mean is an example of linear spatial filtering (while smoothing with median is nonlinear) Computed by convolving a weight matrix (filter coefficients, filter kernel, or mask) to input image { F i,j }, (i, j) Neighbor(x,y) G x,y pixel-wise multiplication { F x,y } and summation { G x,y } weight matrix 12

Examples of 3x3 smoothing weight matrices 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/10 1/10 1/10 1/10 1/5 1/10 1/10 1/10 1/10 0 1/8 0 1/8 1/2 1/8 0 1/8 0 = = = 1 1 1 1 1 1 1/9 1 1 1 1/10 1 2 1 1/8 1 1 1 1 1 1 0 1 0 1 4 1 0 1 0 13

Linear filtering example cv::mat weight = (cv::mat_<float>(3,3) << 0, 1, 0, 1, 4, 1, 0, 1, 0); weight = weight / 8.0f; convenient way of matrix initialization cv::filter2d(input, output, CV_8U, weight); Or, very common filters are readily available cv::gaussianblur(input, output, cv::size(0, 0), 10.0); cv::sobel(input, output, CV_8U, 1, 0); cv::laplacian(input, output, CV_8U); 14

Implementation of 3x3 linear filtering cv::mat input, output; cv::mat weight = (cv::mat_<int>(3,3) << 0, 1, 0, 1, 4, 1, 0, 1, 0); int normalizer = 8; for (j = 1; j < height - 1; j++) { for (i = 1; i < width - 1; i++) { int sum = 0; for (n = 0; n < 3; n++) { for (m = 0; m < 3; m++) { sum += weight.at<int>(n, m) } } } } boundary handling (just untouched) * input.at<uchar>(j - 1 + n, i - 1 + m); Note: center coordinate of weight is not (0, 0) but (1, 1) output.at<uchar>(j, i) = saturate(sum / normalizer); make sure the pixel value is in [0, 255] 15

Gaussian: most widely used smoothing kernel separable in x and y Discretized in space for computation Coefficient values are sometimes rounded to integer (for efficiency) Amount of smoothing can be controlled by parameter ¾ (large ¾ requires large matrix size) 16

Frequency-domain understanding : 2-D discrete Fourier transform 0 1 0 1 4 1 0 1 0 (zero-padded to 256x256 and) Recall: Fourier transform of Gaussian function is Gaussian 17

Why Gaussian is preferred for smoothing Several explanations are possible. For example: Receptive fields in mammalian retina and visual cortex have similar characteristics Gaussian is ideal in that the product of standard deviations in spatial and frequency domains is minimal [Marr and Hildreth 1980] When convolved to 1D signals, Gaussian is the unique kernel that never creates new local extrema and satisfies some other good properties (but not in 2D) [Babaud 1986] [Lindeberg 1994] For 2D or more dimensional signals, Gaussian is the unique kernel that is linear, shift invariant, scale invariant, isotropic, separable and has a semi-group structure [Florack et al. 1992] 18

Florack s proof (simplified) p(x): original image, p(x, t): smoothed image by amount t = t(¾), ¾: scale parameter with dimension of length Linear, shift invariant ) Scale invariant ) H must be described by normalized frequency, and t must be homogeneous function of ¾: Istropic ) described by the magnitude (Euclidean norm) of frequency Semi-group structure ) successive smoothing by two filters is represented by another smoothing filter Separable ) 19

Edge Detection Spatial differentiation (approximated by finite difference) 0 0 0-1 0 1 0 0 0 0-1 0 0 0 0 0 1 0 1 st order diff. in x direction 1 st order diff. in y direction Often combined with smoothing: -1 0 1-2 0 2-1 0 1 Sobel filter in x direction -1-2 -1 0 0 0 1 2 1 Sobel filter in y direction 20

Edge detection by 2 nd order derivative Edge = zero crossing of 2 nd order derivative Laplacian 2 / x 2 + 2 / y 2 is the lowest-order isotropic differential operator does not depend on direction of edges Laplacian operator is realized by adding 2 nd order differentials f i+1 2 f i + f i 1 of x and y directions 0 1 0 1 4 1 0 1 0 21

Sharpening Subtract the Laplacian image from the original image to yield an edge-enhanced image 0 0 0 0 1 0 0 0 0 0 1 0 1 4 1 = 0 1 0 0-1 0-1 5-1 0-1 0 22

Frequency-domain visualization Laplacian: 0 1 0 1-4 1 0 1 0 Sobel: 1 2 1 0 0 0-1 -2-1 DC in y direction highest frequency in y direction Q: Why is Sobel a band-pass filter instead of high-pass? 23

Summary Image to Image processing Point operations e.g.: pixel value conversion concept of histogram Local operations linear spatial filters (cf. nonlinear filters) smoothing edge detection sharpening frequency domain understanding uniqueness of Gaussian 24

References R. Szeliski: Computer Vision: Algorithms and Applications, Springer, 2010. A. Hornberg eds.: Handbook of Machine Vision, Wiley-VCH, 2006. G. Bradski and A. Kaebler: Learning OpenCV, O Reilly, 2008. OpenCV Documentation: http://docs.opencv.org/index.html T. Lindeberg: Scale-space theory: A basic to ol for analysing structures at different scales, J. Applied Statistics, vol. 21, no. 2, pp.225-270, 1994. L. M. J. Florack, B. M. T. Romeny, J. J. Koenderink and M. A. Viergever: Scale and the Differential Structure of Images, Image and Vision Computing, vol.10, no.6, pp.376-388, 1992. (in Japanese) ディジタル画像処理編集委員会, ディジタル画像処理, CG-ARTS 協会, 2015. 田村 : コンピュータ画像処理, オーム社, 2002. Sample codes are available at http://www.ic.is.tohoku.ac.jp/~swk/lecture/ 25