Papers
Topics
Authors
Recent
Search
2000 character limit reached

Animated Territorial Data Extractor (ATDE)

Updated 29 November 2025
  • ATDE is an end-to-end computer vision pipeline that quantitatively extracts territorial control data from animated historical map videos using HSV-based segmentation and temporal alignment.
  • The system refines territorial masks with Direct-Neighbor Filtering and normalization routines, achieving over 95% pixel-level accuracy in suitable conditions.
  • It processes videos rapidly for educational demos and comparative analyses, and can integrate with photogrammetric methods to enhance geospatial data extraction.

The Animated Territorial Data Extractor (ATDE) is an end-to-end computer vision pipeline designed for quantitative extraction of territorial control data from rasterized animated historical map videos. ATDE operates without the need for pre-existing GIS shapefiles and is suitable for educational demonstrations, preliminary territorial dynamic analysis, and comparative studies using time-series pixel-count data. Its key innovations include HSV-based color segmentation, adaptive temporal alignment, Direct-Neighbor Filtering (DNF) for local connectivity, and normalization routines for cross-video quantitative comparison. The approach is exemplified by large-scale analyses of Chinese dynastic history, producing year-by-year pixel counts of controlled territory from popular map animations (Alshamy et al., 22 Nov 2025). Related frameworks in photogrammetric segmentation augment ATDE’s potential for heterogeneous simulation data extraction and semantic mapping (Chen et al., 2020).

1. System Architecture and Workflow

ATDE operates as a linear pipeline comprised of three major modules:

  • Video Pre-processing: Ingests raw MP4 animations, applies spatial cropping (eliminating legends and labels), and computes a temporal alignment mapping such that each output frame uniquely represents a specific calendar year. This is achieved via “delta encoding” and frame clock analysis, yielding a monotonic, year-indexed sequence of frames {fy}\{f_y\} (Alshamy et al., 22 Nov 2025).
  • Color-Based Territory Extraction: Processes each temporally aligned frame. RGB images are converted to HSV (hue-saturation-value) space; seed colors are thresholded to generate binary territorial masks. Optionally, RGB-channel filtering distinguishes similar hues. DNF further refines masks by enforcing neighbor support.
  • Time-Series Assembly and Normalization: Aggregates per-frame pixel counts into {y:py}\{y: p_y\}, applies cross-video scale normalization using invariant water features, and outputs plots and normalized datasets for downstream analysis and visualization.

2. Pre-processing: Temporal and Spatial Alignment

Temporal alignment in ATDE exploits recurrent digit changes in a designated “clock region” C\mathcal{C} of each frame. The frame-to-frame change score,

St=(x,y)CIt(x,y)It1(x,y)1,S_t = \sum_{(x, y) \in \mathcal{C}} \| I_t(x, y) - I_{t-1}(x, y) \|_1,

quantifies pixel-wise changes. Threshold τ\tau (e.g., 50,00050{,}000) identifies change points corresponding to year increments, ensuring exactly one representative frame per year. Cross-video scale normalization addresses inconsistent zoom or crop between videos by computing the scale factor

σd=WdWr,\sigma_d = \frac{W_d}{W_r},

where WdW_d is the water pixel count in a user-defined bounding box for dynasty dd, and WrW_r the reference dynasty. Territorial pixel counts py(d)p_y^{(d)} are normalized by σd\sigma_d. This procedure aligns extracted trajectories for comparative cross-dynasty analyses (Alshamy et al., 22 Nov 2025).

3. Color Segmentation and RGB Channel Filtering

Territorial pixel extraction proceeds by HSV color segmentation. Given RGB seed colors Ci=(ri,gi,bi)C_i = (r_i, g_i, b_i) for each dynasty, conversion to HSV yields (Hi,Si,Vi)(H_i, S_i, V_i). For each seed, bounds are defined by configurable hyperparameters:

  • Hue tolerance: Δh\Delta_h
  • Saturation: [Smin,Smax][S_{\min}, S_{\max}]
  • Value: [Vmin,Vmax][V_{\min}, V_{\max}]

