Image analysis. CS/CME/BioE/Biophys/BMI 279 Oct. 31 and Nov. 2, 2017 Ron Dror

Similar documents
Image analysis. CS/CME/BioE/Biophys/BMI 279 Oct. 31 and Nov. 2, 2017 Ron Dror

Image analysis. CS/CME/BIOPHYS/BMI 279 Fall 2015 Ron Dror

CSC 320 H1S CSC320 Exam Study Guide (Last updated: April 2, 2015) Winter 2015

CoE4TN4 Image Processing. Chapter 3: Intensity Transformation and Spatial Filtering

Image Enhancement using Histogram Equalization and Spatial Filtering

CS534 Introduction to Computer Vision. Linear Filters. Ahmed Elgammal Dept. of Computer Science Rutgers University

Digital Image Processing

Image Filtering. Median Filtering

Image Denoising Using Statistical and Non Statistical Method

Non Linear Image Enhancement

ECC419 IMAGE PROCESSING

Frequency Domain Enhancement

The Use of Non-Local Means to Reduce Image Noise

An Efficient Noise Removing Technique Using Mdbut Filter in Images

EE482: Digital Signal Processing Applications

Microscopy. CS/CME/BioE/Biophys/BMI 279 Nov. 2, 2017 Ron Dror

Filtering in the spatial domain (Spatial Filtering)

Image processing for gesture recognition: from theory to practice. Michela Goffredo University Roma TRE

A Spatial Mean and Median Filter For Noise Removal in Digital Images

Filip Malmberg 1TD396 fall 2018 Today s lecture

CSE 564: Scientific Visualization

Image Processing. Adam Finkelstein Princeton University COS 426, Spring 2019

Practical Image and Video Processing Using MATLAB

Image Enhancement in spatial domain. Digital Image Processing GW Chapter 3 from Section (pag 110) Part 2: Filtering in spatial domain

Prof. Feng Liu. Winter /10/2019

>>> from numpy import random as r >>> I = r.rand(256,256);

A Study On Preprocessing A Mammogram Image Using Adaptive Median Filter

Grayscale and Resolution Tradeoffs in Photographic Image Quality. Joyce E. Farrell Hewlett Packard Laboratories, Palo Alto, CA

MATLAB 6.5 Image Processing Toolbox Tutorial

Preparing Remote Sensing Data for Natural Resources Mapping (image enhancement, rectifications )

Digital Image Processing

CSE 564: Visualization. Image Operations. Motivation. Provide the user (scientist, t doctor, ) with some means to: Global operations:

Achim J. Lilienthal Mobile Robotics and Olfaction Lab, AASS, Örebro University

IMAGE ENHANCEMENT IN SPATIAL DOMAIN

Image Enhancement contd. An example of low pass filters is:

Digital Image Processing Labs DENOISING IMAGES

Digital Image Processing 3/e

Chapter 3. Study and Analysis of Different Noise Reduction Filters

Sensors and Sensing Cameras and Camera Calibration

Keywords Fuzzy Logic, ANN, Histogram Equalization, Spatial Averaging, High Boost filtering, MSE, RMSE, SNR, PSNR.

Efficient Target Detection from Hyperspectral Images Based On Removal of Signal Independent and Signal Dependent Noise

LAB MANUAL SUBJECT: IMAGE PROCESSING BE (COMPUTER) SEM VII

Computer Graphics. Si Lu. Fall er_graphics.htm 10/02/2015

Lane Detection in Automotive

Removal of High Density Salt and Pepper Noise through Modified Decision based Un Symmetric Trimmed Median Filter

Target detection in side-scan sonar images: expert fusion reduces false alarms

Image acquisition. Midterm Review. Digitization, line of image. Digitization, whole image. Geometric transformations. Interpolation 10/26/2016

1.Discuss the frequency domain techniques of image enhancement in detail.

DIGITAL IMAGE DE-NOISING FILTERS A COMPREHENSIVE STUDY

An Efficient Nonlinear Filter for Removal of Impulse Noise in Color Video Sequences

Motivation: Image denoising. How can we reduce noise in a photograph?

Evaluation of image quality of the compression schemes JPEG & JPEG 2000 using a Modular Colour Image Difference Model.

Image Processing for feature extraction

Chapter 4 SPEECH ENHANCEMENT

Removal of Line Noise Component from EEG Signal

Chapter 6. [6]Preprocessing

Lecture 4: Spatial Domain Processing and Image Enhancement

Session 5 Variation About the Mean

Image Denoising using Filters with Varying Window Sizes: A Study

Processing and Enhancement of Palm Vein Image in Vein Pattern Recognition System

