Giter VIP home page Giter VIP logo

cs5237-voronoiart's Introduction

About Me

I hail from New Zealand.

I studied my undergraduate degree BComp (Hon) at the National University of Singapore, 2011-2015.

I’m currently based in Vietnam.

Repositories

cs5237-voronoiart's People

Contributors

blackening avatar danny90 avatar rgoulter avatar vinaybenny avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

robinlzw

cs5237-voronoiart's Issues

Screenshots for README

The main 'cool' thing about this project is its visuals (& its computational geometry).

Having the README without screenshots is lame.

MyPanelOpenGL is quite a mess

At the moment, this class does a lot of stuff; and seems to be responsible for everything from
handling mouse events, maintaining the current structures used by the algorithms, and state / input from the buttons / widgets of the UI.

Surely some of these responsibilities can be split out into other classes.

Licences

What licence does this repo have?
& the licences of its dependencies?

Improve Windows Build Instructions

Currently, it's unclear what the setup / build instructions are for Windows.

AppVeyor already has everything installed, so it's presumably somewhat easier to build.
(Travis runs on Linux/macOS; where it's easier to know the commands to run to install these things).

This may include looking at whatever C++ "package" solutions are available for Windows.

Investigate (or Remove/Replace) the Implementation of Fortune's

  • Wasn't implemented (nor modified!) by the authors of this project
  • Seems that "normally" the algorithm's getEdges returns with ... (start, a, b) where start has numbers.
    • In degenerate cases, the start of the VEdge will have Nan.
    • I guess our polygon-construction (using winged-edges and everything) assumes this isn't the case?
  • In the main.cpp of the code using this implementation, the points generated are all doubles, up-to-10000 in x, y coordinate. Our values are integers, and much smaller range.
    • With that kindof input, the implementation frequently runs into cases with NaN values in its start VPoint.

I don't know if it's a matter of:

  • just render these edges anyway (will still look 'nice'); and buggy polygon-construction(?)
  • the algorithm suffers too badly in edge cases.

In any case; probably better to just get rid of it for now; maybe investigate using some implementation of Fortune's if it turns out the Delaunay one is just too slow.

Windows Deployment

My understanding is that currently, the built executable assumes that e.g. OpenCV, Qt5, and other DLLs are available on the PATH.

This means that it's not easy to share the built artifact + run on a different machine.

Our StopWatch should be 'portable', so doesn't need <windows.h>

windows.h pollutes the global namespace, so we can't use the name Polygon.

Our timing needs aren't super precise; simple C methods for getting differences in time suffice for our usage. (Which is mostly just debugging / showing time some step took).

Improve UX: RadioButtons for 'Render Mode'

The way the software can be used, is that it can show:

  • The loaded image
  • The 'find edges' computation from the image
  • Gaussian blurs of the find-edges; and the subtraction of these (to get the Probability Distribution)
  • The "stained glass" effect.

The original intention was to lay out the buttons in a way that it illustrated this process.
I don't think that's very clear.
I think radio buttons (and disabling/enabling them as makes sense) would be a better approach.

Improve clean-up discipline

Parts of the project use raw pointers, and also e.g. Qt5 connections
which probably need to be cleaned up.

Split up the point-generation code

The problem is:
The VornoiCLI program is just a debugging toy. It's useful for "just running the algorithm" when the
algorithm is broken. (e.g. for when we used the bad impl. of Fortune's; or when using imprecise arithmetic for Delaunay).

All the same, it uses point generation code from the 'lib' target. -- It seems stupid to me that this would depend on the OpenCV library. However, this is because the point generation code includes this fancy "edge-detection probability distribution field", which uses OpenCV.

That's ... a bit messy.
The point generation should be split between the uniform-random (which doesn't need OpenCV) and the edge-detection PDF (which does).

Fix Windows Build

Commits since 2013 had broken the build for Windows.

e.g. use of namespaced geometry::Polygon as Polygon conflicts with a function (macro?) from windows.h.
Also references to SOIL.h and other things like that.

Improve notes on Delaunay Triangulation, Fortune's Algorithm

The project has two algorithms:

  • Delaunay triangulation
  • Fortune's Algorithm

The algorithms aren't well documented here. Without that domain knowledge, it's difficult to
make sense of how the code ought to be structured.

Either discuss (with diagrams?), or link to places which do explain/discuss.

AppVeyor Build for MSVC with vcpkg

Once the build works for Windows, it would be beneficial to set up the project
to be built on AppVeyor.

This is good project practice; would help ensure the build doesn't break unintentionally if maintained from Linux or macOS.

Refactor Unit Tests

Catch2 (see #10) allows for more concisely written unit tests, which makes things more readable/apparent than the transliteration of the GTests which I have now.

Improve debuggability

Currently:

  • sprinkled throughout the code are some commented-out cout << ... statements.
  • As well as some "stopwatch" timings.
  • And there doesn't seem to be an easy way to grab the input points used / retry with these.
  • Nor is it obvious how "far through" an algorithm is.

These kind of log remarks and timings may be useful for a Debug build, but not Release. :-)
(It'd be nice to compile-time enable things like this for a Debug build, and omit them in a Release build).

Segfaults

Haven't touched this in quite a while,
but building/running now segfaults the program. (Running on Arch Linux).

Steps to Reproduce

  1. Run program; open an image.
  2. Draw image.
  3. Generate random points.
  4. Segfaults when clicking "Compute Voronoi Diagram" or so.

Segfault happens in polypixel.cpp, findSomeColor3iv(), when accessing loadedImageData.

Template-ize Delaunay Code to use non-LongInt

It seems to me that the Delaunay's dag-node's find leaf nodes with edge is more expensive than it needs to be.

The method does use an expensive computation: 'is point in tri'.

At the moment, the Delaunay triangulation code is slow because it's using precise arithmetic (with LongInt). I suspect this code could be 'quicker' if using int (or double).
-- Although I'm not sure what detriment a small error-in-precision would cause.

Unit Tests for the Delaunay Algorithm

Currently, there are unit tests for the structures used by the algorithms,
but no unit tests for the algorithms Delaunay Algorithm we use.

I don't expect the algorithms perform well in edge cases. But there ought to be unit tests for basic cases.

Since many of the unit tests are geometric, having e.g. SVG diagrams of these may be helpful.
https://www.draw.io/ seems a nice, convenient way to make illustrations for this.

Improve UX: Colours of vertices / edges

Currently, the edges are just plain blue. The vertices are plain black.

The blue looks uninspiring against images.

The black isn't useful against the black-and-white find-edges / etc. renderings.

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.