| 1234567891011121314151617181920212223242526 |
- from pathlib import Path
- import json
- import numpy as np
- from PIL import Image
- root = Path(__file__).parent
- first = np.asarray(Image.open(root / 'k2-normal-a.jpg').convert('RGB')).astype(np.int16)
- second = np.asarray(Image.open(root / 'k2-normal-b.jpg').convert('RGB')).astype(np.int16)
- assert first.shape == second.shape == (1540, 2723, 3)
- # Fixed boxes from the observed normalized screenshots. All exclude the clock,
- # detail panel and dashboard; the control box contains only static ground imagery.
- boxes = {'device_and_halo': (1320, 805, 1395, 885), 'static_ground_control': (1050, 800, 1225, 900)}
- results = {}
- for name, (left, top, right, bottom) in boxes.items():
- delta = np.abs(first[top:bottom, left:right] - second[top:bottom, left:right])
- per_pixel = delta.max(axis=2)
- results[name] = {'box_xyxy': [left, top, right, bottom], 'pixels': int(per_pixel.size),
- 'changed_over_10': int((per_pixel > 10).sum()),
- 'changed_over_20': int((per_pixel > 20).sum()),
- 'mean_channel_delta': float(delta.mean()), 'max_channel_delta': int(delta.max())}
- results['evidence_limits'] = ['JPEG normalized tool screenshots, not original PNG pixels.',
- 'Two wall-clock captures ~35 seconds apart, not a controlled RAF trace.',
- 'Local image change supports visible motion, not a measured frame rate or GPU timing.',
- 'No live page script or browser process was used; this only analyzes saved images.']
- (root / 'pixel-diff.json').write_text(json.dumps(results, ensure_ascii=False, indent=2), encoding='utf-8')
- print(json.dumps(results, ensure_ascii=False, indent=2))
|