Package gov.nih.mipav.model.algorithms
Class libdt
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.libdt
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.awt.event.WindowListener,java.lang.Runnable,java.util.EventListener
public class libdt extends AlgorithmBase
libdt - OpenCV library for Dynamic Textures - version 1.0 Copyright (c) 2011-2014 Antoni B. Chan, Adeel Mumtaz, City University of Hong Kong All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither name of copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Modeling, clustering, and segmenting video with mixtures of dynamic textures. Antoni B. Chan and Nuno Vasconcelos, IEEE Trans. on Pattern Analysis and Machine Intelligence (TPAMI), 30(5):909-926, May 2008. Clustering Dynamic Textures with the Hierarchical EM Algorithm for Modeling Video. Adeel Mumtaz, Emanuele Coviello, Gert R.G. Lanckriet, and Antoni B. Chan, IEEE Trans. on Pattern Analysis and Machine Intelligence (TPAMI), 35(7):1606-1621, Jul 2013. [appendix] A Scalable and Accurate Descriptor for Dynamic Textures using Bag of System Trees. Adeel Mumtaz, Emanuele Coviello, Gert R.G. Lanckriet, and Antoni B. Chan, IEEE Trans. on Pattern Analysis and Machine Intelligence (TPAMI), 37(4):697-712, Apr 2015. [appendix]
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classlibdt.ConfigFilestatic classlibdt.cov_reg_typeregularization method.static classlibdt.cov_typetype of covariance matrix.classlibdt.CovMatrix(package private) classlibdt.DatDescriptorStructure to represent Dat file Descriptor parametersclasslibdt.DytexDynamic Texture class.(package private) classlibdt.DytexKalmanFilterclass for running the Kalman filter for dynamic texture inference.classlibdt.DytexMixclasslibdt.DytexOptionsclasslibdt.DytexRegOptionsClass for specifying the regularization methods for a Dytex.classlibdt.DytexSplitParams(package private) classlibdt.EMOptions(package private) classlibdt.Estats(package private) static classlibdt.fill_typeclasslibdt.HEMOptionsprivate classlibdt.indexValueComparatorprivate classlibdt.indexValueItemstatic classlibdt.kf_modeclasslibdt.Mat(package private) static classlibdt.norm_typeNormalization mode for each patch.(package private) classlibdt.PatchBatchExtractorClass for extracting spatio-temporal patches (cubes) from a video (batch mode).(package private) classlibdt.PatchExtractorClass for extracting spatio-temporal patches (cubes) from a video (online mode).(package private) classlibdt.PatchOptionsClass for specifying spatio-temporal patches (cubes).(package private) classlibdt.Rangestatic classlibdt.Split_critstatic classlibdt.Split_modestatic classlibdt.Split_varsstatic classlibdt.Verbose_mode(package private) classlibdt.VidSegm(package private) classlibdt.VidSeqSegmParamsstatic classlibdt.Ymean_typeOptions for modeling the observation mean, Ymean.
-
Field Summary
Fields Modifier and Type Field Description private byte[]byteDoubleBufferbyte array for double *private byte[]byteIntBufferbyte array for int *private byte[]byteLongBufferbyte array for long *private intCV_64Fprivate intCV_64FCprivate intCV_64FC1private intCV_64FC3private intCV_8Uprivate intCV_8UCprivate intCV_8UC1private intCV_REDUCE_AVGprivate intCV_REDUCE_MAXprivate intCV_REDUCE_MINprivate intCV_REDUCE_SUMprivate booleandebugprivate booleanendianprivate libdt.Mat[][]g_mask_lutprivate double[][]g_rgbtableprivate intMAXCOLprivate java.io.RandomAccessFileraFile-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description libdt()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) booleanaddFrames(libdt.PatchExtractor pe, libdt.Mat[] invid)(package private) voidannotateVideos()(package private) voidcalculate(libdt.CovMatrix cov, libdt.Mat data, boolean use_unbiased)(package private) intcheckOptionInStr(java.lang.String str, java.lang.String opt)libdt.Matclone(libdt.Mat A)libdt.Matcol(libdt.Mat A, int colNum)(package private) voidcolorMask(libdt.Mat[] img, libdt.Mat[] mask, libdt.Mat oimg, int border)private voidcomputeAggregateStats(libdt.Estats Estat, libdt.Mat W)private voidcomputeEll(libdt.Estats Estat)(package private) voidcomputePrecisionRecall()(package private) doublecomputeVariance3dDouble(libdt.Mat[] input)(package private) libdt.Matconvertmovie(libdt.Mat[] Y, int[] sx, int[] sy, int[] sc, int[] cnorm)private voidcopyFromSrcColRange(libdt.Mat A, libdt.Mat B, int inclusiveStart, int exclusiveEnd)private voidcopyTo(libdt.Mat[] A, libdt.Mat[] B)private voidcopyTo(libdt.Mat A, libdt.Mat B)private voidcopyToDstColRange(libdt.Mat A, libdt.Mat B, int inclusiveStart, int exclusiveEnd)intcountNonZero(libdt.Mat A)private libdt.Mat[]create(int frames, int rows, int cols, int type)libdt.Matdivide(libdt.Mat A, double q)libdt.Matdivide(libdt.Mat A, libdt.Mat B)(package private) voiddumpMatSize(libdt.Mat[] m)voiddytex_kalman(libdt.Mat[] Y2, libdt.Dytex dt, java.lang.String opt, java.util.Vector<libdt.Mat> xt, libdt.Mat[] Vt, libdt.Mat[] Vt1, libdt.Mat L)private voiddytex_mix_split(libdt.DytexMix dtm, libdt.DytexSplitParams splitopt, int[] ctg, int[] csp)private voiddytex_perturb(libdt.Dytex dtp, double pert, libdt.Split_mode mode, libdt.Split_vars vars)libdt.MatelementTimes(libdt.Mat A, libdt.Mat B)(package private) java.util.Vector<libdt.Mat>extractY(libdt.Mat[] Yin, java.util.Vector<java.lang.Integer> inds)private libdt.Matframe(libdt.Mat vid, int f)voidgetClasses(libdt.DytexMix dtm, java.util.Vector<libdt.Mat> Y, libdt.Mat LLm)voidgetClasses(libdt.DytexMix dtm, java.util.Vector<libdt.Mat> Y, java.util.Vector<java.lang.Integer> classes)libdt.cov_reg_typegetCov_reg_type(int cov_reg_code)libdt.cov_typegetCov_type(int cov_code)doublegetDouble(boolean bigEndian)Reads eight unsigned bytes from file.intgetInt(boolean bigEndian)Reads four signed bytes from file.libdt.norm_typegetNorm_type(int norm_code)(package private) java.util.Vector<libdt.Mat[]>getPatches(libdt.PatchExtractor pe)(package private) java.util.Vector<java.lang.Integer>getTagVids(java.util.Vector<java.lang.Integer> trainVidIds, java.lang.String tag, java.util.Vector<java.util.Vector<java.lang.String>> annlist)private java.lang.StringgetTime()libdt.Ymean_typegetYmean_type(int Ymean_code)private libdt.Dytexinit_multiple_dt(libdt.DytexMix dtm)(package private) libdt.Dytexinitcluster_doretto(java.util.Vector<libdt.Mat> Y, libdt.DytexOptions param)private booleaninp_minbnd(double[][] arr, double min_bnd)private booleaninp_minbnd(double[] arr, double min_bnd)(package private) libdt.CovMatrixinv(libdt.CovMatrix cov)(package private) voidlearnBaseDTM()(package private) voidlearnBaseDTMBoS()(package private) voidlearnDTM(libdt.VidSegm tvs, java.lang.String vpath, boolean dosegm)(package private) voidlearnLeastSquares(libdt.Dytex mydt, java.util.Vector<libdt.Mat> videos)(package private) voidlearnTagDTM()(package private) voidlearnWithSplitting(libdt.DytexMix dtm, java.util.Vector<libdt.Mat[]> Yin, libdt.EMOptions emopt)(package private) libdt.Mat[]loaddat(java.lang.String filename, java.lang.String opt)(package private) libdt.DatDescriptorloaddatinfo(java.lang.String filename, int verbose)(package private) doublelogdetiid(libdt.Mat Q, double r, int C)(package private) libdt.Matlogtrick(libdt.Mat lA)(package private) libdt.Matmask2Border(libdt.Mat mask, int border, byte[] mask_flag)(package private) libdt.Mat[]maxvotefilt(libdt.Mat[] I, int sx, int sy, int sz, int numclass)(package private) doublemeanOfStdVector(java.util.Vector<java.lang.Double> v)(package private) doubleminOfStdVector(java.util.Vector<java.lang.Double> v)libdt.Matminus(libdt.Mat A, double b)libdt.Matminus(libdt.Mat A, libdt.Mat B)(package private) voidmulTransposed(libdt.Mat src, libdt.Mat dst, boolean transposeFirst)(package private) doublenorm2(libdt.Mat[] vid)libdt.Matplus(libdt.Mat A, double b)libdt.Matplus(libdt.Mat A, libdt.Mat B)(package private) java.util.Vector<java.lang.Double>plus(java.util.Vector<java.lang.Double> a, java.util.Vector<java.lang.Double> b)(package private) voidpostmultiply(libdt.CovMatrix cov, libdt.Mat src, libdt.Mat dst)private voidppertC(libdt.Mat C, libdt.Mat S0, double pert)(package private) voidprintResults()(package private) voidprocessNextPatch(libdt.PatchExtractor pe)(package private) voidprocessVideoTesting(libdt.Dytex dt, libdt.Mat vin, libdt.Mat Yout)(package private) voidprocessVideoTraining(libdt.Dytex mydt, libdt.Mat vin, libdt.Mat Yout, libdt.Mat Yout_mean)voidread(libdt.CovMatrix cm)voidread(libdt.Dytex dt)voidread(libdt.DytexMix dtm)voidread(libdt.DytexOptions opt)voidread(java.lang.String name, boolean[] val)voidread(java.lang.String name, byte[] val)voidread(java.lang.String name, double[] val)voidread(java.lang.String name, int[] val)voidread(java.lang.String name, libdt.Mat mtx)voidread(java.lang.String name, java.util.Vector<java.lang.Integer> vec)voidread(javax.vecmath.Point3i p)(package private) voidreadGtruthFile(java.lang.String fpath, java.util.Vector<java.lang.String> vlist, java.util.Vector<java.util.Vector<java.lang.String>> annlist, java.util.Vector<java.lang.String> taglist)voidreadHeader(java.lang.String str)(package private) voidreadTrialInfo(java.lang.String fpath, java.util.Vector<java.util.Vector<java.lang.Integer>> trainVidIds, java.util.Vector<java.util.Vector<java.lang.Integer>> testVidIds)(package private) voidreadVecDouble(java.lang.String name, java.util.Vector<java.lang.Double> vec)voidreadVectorString(java.lang.String name, java.util.Vector<java.lang.String> vec)(package private) voidreadVecVecDouble(java.lang.String name, java.util.Vector<java.util.Vector<java.lang.Double>> vec)private voidreduce(libdt.Mat[] vid, libdt.Mat out, int reduceOp)private voidreduce(libdt.Mat src, libdt.Mat dst, int dim, int rtype)private libdt.DytexMixreduceWithSplitting(libdt.DytexMix dtm, libdt.HEMOptions hopt)private voidregularize(libdt.CovMatrix cov)private voidregularize(libdt.Dytex dy, boolean regA)libdt.Mat[]repeat(libdt.Mat img, int nf)voidrepeat(libdt.Mat src, int ny, int nx, libdt.Mat dst)private voidresize(java.util.Vector<libdt.Mat> matVec, int n)private voidresizeDouble(java.util.Vector<java.lang.Double> doubleVec, int n)voidrunAlgorithm()#include#include #include #include #include #include #include #include "opencv/cv.h" #include "opencv/cxcore.h" #include "opencv/highgui.h" #include "options.h" #include "utils/libutils.h" #include "stats/libstats.h" #include "video/libvideo.h" #include "dytex/libdytex.h" #include "platInd/platInd.hpp" #include "bufferer/Bufferer.hpp" using namespace cv; using namespace std; (package private) voidrunEM(libdt.DytexMix dtm, java.util.Vector<libdt.Mat[]> Yin, libdt.EMOptions emopt)private voidrunHEM(libdt.DytexMix dtm, libdt.DytexMix hembest, libdt.HEMOptions hopt, java.util.Vector<java.lang.Integer> classes)(package private) voidscaleRows(libdt.Mat m, libdt.Mat w)(package private) libdt.Mat[]segm_mask(libdt.PatchBatchExtractor pbe, java.util.Vector<java.lang.Integer> oldclasses)(package private) libdt.Mat[]segm_mask(libdt.VidSegm vs)(package private) libdt.Mat[]segmentVideo(libdt.VidSegm vs, libdt.Mat[] vid, int stepxy, int stepz, int filtxy, int filtz, libdt.Mat[] osmaskout)voidsegmentVideoSequence(libdt.VidSegm vs, java.util.Vector<java.lang.String> paths, int stepxy, int stepz, int filtxy, int filtz, java.lang.String vidPath2)private voidsetRegularizer(libdt.CovMatrix cov, libdt.cov_reg_type regopt, double regval)private voidsetRegularizer(libdt.Dytex dy, libdt.DytexRegOptions dtreg)(package private) voidsetupKFB(libdt.DytexMix dtm, int tau)(package private) java.lang.String[]strtok2(java.lang.String str, java.lang.String del)(package private) libdt.Mat[]subvid(libdt.Mat[] vid, int frange_start_inclusive, int frange_end_exclusive)(package private) libdt.Mat[]subvid(libdt.Mat[] vid, int zstart, int zend, int ystart, int yend, int xstart, int xend)(package private) libdt.Mat[]subvid(libdt.Mat[] vid, libdt.Range box_z, libdt.Range box_y, libdt.Range box_x)doublesum(libdt.Mat A)voidtest_BoSClassification()voidtest_HEM()voidtest_HEMDTM()inttest_videoSegm(java.lang.String paramFile)libdt.Mat[]times(libdt.Mat[] A, double q)libdt.Mattimes(libdt.Mat A, double q)libdt.Mattimes(libdt.Mat A, libdt.Mat B)(package private) libdt.MattoFullMatrix(libdt.CovMatrix cov)(package private) longtotal(libdt.Mat vid)(package private) longtotal(libdt.Mat[] vid)doubletrace(libdt.Mat A)libdt.Mattranspose(libdt.Mat A)(package private) libdt.Matvectorize(libdt.Mat vid, boolean flag_col)voidwrite(libdt.CovMatrix cm)voidwrite(libdt.Dytex dt)voidwrite(libdt.DytexMix dtm)voidwrite(libdt.DytexOptions opt)voidwrite(java.lang.String name, boolean val)voidwrite(java.lang.String name, byte val)voidwrite(java.lang.String name, double val)voidwrite(java.lang.String name, int val)voidwrite(java.lang.String name, libdt.Mat mtx)voidwrite(java.lang.String name, java.util.Vector<java.lang.Integer> vec)voidwrite(javax.vecmath.Point3i p)voidwriteDouble(double data, boolean bigEndian)Writes a double as eight bytes to a file.longwriteHeader(java.lang.String str)voidwriteInt(int data, boolean bigEndian)Writes an int as four bytes to a file.voidwriteLong(long data, boolean bigEndian)Writes a long as eight bytes to a file.voidwriteSize(long spos)voidwriteVecDouble(java.lang.String name, java.util.Vector<java.lang.Double> vec)voidwriteVecVecDouble(java.lang.String name, java.util.Vector<java.util.Vector<java.lang.Double>> vec)private doublezabs(double zr, double zi)zabs computes the absolute value or magnitude of a double precision complex variable zr + j*zi.-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
raFile
private java.io.RandomAccessFile raFile
-
endian
private boolean endian
-
byteIntBuffer
private final byte[] byteIntBuffer
byte array for int *
-
byteDoubleBuffer
private final byte[] byteDoubleBuffer
byte array for double *
-
byteLongBuffer
private final byte[] byteLongBuffer
byte array for long *
-
CV_8U
private final int CV_8U
- See Also:
- Constant Field Values
-
CV_8UC1
private final int CV_8UC1
- See Also:
- Constant Field Values
-
CV_8UC
private final int CV_8UC
- See Also:
- Constant Field Values
-
CV_64F
private final int CV_64F
- See Also:
- Constant Field Values
-
CV_64FC1
private final int CV_64FC1
- See Also:
- Constant Field Values
-
CV_64FC
private final int CV_64FC
- See Also:
- Constant Field Values
-
CV_64FC3
private final int CV_64FC3
- See Also:
- Constant Field Values
-
CV_REDUCE_SUM
private final int CV_REDUCE_SUM
- See Also:
- Constant Field Values
-
CV_REDUCE_AVG
private final int CV_REDUCE_AVG
- See Also:
- Constant Field Values
-
CV_REDUCE_MAX
private final int CV_REDUCE_MAX
- See Also:
- Constant Field Values
-
CV_REDUCE_MIN
private final int CV_REDUCE_MIN
- See Also:
- Constant Field Values
-
MAXCOL
private final int MAXCOL
- See Also:
- Constant Field Values
-
g_mask_lut
private libdt.Mat[][] g_mask_lut
-
g_rgbtable
private double[][] g_rgbtable
-
debug
private boolean debug
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm()
#include#include #include #include #include #include #include #include "opencv/cv.h" #include "opencv/cxcore.h" #include "opencv/highgui.h" #include "options.h" #include "utils/libutils.h" #include "stats/libstats.h" #include "video/libvideo.h" #include "dytex/libdytex.h" #include "platInd/platInd.hpp" #include "bufferer/Bufferer.hpp" using namespace cv; using namespace std; - Specified by:
runAlgorithmin classAlgorithmBase
-
getTime
private java.lang.String getTime()
-
test_HEM
public void test_HEM()
-
reduceWithSplitting
private libdt.DytexMix reduceWithSplitting(libdt.DytexMix dtm, libdt.HEMOptions hopt)
-
runHEM
private void runHEM(libdt.DytexMix dtm, libdt.DytexMix hembest, libdt.HEMOptions hopt, java.util.Vector<java.lang.Integer> classes)
-
computeAggregateStats
private void computeAggregateStats(libdt.Estats Estat, libdt.Mat W)
-
computeEll
private void computeEll(libdt.Estats Estat)
-
subvid
libdt.Mat[] subvid(libdt.Mat[] vid, int zstart, int zend, int ystart, int yend, int xstart, int xend)
-
subvid
libdt.Mat[] subvid(libdt.Mat[] vid, libdt.Range box_z, libdt.Range box_y, libdt.Range box_x)
-
logdetiid
double logdetiid(libdt.Mat Q, double r, int C)
-
create
private libdt.Mat[] create(int frames, int rows, int cols, int type)
-
setRegularizer
private void setRegularizer(libdt.Dytex dy, libdt.DytexRegOptions dtreg)
-
setRegularizer
private void setRegularizer(libdt.CovMatrix cov, libdt.cov_reg_type regopt, double regval)
-
regularize
private void regularize(libdt.Dytex dy, boolean regA)
-
zabs
private double zabs(double zr, double zi)zabs computes the absolute value or magnitude of a double precision complex variable zr + j*zi.- Parameters:
zr- doublezi- double- Returns:
- double
-
regularize
private void regularize(libdt.CovMatrix cov)
-
inp_minbnd
private boolean inp_minbnd(double[] arr, double min_bnd)
-
inp_minbnd
private boolean inp_minbnd(double[][] arr, double min_bnd)
-
init_multiple_dt
private libdt.Dytex init_multiple_dt(libdt.DytexMix dtm)
-
dytex_mix_split
private void dytex_mix_split(libdt.DytexMix dtm, libdt.DytexSplitParams splitopt, int[] ctg, int[] csp)
-
dytex_perturb
private void dytex_perturb(libdt.Dytex dtp, double pert, libdt.Split_mode mode, libdt.Split_vars vars)
-
copyToDstColRange
private void copyToDstColRange(libdt.Mat A, libdt.Mat B, int inclusiveStart, int exclusiveEnd)
-
copyFromSrcColRange
private void copyFromSrcColRange(libdt.Mat A, libdt.Mat B, int inclusiveStart, int exclusiveEnd)
-
getYmean_type
public libdt.Ymean_type getYmean_type(int Ymean_code)
-
getCov_type
public libdt.cov_type getCov_type(int cov_code)
-
getCov_reg_type
public libdt.cov_reg_type getCov_reg_type(int cov_reg_code)
-
toFullMatrix
libdt.Mat toFullMatrix(libdt.CovMatrix cov)
-
inv
libdt.CovMatrix inv(libdt.CovMatrix cov)
-
postmultiply
void postmultiply(libdt.CovMatrix cov, libdt.Mat src, libdt.Mat dst)
-
sum
public double sum(libdt.Mat A)
-
countNonZero
public int countNonZero(libdt.Mat A)
-
trace
public double trace(libdt.Mat A)
-
read
public void read(libdt.DytexMix dtm)
-
write
public void write(libdt.DytexMix dtm)
-
read
public void read(java.lang.String name, java.util.Vector<java.lang.Integer> vec)
-
readVecDouble
void readVecDouble(java.lang.String name, java.util.Vector<java.lang.Double> vec)
-
writeVecDouble
public void writeVecDouble(java.lang.String name, java.util.Vector<java.lang.Double> vec)
-
readVecVecDouble
void readVecVecDouble(java.lang.String name, java.util.Vector<java.util.Vector<java.lang.Double>> vec)
-
writeVecVecDouble
public void writeVecVecDouble(java.lang.String name, java.util.Vector<java.util.Vector<java.lang.Double>> vec)
-
readVectorString
public void readVectorString(java.lang.String name, java.util.Vector<java.lang.String> vec)
-
write
public void write(java.lang.String name, java.util.Vector<java.lang.Integer> vec)
-
read
public void read(libdt.Dytex dt)
-
write
public void write(libdt.Dytex dt)
-
read
public void read(libdt.CovMatrix cm)
-
write
public void write(libdt.CovMatrix cm)
-
read
public void read(java.lang.String name, double[] val)
-
write
public void write(java.lang.String name, double val)
-
writeDouble
public final void writeDouble(double data, boolean bigEndian) throws java.io.IOExceptionWrites a double as eight bytes to a file.- Parameters:
data- Data to be written to file.bigEndian-trueindicates big endian byte order,falseindicates little endian.- Throws:
java.io.IOException- if there is an error writing the file
-
writeLong
public final void writeLong(long data, boolean bigEndian) throws java.io.IOExceptionWrites a long as eight bytes to a file.- Parameters:
data- Data to be written to file.bigEndian-trueindicates big endian byte order,falseindicates little endian.- Throws:
java.io.IOException- if there is an error writing the file
-
read
public void read(java.lang.String name, libdt.Mat mtx)
-
write
public void write(java.lang.String name, libdt.Mat mtx)
-
read
public void read(javax.vecmath.Point3i p)
-
write
public void write(javax.vecmath.Point3i p)
-
read
public void read(java.lang.String name, boolean[] val)
-
write
public void write(java.lang.String name, boolean val)
-
read
public void read(libdt.DytexOptions opt)
-
write
public void write(libdt.DytexOptions opt)
-
read
public void read(java.lang.String name, int[] val)
-
write
public void write(java.lang.String name, int val)
-
writeSize
public void writeSize(long spos)
-
read
public void read(java.lang.String name, byte[] val)
-
write
public void write(java.lang.String name, byte val)
-
readHeader
public void readHeader(java.lang.String str)
-
writeHeader
public long writeHeader(java.lang.String str)
-
writeInt
public final void writeInt(int data, boolean bigEndian) throws java.io.IOExceptionWrites an int as four bytes to a file.- Parameters:
data- Data to be written to file.bigEndian-trueindicates big endian byte order,falseindicates little endian.- Throws:
java.io.IOException- if there is an error writing the file
-
resize
private void resize(java.util.Vector<libdt.Mat> matVec, int n)
-
resizeDouble
private void resizeDouble(java.util.Vector<java.lang.Double> doubleVec, int n)
-
getInt
public final int getInt(boolean bigEndian) throws java.io.IOExceptionReads four signed bytes from file.- Parameters:
bigEndian-trueindicates big endian byte order,falseindicates little endian.- Returns:
- The value of the integer read from the file.
- Throws:
java.io.IOException- if there is an error reading the file
-
getDouble
public final double getDouble(boolean bigEndian) throws java.io.IOExceptionReads eight unsigned bytes from file.- Parameters:
bigEndian-trueindicates big endian byte order,falseindicates little endian.- Returns:
- The value of the double read from the file.
- Throws:
java.io.IOException- if there is an error reading the file
-
test_videoSegm
public int test_videoSegm(java.lang.String paramFile)
-
getNorm_type
public libdt.norm_type getNorm_type(int norm_code)
-
learnDTM
void learnDTM(libdt.VidSegm tvs, java.lang.String vpath, boolean dosegm)
-
loaddat
libdt.Mat[] loaddat(java.lang.String filename, java.lang.String opt)
-
checkOptionInStr
int checkOptionInStr(java.lang.String str, java.lang.String opt)
-
loaddatinfo
libdt.DatDescriptor loaddatinfo(java.lang.String filename, int verbose)
-
strtok2
java.lang.String[] strtok2(java.lang.String str, java.lang.String del)
-
getPatches
java.util.Vector<libdt.Mat[]> getPatches(libdt.PatchExtractor pe)
-
addFrames
boolean addFrames(libdt.PatchExtractor pe, libdt.Mat[] invid)
-
processNextPatch
void processNextPatch(libdt.PatchExtractor pe)
-
norm2
double norm2(libdt.Mat[] vid)
-
total
long total(libdt.Mat vid)
-
total
long total(libdt.Mat[] vid)
-
computeVariance3dDouble
double computeVariance3dDouble(libdt.Mat[] input)
-
dumpMatSize
void dumpMatSize(libdt.Mat[] m)
-
meanOfStdVector
double meanOfStdVector(java.util.Vector<java.lang.Double> v)
-
minOfStdVector
double minOfStdVector(java.util.Vector<java.lang.Double> v)
-
learnWithSplitting
void learnWithSplitting(libdt.DytexMix dtm, java.util.Vector<libdt.Mat[]> Yin, libdt.EMOptions emopt)
-
runEM
void runEM(libdt.DytexMix dtm, java.util.Vector<libdt.Mat[]> Yin, libdt.EMOptions emopt)
-
extractY
java.util.Vector<libdt.Mat> extractY(libdt.Mat[] Yin, java.util.Vector<java.lang.Integer> inds)
-
initcluster_doretto
libdt.Dytex initcluster_doretto(java.util.Vector<libdt.Mat> Y, libdt.DytexOptions param)
-
learnLeastSquares
void learnLeastSquares(libdt.Dytex mydt, java.util.Vector<libdt.Mat> videos)
-
processVideoTraining
void processVideoTraining(libdt.Dytex mydt, libdt.Mat vin, libdt.Mat Yout, libdt.Mat Yout_mean)
-
calculate
void calculate(libdt.CovMatrix cov, libdt.Mat data, boolean use_unbiased)
-
dytex_kalman
public void dytex_kalman(libdt.Mat[] Y2, libdt.Dytex dt, java.lang.String opt, java.util.Vector<libdt.Mat> xt, libdt.Mat[] Vt, libdt.Mat[] Vt1, libdt.Mat L)
-
setupKFB
void setupKFB(libdt.DytexMix dtm, int tau)
-
processVideoTesting
void processVideoTesting(libdt.Dytex dt, libdt.Mat vin, libdt.Mat Yout)
-
segm_mask
libdt.Mat[] segm_mask(libdt.PatchBatchExtractor pbe, java.util.Vector<java.lang.Integer> oldclasses)
-
segmentVideoSequence
public void segmentVideoSequence(libdt.VidSegm vs, java.util.Vector<java.lang.String> paths, int stepxy, int stepz, int filtxy, int filtz, java.lang.String vidPath2)
-
segmentVideo
libdt.Mat[] segmentVideo(libdt.VidSegm vs, libdt.Mat[] vid, int stepxy, int stepz, int filtxy, int filtz, libdt.Mat[] osmaskout)
-
getClasses
public void getClasses(libdt.DytexMix dtm, java.util.Vector<libdt.Mat> Y, libdt.Mat LLm)
-
getClasses
public void getClasses(libdt.DytexMix dtm, java.util.Vector<libdt.Mat> Y, java.util.Vector<java.lang.Integer> classes)
-
segm_mask
libdt.Mat[] segm_mask(libdt.VidSegm vs)
-
test_HEMDTM
public void test_HEMDTM()
-
learnBaseDTM
void learnBaseDTM()
-
learnTagDTM
void learnTagDTM()
-
readGtruthFile
void readGtruthFile(java.lang.String fpath, java.util.Vector<java.lang.String> vlist, java.util.Vector<java.util.Vector<java.lang.String>> annlist, java.util.Vector<java.lang.String> taglist)
-
readTrialInfo
void readTrialInfo(java.lang.String fpath, java.util.Vector<java.util.Vector<java.lang.Integer>> trainVidIds, java.util.Vector<java.util.Vector<java.lang.Integer>> testVidIds)
-
getTagVids
java.util.Vector<java.lang.Integer> getTagVids(java.util.Vector<java.lang.Integer> trainVidIds, java.lang.String tag, java.util.Vector<java.util.Vector<java.lang.String>> annlist)
-
annotateVideos
void annotateVideos()
-
computePrecisionRecall
void computePrecisionRecall()
-
printResults
void printResults()
-
plus
java.util.Vector<java.lang.Double> plus(java.util.Vector<java.lang.Double> a, java.util.Vector<java.lang.Double> b)
-
test_BoSClassification
public void test_BoSClassification()
-
learnBaseDTMBoS
void learnBaseDTMBoS()
-
-