Typically, the functional operation requires discrete values
-sample the two-dimensional(2D) space on a regular grid
-Quantize each sample(rounded to “nearest integer”)
Matrix of integer values(Range:0-255)
image, height map, zoomed in
Pixel count
Image Histogram, intensity bins
color, red channel, green channel, blue channel
Raster image formats store a series of colored dot “pixels”
Number of bits for each pixel represents the depth of color
– 1 bit-per-pixel: 2colors (black or white, binary)
– 4 bit-per-pixel: 16colors
– 8 bit-per-pixel: 256 different colors 2^8 = 256
24 bit per pixel usually means 8 bits per color
at the two highest levels, the pixels themselves can carry up to 16777,216 different colors
Common raster image format
-gif, jpg, ppm, tif, bmp, etc
Exercise to do on own
-openCV/Python
(opencv.org, python.prg)
-matlab/octave
(mathworks.com, www.gnu.org/software/octave)
-Processing
(processing.org)
import cv2 # Read images img = cv2.imread("mona-lisa.png") print "Read image from file; size: {}x{}".format(img.shape[1], img.shape[0]) cv2.imshow("Mona Lisa", img) # and run different operations on them img_smooth = cv2.GaussianBlur(img, (7, 7), 0) #smooth image using a Gaussian Blur cv2.imshow("Smoothed", img_smooth) img_gray = cv2.cvtColor(img_smooth, cv2.COLOR_BGR2GRAY) cv2.imshow("Grayscale", img_gray)
buzz=imread('buzz3.jpg') imshow(buzz)