Outline • Image formats and basic operations – Image representation – Basic operations

advertisement
Outline
• Image formats and basic operations
– Image representation
– Basic operations
Four Stages of Visual Processing
•
•
•
•
Image-based stage
Surface-based stage
Object-based stage
Category-based stage
5/29/2016
Visual Perception Modeling
2
Problems in Computer Vision
• Classification
– Edge detection
• Segmentation
• Recognition
• Motion analysis
5/29/2016
Visual Perception Modeling
3
Digital Image Formation
• How to acquire a digital image – Digital
cameras
– The continuous spatial space is digitized into
small cells
– The color of a cell is all the photons fall into the
cell within a very short period of time
– Charge Coupled Device - CCD cameras
• An electronic memory which is able to be charged by
light
5/29/2016
Visual Perception Modeling
4
Image Representation
• Mathematically, an image can be represented
by a 2-D matrix
– Each entry (i,j) represents the value at the
corresponding location, which is called a pixel
– The value of a pixel can have different types,
depending on the image types
•
•
•
•
5/29/2016
Unsigned char
Int
Float
A vector (Color image, for example)
Visual Perception Modeling
5
Image Sequence Representation
• Mathematically, an image sequence is
represented as a 3-D matrix
– At any time, it is a 2-D matrix
– A commonly used format is animated gif
5/29/2016
Visual Perception Modeling
6
Image as a File
• Image formats
–
–
–
–
TIFF
GIF
JPEG
PBM
5/29/2016
Visual Perception Modeling
7
Image as a File – cont.
• Image file consists of two parts
– Header
• Type of the image
• Size of the image
• Color map
– Data
• Uncompressed
• Compressed
5/29/2016
Visual Perception Modeling
8
PBM Format
• Portable Bitmap Utilities
– Header
• A two-letter magic number that identifies the format
type
• File parameters
– Height, width, maximum value of a pixel of the image
– Data
• In ASCII or binary, depending on the format type
5/29/2016
Visual Perception Modeling
9
Portable Gray Map
• Binary PGM format
–
–
–
–
–
P5
Width
Height
Max
Pixels as binary values
5/29/2016
Visual Perception Modeling
10
Portable Pixel Map
• Binary PPM format
–
–
–
–
P6
Width
Height
Max
5/29/2016
Visual Perception Modeling
11
Programs to Read/Write Images
• These functions are based on my program
– type-def.h defines the structures
– imageio.c defines the functions to read and write
images of different types
– util.c defines functions to dynamically allocate
memory needed for an image
5/29/2016
Visual Perception Modeling
12
Image Sequence
• There are many different kinds of formats for
movie or video sequence
– avi
– mpeg
• An easy way to generate a video sequence is
to concatenate images together
– Animated gif is such a format
5/29/2016
Visual Perception Modeling
13
Visualization of Images
• xv
– A utility for X-window system
– Can display and convert many different kinds of
image formats
• ImageMagick package
–
–
–
–
convert
display
animate
available at
http://www.simplesystems.org/ImageMagick/
5/29/2016
Visual Perception Modeling
14
Download