- Forward


Image Analysis
An Introduction


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu

Print

Getting Started
Back SMYC Forward
  • Definition:
    • The extraction of information/data from images
  • Our Concern:
    • The analysis of digital images by an electronic processor (e.g., a computer or microprocessor)
  • Other Approaches:
    • The analysis of either digital or analog images by a person (e.g., aerial image analysis)
Common Tasks
Back SMYC Forward
  • Image Comparison:
    • Object Detection
    • Motion Detection
  • Object Identification:
    • Optical Character Recognition (OCR)
    • Object Classification (e.g., species classification, military target classification)
    • Facial Recognition
    • Medical Analysis
Object Detection
Back SMYC Forward
  • The Task:
    • Compare two images to determine if one contains an object that is not in the other
  • A Very Naive Algorithm:
    • Compare the two images pixel by pixel to determine if there are any differences
Object Detection (cont.)
Back SMYC Forward
  • Problems with the Very Naive Algorithm:
    • Because of the way digital cameras work, the pixels in two images recorded almost simultaneously can vary (even when not compressed)
    • Because the camera may move (even slightly) two images recorded almost simultaneously may be translated or rotated
  • Improving the Naive Algorithm:
    • We will improve upon the naive algorithm using techniques that are easy to understand conceptually
    • There are very sophisticated algorithms (using advanced mathematics) that are well beyond the scope of this lecture
Object Detection (cont.)
Back SMYC Forward
  • Correcting for Small Color Differences:
    • We can use one of several measures of distance to determine the similarity between corresponding pixels in images of the same "scene" taken at different times
  • The Resulting Algorithm:
    • Count the number of pixels that are father apart than some threshold
    • If the number of pixels is large, conclude that there is an object in one and not the other
Object Detection (cont.)
Back SMYC Forward
  • An Intuitive Distance Measure:
    • Using the supremum distance we can determine if the red, green or blue component differs by more than a given threshold
  • An Example:
    • images/object-detection_example_before.png
Object Detection (cont.)
Back SMYC Forward
  • With a Threshold of 10:
    • About 3% of the pixels are different
  • Visualization:
    • images/object-detection_example_after.png
Object Detection (cont.)
Back SMYC Forward
  • A Shortcoming of this Algorithm:
    • The pixels that are different may not be contiguous
  • Overcoming this Shortcoming:
    • Only conclude that an object has been detected if the pixels that are different are close to each other
Object Detection (cont.)
Back SMYC Forward
  • One Way to Account for Translated Images:
    • Instead of comparing the two images pixel-by-pixel, calculate a single value for the entire image (or a value for each row, or a value for each column) by finding the color distance between each pixel and all of its neighbors
  • An Example:
    • images/object-detection_shifted.png
    • 12 pixels will be identified as different if we don't account for the translation
    • The total distance between neighbors for row 3 will be: \(|255-0| + |0-255| = 510\) in both images
Object Detection (cont.)
Back SMYC Forward
  • Another Way to Account for Translated Images:
    • Use a lower resolution version of the image (e.g., take the average of nine neighboring pixels to create an image that is one third as large in both dimensions) and effectively "blur" small differences
  • An Example:
    • images/spatial_convolution_blur.gif
Optical Character Recognition
Back SMYC Forward
  • The Task:
    • Identify a letter/number in a digital image
  • A Very Naive Algorithm:
    • Compare the black-and-white image containing the character to recognize to a set of black-and-white images containing all of the candidate characters and choose the candidate with the smallest number of different pixels
Optical Character Recognition (cont.)
Back SMYC Forward
  • Problems with the Very Naive Algorithm:
    • The number of different pixels will be determined, in large part, by the number of black pixels
    • The image containing the character to recognize is likely to be translated
  • Improving the Naive Algorithm:
    • For each black pixel in the character to recognize, find the closest black pixel in the candidate character
    • Calculate the sum of the pixel-by-pixel distances and call it the distance between the character to recognize and the candidate
    • Find the candidate that is closest (in total) to the character to recognize
Optical Character Recognition (cont.)
Back SMYC Forward
  • An Example:
    • images/ocr_one-candidate.png
  • Some of the Calculations:
    • Pixel (3,0) in the character is closest to pixel (3,1) in the candidate with a distance of 1
    • Pixel (3,3) in the character is closest to pixel (3,3) in the candidate, with a distance of 0
    • The sum of all of this distances is the distance between the character and this candidate
    • Do this for every candidate and pick the closest
Optical Character Recognition (cont.)
Back SMYC Forward
  • Making the Problem Easier:
    • Use a font in which the characters are as distinct as possible (e.g., 1, I, and i are distinct)
  • An Example Font (OCR-A):
    • images/OCR-A.png
Motion Detection
Back SMYC Forward
  • Approaches:
    • Blob-Based
    • Contour-Based
    • Model/Database-Based (i.e., detected objects are matched to a database)
    • Color-Based
    • Classification-Based (e.g., pattern recognition using support vector machines)
  • Important Issues:
    • Camera Orientation (e.g., upstream, downstream, side view)
    • Platform Stability
    • Time of Day
    • Weather
    • Dirt on the Lens
Infrared Sensors
Back SMYC Forward
  • An Observation:
    • We've been thinking about cameras that sense light in the visible spectrum, but there's no reason not to use infrared
  • Types:
    • Active - illuminated the detection zone with low-power infrared energy
    • Passive - detect the energy that is emitted from objects
There's Always More to Learn
Back -