In garment manufacturing, an automatic sewing machine is desirable to reduce cost. To accomplish this, a high speed vision system is required to track fabric motions and recognize repetitive weave patterns with high accuracy, from a micro perspective near a sewing zone. In this paper, we present an innovative framework for real-time texture tracking and weave pattern recognition. Our framework includes a module for motion estimation using blob detection and feature matching. It also includes a module for lattice detection to facilitate the weave pattern recognition. Our lattice detection algorithm utilizes blob detection and template matching to assess pair-wise similarity in blobs' appearance. In addition, it extracts information of dominant orientations to obtain a global constraint in the topology. By incorporating both constraints in the appearance similarity and the global topology, the algorithm determines a lattice that characterizes the topological structure of the repetitive weave pattern, thus allowing for thread counting. In our experiments, the proposed thread-based texture tracking system is capable of tracking denim fabric with high accuracy (e.g., 0.03 degree rotation and 0.02 weave-thread' translation errors) and high speed (3 frames per second), demonstrating its high potential for automatic real-time textile manufacturing.