Artificial Intelligence
Machine Learning
Constraint Solvers
Spring 2013
-
Image Processing Computer Vision
-
bitmap PPM color PGM grayscale
-
lena_rgb_p3.ppm
-
katrina-08-28-2005.jpg
katrina.ppm
-
-
PPM text P3 binary P6
-
PGM text P2 binary P5
-
-
Format
-
filetype (P3, P6, P2, P5)
-
numcols
-
numrows
-
maxval (usually 255)
-
pixel values... (in row major order)
-
-
Data is tokenized by whitespace, otherwise spacing is irrelevant.
-
Each pixel is three ints (RGB for PPM) or one int (grayscale for PGM).
-
-
Advice... just use PPM and set R=G=B for grayscale (check file size).
-
Avoid binary files (P6 and P5) even though bytes are 2 or 3 or 4 to 1.
-
-
convert -compress None blah.jpg blah.ppm
-
-
img0 - original source image
-
img1 - convert RGB to grayscale = 0.30*red + 0.59*green + 0.11*blue
-
img2 - smooth grayscale values for all non-border pixels by a weighted average of nearest neighbors
-
img3 - calculate G=|Gx|+|Gy| for all non-border pixels and color as red those that surpass a particular threshold
-
img4 - nonmaximal supression to reduce computation for data-intensive feature identification
-
img5 - color as green the most likely circle (first test on hand-drawn circle triangle square image)
Temporary Archive of Fall 2012
-
link
-
As of 28 January 2013.
Back to TJ CompSci
31 August 2012