Class libdt.PatchExtractor

  • Enclosing class:
    libdt

    class libdt.PatchExtractor
    extends java.lang.Object
    Class for extracting spatio-temporal patches (cubes) from a video (online mode). The extractor works in an "online" mode, where frames are added sequentially. When enough frames are added a true flag is returned, which indicates that new patches have been formed. Normalization of patches is handled efficiently, and access is given to the current video buffer. Also included is a function for converting a set of labels corresponding to each patche to an image. The actual patches will be in different places, depending on the normalization used: 1) norm_none --> patches are sub-videos of the buffer (vbuf); 2) norm_zm --> patches are sub-videos of the buffer (vbuf_zm); 3) norm_zmuv --> patches are local copies. Note that in some cases, the patches are just references to a sub-videos of the video buffer. Hence, it is not allowed to modify the patches. \sa PatchOptions, PatchBatchExtractor
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.Vector<java.lang.Integer> allx
      < offset to center of patch.
      java.util.Vector<java.lang.Integer> ally
      < all x-locations on step grid.
      javax.vecmath.Point3i coff
      < value of curz that will form a new patch.
      int curz
      < current z location of the patches (z of the first frame of the patch).
      boolean flag_zm
      < the set of patches.
      libdt.Mat frame_center
      < flag if vbuf_zm is used.
      libdt.Mat[] frame_patches
      < center frame of the video buffer (reference to vbuf).
      java.util.Vector<javax.vecmath.Point2i> locyx
      < number of columns in the video frame.
      java.util.Vector<java.lang.Boolean> locyx_mask
      < (y,x) coordinates of top-left of each patch.
      int locz
      < patch mask depending on pixel variance.
      int nextz
      < z location for next frame added.
      java.util.Vector<libdt.Mat[]> patches
      < video buffer w/o mean [vrows,vcols,patopt.win.z] type=OPT_MAT_TYPE.
      libdt.PatchOptions patopt
      fill type for generating images from patch labels.
      libdt.Mat[] vbuf
      < all y-locations on step grid.
      libdt.Mat[] vbuf_zm
      < video buffer to store current frames [vrows,vcols,patopt.win.z] type=OPT_MAT_TYPE.
      int vcols
      < options for extracting patches.
      int vrows
      < options for extracting patches.
    • Constructor Summary

      Constructors 
      Constructor Description
      PatchExtractor​(libdt.PatchOptions patopt, int vrows, int vcols)
      < center frames of the video buffer (reference to vbuf).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void getLoc()  
      (package private) void reset()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • patopt

        public libdt.PatchOptions patopt
        fill type for generating images from patch labels. \sa patchLabelsToImage
      • vrows

        public int vrows
        < options for extracting patches.
      • vcols

        public int vcols
        < options for extracting patches.
      • locyx

        public java.util.Vector<javax.vecmath.Point2i> locyx
        < number of columns in the video frame.
      • locyx_mask

        public java.util.Vector<java.lang.Boolean> locyx_mask
        < (y,x) coordinates of top-left of each patch.
      • locz

        public int locz
        < patch mask depending on pixel variance.
      • curz

        public int curz
        < current z location of the patches (z of the first frame of the patch).
      • nextz

        public int nextz
        < z location for next frame added.
      • coff

        public javax.vecmath.Point3i coff
        < value of curz that will form a new patch.
      • allx

        public java.util.Vector<java.lang.Integer> allx
        < offset to center of patch.
      • ally

        public java.util.Vector<java.lang.Integer> ally
        < all x-locations on step grid.
      • vbuf

        public libdt.Mat[] vbuf
        < all y-locations on step grid.
      • vbuf_zm

        public libdt.Mat[] vbuf_zm
        < video buffer to store current frames [vrows,vcols,patopt.win.z] type=OPT_MAT_TYPE.
      • patches

        public java.util.Vector<libdt.Mat[]> patches
        < video buffer w/o mean [vrows,vcols,patopt.win.z] type=OPT_MAT_TYPE.
      • flag_zm

        public boolean flag_zm
        < the set of patches.
      • frame_center

        public libdt.Mat frame_center
        < flag if vbuf_zm is used.
      • frame_patches

        public libdt.Mat[] frame_patches
        < center frame of the video buffer (reference to vbuf).
    • Constructor Detail

      • PatchExtractor

        public PatchExtractor​(libdt.PatchOptions patopt,
                              int vrows,
                              int vcols)
        < center frames of the video buffer (reference to vbuf).
    • Method Detail

      • getLoc

        void getLoc()
      • reset

        void reset()