Skip to content
This repository has been archived by the owner on Sep 29, 2020. It is now read-only.
/ vpipe Public archive

Image processing & contour extraction

Notifications You must be signed in to change notification settings

mknblch/vpipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image processing & contour extraction

This is my Avantgarde Labs Hackathon 2018 Project - an image processing pipeline using J8 functional patterns.

Overview

The framework utilizes the power and simplicity of j8's functional patterns to get its work done. They provide everything needed to build an image processing pipeline. In fact, the part of the code I would call the framework consists of only a few classes like Source, Split and Merge. Im using Sarxos's great Webcam Capture Library to access data stream from my webcam. Everything else is implemented as separate processing unit.

Processing units are nothing more then a java.util.function.Function<I, O> which itself can be composed to a full processing pipeline using its built-in methods compose(..) and andThen(..). Additionally the Source<T> interface exists which is just an extended Supplier<T> with some helper methods to chain it with processing units.

These units are defined in de.mknblch.vpipe.Functions.* and implement some basic image processing functions like Color/Intensity-to-Color/Intensity image transformation, spatial convolution, contour extraction and some visualization units to transform the image back into a BufferedImage.

A common pipe is shown below:

    import static de.mknblch.vpipe.Functions.*;

    final Source<BufferedImage> pipe = SarxosWebcamSource.choose()
            .connectTo(grayscale())
            .connectTo(contrast(2))
            .connectTo(contours(128))
            .connectTo(renderAll(640, 480));

    Viewer.start(pipe);

Maven

Yep - Im using github as poor-mans-repo ;)

<repositories>
    <repository>
        <id>vpipe-mvn-repo</id>
        <url>https://raw.github.com/mknblch/vpipe/mvn-repo/</url>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>de.mknblch.vpipe</groupId>
        <artifactId>vpipe</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
</dependencies>

ToDo's

  • add multithreading in de.mknblch.vpipe.core.Split using a predefined thread pool
  • pattern recognition (fourier descriptors)

Examples

contours

contours

colorization by depth in the contour tree

contours

drawing bounding boxes instead of contours gives you this

contours

using a more complex pipe which splits the image into its 3 colors and computes the contours on each of them separately leads to this view

contours

besides all the sexy looking images the software can also do some useful stuff like adding gifs to your webcam image in real time ;)

contours

Releases

No releases published

Packages

No packages published

Languages