tangible vcki

about the demo

This demo is a proof of concept for using topcodes to simulate the functionality of the scheduling grid. In a real-world situation, circular tokens (perhaps coins) with a topcode on each side (representing pills) would be placed on the grid by a user, and then photographed. The resulting picture would be fed into a program similar to the demo code to extract the positions of the tokens within the grid.

To run the demo, execute the meds.GridReader class (you'll need the meds.GridParser class, as well as the topcodes.* classes in your classpath). Give it a single argument, which is the path/location of the JPEG image from which you want to read the scheduling grid's content. (For now, that image must have the same basic shape, size, and structure as the image below — but the number and position of the topcodes may be varied to your heart's content.) Assuming everything works as planned, this will print a YAML document to stdout summarizing the contents of the grid (see below). I chose YAML because it's easy to construct using simple println statements, and easy to de-serialize in a wide variety of computer languages (or convert to more sophisticated formats, such as XML, for processing with other tools).

Below is an artificial schedule image for testing purposes, and below that, the output it generates. The code will have to be altered for use with photographic images, but such modifications ought to be straightforward. (One approach would be to use unique topcodes to mark the corners of the grid, from which the positions of the internal topcodes could be interpolated.)

a contrived weekly schedule

Contrived weekly schedule

image key:

Columns: Days of the week (i.e. Sunday - Saturday)
Rows: Times of day (i.e. morning, afternoon, night)
Advil: Advil Celebrex: Celebrex Lipitor: Lipitor Tylenol: Tylenol Viagra: Viagra Xanax: Xanax

Note: the medication names in the image are merely decoration for human convenience — they don't play a role in the topcode recognition.

output (in YAML) of meds.GridReader:

---
sunday:
  morning:
  afternoon:
  night:
monday:
  morning:
    pill: Celebrex
  afternoon:
  night:
    pill: Tylenol
tuesday:
  morning:
    pill: Advil
  afternoon:
    pill: Xanax
    pill: Lipitor
  night:
    pill: Tylenol
wednesday:
  morning:
    pill: Celebrex
  afternoon:
  night:
    pill: Tylenol
thursday:
  morning:
    pill: Advil
  afternoon:
    pill: Lipitor
    pill: Xanax
  night:
    pill: Tylenol
friday:
  morning:
    pill: Celebrex
  afternoon:
  night:
    pill: Viagra
    pill: Tylenol
saturday:
  morning:
  afternoon:
  night:
    pill: Viagra
Powered by vcki © Copyright 2007 Eli Marschner