Skip to content

esimov/openfaas-coherent-line-drawing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coherent Line Drawing - OpenFaaS function

OpenFaaS function for generating sketch like artistic image from the provided source image. For more information about the implementation check the project source code at https://github.com/esimov/colidr.

Local usage

To run the function locally you have to make sure OpenFaaS is up and running. Read the official documentation for help in case is needed: https://docs.openfaas.com/

Clone the repository:

$ git clone https://github.com/esimov/openfaas-coherent-line-drawing

Build

$ faas-cli template pull https://github.com/alexellis/opencv-openfaas-template
$ faas-cli build -f stack.yml --gateway=http://<GATEWAY-IP>

Deploy

$ faas-cli deploy -f stack.yml --gateway=http://<GATEWAY-IP>

You can access the user interface under the url provided for the --gateway.

Important notice: in case of large images you need to increase write_timeout in stack.yml.

Results

After deployment the coherent-line-drawing function will show up in the function list. You need to provide an image URL then hit invoke. This will generate a contoured, sketch-liked image as below.

image

You can also provide different values as query parameters. The follwing parameters are supported:

Flag Default value Description
aa false Anti aliasing
bl 3 New height
di 1 Number of FDoG iteration
ei 2 Number of Etf iteration
k 2 Etf kernel
rho 0.98 Rho
sc 1 Sigma C
sm 3 Sigma M
sr 2.6 Sigma R
tau 0.98 Tau

Below is an example with query parameters you can try out:

https://user-images.githubusercontent.com/883386/61370913-30e21c00-a89c-11e9-8edf-f4b59b59793c.jpg?k=2&sr=2.9&sm=3.5&tau=0.999&aa=1&ei=2&di=1
Input Output
tiger_source tiger_dest
patio_source patio_dest
people_source people_dest
starry_night_source starry_night_dest

License

Copyright © 2019 Endre Simo

This project is under the MIT License. See the LICENSE file for the full license text.