iPython/ Numpy/ Scipy | WINTER 2016
IMAGE FILTER DESIGN TO GIVE A GLASS STAIN FILTER DESIGN USIN VORONOI CELLS.
The project objective is to develop an image filter to produce a glass stain effect (which is a bit similar to a bokeh effect applied on images ). The following are the steps to achieve this objective:
- Segment the image into sections of size blocksize and call each section a region.
- Generate a random x,y co-ordinate in every region, these are the Voronoi points.
- Using one of the distance algorithms ( euclidean, chebychev or manhattan ), assign every pixel a region. These regions are called vornoi regions.
- Assign all the pixels in one region the same color . The color can be dervied by the mean ,median or mode of the pixel color values in the region.
p_x,p_y – co-ordinates of every pixel
v_x,v_y – co-ordinates of region vornoi point
EUCLIDEAN DISTANCE : sqrt((p_x-v_x)^2+(p_y-v_y)^2)
CHEBYCHEV DISTANCE : max (|p_x-v_x|,|p_y-v_y|)
MANHATTAN DISTANCE : |p_x-v_x|+|p_y-v_y| (looks like road structures in Manhattan )