Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataFrame
  • PyFlink Multimodal
    • Image
    • Video
    • Utilities
  • PyFlink DataStream
  • PyFlink Common

pyflink.multimodal.operators.image_sharpness#

image_sharpness(*columns, max_edge=None, allow_upscale=False, concurrency=None)[source]#

Compute a raw sharpness metric using Laplacian variance.

The result is in [0, +inf) and larger values usually indicate sharper images. This is a low-cost focus measure, not an absolute quality score: thresholds depend on image scale, texture, contrast, and noise.

Parameters
  • *columns – Optional image columns. When provided, the UDF is applied directly (syntactic sugar).

  • max_edge – Cap the longest edge to this many pixels before computing sharpness. None (default) preserves the original scale.

  • allow_upscale – When max_edge is set, allow upscaling smaller images. Default False.

  • concurrency – UDF concurrency. None uses the framework default.

Returns

A UDF producing float64.

Example::
>>> # As a reusable variable
>>> sharpness = image_sharpness(max_edge=512)
>>> df = df.with_columns("sharpness", sharpness(col("img")))
>>>
>>> # Inline
>>> df = df.with_columns("sharpness", image_sharpness(col("img"), max_edge=512))

previous

pyflink.multimodal.operators.image_aspect_ratio

next

pyflink.multimodal.operators.image_hash

Show Source

Created using Sphinx 4.5.0.