Part I Feature Extraction (1) Image Enhancement. CSc I6716 Spring Local, meaningful, detectable parts of the image.

SECTION I - CHAPTER 2 DIGITAL IMAGING PROCESSING CONCEPTS

Image Enhancement. DD2423 Image Analysis and Computer Vision. Computational Vision and Active Perception School of Computer Science and Communication

Noise Reduction Technique in Synthetic Aperture Radar Datasets using Adaptive and Laplacian Filters

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

Image Processing by Bilateral Filtering Method

Study guide for Graduate Computer Vision

Introduction to Image Analysis with

8.2 IMAGE PROCESSING VERSUS IMAGE ANALYSIS Image processing: The collection of routines and

Vision Review: Image Processing. Course web page:

COMPARITIVE STUDY OF IMAGE DENOISING ALGORITHMS IN MEDICAL AND SATELLITE IMAGES

Performance Comparison of Mean, Median and Wiener Filter in MRI Image De-noising

Computer Vision, Lecture 3

Introduction. Computer Vision. CSc I6716 Fall Part I. Image Enhancement. Zhigang Zhu, City College of New York

TIRF, geometric operators

Head, IICT, Indus University, India

Image Denoising Using Different Filters (A Comparison of Filters)

APJIMTC, Jalandhar, India. Keywords---Median filter, mean filter, adaptive filter, salt & pepper noise, Gaussian noise.

Literature Survey On Image Filtering Techniques Jesna Varghese M.Tech, CSE Department, Calicut University, India

Image Processing Computer Graphics I Lecture 20. Display Color Models Filters Dithering Image Compression

RELEASING APERTURE FILTER CONSTRAINTS

Performance Analysis of Average and Median Filters for De noising Of Digital Images.

Image Processing COS 426

Part 2: Fourier transforms. Key to understanding NMR, X-ray crystallography, and all forms of microscopy

EE 791 EEG-5 Measures of EEG Dynamic Properties

Image Deblurring and Noise Reduction in Python TJHSST Senior Research Project Computer Systems Lab

Chrominance Assisted Sharpening of Images

Antennas and Propagation. Chapter 6b: Path Models Rayleigh, Rician Fading, MIMO

Image Filtering Josef Pelikán & Alexander Wilkie CGG MFF UK Praha

Imaging Particle Analysis: The Importance of Image Quality

Digital Image Processing

FUZZY BASED MEDIAN FILTER FOR GRAY-SCALE IMAGES

IMAGE PROCESSING: AREA OPERATIONS (FILTERING)

Motivation: Image denoising. How can we reduce noise in a photograph?

Image De-noising Using Linear and Decision Based Median Filters

Instruction Manual. Mark Deimund, Zuyi (Jacky) Huang, Juergen Hahn

Image Denoising with Linear and Non-Linear Filters: A REVIEW

Multiresolution Analysis of Connectivity

Computer Vision. Howie Choset Introduction to Robotics

I. INTRODUCTION II. EXISTING AND PROPOSED WORK

Transcription:

Image analysis CS/CME/BioE/Biophys/BMI 279 Oct. 31 and Nov. 2, 2017 Ron Dror 1

Outline Images in molecular and cellular biology Reducing image noise Mean and Gaussian filters Frequency domain interpretation Median filter Sharpening images Image description and classification Practical image processing tips 2

Images in molecular and cellular biology 3

Most of what we know about the structure of cells come from imaging Light microscopy, including fluorescence microscopy Fluorescence microscopy is where you label particular proteins or other targets with a molecule that glows, so you can distinguish that specific target from everything else in the image. https:// www.microscopyu.com/ articles/livecellimaging/ livecellmaintenance.html Electron microscopy In fact, some techniques we ll discuss later on require you to do lots of computation BEFORE you can even see the picture. http:// blog.library.gsu.edu/ wp-content/uploads/ 2010/11/mtdna.jpg 4

Imaging is pervasive in structural biology The experimental techniques used to determine macromolecular (e.g., protein) structure also depend on imaging X-ray crystallography Single-particle cryo-electron microscopy https://askabiologist.asu.edu/sites/default/ files/resources/articles/crystal_clear/ CuZn_SOD_C2_x-ray_diffraction_250.jpg http://debkellylab.org/?page_id=94 5

Computation plays an essential role in these imaging-based techniques We will start with analysis of microscopy data, because it s closest to our everyday experience with images In fact, the basic image analysis techniques we ll cover initially also apply to normal photographs 6

