Coder Social home page Coder Social logo

mnt_and_sdf_cuda's Introduction

Parallel Moore-Neighbour Tracing and 2D SDF

This code is part of our TRO submission. It is a CUDA implementation of our parallel Moore-Neighbour Tracing and the 2D SDF.

Introduction

Moore-Neighbour Tracing is a common method to extract the boundary pixels from a binary silhouette. Please refer to here for some more details. The traditional MNT is not run in a parallel process. Here, we improve the traditional MNT such that it is calculated in a different way, and run in a parallel process. The CUDA implementation of our method is released. We also release the code of calculating the 2D SDF from the extracted boundary pixels.

Some more details:

  • MATLAB code to calculate 2D SDF calculate_sdf2D.m
  • MATLAB code to calculate 2D normal vector LineNormals2D.m (based on here).
  • CUDA code in ./src/:
    • main function link MATLAB main_sdf.cpp
    • main function calculate SDF from a binary silhouette main_sdf_cuda.cu, main_sdf_cuda.h
    • some useful vector operators vector_ops.hpp
    • Calculate the normal vector of boundary line_normal.cu
    • calculate Parallel Moore Neighbour Tracing feature_contour.cu, feature_contour_utils.hpp
    • calculate SDF and the gradient of SDF. sdf_contour.cu, sdf_config.h
    • Some other functions cuda_utils.h

Usage

This code has been tested on Ubuntu 16.04 with CUDA 9.0, and MATLAB 2018a.

  • Compile: In MATLAB command window, run calculate_sdf2D.m to compile the CUDA code. Some modification may be needed.
  • Run: an example on how to use the code and a comparison with the MATLAB code is in main_PMNT_and_SDF2D.m.

Contacts:

Yanhao Zhang: [email protected]. Any discussions or concerns are welcomed :)

mnt_and_sdf_cuda's People

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.