LemmingsScanner release

Here the release of my new contour scanner.

https://github.com/clankill3r/LemmingsScanner/releases

A preview:

It's supper fast! Please tell me if you used it and come with any feedback. I need to work on the examples there are a few but it only covers a small part of the possibilities.

Comments

  • really Super fast ! Thanks

  • If someone make any cool project with it then please post it here. I will list it on my website later.

  • what does it do exactly? you give it as input ? (images, functions?) and it generates a set of contour lines?

  • edited August 2014

    You can scan a image on a Threshold like any blobscanner.

    After that you can get the blobs as a Blob object. This has the method getCornerVectors() and getEdgeVectors() which both returns a ArrayList.

    For example:

    ArrayList<PVector> corners = someBlob.getCornerVectors();

    Or to get normalized values use (almost every method can be accessed like this to get the normalized version): ArrayList<PVector> corners = someBlob.normalized.getCornerVectors();

    There are methods to draw, also for the normalized version which make it easy to draw something smaller or bigger, or do certain math with it.

    For the rest, the methods are pretty much like other contour scanners. The algorithm however is not. It does not have to scan every pixel in the image which can increase speed a lot. If you don't want blobs smaller then 16 pixels for example, then why check every row? What it does it checks for a edge. If it fins a edge then it check's if this edge is already on existing blob. If it's not it follows the contour in a clockwise motion until it reaches the start again, then we know the contour is complete.

    It can scan one threshold value less then other contour scanners, this is a small downside. However, this allows me to never check for the bounds of an image when following the edge which is also a huge speed increase.

    Also you can set a lot of options which can influence memory usage and speed:

    scanner = new ContourFinder()
            .setInitialBlobNumber(100)
            .setMinBlobHeight(0)
            .setMinBlobWidth(0)
            .setMaxBlobWidth(0)
            .setScanIncrementX(32)
            .setScanIncrementY(64)
            .setAddAllEdgesToContour(true)
            .setMaxEdgeIndexes(5000)
            .setMaxCornerIndexes(2000)
            .setComputeContainingBlobs(true)
            .setComputeEnclosedBlobs(true)
            .setNormalizeCornerVectors(true)
            .setROI(50, 50, 100, 75)
            ;
    

    Don't get scared, the default values are good and the algorithm is quite smart. If something doesn't needs to be calculated then it probably won't.

Sign In or Register to comment.