dataeval.flags.ImageStats¶
- class dataeval.flags.ImageStats(*args, **kwds)¶
Flag enumeration for controlling image statistics computation.
This enum provides fine-grained control over which statistics are computed during image processing. Flags can be combined using bitwise OR (|) to select multiple statistics.
Individual Stats¶
Pixel Statistics (computed on pixel values):
PIXEL_MEAN : Mean pixel value
PIXEL_STD : Standard deviation of pixel values
PIXEL_VAR : Variance of pixel values
PIXEL_SKEW : Skewness of pixel distribution
PIXEL_KURTOSIS : Kurtosis of pixel distribution
PIXEL_ENTROPY : Entropy of pixel histogram (depends on PIXEL_HISTOGRAM)
PIXEL_MISSING : Fraction of missing/NaN pixels
PIXEL_ZEROS : Fraction of zero pixels
PIXEL_HISTOGRAM : 256-bin histogram of pixel values
Visual Statistics (computed on visual properties):
VISUAL_BRIGHTNESS : Brightness measure (depends on VISUAL_PERCENTILES)
VISUAL_CONTRAST : Contrast measure (depends on VISUAL_PERCENTILES)
VISUAL_DARKNESS : Darkness measure (depends on VISUAL_PERCENTILES)
VISUAL_SHARPNESS : Sharpness measure using edge detection
VISUAL_PERCENTILES : Percentiles (0, 25, 50, 75, 100)
Dimension Statistics (computed on image/box dimensions):
DIMENSION_OFFSET_X : X-offset of bounding box
DIMENSION_OFFSET_Y : Y-offset of bounding box
DIMENSION_WIDTH : Width of image/box
DIMENSION_HEIGHT : Height of image/box
DIMENSION_CHANNELS : Number of color channels
DIMENSION_SIZE : Total pixel count
DIMENSION_ASPECT_RATIO : Normalized aspect ratio between -1 (vertical) and 1 (horizontal)
DIMENSION_DEPTH : Bit depth of image
DIMENSION_CENTER : Center coordinates [x, y]
DIMENSION_DISTANCE_CENTER : Distance from box center to image center
DIMENSION_DISTANCE_EDGE : Distance from box to nearest image edge
DIMENSION_INVALID_BOX : Whether bounding box is invalid
Hash Statistics (computed on raw image data):
HASH_XXHASH : xxHash of raw image
HASH_PHASH : Perceptual hash of image
HASH_DHASH : Difference/gradient hash of image
HASH_PHASH_D4 : Perceptual hash with D4 symmetry (rotation/flip invariant)
HASH_DHASH_D4 : Difference hash with D4 symmetry (rotation/flip invariant)
Convenience Groups¶
Sub-groups:
PIXEL_BASIC : Mean, std, var
PIXEL_DISTRIBUTION : Skew, kurtosis, entropy, histogram
VISUAL_BASIC : Brightness, contrast, sharpness
DIMENSION_BASIC : Width, height, channels
DIMENSION_OFFSET : Offset X and Y
DIMENSION_POSITION : Center, distance to center, distance to edge
HASH_DUPLICATES_BASIC : Standard duplicate detection (xxhash + phash + dhash)
HASH_DUPLICATES_D4 : Rotation/flip-invariant detection (xxhash + phash_d4 + dhash_d4)
Full Categories:
NONE : No statistics
PIXEL : All pixel statistics
VISUAL : All visual statistics
DIMENSION : All dimension statistics
HASH : All hash statistics
ALL : All available statistics
Examples
Select specific statistics:
>>> stats = ImageStats.PIXEL_MEAN | ImageStats.PIXEL_STD >>> stats = ImageStats.VISUAL_BRIGHTNESS | ImageStats.DIMENSION_WIDTHUse convenience groups:
>>> stats = ImageStats.PIXEL # All pixel stats >>> stats = ImageStats.PIXEL_BASIC | ImageStats.VISUAL # Basic pixel & all visualNotes
Some statistics have dependencies on others, the dependencies will be added automatically during processing.