What is CrystalUI

Crystal is a Abstract Graphical User Interface. The goal of this project is experiment in the areas of GUI (concurrent/multithreading), advanced input devices camera based hand detection.

The Crystal API is divided into the public API, which is mainly a collection of interfaces and classes that act as glue code and various implementations of the public API.

Channels ver. 21

Here is some more work on Channels.

Image:Channel Concept

I am actually quiet surprised how much complexity there is with trying to define 2 concepts. First a generic hierarchal network "graph" model and a concept of a data channel.

The graph network


At the core of many sophisticated functions of pattern recognition provided by crystal is its graph network. Crystal utilizes a custom graph network for processing images, matching patterns, timing and many other features that would otherwise be extremely hard to implement.

Crystal graphs are made up of 2 main parts. The node and the channel. Of the 2, nodes are more interesting.

Image processing library

I've made significant progress on image processing library needed for hand detection. Here is a little application that using a static image sets up a scene graph with 3 branches that does different type of processing on the source image. The post processed image results of each graph branch are displayed in a swing frame. Below is an sample code in its entirety. When run, it brings up 3 windows with 3 different type of images displayed in them. The code is broken up into smaller sections with images inserted when they are brought up.

Started work on MultiTouch detection using webcam

MultiTouch is a term used to describe UI controls through a touch screen or projection device that can detect multiple touches at the same time. Perfect example is iPhone that allows multiple fingers to interact with the screen such as 2 fingers sliding away from each other causing a picture to be zoomed in.

I started some preliminary work on MT detection. There are many techniques, the most common one and cheapest/easiest to implement is a webcamera that can view the backside of a piece of paper or laminent that tracks shadows cast when you fingers slide on the other side.

Designing the view

The view is where all the real magic takes place. The view is responsible for interfacing with the underlying display medium, input controls and provides the behavior for each component.

A quick look at the class hierarchy. This is currently preliminary and will most likely change after further design review.

Component
 +-o Model
 +-o View
      +-o Geometry - keeps information about the shape of the component
      +-o Behavior - interaction with the user and the environment. 
      |   Yes, components can bounce of each other, users can spin
      |   labels, etc..

Designing the model

The one thing that all crystal implementations are going to have the same, is the Controller and the data Model. I started design on the data model first. After careful design, review and several rewrites I came up with 3 simple models.

  • FlatModel<? extends Model.Data> - holds a single piece of model data
  • ListModel<? extends Model.Data> - holds model data as a list. The list can be arranged and changed at runtime
  • TreeModel<Model.Data> - a hierarchical tree of nodes which hold model data