A pixel pp with HSV(p)=(h,s,v)\mathrm{HSV}(p) = (h, s, v) matches if

HlowerihHupperiandSlowerisSupperiandVlowerivVupperiH_{\text{lower}}^i \leq h \leq H_{\text{upper}}^i \quad \text{and} \quad S_{\text{lower}}^i \leq s \leq S_{\text{upper}}^i \quad \text{and} \quad V_{\text{lower}}^i \leq v \leq V_{\text{upper}}^i

for any ii. Multiple territorial hues are combined with cv2.inRange and bitwise OR operations. When needed, RGB-channel restrictions (e.g., g(p)<150g(p) < 150) further differentiate territorial colors from visually similar ocean or background pixels (Alshamy et al., 22 Nov 2025).

4. Direct-Neighbor Filtering (DNF) and Mask Refinement

Post-segmentation, DNF suppresses isolated and noisy pixels by enforcing local connectivity. For each pixel in the binary mask MyM_y, the number of contiguous “territorial” neighbors (using a 3×33\times3 kernel: K=[111 101 111]K = \begin{bmatrix} 1 & 1 & 1 \ 1 & 0 & 1 \ 1 & 1 & 1 \end{bmatrix} ) is computed. Filtering is applied as follows:

Mi,j={1(u,v)N(i,j)Mu,vk 0otherwiseM'_{i, j} = \begin{cases} 1 & \sum_{(u, v) \in \mathcal{N}(i, j)} M_{u, v} \geq k \ 0 & \text{otherwise} \end{cases}

where N(i,j)\mathcal{N}(i, j) denotes the eight immediate neighbors and kk is the minimum required (default k=5k=5) (Alshamy et al., 22 Nov 2025).

5. Time-Series Pixel Count Aggregation and Comparative Analysis

For each year-indexed frame, ATDE computes the aggregate territorial pixel count via

py=i=1Hj=1WMy(i,j),p_y = \sum_{i=1}^H \sum_{j=1}^W M_y(i, j),

scaled and normalized for cross-video comparison: $p'_y = \frac{p_y}{\sigma_d}, \quad p_{\max} = \max_{d, y} p'_y^{(d)}$ Producing final trajectories: {y:py/pmax}\{ y : p'_y / p_{\max} \} These curves enable analysis of territorial evolution, expansion, contraction, and inter-dynasty comparative dynamics. Year-by-year results align with established historical periodizations, as demonstrated for ten major Chinese dynasties (Alshamy et al., 22 Nov 2025).

6. Accuracy, Limitations, and Application Scope

On animations with consistent flat coloring and minimal artifacts, the pipeline achieves >95% pixel-level correspondence with manual annotations. Principal error sources include inaccuracies in visual boundaries within source videos, hue overlap and compression artifacts, and sensitivity to the temporal change threshold τ\tau. ATDE processes a 1920×1080, 1000-frame video in under five minutes on commodity CPUs. It is unsuitable for animations with overlapping territories, gradient fills, dynamic legends, or cases demanding precise GIS area estimates. The pipeline’s output supports rapid exploration, comparative studies, and pedagogical utility, but is not a replacement for authoritative geospatial datasets (Alshamy et al., 22 Nov 2025).

ATDE’s methodology can be augmented with photogrammetric and semantic segmentation frameworks to broaden its applicability. Chen et al. (Chen et al., 2020) provide a pipeline involving U-Net voxel segmentation, multi-class semantic labeling, and integration with simulation engines. Techniques such as region growing, graph-cut energy minimization, and GPU-accelerated inference may be adapted for real-time or large-scale ATDE deployments. Cross-referencing extracted territorial pixel masks with geo-typical object databases or integrating output as WMS/WFS spatial layers are plausible extensions. The systematic normalization and mask refinement procedures of ATDE establish a reproducible paradigm for extracting dynamic territorial datasets, which could be synchronized with semantic terrain data for distributed simulation or GIS/CBR frameworks—a plausible implication is enhanced interoperability between animated historic visualizations and modern geospatial analysis pipelines (Alshamy et al., 22 Nov 2025, Chen et al., 2020).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Animated Territorial Data Extractor (ATDE).