Thanks to visit codestin.com
Credit goes to github.com

Skip to content

uniqfroyo/CCI_S2_Coding2_Final-Project

Repository files navigation

CCI_S2_Coding2_Final-Project

Project Summary

Use opencv, numpy, matplot, scikit-image in Python to create different image filters to show the beautiful scenery of London, then use dash to show before after as an album.

‘When a man is tired of London, he is tired of life.’ Everytime I walk on the streets of London, I feel that every landscape is an oil painting. This reminds me of one of my favourite impressionism artists -Claude Monet.

As a overseas student, the life of studying in London is a memory that I will never forget in my life. So I hope to record the beautiful scenery of London in the form of paintings and make it into 'an album'.

image

Process

Oil Painting Effect filter link

It is included in cv2.xphoto() which also has several other cool functions like image inpainting, white balance, image denoising, etc. Step 1: Superpixel segmentation of the area Step 2: Substitute the original pixel for the material sample of the segmented area

image

Pointillist Art filter link

To do this in Python, our first step is to compute the most used colors for which Kmeans is used. I used a color palette of 20 which means that the dots will be made by 20 most used colors will be present in the image. A suitable radius size is calculated for the dots according to the image size. Then we loop over the image and find the color closest to the dot, using which the circle is drawn.

image

Frosted glass filter link

The double layer circulates through each pixel of the image, and then uses the defined random number to replace the color of each neighborhood pixel.

image

Pencil sketch filter link

The cv2.bilateralFilter() function is called to perform bilateral filtering on the original image. The filter can effectively remove noise while ensuring clear boundary and shorten pixel value to one value every 7 gray levels. It uses both spatial Gaussian weight and gray similarity Gaussian weight to ensure that the boundary will not be blurred.

image

Light ripple filter link

Calculate the center position of wave, and then call np.sin() function to calculate the wave transfer function, and finally form the light wave special effect.

image

Final Outcomes

I use dash to visualize them in Reactive Web Apps. You’ll find a getting started guide here and the Dash code on GitHub here. Dash is a user interface library for creating analytical web applications. Those who use Python for data analysis, data exploration, visualization, modelling, instrument control, and reporting will find immediate use for Dash. link

I choose 'streets of London' as my BGM. I hope this can takes you back to your London memories.

More details in blog

Video

Useful resource

OpenCV with Python tutorial)

Python image manipulation tools

Opencv library: https://github.com/opencv/opencv-python

Dash introduction: https://medium.com/plotly/introducing-dash-5ecf7191b503

Dash core component library:

https://github.com/plotly/dash-core-components

https://dash.plotly.com/dash-core-components/graph

Machine learning in creating art and music

Create Pointillism Art from Digital Images

python-opencv displays blur, beautification, watercolor and other effects on videos and images

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors