Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about the weighting method for recalculating centers #12

Open
i-make-robots opened this issue Dec 12, 2017 · 3 comments
Open

Comments

@i-make-robots
Copy link

https://github.com/evil-mad/stipplegen/blob/master/StippleGen/StippleGen.pde#L838

What is going on with the scale factor and the maxSize here? The sample rate across a cell greatly affects the change to the voronoi... but I don't get why, it's not intuitive. None of the papers I've found discuss the tweaking you're doing here. Please break it down for me coz I'm lost and I'd really like to improve my weighting results.

I get that the rate is higher for smaller cells, and I have played with different rates. Bad scaling makes points jump around like crazy or settle into a nearly even grid. The sweet spot is hard to find!

@oskay
Copy link
Contributor

oskay commented Dec 12, 2017

We're essentially drawing a raster grid across the individual voronoi cell, and using that grid to compute the weighted centroid. (Why raster? Because we're comparing it to the original rastered image.) To keep accuracy and computation times reasonable, we scale each cell up (or down) to be about 50-100 pixels across, before creating the grid.

@i-make-robots
Copy link
Author

In my code i used an consistent step size (1) regardless of cell shape. produced a very even grid of cells. Unsatisfied, I tried stepSize = maxSize/cellBuffer, but quality varies with number of cells (or relative cell size?). I tried the while loops as you have them and one number kept going to -infinity, never ending loop.

@oskay
Copy link
Contributor

oskay commented Dec 12, 2017

Um, there might be a bug in your code then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants