Class ImageProcess

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--ImageProcess
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

class ImageProcess
extends java.awt.Frame

Author:
Erhan Oztop, 2001-2002

Source code by Erhan Oztop (erhan@atr.co.jp)
Copyright August 2002 via
University of Southern California Ph.D. publication copyright
See Also:
Serialized Form

Inner classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
 double[] askbuf
           
 short[] B
           
 BP bp
           
 java.awt.Button colbut
           
static int COLORSEP
           
 java.awt.Panel cp
           
(package private)  IPcanvas cv
           
(package private)  java.lang.String def_pattern_file
           
(package private)  java.lang.String def_picture_file
           
(package private)  int dstart
           
(package private)  int dupend
           
(package private)  int dupstart
           
(package private)  Point3d[][] fing
           
 short[] G
           
(package private)  int he
           
(package private)  java.awt.TextField hidden
           
 int histmode
           
(package private)  java.awt.Image im
           
 boolean im_done
           
(package private) static int INDEX
           
(package private)  java.awt.TextField input
           
 double learningdecrease
           
 double learningincrease
           
 double learningrate
           
(package private)  java.lang.String[] limbs
           
(package private)  double[][] marker
           
(package private)  int[] markerB
           
(package private)  int markerc
           
(package private)  java.awt.Color[] markerC
           
(package private)  int[] markerG
           
(package private)  int[] markerR
           
(package private)  int[] mask
           
(package private) static int MIDDLE
           
(package private)  int midx
           
(package private)  int midy
           
 double momentum
           
(package private)  java.lang.String[] names
           
 boolean networkset
           
(package private)  java.awt.TextField output
           
 int patc
           
 java.util.Vector pats
           
(package private)  java.awt.TextField pattern
           
 java.awt.image.PixelGrabber pick
           
 int pickB
           
 int pickG
           
 int pickmode
           
 int pickR
           
(package private)  java.awt.TextField picture
           
(package private) static int PINKY
           
 int[] pix
           
 short[] R
           
 boolean recording
           
 short[] resB
           
 short[] resG
           
 short[] resR
           
(package private)  double rgbmindis
           
(package private) static int RING
           
(package private)  boolean splitdone
           
 int sz
           
(package private) static int THUMB
           
(package private) static ImageProcess top
           
(package private)  java.awt.Panel upper
           
(package private)  double VB
           
(package private)  double VG
           
(package private)  double VR
           
(package private)  java.awt.TextField weight
           
(package private)  int wi
           
(package private)  Point3d wrist
           
(package private) static int WRIST
           
 int Xdim
           
 int Ydim
           
 int Zdim
           
 
Fields inherited from class java.awt.Frame
base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, menuBar, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis
 
Fields inherited from class java.awt.Window
active, dbg, focusMgr, inputContext, inputContextLock, nativeActive, OPENED, ownedWindowList, warningString, windowListener, windowSerializedDataVersion
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, needsPaint, printing, printingThreads
 
Fields inherited from class java.awt.Component
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ImageProcess(java.lang.String s)
           
ImageProcess(java.lang.String s, double VR, double VG, double VB)
           
 
Method Summary
 boolean action(java.awt.Event evt, java.lang.Object arg)
           
 void addPattern(int i)
           
 void applyBRMeanMask(int Rad)
           
 void applyMask(double[][] M, int Rad)
           
 void applyMaxMask(int Rad)
           
 void applyMeanMask(int Rad)
           
 void applyMedianMask(int Rad)
           
 java.lang.String bitcode(int tot, int i)
           
 void bp_histit(Node n)
           
 void clearPattern()
           
 void closePattern()
           
 Point3d color2ix_bot(java.lang.String c)
           
 Point3d color2ix_top(java.lang.String c)
           
 Point3d color2ix(java.lang.String c)
           
 java.lang.String compactbitcode(int tot, int i)
           
 boolean connected(int ix, Node n)
           
 double dist(Point3d p1, Point3d p2)
           
 void extract0()
           
 void extract1()
           
 void fillRGB()
           
