GithubHelp home page GithubHelp logo

vb6hobbyst7 / gtvimagevect Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kerautret/gtvimagevect

0.0 2.0 0.0 5.92 MB

Source code of "Geometric Total Variation for Image Vectorization, Zooming and Pixel Art Depixelizing"

C++ 64.98% CMake 0.83% Shell 2.03% C 32.15%

gtvimagevect's Introduction

GTVimageVect

Source code of "Geometric Total Variation for Image Vectorization, Zooming and Pixel Art Depixelizing" authored by Bertrand Kerautret and Jacques-Oliver Lachaud (2019)

You can also access to IPOL online demonstration here

Build status:

  • Linux/MacOS Build Status
  • Windows Build status

Installation

To use this source code, you need to install the following dependencies:

  • DGTal library (current version or at least commit 0e13036), on Linux/Mac just follow these steps:

    • Install (if not already present), the boost dependancies (see https://www.boost.org). For instance on linux you can install the following package: sudo apt-get install libboost-dev libboost-system-dev libboost-program-options-dev(the libboost-program-options-dev is not mandatory for DGtal but is used by our project)
    • git clone [email protected]:DGtal-team/DGtal.git
    • cd DGtal; mkdir build; cd build
    • cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE:string="Release";
    • make; eventually: make install.

    For any problem, don't hesitate to contact the DGtal team on the GitHub repository. On windows or more details see instructions here.

  • cairo On Linux, the installation can be done from a package mananger (see here for more details. On Windows, you can follow the steps of the cairo website or run the script or upload the binary from the cairo-windows repository. You can also consult the appveyor configuration file (appveyor.yml) that uses it.

  • boost programm options by default the application use the package libboost-program-options-dev. You can use you default package manager to install it.

The installation of the code can be done by following these steps:

  • Download the source for instance by using the git command:

    • git clone [email protected]:kerautret/GTVimageVect.git
    • cd GTVimageVect; mkdir build; cd build;
  • Then, you can start to build the code: (you can remove the DGtal path if you make a global installation of DGtal).

    • cmake .. -DDGtal_DIR="/fullpath_to_yourParent_DGtal_dir/DGtal/build" -DCMAKE_BUILD_TYPE:string="Release"
    • make
    • cd ..

Typical Use

The algorithm is run from executable tv-triangulation-color. For instance, you can use as follows (from the project directory):

./build/bin/tv-triangulation-color -i Input/dolphin.ppm -b 16 -D 16 -o output -C result.svg

Then you should obtain:

source image (.png) result (scaled bitmap .png)result (vectorial format .svg)

The vectorial representation allows you to edit easely the shape by using for instance inskape. First you can generate the vectorial representation:

./build/bin/tv-triangulation-color -i tests/ex_results/skeleton.ppm -b 16 -D 16 -C skeleton.svg

Then, thanks to the vectorial representation, you can animate the resulting vectorial file like in the animation below on the right:

source (scaled) result (svg) Edited using inskape and animated with svg format (reload or click to see animation).

The algorithm can be used to zoom on part of photography:

./build/bin/tv-triangulation-color -i Input/ara.ppm -b 16 -D 16 -o resultAra

convert -scale 1600% Input/ara.ppm ara16x.png

You should obtain such resulting images:

Source scaled x16 Resulting image

Reproduction of Paper Figures

All the figures of the paper using the present algorihtms can be reproduced from the following script script-figures.sh. You just have to run by specifying the Input/Output directory:

mkidr Output

script-figures.sh Input Output

The comparisons with existing algorithms can be applied onlne with the following demonstrations:

  • Convolutional Neural Network for Subpixel Super-Resolution [22]: online demo.
  • Super resolution with HQx Algorithm [23]: online demo
  • Image Interpolation with Geometric Contour Stencils [7]: online demo.
  • Vector-valued image interpolation by an anisotropic diffusion-projection PDE [19]: online demo.
  • Vector Magic Inc [10]: online demo.
  • Depixelizing [13] and Potrace [21] were produced by using Inskape with the default parameters.

gtvimagevect's People

Contributors

jacquesolivierlachaud avatar kerautret avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.