n=1;
w=0.3;
x=1:300;
I=(-1/n)*sin(n*w*x)
D=I;
plot(D)

n=2;
I2=(-1/n)*sin(n*w*x)
D=D+I2;
plot(D)


I=imread('mandrill','bmp');
plot(myhist(I(:,:,2)));
figure
imhist(I(:,:,2))

imagesc(threshold_lightdark(I(:,:,2),150,'l'))
colormap(gray)
imagesc(threshold_lightdark(I(:,:,2),150,'d'))

close all

threshold_percent(I(:,:,2),0.50,'l')
colormap(gray)
threshold_percent(I(:,:,2),0.50,'d')