measure_sharpness
Measures image sharpness via Sobel gradient energy of luminance, for a specified ROI or central half, returning a JSON score.
Instructions
Measure sharpness as the mean Sobel gradient energy (gx² + gy²) of luminance over every 4th pixel of a region. The region is roi_x/roi_y/roi_w/roi_h when all four are given (it must lie inside the image), else the central half of the image in each dimension. Returns JSON: sharpness, samples, roi {x, y, w, h}. luminance is 0.2126R + 0.7152G + 0.0722B.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"view_id": "<view_id>"
},
"name": "measure_sharpness"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| roi_h | No | Region height in pixels | |
| roi_w | No | Region width in pixels | |
| roi_x | No | Region left edge in pixels (all four ROI values together, or none: the central half) | |
| roi_y | No | Region top edge in pixels | |
| view_id | Yes | View to measure |