GithubHelp home page GithubHelp logo

mohakpatel / poisson-disc-sampling Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 4.0 10 KB

Matlab script for N-dimensional Poisson-Disc Sampling. This can also be used this to randomly sample k pts from N-dimensional space with minimum separation distance between the points.

License: MIT License

MATLAB 100.00%
poisson-disc-sampling matlab

poisson-disc-sampling's Introduction

Poisson-Disc-Sampling

Matlab script for N-dimensional Poisson-Disc Sampling. This can also be used this to randomly sample k pts from N-dimensional space with minimum separation distance between the points.

###Download Download the latest version v1.0

Inputs:

  • sizeI - [required] Size of volume from which points are to be sampled
  • spacing - [required] Minimum sepration distance between points
  • nPts - [Default is 0] if nPts = 0 For poisson disc sampling. nPts = k to sample k-pts from N-dimensional space with minimum separation distance
  • showIter - [Default is 0] If showIter == 1, this option can be used to see how points are generated through each iteration. It can be useful when code is taking a long time to generate points.

Output:

  • pts - All eligible points

Example:

  • Poisson disc sampling in 2D space.
sizeI = [512,512];  
spacing = 30;  
pts = poissonDisc(sizeI,spacing);  
  • Sample k-pts in 3D space.
sizeI = [512,512,192];  
spacing = 6;  
nPts = 10000;  
pts = poissonDisc(sizeI,spacing,nPts);  
  • Show iteration progress from poisson disc sampling in 2D
sizeI = [512,512];  
spacing = 6;  
nPts = 0;  
showIter = 1;  
pts = poissonDisc(sizeI,spacing,nPts,showIter);  

poisson-disc-sampling's People

Contributors

mohakpatel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

poisson-disc-sampling's Issues

3D Error

Hello, I tried using your code in Matlab for 3D sampling but the error shown below was given.

Index in position 2 exceeds array bounds.

Error in poissonDisc (line 106)
D = D(:,2);

Please help

ask for some help

hello~
i'm a beginner about image processing. recent study the poisson sampling. i test your excellent code.
but i have a question about the input. if i have some 3d data, i want to use the code to sample the data.
how can i achieve the goal?

look forward to your reply~ thank you~

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.