240 likes | 343 Views
Measurements in Fluid Mechanics 058:180:001 (ME:5180:0001) Time & Location: 2:30P - 3:20P MWF 218 MLH Office Hours: 4:00P – 5:00P MWF 223B-5 HL. Instructor: Lichuan Gui lichuan-gui@uiowa.edu http:// lcgui.net. Lecture 24 . Digital image & image processing.
E N D
Measurements in Fluid Mechanics058:180:001 (ME:5180:0001)Time & Location: 2:30P - 3:20P MWF 218 MLHOffice Hours: 4:00P – 5:00P MWF 223B-5 HL Instructor: Lichuan Gui lichuan-gui@uiowa.edu http://lcgui.net
Digital image & image processing Digital Image
Digital image & image processing Digital Image • Images constitute a continuous spatial distribution of the irradiance at a plane. • Digital images consist of pixels. Each pixel represents a square region of the image on a square grid. • Pixel value (gray value) represents intensity of the irradiance • 1-bit: 0 1 • 8-bit: 0 255 • 10-bit: 0 1,023 • 12-bit: 0 4,095 • 24-bit: 0 16,777,215 • Bitmap data in file.
Digital image & image processing Digital Image • Sufficient pixels make image look continuous
Digital image & image processing Digital Image • Color models • True color model: (Red,Green,Blue)=(0255, 0255, 0255) • Others: Palettes/look-up table (LUT)/color map/index map/etc.
Digital image & image processing Digital Image • Physical & logical pixels
Digital image & image processing Digital Image • Digital PIV image sample presented as a 2D-function G(x,y) displayed on a PC screen
Digital image & image processing Digital Image • 2D & 3D digital images
Digital image & image processing Digital Image • Histogram (PDF) of digital image PDF – Probability density function
Digital image & image processing Digital Image Processing • Pixel operation - Changing gray value of single pixel without considering the neighborhood • Filter operation - Changing gray value of single pixel considering the neighborhood of (2r+1)(2r+1) pixels • Many others
Digital image & image processing Pixel Operation • Linear transformation
Digital image & image processing Pixel Operation • Binary operation - gray value threshold
Digital image & image processing Pixel Operation • Threshold - gray value threshold
Digital image & image processing Pixel Operation • Invert • Square • Root
Digital image & image processing Digital Filter • Smooth filter
Digital image & image processing Digital Filter • Gradient filter
Digital image & image processing Digital Filter • Laplace filter
Digital image & image processing Digital Filter • Regional normalization
Digital image & image processing Digital Filter • (Removing) unsharp mask
Digital image & image processing Digital Filter • Median • Expansion • Erosion
Digital image & image processing Digital image files • Device independent image files • Device independent image files • Basic components of a digital image - Microsoft Windows Bitmap “*.bmp” - Tag Image File Format “*.tif” - Graphics Interchange Format “*.gif” - JPEG File Interchange Format “*.jpg” - Many others - Header, Palette, Bitmap Data, Footer etc. • Information in a bitmap header • File Identifier • File Version • Number of Lines per Image • Number of Pixels per Line • Number of Bits per Pixel • Number of Color Planes • Compression Type • X & Y Origin of Image • Text Description • Others • Unused Space • Device dependent image files - Raw image formats (e.g. *.raww) - TSI image file Format “*.img” - DANTEC image file format “*.img” - LAVISION image file format “*.img” - Others
Digital image & image processing Digital image files • Microsoft Windows Bitmap • 14-byte file header (Version 2.x +)Byte 12 File type, always 4D42h (“BM”);Byte 36 Size of the file in bytes;Byte 78 Reserved 1, always 0; Byte 910 Reserved 2, always 0; Byte 1114 Starting position of image data in bytes. • Bitmap headerByte 14 Size of this header in bits; Byte 58 Image width in pixels; (2 bytes for version 2.x) Byte 912 Image height in pixels; (2 bytes for version 2.x) Byte 1314 Number of color planes;Byte 1516 Number of bits per pixel; (end of version 2.x)Byte 1720 Compression methods used; Byte 2124 Size of bitmap in Bytes; Byte 2528 Horizontal resolution in pixels per meter; Byte 2932 Vertical resolution in pixels per meter; Byte 3336 Number of colors in the image; Byte 3740 Minimum number of important colors. (end of version 3.x)Up to 108 bytes forVersion 4.x • Color PaletteOne-, 4-, and 8-bit BMP files always contain a color palette24-bit BMP files never contain color palettes
Digital image & image processing Project warm-up • Write a Matlab program to read gray values at the center and 4 corners of image: http://lcgui.net/lectures/lecture02/image01.bmp • Try to use pixel or filter operations to process the digital image • A 124×124-pixel uncompressed 8-bit gray-scale BMP fileFileheader: 14 bytesBitmap header: 40 bytes Color palette: 1024 bytesBitmap data: 15376 bytesTotal size: 16454 bytes • Simplest Matlab programA=imread('image01.bmp');A(1,1)A(1,124)A(124,1)A(124,124)A(62,62)imshow(A);