Image Quality and the Reliability of Fabric-Density Measurement: Counting Threads from Smartphone Photos Through a Pick Glass

Anoubhav AgarwaalarXiv 2026 · arXiv

TL;DR

This paper explores automating fabric thread counting using smartphone photos taken through a standard 10$\times$ "pick glass" magnifier. By introducing the PickGlass-TPI dataset, the authors demonstrate that while modern AI models (like tuned VLMs) can outperform non-expert humans, they still struggle to meet the strict $\pm$5% industry tolerance due to inherent visual ambiguities and the "octave error" (counting half or double).

What Problem Does This Paper Address?

In the textile industry, "thread density"—the number of warp and weft threads per inch (TPI)—is a critical quality specification. Traditionally, inspectors count these threads manually using a pick glass (a folding magnifier with a 1-inch window). This process is slow, tedious, and prone to human error.

Figure 1. PickGlass-TPI and the task: from a phone photo taken through a pick glass (a 10× magnifier), count the threads that cross its one-inch window in each direction (threads per inch). Left: factory photos differ in glare, shadow, color and resolution (yellow: hand- marked window; numbers: image size in pixels). (a) On photo #118, ticks engraved on the glass locate the window’s corner (green: fit to the ticks; dashed: hand-marked edges). (b) The window, warped to a square, with the horizontal (H) and vertical (V) counting lines. (c) The box in (b), enlarged: PG-Lattice, our training-free counter, puts one dot on each thread crossing a line. (d) On part of the H line of photo #39, the textile-trained reference annotator and PG-Lattice mark nearly the same threads (numbers: counts over the whole line); a non-expert annotator, our human baseline, marks 111, about twice as many, and the photo alone cannot settle which is right (Sec. 5.2).

While laboratory instruments exist for this, they are too expensive for small-scale weavers in regions like India. A smartphone-based solution would be revolutionary, but it faces significant challenges: factory environments introduce glare, shadows, and varying focus. The authors ask: Can we define "task-based image quality" for this problem? In other words, what makes a photo "good enough" to yield an accurate count?

Methods

The authors benchmarked several distinct approaches:

  • PG-Lattice: A novel, training-free spectral counter. it analyzes the 2D power spectrum of the image to identify the underlying yarn lattice. It's lightweight enough to run offline on a laptop.
  • Vision-Language Models (VLMs): They tested frontier models (like GPT-6.1-sol) and open-weight models.
  • Synthetic Tuning (Molmo2-4B): They fine-tuned a small, open-weight VLM (Molmo2-4B) using LoRA on 12,000 purely synthetic images. This model was never shown a real fabric image during training.
  • CNNs: Standard residual networks trained to regress thread counts from image tiles.
  • Image Quality Assessment (IQA): They evaluated whether standard no-reference quality metrics (like BRISQUE or NIQE) could predict how much a model would struggle with a particular photo.

Datasets

  • PickGlass-TPI (New): The primary benchmark, consisting of 76 factory scenes of 44 fabric patches. Each was annotated from scratch by a textile-trained expert (the reference) and a non-expert human.
  • Legacy Hand Counts: 13 hand-counted crops from a previous project used for initial design choices.
  • Synthetic Dataset: A large-scale set of analytically rendered fabric images used for training the CNNs and tuning the Molmo VLM.

Key Insights and Ideas

  • The "Octave Error": A recurring failure mode where models count exactly half or double the true number of threads. This happens because yarns often have sub-structures (plies) or group together in ways that look like single, thicker yarns.
  • Task-Based Quality vs. Perceptual Quality: Standard image quality scores (which favor "pretty" images) do not correlate with counting accuracy. A photo can look sharp to a human but be useless for a spectral counter if it has subtle motion blur that destroys the high-frequency lattice information.
  • The Reliability Gap: Even the human expert's counts varied by a median of 9% when looking at different photos of the exact same fabric patch. This suggests that the $\pm$5% industry tolerance might be impossible to guarantee from a single photo alone.
  • Enhancement is Counter-Productive: Using generative AI to "enhance" or super-resolve blurry photos often makes the count worse. These models tend to hallucinate textures or "clean up" the periodic patterns that counters rely on.

Key Results

  • No method met the $\pm$5% tolerance. The best-performing methods had a Mean Absolute Percentage Error (MAPE) of approximately 25%.
  • Molmo2-4B (Tuned) and GPT-6.1-sol (given magnified insets) were the top performers, both significantly beating the non-expert human baseline (37.3% MAPE).
  • PG-Lattice was the most consistent across re-shoots (repeating counts within 5% most often) but was highly susceptible to the "octave error," frequently halving or doubling the count.
  • Capture Guidelines: The authors found that for reliable counting, a capture system needs at least 7 pixels per yarn. Anything below 3 pixels per yarn leads to a total collapse of the measurement.

Limitations and Future Work

The study is limited by its relatively small real-world dataset (one mill, one type of pick glass). The current models also struggle with complex weaves like jacquards or knits, as they primarily assume a regular lattice structure.

Future work should focus on multi-photo fusion—combining information from several shots of the same patch to resolve ambiguities—and developing better "octave-aware" loss functions to penalize factor-of-two errors more effectively. The authors also suggest that a deployed system should always show the yarns it thinks it counted, allowing a human to quickly spot and correct "half or double" errors.

Summary updated

Abstract

Thread density, the threads per inch along and across a woven fabric, is a basic specification that buyers check whenever fabric is sold. Without laboratory instruments, inspectors count it slowly, by eye, through a pick glass, a folding 10$\times$ magnifier with a one-inch window. A smartphone photo through that glass could make the check faster and leave a record. We judge such a photo by what it is used for, as in task-based image quality: it is good if the thread count from it is within $\pm$5% of the true count, a common tolerance in fabric specifications. We introduce PickGlass-TPI: 76 factory scenes of 44 fabric patches, each counted in an open annotation tool by a textile-trained annotator, whose counts are the reference. On it we benchmark frontier and open vision-language models, CNNs, counting specialists and a training-free spectral counter (PG-Lattice). No method agrees with the reference within the tolerance. The best methods are off by about a quarter: a small open model that we tuned only on synthetic images (Molmo2-4B, 25%) is level with the best frontier model, GPT-6.1-sol (27% when asked directly, 25% given four magnified close-ups of the window). Both err less than a non-expert annotator (37%), but only the tuned model also beats, on both error measures, a baseline that guesses each scene's density as the average of the others. PG-Lattice most often repeats its count within 5% across two photos of the same patch, but its misses, like GPT-6.1-sol's errors, are often a factor of two. Even the reference repeats a count across such re-shoots only to a median 9%, so one photo cannot yet be shown to meet $\pm$5%; the image quality that matters is reliability across re-shoots. Generic no-reference quality scores chosen before labeling do not rank PG-Lattice's error, and generative enhancement raises perceptual scores but does not reliably improve the count.
BibTeX
@misc{agarwaal2026image,
  author = {Anoubhav Agarwaal},
  title = {{Image Quality and the Reliability of Fabric-Density Measurement: Counting Threads from Smartphone Photos Through a Pick Glass}},
  year = {2026},
  eprint = {2611.13200},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.13200},
}
Figure