public class TrackerEngine
extends javax.swing.JFrame
implements java.awt.event.WindowListener
javax.swing.JFrame.AccessibleJFrame
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
javax.swing.JButton |
analysisButton |
protected java.awt.Menu |
analysisMenu |
boolean |
analysisRunning |
boolean |
analysisStart |
java.awt.MenuItem |
camSettings |
boolean[] |
channelsOn |
javax.swing.JLabel |
commentPanel1 |
javax.swing.JPanel |
controls |
int |
defPixelFormat |
javax.swing.JPanel |
displays |
boolean |
displayVideo |
protected java.awt.Menu |
editMenu |
protected java.awt.Menu |
fileMenu |
static int |
fsTiming |
static int |
FSTIMING_RECORDPROCRUNNER |
static int |
FSTIMING_SYNCHRONOUSCALLBACK |
static int |
FSTIMING_UNKNOWN |
java.io.FileWriter |
fw |
boolean |
hasColorLabel |
boolean |
hasDarkObject |
boolean |
hasLightObject |
boolean |
is3D |
DeviceInterface |
itsDeviceInterface |
float |
itsFramesPerSec |
RecordProc |
itsRecordProc |
RecordProcRunner |
itsRunner |
int |
itsSecsToRun |
org.bridj.Pointer<org.openpnp.libuvc4j.uvc_stream_ctrl> |
itsStreamControl |
float |
itsTimeBetweenFrames |
java.util.Vector<java.lang.Double>[] |
itsTimes |
TrackingJobSettingsGroup |
itsTrackingGroup |
org.bridj.Pointer<org.openpnp.libuvc4j.UvcLibrary.uvc_device_handle> |
itsUVCDeviceHandle |
java.util.Vector<java.lang.Integer>[] |
itsXs |
java.util.Vector<java.lang.Integer>[] |
itsYs |
java.util.Vector<java.lang.Integer>[] |
itsZs |
float |
kRelativeSize |
java.awt.MenuItem |
makeAutoSettings |
java.awt.MenuBar |
menuBar |
LEDButton |
movButton |
javax.swing.JProgressBar |
movieRateReporter |
int |
nativeHeight |
int |
nativeWidth |
int |
nFramesProcessed |
int |
nFramesProduced |
int |
nTrackJobs |
javax.swing.JButton |
referenceButton |
javax.swing.JPanel |
resolutionPanel |
java.awt.MenuItem |
saveExternalRefSettings |
boolean |
setUpDone |
protected java.awt.Menu |
setupMenu |
javax.swing.JButton |
showButton |
boolean |
shuttingDown |
static int |
startUpDelay |
javax.swing.JButton |
stopButton |
java.awt.MenuItem |
tjSettings |
boolean |
toFile |
boolean |
toScreen |
boolean |
toVector |
java.awt.Dimension |
trackerWindowDim |
RHPathPlotter |
trackingC |
protected java.awt.Menu |
trackingMenu |
RHVideoComponent |
videoC |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
TrackerEngine()
empty constructor for the Tracker class.
|
TrackerEngine(java.lang.String title,
int camID)
Standard constructor for the Tracker class.
|
Modifier and Type | Method and Description |
---|---|
void |
addMenus()
sets up menus for the tracking application
|
void |
addPixel(int trackJob,
Pixel aPix)
add a pixel to the Vector
|
void |
configureVideoSource()
configure the source of video frames
|
void |
fileWrite(java.lang.String aString)
main function to report a string to the file
|
void |
fileWriteln()
report a carriage return to the file
|
void |
fileWriteln(java.lang.String aString)
report a string and carriage return to the file
|
int |
getCameraID()
returns the camera ID
|
double |
getFrameRate()
returns the current frame rate
|
java.util.Vector<java.lang.Double> |
getTimes(int i)
return the Vector for the times of a given track job
|
TrackingJobSetting |
getTrackingJobSetting(int i)
return one tracking job
|
TrackingJobSettingsGroup |
getTrackingJobSettingsGroup()
returns the group of tracking jobs
|
AVIProducer |
getVideoProducer()
returns the producer for recording to an AVI movie
|
java.util.Vector<java.lang.Integer> |
getXs(int i)
return the Vector for x coordinates
|
java.util.Vector<java.lang.Integer> |
getYs(int i)
return the Vector for y coordinates
|
java.util.Vector<java.lang.Integer> |
getZs(int i)
return the Vector for z coordinates
|
void |
initializeTracker(float fps,
int secs,
TrackingJobSettingsGroup tJobSettings,
boolean tf,
boolean tv,
boolean ts,
DeviceInterface aDeviceInterface,
java.lang.Object trackingCycler)
initializes the tracker
|
void |
initializeTracker(float fps,
int secs,
TrackingJobSettingsGroup tJobSettings,
boolean tf,
boolean ts,
DeviceInterface aDeviceInterface,
java.lang.Object aTrackingCycler)
initializes the tracker
|
void |
initializeTrackingCycler(java.lang.Object TrackingCycler)
initializes the timing framework, either via a ProcRunner or a callback
|
boolean |
isApplyFilterBeforeDetection()
returns whether an unsharpen filter should be applied to the frame prior to analysis
|
RecordProc |
makeDefaultRecordProc()
makes a new default RecordProc
|
RHPathPlotter |
makePathPlotterComponent(int wid,
int hei)
makes a path plotting component for the tracking application, either a live video display or a movie player
|
RHVideoComponent |
makeVideoComponent(int wid,
int hei)
makes a video component for the tracking application, either a live video display or a movie player
|
void |
pickLabelColorsFromDialog()
fill label colors for TrackingJobs from a ColorChooser Dialog
|
void |
powerDown()
Shutting down the video tracker
|
void |
powerUp()
set-up all the needed parts for capturing objects of interest
|
void |
scaleWindow()
scales the frame of the tracker to fit onto the screen.
|
void |
setApplyFilterBeforeDetection(boolean applyFilterBeforeDetection)
sets whether an unsharpen filter should be applied to the frame prior to analysis
|
void |
setCameraID(int cameraID)
sets the camera ID
|
void |
setDataOutFile()
create a new text file for the captured locations
|
void |
setFrameRate(float fps)
sets the preferred rate for frames/second
|
void |
setRecordProc(RecordProc thisProc)
sets the RecordProc for the tracker
|
void |
setTrackingJobSettingsGroup(TrackingJobSettingsGroup theTrackJobsGroup)
sets the tracking jobs
|
void |
setVanishingTrail(int nTrailImages)
sets the number of captures faded into a vanishing trail.
|
void |
setVideoProducer(AVIProducer theProducer)
sets the producer for recording to an AVI movie
|
void |
startAnalysis()
controls starting the analysis
|
void |
startTrackingCycler()
initializes the timing framework, either via a ProcRunner or a callback
|
void |
stopAnalysis()
controls stopping the analysis
|
void |
updateTrackerLabels()
updates the trackers labels for the installed tracking jobs
|
void |
windowActivated(java.awt.event.WindowEvent e) |
void |
windowClosed(java.awt.event.WindowEvent e) |
void |
windowClosing(java.awt.event.WindowEvent e)
close the window
|
void |
windowDeactivated(java.awt.event.WindowEvent e) |
void |
windowDeiconified(java.awt.event.WindowEvent e) |
void |
windowIconified(java.awt.event.WindowEvent e) |
void |
windowOpened(java.awt.event.WindowEvent e) |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final int FSTIMING_UNKNOWN
public static final int FSTIMING_RECORDPROCRUNNER
public static final int FSTIMING_SYNCHRONOUSCALLBACK
public static final int startUpDelay
public static int fsTiming
public RecordProcRunner itsRunner
public RecordProc itsRecordProc
public org.bridj.Pointer<org.openpnp.libuvc4j.uvc_stream_ctrl> itsStreamControl
public org.bridj.Pointer<org.openpnp.libuvc4j.UvcLibrary.uvc_device_handle> itsUVCDeviceHandle
public float itsFramesPerSec
public float itsTimeBetweenFrames
public int itsSecsToRun
public boolean toFile
public boolean toVector
public boolean toScreen
public final java.awt.MenuBar menuBar
protected java.awt.Menu fileMenu
protected java.awt.Menu editMenu
protected java.awt.Menu setupMenu
protected java.awt.Menu trackingMenu
protected java.awt.Menu analysisMenu
public java.awt.MenuItem saveExternalRefSettings
public java.awt.MenuItem makeAutoSettings
public java.awt.MenuItem camSettings
public java.awt.MenuItem tjSettings
public int defPixelFormat
public int nTrackJobs
public TrackingJobSettingsGroup itsTrackingGroup
public boolean hasDarkObject
public boolean hasLightObject
public boolean hasColorLabel
public int nFramesProcessed
public int nFramesProduced
public java.util.Vector<java.lang.Integer>[] itsXs
public java.util.Vector<java.lang.Integer>[] itsYs
public java.util.Vector<java.lang.Integer>[] itsZs
public java.util.Vector<java.lang.Double>[] itsTimes
public java.io.FileWriter fw
public boolean setUpDone
public boolean analysisStart
public boolean analysisRunning
public boolean shuttingDown
public boolean displayVideo
public float kRelativeSize
public int nativeWidth
public int nativeHeight
public java.awt.Dimension trackerWindowDim
public RHVideoComponent videoC
public RHPathPlotter trackingC
public javax.swing.JPanel displays
public javax.swing.JPanel resolutionPanel
public javax.swing.JProgressBar movieRateReporter
public javax.swing.JPanel controls
public javax.swing.JLabel commentPanel1
public javax.swing.JButton referenceButton
public javax.swing.JButton showButton
public javax.swing.JButton analysisButton
public javax.swing.JButton stopButton
public DeviceInterface itsDeviceInterface
public boolean[] channelsOn
public boolean is3D
public LEDButton movButton
public TrackerEngine(java.lang.String title, int camID) throws java.lang.Exception
title
- window titlejava.lang.Exception
public TrackerEngine() throws java.lang.Exception
title
- window titlejava.lang.Exception
public void initializeTracker(float fps, int secs, TrackingJobSettingsGroup tJobSettings, boolean tf, boolean ts, DeviceInterface aDeviceInterface, java.lang.Object aTrackingCycler) throws java.lang.Exception
fps
- the frames per secondsecs
- the seconds to run, for indefinite use -1tJobSettings
- the specifications for what to look fortf
- log to filets
- log to screenaDeviceInterface
- the robotic interfaceaTrackingCycler
- the analysis procedurejava.lang.Exception
public void initializeTracker(float fps, int secs, TrackingJobSettingsGroup tJobSettings, boolean tf, boolean tv, boolean ts, DeviceInterface aDeviceInterface, java.lang.Object trackingCycler) throws java.lang.Exception
fps
- the frames per secondsecs
- the seconds to run, for indefinite use -1tJobSettings
- the specifications for what to look fortf
- log to filetv
- log to vectorts
- log to screenaDeviceInterface
- the robotic interfaceaTrackingCycler
- the analysis procedurejava.lang.Exception
public void initializeTrackingCycler(java.lang.Object TrackingCycler) throws java.lang.Exception
java.lang.Exception
public void startTrackingCycler() throws java.lang.Exception
java.lang.Exception
public void configureVideoSource() throws java.lang.Exception
java.lang.Exception
public RHVideoComponent makeVideoComponent(int wid, int hei) throws java.lang.Exception
java.lang.Exception
public RHPathPlotter makePathPlotterComponent(int wid, int hei)
public void setVanishingTrail(int nTrailImages) throws java.lang.Exception
nTrailImages
- the number of images until trail vanishesjava.lang.Exception
public void pickLabelColorsFromDialog()
public void addMenus() throws java.lang.Exception
java.lang.Exception
public void powerUp() throws java.lang.Exception
java.lang.Exception
public void powerDown() throws java.lang.Exception
java.lang.Exception
public boolean isApplyFilterBeforeDetection()
public void setApplyFilterBeforeDetection(boolean applyFilterBeforeDetection)
applyFilterBeforeDetection
- needs unsharpen filter before detection?public void setVideoProducer(AVIProducer theProducer) throws java.lang.Exception
theProducer
- the producer for the moviejava.lang.Exception
public AVIProducer getVideoProducer()
public java.util.Vector<java.lang.Integer> getXs(int i) throws java.lang.Exception
i
- the track jobjava.lang.Exception
public java.util.Vector<java.lang.Integer> getYs(int i) throws java.lang.Exception
i
- the track jobjava.lang.Exception
public java.util.Vector<java.lang.Integer> getZs(int i) throws java.lang.Exception
i
- the track jobjava.lang.Exception
public java.util.Vector<java.lang.Double> getTimes(int i) throws java.lang.Exception
i
- the track jobjava.lang.Exception
public void setFrameRate(float fps)
fps
- the preferred frameratepublic double getFrameRate()
public void setDataOutFile()
public void setTrackingJobSettingsGroup(TrackingJobSettingsGroup theTrackJobsGroup) throws java.lang.Exception
theTrackJobsGroup
- an array of track job settings that control object detectionjava.lang.Exception
public TrackingJobSettingsGroup getTrackingJobSettingsGroup()
public TrackingJobSetting getTrackingJobSetting(int i)
i
- index of the track jobpublic void updateTrackerLabels() throws java.lang.Exception
java.lang.Exception
public RecordProc makeDefaultRecordProc() throws java.lang.Exception
java.lang.Exception
public void setRecordProc(RecordProc thisProc) throws java.lang.Exception
thisProc
- the analysis procedurejava.lang.Exception
public void windowClosing(java.awt.event.WindowEvent e)
windowClosing
in interface java.awt.event.WindowListener
public void windowIconified(java.awt.event.WindowEvent e)
windowIconified
in interface java.awt.event.WindowListener
public void windowDeiconified(java.awt.event.WindowEvent e)
windowDeiconified
in interface java.awt.event.WindowListener
public void windowActivated(java.awt.event.WindowEvent e)
windowActivated
in interface java.awt.event.WindowListener
public void windowDeactivated(java.awt.event.WindowEvent e)
windowDeactivated
in interface java.awt.event.WindowListener
public void windowClosed(java.awt.event.WindowEvent e)
windowClosed
in interface java.awt.event.WindowListener
public void windowOpened(java.awt.event.WindowEvent e)
windowOpened
in interface java.awt.event.WindowListener
public void scaleWindow() throws java.lang.Exception
java.lang.Exception
public void startAnalysis()
public void stopAnalysis()
public void fileWrite(java.lang.String aString) throws java.lang.Exception
aString
- the string to reportjava.lang.Exception
public void fileWriteln(java.lang.String aString) throws java.lang.Exception
aString
- the string to reportjava.lang.Exception
public void fileWriteln() throws java.lang.Exception
java.lang.Exception
public void addPixel(int trackJob, Pixel aPix) throws java.lang.Exception
trackJob
- is the particular tracking job for which the pixel was capturedaPix
- the pixel to addjava.lang.Exception
public int getCameraID()
public void setCameraID(int cameraID)
cameraID
- the ID of the camera in the computer's device listRH, 2017