Commit 2bb870d9 authored by Taddeüs Kroes's avatar Taddeüs Kroes

ImProc ass1: Implemented part 1 of assignment.

parent 9db9fced
improc/ass1/lowcontrast.png

202 KB | W: | H:

improc/ass1/lowcontrast.png

245 KB | W: | H:

improc/ass1/lowcontrast.png
improc/ass1/lowcontrast.png
improc/ass1/lowcontrast.png
improc/ass1/lowcontrast.png
  • 2-up
  • Swipe
  • Onion skin
from pylab import clf, histogram, np, imshow from pylab import clf, histogram, imshow, imread, bar, diff, xlim, show, \
figure, amin, amax
i = 1
def show_hist(a):
global i
figure(i)
imshow(a, vmin=0, vmax=1)
h, be = histogram(a.flatten(), bins=40)
figure(i + 1)
bar(be[:-1], h, width=diff(be)[0])
xlim((0, 1))
i += 2
def cst(f): def cst(f):
fmin = amin(f) fmin = amin(f)
fmax = amax(f) fmax = amax(f)
return (f - fmin) / (fmax - fmin) return (f - fmin) / (fmax - fmin)
a = np.load('lowcontrast.npy') #a = imread('stinkbug.png')
clf() a = imread('lowcontrast.png')
imshow(a, vmin=0, vmax=1)
h, be = histogram(a.flatten(), bins=40)
show_hist(a)
show_hist(cst(a))
show()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment