Image Ray Transform

This Java 6 applet provides a demonstration of the image ray transform, a technique that uses an analogy to light to find features within images. If you wish to use the applet on your own images you must use the signed version and accept the security certificate.

Some examples of the transform results can be viewed here.

A jar of the code is available. It was originally written in Python/C with F2PY, but ported to Java for this applet. An explanation of the transform is available, although reading my publications will provide a better description.

Instructions

  1. Load an image from the provided list. (See above if you wish to use your own image).
  2. Select the type of transform you wish to perform:
    • Single Ray - One ray at a time.
    • Beam - Multiple rays at a time that can affect each other.
    • Symmetry - Two rays, whose paths are compared for symmetry.
  3. Select the type of Collision policy you wish to use (Only high to low generally gives the best results):
    • Only High to Low - Calculate refraction/reflection only when n1>n2
    • Only Low to High - Calculate refraction/reflection only when n2>n1
    • All - Always calculate refraction/reflection
  4. Select how to calculate refractive indices:
    • Linear - Linearly spaced between 1 and nmax
    • Exponential - Exponentially spaced, controlled by k
  5. Select other parameters.
    • nmax: Maximum linear refractive index.
    • k: Divisor in exponential refractive index calculation.
    • d: Maximum number of refractions/reflections before ray tracing is stopped.
    • l: Maximum length ray can travel before tracing is stopped
    • t: The intensity which will have the highest refraction index
    • B: Number of rays in a beam
    • γv: How quickly rays in a beam converge to the mean
    • σ:Distance parameter in symmetry calculation
  6. Clicking start will initilise the transform.
  7. Use the display combobox to select what which image to look at:
    • Original - Original image.
    • Material - The material matrix, each intensity is a different material.
    • Accumulator - The output of the transform.
    • Normal Direction - The directions of the normals. 0=0, 255 =2π.
    • Edge Magnitude - The edge map of the image.
    • Symmetry - The symmetry accumulator (only during symmetry transform,
  8. The step button will trace the number of rays set in "Step Size", whilst play will continuously trace rays, the time spent on each one being configurable by changing "Step time". Pause will stop the transform.
  9. Once a ray has been traced, on the accumulator image there will be a red line, showing the path of the ray. The coloured dots indicate different events that have occured at those points:
    • Green - Ray was initialised here
    • Cyan - Ray reflected here
    • Yellow - Ray Refracted here
    This can be turned off by unchecking the highlight last ray box
  10. Once initialised the parameters of the transform cannot be changed, pressing the Reset button will stop it and allow modification.
Please contact me at with any comments, suggestions, bugs, or interesting results.