Representations of an image Recall that we can think of a grayscale image as: A function of two variables (x and y) A two-dimensional array of brightness values A matrix (of brightness values) A color image can be treated as: Three separate images, one for each color channel (red, green, blue) A function that returns three values (red, green, blue) for each (x, y) pair By the way, why do we use three color channels? because we only have three kinds of cones in our eyes that detect color, so three channels are sufficient to describe the colors we perceive. y x Whereas Einstein proposed the concept of mass-energy equivalence, Professor Mihail Nazarov, 66, proposed monkey-einstein equivalence. From http://www.nydailynews.com/news/world/baby-monkey-albert-einstein-article-1.1192365 7

Reducing image noise 8

Experimentally determined images are always corrupted by noise Noise means any deviation from what the image would ideally look like http://www.siox.org/pics/pferd-noisy.jpg 9

There are many different kinds of noise, which depends on how you re making the measurement. Two common kinds are gaussian noise or salt and pepper noise Original image Image noise Noisy images Gaussian noise : normally distributed noise added to each pixel How would you de-noise images like this? For each pixel, maybe average the values of nearby pixels. Salt and peper noise : random pixels replaced by very bright or dark values 10

Reducing image noise Mean and Gaussian filters 11

How can we reduce the noise in an image? The simplest way is to use a mean filter Replace each pixel by the average of a set of pixels surrounding it For example, a 3x3 mean filter replaces each pixel with the average of a 3x3 square of pixels This is equivalent to convolving the image with a 3x3 matrix: 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 = 1 9 1 1 1 1 1 1 1 1 1 Why 1/9? Values should sum to 1, so that overall brightness of the image remains constant Or you could use 5x5 matrix, or larger. 4x4 is trickier because then you can t center it around the target pixel. For corner/edge pixels, just average the existing surrounding pixels and ignore missing ones. 12

After the mean filter, noise is lower but images are blurrier. Blurring comes from averaging at the boundaries between two colors. As the filter size becomes bigger, you reduce the noise more because you re averaging over more pixels, but you also blur the image more. If you know that your image will consist of regions of solid colors, you can do fancier things that detect the edge locations. But you can t do this for many images, such as for images of cells. Original images Mean filter Result of 3x3 mean filter A larger filter (e.g., 5x5, 7x7) would further reduce noise, but would blur the image more 13

A better choice: use a smoother filter We can achieve a better tradeoff between noise reduction and distortion of the noise-free image by convolving the image with a smoother function One common choice is a (two-dimensional) Gaussian Rather than choosing exact filter size (3x3, 5x5, etc.), choose the Gaussian standard deviation σ (e.g. σ = 1 pixel, 2 pixels, etc.) 14

Gaussian filter Original images Result of Gaussian filter (standard deviation σ = 1 pixel) 15 Using a larger Gaussian would further reduce noise, but would blur the image more

Mean filter (for comparison) Original images Filtered images 16

Gaussian filter (for comparison) Original images Filtered images 17

Reducing image noise Frequency domain interpretation 18

Low-pass filtering Because the mean and Gaussian filters are convolutions, we can express them as multiplications in the frequency domain Both types of filters reduce high frequencies while preserving low frequencies. They are thus known as low-pass filters These filters work because real images have mostly low-frequency content, while noise tends to have a lot of high-frequency content In other words, most of the low frequency information in the noisy image comes from the real image, while most of the high frequency information in the noisy image comes from the noise. So if you reduce high frequencies in the image, you can preferentially reduce the noise. This is like re-weighting the frequency components so that the low frequency signal stays strong but the higher frequency signal is weakened. This is best done in Fourier space. 19

Low-pass filtering Gaussian filter Mean filter Filter in real domain Use a Fourier transform to go from the top images (real domain) to the bottom images (frequency domain). Note: Fourier transform of a Gaussian is another Gaussian Magnitude profile in frequency domain (low frequencies are near center of plots) The Gaussian filter eliminates high frequencies more effectively than the mean filter, making the Gaussian filter better by most measures. 20

Low-pass filtering As a filter becomes larger (wider), its Fourierdomain representation becomes narrower In other words, making a mean or Gaussian filter larger will make it more low-pass (i.e, narrow the range of frequencies it passes) Thus it will eliminate noise better, but blur the original image more 21

Reducing image noise Median filter 22

Median filter A median filter ranks the pixels in a square surrounding the pixel of interest, and picks the middle value This is particularly effective at eliminating noise that corrupts only a few pixel values (e.g., saltand-pepper noise) This filter is not a convolution 23

Median filter Original images Result of 3x3 median filter 24 Using a larger window would further reduce noise, but would distort the image more

Sharpening images 25

