Computational Biology, Part 23Biological Imaging III
Computational Biology, Part 23Biological Imaging III
G. Steven VanniG. Steven Vanni
Robert F. MurphyRobert F. Murphy
Copyright Copyright 1998, 2000. 1998, 2000.
All rights reserved.All rights reserved.
Basic Image Processing OperationsBasic Image Processing Operations
Arithmetic OperationsArithmetic Operations Kernel OperationsKernel Operations Image MathImage Math
Arithmetic OperationsArithmetic Operations
Two cases:Two cases: Perform a Perform a singlesingle operand operation (e.g., operand operation (e.g.,
logarithm, square root) on each pixel of an imagelogarithm, square root) on each pixel of an image Perform a Perform a dualdual operand operation (e.g., add, operand operation (e.g., add,
multiply) on each pixel of an image using a multiply) on each pixel of an image using a constantconstant as the second operand as the second operand
In both cases, the result is usually stored in In both cases, the result is usually stored in the same pixel location (“storing in place”)the same pixel location (“storing in place”)
Kernel OperationsKernel Operations Basic idea: Use a matrix (usually square and Basic idea: Use a matrix (usually square and
of odd dimension, e.g., 3x3) in combination of odd dimension, e.g., 3x3) in combination with an image to generate a new imagewith an image to generate a new image
Algorithm:Algorithm: For each pixel in the image (the For each pixel in the image (the currentcurrent pixelpixel)) Align the matrix to center it on that pixelAlign the matrix to center it on that pixel For each position in the matrix, multiply the For each position in the matrix, multiply the
corresponding pixel value in the image by the corresponding pixel value in the image by the value in the matrix and sum the resultsvalue in the matrix and sum the results
Store the result in the Store the result in the currentcurrent pixelpixel
Kernel OperationsKernel Operations
A matrix used in this fashion is called a A matrix used in this fashion is called a kernelkernel
Note that the operation is different from Note that the operation is different from matrix multiplication of the kernel by the matrix multiplication of the kernel by the image becauseimage because the dimensions don’t match, andthe dimensions don’t match, and all elements of the matrix are combined to give all elements of the matrix are combined to give
one resultone result
Common Kernel Operations used in Image ProcessingCommon Kernel Operations used in Image Processing SmoothingSmoothing SharpeningSharpening Edge FindingEdge Finding
Examples of Kernel Operations using NIH ImageExamples of Kernel Operations using NIH Image
Open an example file (from Mellon: BioServer: File Open an example file (from Mellon: BioServer: File Service: Courses: 03310: Demos: NIH Image files)Service: Courses: 03310: Demos: NIH Image files)
Examples of Kernel Operations using NIH ImageExamples of Kernel Operations using NIH Image
SmoothSmooth
Examples of Kernel Operations using NIH ImageExamples of Kernel Operations using NIH Image
Close smoothed image, reopen original image, then Close smoothed image, reopen original image, then SharpenSharpen
Examples of Kernel Operations using NIH ImageExamples of Kernel Operations using NIH Image
Close sharpened image, reopen original image, then Find Close sharpened image, reopen original image, then Find EdgesEdges
Image MathImage Math
Basic idea: Combine two images using an Basic idea: Combine two images using an dual operand operator to generate a new dual operand operator to generate a new imageimage
Algorithm:Algorithm: For each pixel in the first image, operate on it For each pixel in the first image, operate on it
using the corresponding pixel in the second using the corresponding pixel in the second image and store the result in the corresponding image and store the result in the corresponding pixel in a new (output) imagepixel in a new (output) image
Image MathImage Math
Any operator can be usedAny operator can be used Most common operators:Most common operators:
division: generate ratio imagedivision: generate ratio image logical AND: logical AND: maskmask one image with another one image with another
(usually binary) image(usually binary) image
Examples of Image Math using NIH ImageExamples of Image Math using NIH Image
Open original image and sharpen once (save as Open original image and sharpen once (save as Abdomen.sharpen1), reopen original imageAbdomen.sharpen1), reopen original image
Ratio of Ratio of sharp to sharp to original original image image (shows (shows regions regions affected affected by by sharpen)sharpen)
Image Math vs. Arithmetic OperationsImage Math vs. Arithmetic Operations Note difference between Image Math which does Note difference between Image Math which does
an operation on two images and Arithmetic which an operation on two images and Arithmetic which does an operation on a single image and a constantdoes an operation on a single image and a constant
Summary: Basic Image Processing OperationsSummary: Basic Image Processing Operations Arithmetic OperationsArithmetic Operations
Inputs: Image, Constant (optional)Inputs: Image, Constant (optional) Common use: Subtract backgroundCommon use: Subtract background
Kernel OperationsKernel Operations Inputs: Image, KernelInputs: Image, Kernel Common use: SmoothingCommon use: Smoothing
Image MathImage Math Inputs: Two imagesInputs: Two images Common use: Generate ratio imageCommon use: Generate ratio image