measure_highlight_texture
Quantify texture in bright subject zones using local standard deviation, tonal span, and gradient energy, with optional reference comparison for retention ratios.
Instructions
Measure the texture of the bright subject zone. Subject pixels have luminance above median + 5 x (median |luminance - median| on a 32 px grid). The ROI is a circle around the luminance-weighted centroid of compact subject pixels (8 px grid, at least 2 of 4 neighbours 3 px away also subject), radius = their 90th-percentile distance held to [50 px, 0.45 x min(width, height)]. The shell zone is the P20..P92 band of the subject pixels in the ROI (every 4th pixel). local_stddev = median luminance stddev of 16 px blocks in the ROI whose samples are at least 40% shell; tonal_span = P90 - P10 of the shell pixels; gradient_energy = mean Sobel energy on shell pixels. With reference_id, the reference is measured over the same ROI and retention is current / reference for each value (null where the reference value is at most 0.0001, or 0.001 for tonal_span). Returns JSON: current, reference, retention, shell_zone, roi, shell_pixel_count, block_count. Fewer than 100 subject pixels in the ROI of either view is an error. luminance is 0.2126R + 0.7152G + 0.0722B.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| view_id | Yes | View to measure | |
| reference_id | No | Optional second view measured over the same ROI, for the retention ratios |