High-pass filter A high-pass filter removes (or reduces) low-frequency components of an image, but not high-frequency ones The simplest way to create a high-pass filter is to subtract a lowpass filtered image from the original image This removes the low frequencies but preserves the high ones The filter matrix itself can be computed by subtracting a low-pass filter matrix (that sums to 1) from an identity filter matrix (all zeros except for a 1 in the central pixel) Note: the grey color now corresponds to 0. Black/white values show up at changes (edges) in the original image Original image Low-pass filtered image High-pass filtered image = 26

https://upload.wikimedia.org/wikipedia/commons/0/0b/accutance_example.png How might one use a high-pass filter? To highlight edges in the image To remove any background brightness that varies smoothly across the image Image sharpening You don t want to actually filter out low-frequency stuff, because it contains the most important information. To sharpen the image, one can add a high-pass filtered version of the image (multiplied by a fractional scaling factor) to the original image This increases the high-frequency content relative to low-frequency content In photography, this is called unsharp masking Mild sharpening Stronger sharpening Original image (small scale factor) (larger scale factor) 27

Image sharpening another example Original image Sharpened image 28 http://www.exelisvis.com/docs/html/images/unsharp_mask_ex1.gif

Image description and classification 29

Describing images concisely The space of all possible images is very large. To fully describe an N-by-N pixel grayscale image, we need to specify N 2 pixel values. We can thus think of a single image as a point in an N 2 - dimensional space. Classifying and analyzing images becomes easier if we can describe them (even approximately) with fewer values. For many classes of images, we can capture most of the variation from image to image using a small number of values This allows us to think of the images as points in a lowerdimensional space We ll examine one common approach: Principal Components Analysis. e.g. pictures of your face from different angles and with different lighting: their actual pixel values can be dramatically different but they re visually similar in many ways to our eyes. How can we capture this similarity by representing images in a lower-dimensional space? 30

Principal component analysis (PCA) Basic idea: given a set of points in a multidimensional space, we wish to find the linear subspace (line, plane, etc.) that best fits those points. The idea of PCA is to find the linear subspaces that best fit your high dimensional data and then project your data onto those subspaces. These subspaces are the principal components the directions in which your data varies the most. This gives you a way to represent your data in much fewer dimensions while keeping the distinct points as separate as possible. Keeping the points as separate as possible means that your representation still captures as much of the original information as possible. First principal component Second principal component If we want to specify a point x with just one number (instead of two), we can specify the closest point to x on the line described by the first principal component (i.e., project x onto that line). In a higher dimensional space, we might specify the point lying closest to x on a plane specified by the first two principal components. 31

Principal component analysis (PCA) How do we pick the principal components? First subtract off the mean value of the points, so that the points are centered around the origin. The first principal component is chosen to minimize the sum squared distances of the points to the line it specifies. This is equivalent to picking the line that maximizes the variance of the full set of points after projection onto that line. The kth principal component is calculated the same way, but required to be orthogonal to previous principal components PCA is sometimes called SVD (singular value decomposition) How many principal components should you use to summarize a dataset? It s a bit of a judgement call. This analysis will also tell you how much of the data is explained by each principal component by looking at how much variance is left unaccounted for and often you will see that 80-90% of variance is captured by the first 3 to 8 principal components Maximizing variance after projection = keeping the points as spread out as possible after projecting onto the line. First principal component Second principal component 32

hop://www.pages.drexel.edu/~sis26/eigenface%20tutorial.htm Example: face recognition A popular face recognition algorithm relies on PCA Take a large set of face images (centered, frontal views) Calculate the first few principal components Approximate each new face image as a sum of these first few principal components (each multiplied by some coefficient). Classify faces by comparing these coefficients to those of the original face images When a face picture is represented as points in the principal component space, pictures of the same person s face will tend to cluster together, allowing you to identify people s faces. Original images Each principal component is a vector in the same high dimensional image space, so it can be viewed as an image too. Principal components (viewed as images) 33

Practical image processing tips 34

Practical image processing tips (Thanks to Leo Kesselman) When viewing an image, you might need to scale all the intensity values up or down so that it doesn t appear all black or all white You might also need to adjust the gamma correction to get the image to look right This applies a nonlinear (but monotonically increasing) function to each pixel value This comes from the fact that the same grey value will look different on different monitors or TV screens, so there are standard ways to adjust the gamma value to correct for this. You re not responsible for this material, but you may find it useful 35

Next quarter: CS/CME/Biophys/BMI 371 Computational biology in four dimensions I m teaching a course next quarter that complements this one Similar topic area, but with a focus on current cutting-edge research Focus is on reading, presentation, discussion, and critique of published papers 36