Giter Club home page Giter Club logo

mlbgstippling's Introduction

Multi-Class Inverted Stippling

A reusable library and interactive playground application for the algorithm proposed in our SIGGRAPH Asia 2021 technical paper.

Inverted stippling of Memorial Church Memorial Church by Paul Debevec Inverted Stippling of fire Inverted Stippling of fire

Disclaimer

This is a cleaned-up version of the GPU-based code that was used to generate the images and timings in the paper, i.e., results should be similar but may vary. The code has quite a few experimental and deactivatable features that are not mentioned in the paper, e.g., various annealing parameters (have little impact), NN-based stipple merging instead of removal (can help in corner cases, but is really complicated), fast generation of sampling maps (see our foveated volume rendering paper for details), a convolution-based stippling model (has more control over packing/filling than the difference model but is trickier to implement), and so on. See pseudo code in the paper for an easy-to-understand version. That being said, the code is written to be readable, extensible, and reusable.

Citation

@article{Schulz2021MultiClass,
    abstract = {We introduce inverted stippling, a method to mimic an inversion technique used by artists when performing stippling. To this end, we extend Linde-Buzo-Gray (LBG) stippling to multi-class LBG (MLBG) stippling with multiple layers. MLBG stippling couples the layers stochastically to optimize for per-layer and overall blue-noise properties. We propose a stipple-based filling method to generate solid color backgrounds for inverting areas. Our experiments demonstrate the effectiveness of MLBG in terms of reducing overlapping and intensity accuracy. In addition, we showcase MLBG with color stippling and dynamic multi-class blue-noise sampling, which is possible due to its support for temporal coherence.},
    author = {Schulz, Christoph and Kwan, Kin Chung and Becher, Michael and Baumgartner, Daniel and Reina, Guido and Deussen, Oliver and Weiskopf, Daniel},
    title = {Multi-Class Inverted Stippling},
    year = {2021},
    month = {dec},
    volume = {40},
    number = {6},
    issn = {0730-0301},
    doi = {10.1145/3478513.3480534},
    journal = {ACM Trans. Graph.},
    articleno = {245},
    numpages = {12},
    keywords = {stippling, linde-buzo-gray-algorithm, voronoi diagram, negative space, sampling, multi-class}
}

Building

For the playground (interactive demo):

  • Install CUDA.
  • Install Qt 5.x or Qt.6.
  • Install CMake 3.20+.
  • Run CMake (generate project, build project). Release mode or RelWithDebInfo is highly preferred due to performance reasons.
  • Run playground binary.
  • Quick-start 1: load the examples/memorial/inverted.json project, hit stipple.
  • Quick-start 2: use Import/Black and White Decomposition and select an image of your choice, hit stipple.

For the unmixer (script that decomposes color images into multiple layers using a user-specified palette):

  • Install Python 3.x.
  • Install dependencies pip install numpy scipy Cython Pillow cvxopt (if cvxopt install fails: use conda instead of pip).
  • Run python unmixer/run.py.
  • Quick-start: edit the image path and palette (image variable). To pick representative colors, we recommend heavy blurring the image of your choice.

mlbgstippling's People

Contributors

schulzch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mlbgstippling's Issues

Problem building

Hi, @schulzch . I am interested in your paper and am very glad to find this repository.

(update: I skipped the original problem with cmake by installing Qt6 instead of Qt5)

However, I encountered this problem (see below) when I tried to build your project. Below are the details.

The output of cmake ..:

-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The CUDA compiler identification is NVIDIA 11.6.55
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda-11.6/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE  
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Found WrapOpenGL: TRUE  
-- Found Vulkan: /usr/lib/x86_64-linux-gnu/libvulkan.so  
-- Found XKB: /usr/lib/x86_64-linux-gnu/libxkbcommon.so (found suitable version "0.8.2", minimum required is "0.5.0") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tiger/Music/MLBGStippling-master/build

Then the output of make:

[  4%] Building CUDA object libstipple/CMakeFiles/libstipple.dir/src/algorithm/collectcells.cu.o
/home/tiger/Music/MLBGStippling-master/libstipple/src/map.h(10): error: a class or namespace qualified name is required

/home/tiger/Music/MLBGStippling-master/libstipple/src/collections/layervector.cuh(157): error: identifier "m_capacity" is undefined

/home/tiger/Music/MLBGStippling-master/libstipple/src/collections/layervector.cuh(164): error: identifier "m_layerIndices" is undefined

/home/tiger/Music/MLBGStippling-master/libstipple/src/collections/layervector.cuh(164): error: identifier "m_size" is undefined

/home/tiger/Music/MLBGStippling-master/libstipple/src/collections/layervector.cuh(165): error: identifier "m_data" is undefined

/home/tiger/Music/MLBGStippling-master/libstipple/src/collections/layervector.cuh(165): error: identifier "m_size" is undefined

/home/tiger/Music/MLBGStippling-master/libstipple/src/collections/layervector.cuh(166): error: identifier "m_layerIndices" is undefined

/home/tiger/Music/MLBGStippling-master/libstipple/src/collections/layervector.cuh(167): error: identifier "m_data" is undefined

/home/tiger/Music/MLBGStippling-master/libstipple/src/collections/layervector.cuh(169): error: identifier "m_layerIndices" is undefined

/home/tiger/Music/MLBGStippling-master/libstipple/src/collections/layervector.cuh(170): error: identifier "m_data" is undefined

/home/tiger/Music/MLBGStippling-master/libstipple/src/collections/layervector.cuh(83): error: identifier "m_capacity" is undefined

/home/tiger/Music/MLBGStippling-master/libstipple/src/collections/layermaps.cuh(64): error: identifier "m_capacity" is undefined

12 errors detected in the compilation of "/home/tiger/Music/MLBGStippling-master/libstipple/src/algorithm/collectcells.cu".
libstipple/CMakeFiles/libstipple.dir/build.make:75: recipe for target 'libstipple/CMakeFiles/libstipple.dir/src/algorithm/collectcells.cu.o' failed
make[2]: *** [libstipple/CMakeFiles/libstipple.dir/src/algorithm/collectcells.cu.o] Error 1
CMakeFiles/Makefile2:118: recipe for target 'libstipple/CMakeFiles/libstipple.dir/all' failed
make[1]: *** [libstipple/CMakeFiles/libstipple.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2

I am using Linux Mint 19.3 (which is similar to Ubuntu 18.04). I have CUDA (nvcc -V says "Cuda compilation tools, release 11.6, V11.6.55"), qt 6.0.4, and cmake 3.22.2.

How should I resolve this problem?
(Or, would you please provide a more detailed description of your installation?)
Thank you in advance!

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.