(package private)  int getHSVclose(float r, float g, float b)
           
 double getLen(int l1, int j1, int l2, int j2)
           
 Point3d getOrientation()
           
 double getPalmLen()
           
(package private)  int getRGBclose(float r, float g, float b)
           
 boolean handleEvent(java.awt.Event evt)
           
 void histit(Node n)
           
 void hsv_histit(Node n)
           
(package private)  double hsvdist(double r0, double g0, double b0, double r1, double g1, double b1)
           
 boolean imageUpdate(java.awt.Image img, int infoflags, int x, int y, int width, int height)
           
 void initimg()
           
 int interpretAns(double[] ans)
           
 void loadPicture(java.lang.String s)
           
static void main(java.lang.String[] argv)
           
(package private)  double[][] makeMeanMask(int rad)
           
 boolean mouseDown(java.awt.Event evt, int x, int y)
           
 boolean mouseMove(java.awt.Event evt, int x, int y)
           
static java.io.DataInputStream openfileREAD(java.lang.String fn)
           
static java.io.DataOutputStream openfileWRITE(java.lang.String fn)
           
 void paint(java.awt.Graphics g)
           
 void repaint()
           
 void resetMarker()
           
(package private)  double rgbAngle(double r0, double g0, double b0, double r1, double g1, double b1)
           
(package private)  double rgbdist(double r0, double g0, double b0, double r1, double g1, double b1)
           
(package private)  double rgbdist0(double r0, double g0, double b0, double r1, double g1, double b1)
           
 void saveExtract(java.lang.String fn)
           
 void saveRecorded(java.lang.String fn)
           
 void setupButtons()
           
 void showColors()
           
 void startPattern()
           
 void switchRGB()
           
 Point3d tohsv(double r, double g, double b)
           
 
Methods inherited from class java.awt.Frame
, addNotify, addToFrameList, constructComponentName, finalize, getAccessibleContext, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, initIDs, isResizable, paramString, postProcessKeyEvent, readObject, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle, writeObject
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, adjustListeningChildren, applyResourceBundle, applyResourceBundle, checkNull, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, processWindowEvent, removeOwnedWindow, removeWindowListener, resetGC, setCursor, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, numListening, paintComponents, paintHeavyweightComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, hasFocus, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDrag, mouseEnter, mouseExit, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

top

static ImageProcess top

cv

IPcanvas cv

im

java.awt.Image im

VR

double VR

VG

double VG

VB

double VB

wi

int wi

he

int he

midx

int midx

midy

int midy

im_done

public boolean im_done

upper

java.awt.Panel upper

splitdone

boolean splitdone

pick

public java.awt.image.PixelGrabber pick

pix

public int[] pix

R

public short[] R

G

public short[] G

B

public short[] B

resR

public short[] resR

resG

public short[] resG

resB

public short[] resB

sz

public int sz

askbuf

public double[] askbuf

networkset

public boolean networkset

bp

public BP bp

Xdim

public int Xdim

Ydim

public int Ydim

Zdim

public int Zdim

learningrate

public double learningrate

momentum

public double momentum

learningincrease

public double learningincrease

learningdecrease

public double learningdecrease

pats

public java.util.Vector pats

patc

public int patc

recording

public boolean recording

cp

public java.awt.Panel cp

colbut

public java.awt.Button colbut

pickR

public int pickR

pickG

public int pickG

pickB

public int pickB

pickmode

public int pickmode

COLORSEP

public static final int COLORSEP

names

java.lang.String[] names

mask

int[] mask

markerR

int[] markerR

markerG

int[] markerG

markerB

int[] markerB

markerC

java.awt.Color[] markerC

marker

double[][] marker

markerc

int markerc

dstart

int dstart

def_pattern_file

java.lang.String def_pattern_file

def_picture_file

java.lang.String def_picture_file

picture

java.awt.TextField picture

pattern

java.awt.TextField pattern

weight

java.awt.TextField weight

input

java.awt.TextField input

hidden

java.awt.TextField hidden

output

java.awt.TextField output

dupstart

int dupstart

dupend

int dupend

rgbmindis

double rgbmindis

histmode

public int histmode

PINKY

static final int PINKY

RING

static final int RING

MIDDLE

