Lectures‎ > ‎

Lecture: Image Formation

Slides

View Lecture Slides

Exercises

See Exercises 2-a  and  2-b in Übungen


Here is a simple example of how to write a command line tool:

gamma-correct

#!/usr/bin/python

import sys,os,optparse
import scipy.misc
from pylab import *

parser = optparse.OptionParser(usage="""
%prog [options] input.png output.png

Perform gamma corection

""")
parser.add_option("-g","--gamma",help="gamma value",type=float,default=1.6)

(options,args) = parser.parse_args()

image = imread(args[0])
image = image**options.gamma
scipy.misc.imsave(args[1],image)


If you put this into a file and make it executable, you can then say:

./gamma-correct -g 0.3 input.png output.png


Ċ
Thomas M. Breuel,
Apr 22, 2010, 5:48 AM
ą
Thomas M. Breuel,
Apr 21, 2011, 12:05 AM
ą
Thomas M. Breuel,
Apr 21, 2011, 12:05 AM
ą
kodak.png
(293k)
Thomas M. Breuel,
Apr 21, 2011, 12:05 AM
Comments