public class RecordProc
extends java.lang.Object
Constructor and Description |
---|
RecordProc()
empty private constructor ensures that the variables are enumerated
|
Modifier and Type | Method and Description |
---|---|
void |
addReferenceImageEdit(ImageEdit imgEdit)
adds an image edit to the list of reference edits for the RecordProc
|
void |
adjustAnalysisRectDimensions(int theWidth,
int theHeight)
adjusts the max dimensions of the analysis rects if they extend outside the videoframe
|
void |
applyFilter(org.opencv.core.Mat diffFrame)
applies a filter to the Mat
|
boolean |
confirmReferenceAvailable()
assures that a reference frame is available
|
void |
displayReference()
display the reference frame in the tracking canvas
|
void |
doAutoSetup()
sets the task state of the RecordProc to perform a search for an object of interest
|
void |
doCustomProcessing(java.util.List<TargetCaptureData> targetList)
replace this with whatever custom processing you like to do on the TargetCaptureDataList
|
void |
doFadeTrail()
report the current time to wherever needed
|
void |
doPrepare()
sets the task state of the RecordProc to prepare for processing
|
void |
doReference()
sets the task state of the RecordProc to reference acquisition
|
void |
doShowSetup()
sets the task state of the RecordProc to perform a search for an object of interest
|
void |
drawFrontToTracking(TargetCaptureData aTCD)
draws the object onto the tracking canvas
|
void |
drawObjectToTracking(TargetCaptureData aTCD)
draws the object onto the tracking canvas
|
void |
drawSurroundToTracking(TargetCaptureData aTCD)
draws the object onto the tracking canvas
|
int |
execute()
performs the basic time management needed for RecordProcs, call this method
from your subclass to see whether your function should record or not
|
java.util.List<TargetCaptureData> |
executeTrackingJob(TrackingJobSetting tJobSetting)
execute the tracking job
|
java.util.List<SGPolygon> |
findPolygons(TrackingJobSetting tJobSetting)
shows the objects found by the current settings
|
void |
finishUpFrame()
does whatever needs to be done after each cycle of the tracker
|
java.util.List<SGPolygon> |
getAutoObjects(TrackingJobSetting tJobSetting)
returns a guess for the objects to track
|
java.lang.Object |
getExternalData()
gets the Object to print after the data
|
double |
getFrameRate()
returns the preferred frame rate
|
java.util.List<ImageEdit> |
getReferenceImageEdits()
gets the reference edits for the RecordProc
|
java.util.List<TargetCaptureData> |
getTargetDataForTrackJob(TrackingJobSetting tJobSetting)
report the info on the matching target
|
int |
getTaskState()
gets the task state of the RecordProc
|
void |
getVideoImage(java.lang.Object frameObject)
fill the basic uncompressed image data into its proper slot.
|
void |
handleAutoObjects()
handles the nitty-gritty of the setup procedure
|
void |
handleAutoReferenceBackground(TrackingJobSetting tJobSetting)
handles the auto background settings
|
void |
handleAutoReferenceBackgrounds()
handles the auto background settings
|
void |
handleLiveDeviceControl(java.util.List<TargetCaptureData> theTargetDataList)
handle the live device control based on the capture locations from the tracking jobs.
|
void |
handlePrepareProcessing(int theWidth,
int theHeight)
prepare everything for tracking
|
void |
handleReference()
installs the reference frame and displays it in the PathPlotter
|
void |
handleShowSetup()
shows the objects selected with the current settings
|
void |
listTargetDataList()
list of found targets
|
void |
makeImagePixels()
makes the ImagePixels from the video source
|
java.util.List<TargetCaptureData> |
makeTargetDataList(TrackingJobSetting tJobSetting)
collate a list of found targets
|
void |
processTargetDataList(TrackingJobSetting tJobSetting)
process the list of found targets
|
void |
readPNGToRef()
reads a reference frame from a file
|
void |
renderReference()
installs image edits into the reference frame
|
void |
reportCoordinate(Pixel aPixel)
write the pixel coordinates into the reports
|
void |
reportCoordinateX(int theX)
write the x pixel coordinates into the reports
|
void |
reportCoordinateY(int theY)
write the x pixel coordinates into the reports
|
void |
reportDescriptors(int tjNum,
int tjNum_obj)
write the pixel coordinates into the reports
|
void |
reportOverallResults()
reports whatever final results the procedure has collected
|
void |
reportResults(TrackingJobSetting tJobSetting)
plots coordinates and reports target results
|
void |
reportSetup(TrackingJobSetting tJobSetting,
java.util.List<SGPolygon> foundPolys)
plots the setup polygons and reports the setup parameters
|
void |
reportTargetData(TrackingJobSetting tJobSetting,
int tjNum_obj,
TargetCaptureData aTgD)
write the target's capture data into the reports
|
void |
reportTimeStamp()
report the current time to wherever needed
|
void |
saveRefToPNG()
saves the reference frame to a file
|
void |
setAutoReferenceBackground(TrackingJobSetting tJobSetting,
java.util.List<SGPolygon> foundPolys)
returns a guess for the objects to track
|
void |
setExternalData(java.lang.Object anExternalConditionObj)
sets the Object to print after the data
|
void |
setFrameRate(double fps)
sets the preferred frame rate
|
void |
setReferenceImageEdits(java.util.List<ImageEdit> refEdits)
sets some reference edits for the RecordProc
|
void |
setTaskState(int taskState)
sets the task state of the RecordProc
|
void |
setTracker(TrackerEngine sgt)
sets the tracker which controls this RecordProc
|
void |
setupAnalysis()
coordinates what needs to be done at the start of analysis
|
java.util.List<TargetCaptureData> |
splitBiggestTarget(java.util.List<TargetCaptureData> targetList,
TrackingJobSetting tJObj)
splits targets if needed
|
void |
startAnalysis()
start the tracking
|
void |
stopAnalysis()
stop the tracking
|
void |
uncompressRawImage()
uncompress the raw compressed image into pixelData_V
|
void |
updateReference()
placeholder for updating the reference frame.
|
void |
updateRunTime()
update the time
|
void |
updateTrackingComponent()
updates the tracking component
|
void |
updateVideoComponent()
updates the video display component
|
void |
writeLineEnd()
wraps up a line in file or on screen
|
public static final int IDLE
public static final int PREPARE
public static final int REFERENCE
public static final int AUTOSETUP
public static final int ANALYSIS
public static final int EXTERNALREFERENCEIN
public static final int EXTERNALREFERENCEOUT
public static final int SHOWSETUP
public TrackerEngine itsTracker
public double itsPreferedfps
public double millisBetweenFrames
public ImagePixelMat theDiffPixelsD
public ImagePixelMat theDiffPixelsL
public ImagePixelMat theDiffPixelsC
public long startAnalysisTime
public long currentTime
public long runTime
public java.lang.String runTimeString
public double nextFrameTime
public long frameTime
public boolean isGrayScale
public java.lang.Object rawDataObject
public java.awt.image.BufferedImage refBufferedImage
public java.util.List<TargetCaptureData> itsTargetDataList
public java.awt.image.BufferedImage itsImage_V
public int intsPerRow
public RHVideoComponent itsVideoC
public java.awt.image.ColorModel colorModel
public int[] masks
public org.opencv.core.Mat frame_mod
public org.opencv.core.Mat refFrame
public org.openpnp.libuvc4j.UvcLibrary.uvc_frame_callback_t itsCallBack
public boolean initialCapturesDone
public boolean reportExtended
public boolean plotExtended
public boolean drawObject
public boolean drawFront
public boolean drawSurround
public long nextRenderedFrameTime
public boolean splitTargets
public RecordProc()
public void setFrameRate(double fps)
fps
- the number of frames that should be captured per secondpublic double getFrameRate()
public int getTaskState()
public void setTaskState(int taskState)
taskState
- the task statepublic java.util.List<ImageEdit> getReferenceImageEdits()
public void setReferenceImageEdits(java.util.List<ImageEdit> refEdits)
refEdits
- the image edit listpublic void addReferenceImageEdit(ImageEdit imgEdit)
imgEdit
- the image editpublic void readPNGToRef() throws java.lang.Exception
java.lang.Exception
public void saveRefToPNG() throws java.lang.Exception
java.lang.Exception
public void doPrepare() throws java.lang.Exception
java.lang.Exception
public void handleReference() throws java.lang.Exception
java.lang.Exception
public void renderReference() throws java.lang.Exception
java.lang.Exception
- ...public void displayReference() throws java.lang.Exception
java.lang.Exception
public void doReference() throws java.lang.Exception
java.lang.Exception
public void doAutoSetup() throws java.lang.Exception
java.lang.Exception
public void doShowSetup() throws java.lang.Exception
java.lang.Exception
public java.lang.Object getExternalData()
public void setExternalData(java.lang.Object anExternalConditionObj) throws java.lang.Exception
anExternalConditionObj
- the Object to report at end of framejava.lang.Exception
public java.util.List<SGPolygon> getAutoObjects(TrackingJobSetting tJobSetting) throws java.lang.Exception
tJobSetting
- the trackjob settingjava.lang.Exception
public void setAutoReferenceBackground(TrackingJobSetting tJobSetting, java.util.List<SGPolygon> foundPolys) throws java.lang.Exception
tJobSetting
- the trackjob settingfoundPolys
- java.lang.Exception
public java.util.List<SGPolygon> findPolygons(TrackingJobSetting tJobSetting) throws java.lang.Exception
tJobSetting
- the trackjob settingjava.lang.Exception
public void handleAutoObjects() throws java.lang.Exception
java.lang.Exception
public void handleAutoReferenceBackground(TrackingJobSetting tJobSetting) throws java.lang.Exception
java.lang.Exception
public void handleAutoReferenceBackgrounds() throws java.lang.Exception
java.lang.Exception
public void handleShowSetup() throws java.lang.Exception
java.lang.Exception
public void reportSetup(TrackingJobSetting tJobSetting, java.util.List<SGPolygon> foundPolys) throws java.lang.Exception
tJobSetting
- the trackjob settingfoundPolys
- the ArrayList of found object polygonsjava.lang.Exception
public void startAnalysis() throws java.lang.Exception
java.lang.Exception
public void stopAnalysis() throws java.lang.Exception
java.lang.Exception
public void setTracker(TrackerEngine sgt) throws java.lang.Exception
sgt
- the tracker to usejava.lang.Exception
public void handlePrepareProcessing(int theWidth, int theHeight) throws java.lang.Exception
java.lang.Exception
public void doFadeTrail() throws java.lang.Exception
java.lang.Exception
public void reportTimeStamp() throws java.lang.Exception
java.lang.Exception
public void updateRunTime()
public void updateReference()
public void makeImagePixels() throws java.lang.Exception
java.lang.Exception
public void uncompressRawImage() throws java.lang.Exception
java.lang.Exception
public void setupAnalysis()
public java.util.List<TargetCaptureData> getTargetDataForTrackJob(TrackingJobSetting tJobSetting) throws java.lang.Exception
tJobSetting
- the TrackingJobSetting to usejava.lang.Exception
public void adjustAnalysisRectDimensions(int theWidth, int theHeight) throws java.lang.Exception
java.lang.Exception
public java.util.List<TargetCaptureData> makeTargetDataList(TrackingJobSetting tJobSetting) throws java.lang.Exception
tJobSetting
- the tracking jobjava.lang.Exception
public java.util.List<TargetCaptureData> splitBiggestTarget(java.util.List<TargetCaptureData> targetList, TrackingJobSetting tJObj) throws java.lang.Exception
targetList
- the list of found targetstJObj
- the tracking job objectjava.lang.Exception
public void processTargetDataList(TrackingJobSetting tJobSetting) throws java.lang.Exception
tJobSetting
- the tracking jobjava.lang.Exception
public void listTargetDataList() throws java.lang.Exception
java.lang.Exception
public void applyFilter(org.opencv.core.Mat diffFrame)
diffFrame
- the Mat to usepublic void doCustomProcessing(java.util.List<TargetCaptureData> targetList) throws java.lang.Exception
targetList
- the list of found targetsjava.lang.Exception
public void getVideoImage(java.lang.Object frameObject) throws java.lang.Exception
frameObject
- frame content - unusedjava.lang.Exception
public int execute()
public java.util.List<TargetCaptureData> executeTrackingJob(TrackingJobSetting tJobSetting) throws java.lang.Exception
tJobSetting
- the tracking jobjava.lang.Exception
public void updateVideoComponent() throws java.lang.Exception
java.lang.Exception
public void updateTrackingComponent() throws java.lang.Exception
java.lang.Exception
public void finishUpFrame() throws java.lang.Exception
java.lang.Exception
public void handleLiveDeviceControl(java.util.List<TargetCaptureData> theTargetDataList) throws java.lang.Exception
theTargetDataList
- the target descriptorsjava.lang.Exception
public void reportDescriptors(int tjNum, int tjNum_obj) throws java.lang.Exception
tjNum
- the trackjob indexjava.lang.Exception
public void reportCoordinateX(int theX) throws java.lang.Exception
theX
- the x coordjava.lang.Exception
public void reportCoordinateY(int theY) throws java.lang.Exception
theY
- the y coordjava.lang.Exception
public void reportCoordinate(Pixel aPixel) throws java.lang.Exception
aPixel
- the pixeljava.lang.Exception
public void reportTargetData(TrackingJobSetting tJobSetting, int tjNum_obj, TargetCaptureData aTgD) throws java.lang.Exception
tJobSetting
- the trackjob settingtjNum_obj
- the object index of the trackjobaTgD
- the descriptor of the found objectjava.lang.Exception
public void writeLineEnd() throws java.lang.Exception
java.lang.Exception
public void drawObjectToTracking(TargetCaptureData aTCD) throws java.lang.Exception
aTCD
- the targetCaptureData describing the objectjava.lang.Exception
public void drawFrontToTracking(TargetCaptureData aTCD) throws java.lang.Exception
aTCD
- the targetCaptureData describing the objectjava.lang.Exception
public void drawSurroundToTracking(TargetCaptureData aTCD) throws java.lang.Exception
aTCD
- the targetCaptureData describing the objectjava.lang.Exception
public void reportResults(TrackingJobSetting tJobSetting) throws java.lang.Exception
tJobSetting
- the tracking jobjava.lang.Exception
public void reportOverallResults()
public boolean confirmReferenceAvailable() throws java.lang.Exception
java.lang.Exception
RH, 2017