public class RecordProc
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ANALYSIS |
static int |
AUTOSETUP |
java.awt.image.ColorModel |
colorModel |
long |
currentTime |
boolean |
drawFront |
boolean |
drawObject |
boolean |
drawSurround |
static int |
EXTERNALREFERENCEIN |
static int |
EXTERNALREFERENCEOUT |
org.opencv.core.Mat |
frame_mod |
long |
frameTime |
static int |
IDLE |
boolean |
initialCapturesDone |
int |
intsPerRow |
boolean |
isGrayScale |
org.openpnp.libuvc4j.UvcLibrary.uvc_frame_callback_t |
itsCallBack |
java.awt.image.BufferedImage |
itsImage_D |
java.awt.image.BufferedImage |
itsImage_L |
java.awt.image.BufferedImage |
itsImage_V |
double |
itsPreferedfps |
java.util.List<TargetCaptureData> |
itsTargetDataList |
TrackerEngine |
itsTracker |
RHVideoComponent |
itsVideoC |
int[] |
masks |
double |
millisBetweenFrames |
double |
nextFrameTime |
long |
nextRenderedFrameTime |
static int[] |
pixelData_D |
static int[] |
pixelData_L |
static int[] |
pixelData_V |
boolean |
plotExtended |
static int |
PREPARE |
java.lang.Object |
rawDataObject |
java.awt.image.BufferedImage |
refBufferedImage |
static int |
REFERENCE |
org.opencv.core.Mat |
refFrame |
boolean |
reportExtended |
long |
runTime |
java.lang.String |
runTimeString |
static int |
SHOWSETUP |
boolean |
splitTargets |
long |
startAnalysisTime |
ImagePixelMat |
theDiffPixelsC |
ImagePixelMat |
theDiffPixelsD |
ImagePixelMat |
theDiffPixelsL |
Constructor and Description |
---|
RecordProc()
empty private constructor ensures that the variables are enumerated
|
Modifier and Type | Method and Description |
---|---|
void |
adjustAnalysisRectDimensions(int theWidth,
int theHeight)
adjusts the max dimensions of the analysis rects if they extend outside the videoframe
|
void |
apply(org.bridj.Pointer<org.openpnp.libuvc4j.uvc_frame> uvcframe,
org.bridj.Pointer<?> user_ptr) |
void |
applyFilter(org.opencv.core.Mat diffFrame)
applies a filter to the Mat
|
void |
call(org.bridj.Pointer<org.openpnp.libuvc4j.uvc_frame> arg0) |
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> |
getAutoSetup(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<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 |
handleAutoSetup()
handles the nitty-gritty of the setup procedure
|
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 |
handleReferenceIn(java.awt.image.BufferedImage refBufImg)
installs the reference frame and displays it in the PathPlotter
|
void |
handleShowSetup()
shows the objects selected with the current settings
|
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
|
java.awt.image.BufferedImage |
readPNGToRef()
reads a reference frame from a file
|
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 |
setExternalData(java.lang.Object anExternalConditionObj)
sets the Object to print after the data
|
void |
setFrameRate(double fps)
sets the preferred framerate
|
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 static int[] pixelData_V
public java.awt.image.BufferedImage itsImage_D
public static int[] pixelData_D
public java.awt.image.BufferedImage itsImage_L
public static int[] pixelData_L
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 int getTaskState()
public void setTaskState(int taskState)
taskState
- the task statepublic java.awt.image.BufferedImage readPNGToRef() throws java.lang.Exception
java.lang.Exception
public void doPrepare() throws java.lang.Exception
java.lang.Exception
public void handleReferenceIn(java.awt.image.BufferedImage refBufImg) 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()
cameraID
- the ID of the camera in the computer's device listpublic void setExternalData(java.lang.Object anExternalConditionObj) throws java.lang.Exception
anExternalCondition
- the Object to report at end of framejava.lang.Exception
public java.util.List<SGPolygon> getAutoSetup(TrackingJobSetting tJobSetting) throws java.lang.Exception
tJobSetting
- the trackjob settingjava.lang.Exception
public java.util.List<SGPolygon> findPolygons(TrackingJobSetting tJobSetting) throws java.lang.Exception
tJobSetting
- the trackjob settingjava.lang.Exception
public void handleAutoSetup() 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 saveRefToPNG() throws java.lang.Exception
java.lang.Exception
public void setFrameRate(double fps)
fps
- the number of frames that should be captured per secondpublic double getFrameRate()
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 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
theCapture
- the capturejava.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
tjNum
- the trackjob indexjava.lang.Exception
public void reportTargetData(TrackingJobSetting tJobSetting, int tjNum_obj, TargetCaptureData aTgD) throws java.lang.Exception
tjNum
- the trackjob indextjNum_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
public void call(org.bridj.Pointer<org.openpnp.libuvc4j.uvc_frame> arg0)
public void apply(org.bridj.Pointer<org.openpnp.libuvc4j.uvc_frame> uvcframe, org.bridj.Pointer<?> user_ptr)
RH, 2017