static final int MIDDLE

INDEX

static final int INDEX

THUMB

static final int THUMB

WRIST

static final int WRIST

wrist

Point3d wrist

fing

Point3d[][] fing

limbs

java.lang.String[] limbs
Constructor Detail

ImageProcess

public ImageProcess(java.lang.String s)

ImageProcess

public ImageProcess(java.lang.String s,
                    double VR,
                    double VG,
                    double VB)
Method Detail

setupButtons

public void setupButtons()

resetMarker

public void resetMarker()

loadPicture

public void loadPicture(java.lang.String s)

rgbAngle

double rgbAngle(double r0,
                double g0,
                double b0,
                double r1,
                double g1,
                double b1)

rgbdist0

double rgbdist0(double r0,
                double g0,
                double b0,
                double r1,
                double g1,
                double b1)

rgbdist

double rgbdist(double r0,
               double g0,
               double b0,
               double r1,
               double g1,
               double b1)

tohsv

public Point3d tohsv(double r,
                     double g,
                     double b)

hsvdist

double hsvdist(double r0,
               double g0,
               double b0,
               double r1,
               double g1,
               double b1)

getHSVclose

int getHSVclose(float r,
                float g,
                float b)

getRGBclose

int getRGBclose(float r,
                float g,
                float b)

applyMaxMask

public void applyMaxMask(int Rad)

applyBRMeanMask

public void applyBRMeanMask(int Rad)

applyMeanMask

public void applyMeanMask(int Rad)

applyMask

public void applyMask(double[][] M,
                      int Rad)

switchRGB

public void switchRGB()

applyMedianMask

public void applyMedianMask(int Rad)

makeMeanMask

double[][] makeMeanMask(int rad)

histit

public void histit(Node n)

bp_histit

public void bp_histit(Node n)

hsv_histit

public void hsv_histit(Node n)

connected

public boolean connected(int ix,
                         Node n)

showColors

public void showColors()

color2ix_bot

public Point3d color2ix_bot(java.lang.String c)

color2ix_top

public Point3d color2ix_top(java.lang.String c)

color2ix

public Point3d color2ix(java.lang.String c)

getPalmLen

public double getPalmLen()

getLen

public double getLen(int l1,
                     int j1,
                     int l2,
                     int j2)

getOrientation

public Point3d getOrientation()

extract0

public void extract0()

dist

public double dist(Point3d p1,
                   Point3d p2)

extract1

public void extract1()

saveExtract

public void saveExtract(java.lang.String fn)

initimg

public void initimg()

fillRGB

public void fillRGB()

mouseDown

public boolean mouseDown(java.awt.Event evt,
                         int x,
                         int y)
Overrides:
mouseDown in class java.awt.Component

mouseMove

public boolean mouseMove(java.awt.Event evt,
                         int x,
                         int y)
Overrides:
mouseMove in class java.awt.Component

interpretAns

public int interpretAns(double[] ans)

handleEvent

public boolean handleEvent(java.awt.Event evt)
Overrides:
handleEvent in class java.awt.Component

action

public boolean action(java.awt.Event evt,
                      java.lang.Object arg)
Overrides:
action in class java.awt.Component

main

public static void main(java.lang.String[] argv)

imageUpdate

public boolean imageUpdate(java.awt.Image img,
                           int infoflags,
                           int x,
                           int y,
                           int width,
                           int height)
Overrides:
imageUpdate in class java.awt.Component

repaint

public void repaint()
Overrides:
repaint in class java.awt.Component

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Container

compactbitcode

public java.lang.String compactbitcode(int tot,
                                       int i)

bitcode

public java.lang.String bitcode(int tot,
                                int i)

addPattern

public void addPattern(int i)

saveRecorded

public void saveRecorded(java.lang.String fn)

closePattern

public void closePattern()

startPattern

public void startPattern()

openfileREAD

public static java.io.DataInputStream openfileREAD(java.lang.String fn)
                                            throws java.io.IOException

openfileWRITE

public static java.io.DataOutputStream openfileWRITE(java.lang.String fn)
                                              throws java.io.IOException

clearPattern

public void clearPattern()