API documentation

Overview of all methods included in quat.

video.py

General video helper

quat.video.advanced_pooling(x, name, parts=3, stats=True, minimal=False)[source]

advanced_pooling temporal pooling method,

quat.video.calc_per_second_scores(per_frame_scores, segment_duration)[source]

converts per frame scores to per second scores, using mean values per second

quat.video.iterate_by_frame(video_filename, convert=True)[source]

iterator over all frames a video given by video_filename, if convert is true, than a conversion to uint will be performed

Parameters
  • video_filename (str) – filename of a video file

  • convert (bool) – if true performs a 8 bit conversion of each frame

Returns

Return type

interator for all video frames

quat.video.iterate_by_frame_two_videos(distortedvideo, referencevideo, convert=True)[source]

interates over a pair of videos (distortedvideo, referencevideo) and returns pairs of frames (dis_frame, ref_frame), if convert is true, uint conversion will be performed, Important, if videos don’t have the same number of frames it will stop after min(frames(dis), frames(ref)) frames.

quat.video.read_videos_frame_by_frame(distortedvideo, referencevideo, per_frame_function, per_frame_function_additional_params={}, debug=False, stepsize=15)[source]

read two videos frame by frame, and perform a function with parameters on each pair of frames

log.py

Logging helpers

quat.log.colorgreen(m)[source]

return m with colored green code, only for linux

quat.log.colorred(m)[source]

return m with colored red code, only for linux

quat.log.jPrint(x)[source]

renamed version of jprint

quat.log.jprint(x)[source]

prints an object x as json formatted to stdout

quat.log.lDbg(msg)[source]

prints msg as debug log message

quat.log.lError(msg)[source]

prints msg as error log message

quat.log.lInfo(msg)[source]

prints msg as info log message

quat.log.lWarn(msg)[source]

prints msg as warning log message

parallel.py

Helpers for parallel processing

quat.parallel.run_parallel(items, function, arguments=[], num_cpus=8, multi_item=False)[source]

run a function call parallel, for each item

Parameters
  • items (list) – list of items passed to function

  • function (function name) – function that should be applied on each item

  • arguments (list) – constant arguments that are passed to function

  • num_cpus (int) – number of cpu’s that should be used

  • multi_item (bool) – in case multi_item is true, it is assumed each item is a list

Returns

Return type

results of function performed on all items as a list

quat.parallel.run_parallel_by_grouping(items, function, arguments, num_cpus=8)[source]

devides items to num_cpus groups and applies function with each group + arguments in parallel threads

unsorted.py

Unsorted methods

quat.unsorted.align_vectors(x, y)[source]

align the length of two vectors x and y using the min length of both

quat.unsorted.create_colormap(start, mid, end, steps=256)[source]

creates a color map between three color points using steps intermediate colors.

Parameters
  • start (tuple(int)) – defined start color as tuple (R, G, B)

  • mid (tuple(int)) – defined middle color as tuple (R, G, B)

  • end (tuple(int)) – defined end color as tuple (R, G, B)

Returns

Return type

list of in total steps colors statring from start, to mid, to end

quat.unsorted.jdump_file(filename, jo, printing=False)[source]

dump a json file to a filename

quat.unsorted.p_bar(iterable, total=100)[source]

progress bar TODO: mark that this is an internal function

quat.unsorted.powerset(iterable)[source]

returns powerset of an iterable,

powerset([1,2,3]) –> () (1) (2) (3) (1,2) (1,3) (2,3) (1,2,3) from: https://stackoverflow.com/a/16915734

quat.unsorted.progress_bar(iterable, max=100)[source]

run progress bar on iterable

quat.unsorted.timeit(func)[source]

get the required time for a function call as information on stdout, via lInfo

example usage:

@timeit
def myfunction():
    return 42

or

def anotherfucntion():
    return 23

timeit(anotherfucntion())

module ff

ffmpeg and ffprobe related helper

segmenting

Tools to segment videos

TODO: check dash_encoder.py

quat.ff.segmenter.create_segments(videofilename, output_folder, segment_time=4, debug=False)[source]

segment a video and store segments in a folder

Parameters
  • videofilename (str) – video filename that should be segmented

  • output_folder (str) – store segments in this folder, folder will be created if it doesn’t exists

  • segment_time (int) – length of video segments in seconds

Returns

Return type

a list of all generated segment filenames

ffprobe

ffprobe related helpers

quat.ff.probe.ffprobe(filename)[source]

run ffprobe to get some information of a given video file

quat.ff.probe.ffprobe_framesizes_types(filename)[source]

run ffprobe to get some frame information of a given video file

encoding

Collected python methods for building up automated ffmpeg commands

exception quat.ff.encoder.FFmpegMissingError[source]
exception quat.ff.encoder.FFprobeMissingException[source]
exception quat.ff.encoder.MissingCodecImplementationException[source]
exception quat.ff.encoder.NoValidVideoFileException[source]
quat.ff.encoder.analyze_video_file(filename)[source]

run ffprobe to get some information of a given video file TODO: check if still required

quat.ff.encoder.build_commands_to_convert_to_4k_and_lossless(processes_video_dir, lossless_output_dir)[source]
read all files in processes_video_dir and create commands to convert

to 4k resolution and lossless codec

TODO: check if still required

quat.ff.encoder.build_ffmpeg_command(pvs, output_dir)[source]

Creates strings out of PVS information for running a ffmpeg instances in a separate shell :param pvs: complete PVS (= dict) :return: return built string

quat.ff.encoder.generic_two_pass(inputfile, bitrate, resolution, framerate, outputfilename, profile, logfile, ffmpeg_base_command, codecsettings)[source]

a general two pass command building, e.g. for vp9 and h264 usable

quat.ff.encoder.h264_encoding(inputfile, bitrate, resolution, framerate, outputfilename, profile, passes, logfile, ffmpeg_base_command)[source]

h264 encoding

quat.ff.encoder.hevc_encoding(inputfile, bitrate, resolution, framerate, outputfilename, profile, passes, logfile, ffmpeg_base_command)[source]

specific handling of hevc encoding settings

quat.ff.encoder.vp9_encoding(inputfile, bitrate, resolution, framerate, outputfilename, profile, passes, logfile, ffmpeg_base_command)[source]

generate settings for vp9 encoding

converting

ffmpeg methods to convert, rescale, and center crop a given video

quat.ff.convert.check_ffmpeg()[source]

checks if ffmpeg is installed in the system

Returns

Return type

true if ffmpeg can be used, otherwise an Exception is thrown

quat.ff.convert.convert_to_avpvs(input_file, tmp_folder, framerate='60/1', width=3840, height=- 2, pix_fmt='yuv422p10le')[source]

converts a video to a unified resolution, framerate and pixel format, can be used, e.g. in case of a full reference model, to unify a distorted video with the source video

Parameters
  • input_file (str) – input video file

  • tmp_folder (str) – folder where converted video is stored

  • framerate (str) – framerate of final video

  • width (int) – width of final video

  • height (int) – height of final video, use -2 to automatically determine height based on width

  • pix_fmt (str) – pixel format of final video

Returns

Return type

filename and path of the converted video

quat.ff.convert.convert_to_avpvs_and_crop(input_file, tmp_folder, framerate='60/1', width=3840, height=- 2, pix_fmt='yuv422p10le', ccheight=360)[source]

converts a video to a unified resolution, framerate and pixel format and performs afterwards a center cropping can be used, e.g. in case of a full reference model, to unify a distorted video with the source video

Parameters
  • input_file (str) – input video file

  • tmp_folder (str) – folder where converted video is stored

  • framerate (str) – framerate of final video

  • width (int) – width of final video

  • height (int) – height of final video, use -2 to automatically determine height based on width

  • pix_fmt (str) – pixel format of final video

  • ccheight (int) – center crop height of final crop

Returns

Return type

filename and path of the converted and center cropped video

quat.ff.convert.crop_video(input_file, tmp_folder, ccheight=360)[source]

create a center cropped version of a video

Parameters
  • input_file (str) – input video file

  • tmp_folder (str) – folder where center cropped version is store, this version gets “_cropped.mkv” as suffix

  • ccheight (int) – default=360, height of the center crop

Returns

Return type

filename and path of generated center cropped video

quat.ff.convert.rescale_video(input_file, tmp_folder, height=360)[source]

rescales a given video

recording

FFmpeg based screen recorder

# TODO: audio is ususally not synced

class quat.ff.recorder.Recorder(resultfolder='tmp')[source]

Bases: object

ffmpeg based screen recording

start(filebasename, hardwareAcceleration=False, width=1366, height=768, fps=24, shift='')[source]

starts the screen record

Parameters
  • filebasename (str) – basename of recording filename (will be extended by .mkv and stored in the recordfolder)

  • hardwareAcceleration (bool) – if true try to used hardware acceleration for intel graphics cards (TODO: experimental)

  • width (int) – recording width (screen resolution must be at least having this width)

  • height (int) – recording height

  • fps (int) – frames per second to record

  • shift (str) – ffmpeg specific shift, e.g. “+100,200” TODO: explain better

stop()[source]

stop recording

module ml

machine learning related methods

dimension visualization

Preparation for visualisation of high dimensial data using TSNE approach

quat.ml.dim_vis.learn_embedding(df, dims=2)[source]

learns an embedding based on TSNE approach with dims final dimensions, using all columns of df

genetic evolution

Genetic evolution experiments, uses multiprocessing

class quat.ml.gen_alg.GeneticEvolution(population_size, mutation_rate, max_num_generations, individual_class, cpu_count=8, verbose=False, live_plot=True, checkpoint_folder='checkpoint', checkpoint_intervall=10)[source]

Bases: object

simple base class for genetic evolution

get_number_generations()[source]
next_generation()[source]

evolve the next generation

class quat.ml.gen_alg.HelloWorld(number_genes=10)[source]

Bases: quat.ml.gen_alg.Individual

example individual class, starting from a random string, evolution will get “HelloWorld”

calc_fitness()[source]

in this case fitness is the difference to the target string

get_genom_as_char()[source]
print()[source]
str_genom()[source]

string version of genom

target = array([ 7, 36, 43, 43, 46, 22, 46, 49, 43, 35])
class quat.ml.gen_alg.Individual(number_genes=42)[source]

Bases: object

base class of an individual in a genetic algorithm

calc_fitness()[source]

calculate fitness of individual

crossover(other)[source]

combine current individual with other, create a new individual (copy)

get_fitness()[source]

return fitness value

get_genom()[source]

return genom

init_genom()[source]

inititalize genom of individual, with random numbers, [0,1] per default

mutate(mutation_rate)[source]

based on mutation rate, change some genes, mutation rate is the percentage of how many genes are changes (randomly choosen, with repetition)

print()[source]
str_genom()[source]

string version of genom

quat.ml.gen_alg.main(_)[source]

example usage of the GeneticEvolution classes

classification/regression

mlcore lib for machine learning experiments, collection of regression, classification approaches

quat.ml.mlcore.load_serialized(filename_with_path)[source]

load a serialized model

quat.ml.mlcore.plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=<matplotlib.colors.LinearSegmentedColormap object>, folder='figures')[source]

This function prints and plots the confusion matrix. Normalization can be applied by setting normalize=True.

quat.ml.mlcore.plot_confusion_matrix_new(confusion_matrix, display_labels, include_values=True, values_format=None, xticks_rotation=0, pdf=None, cmap=<matplotlib.colors.LinearSegmentedColormap object>)[source]
fig = plot_confusion_matrix(

confusion_matrix=cm_norm, display_labels=[“1pass”, “2pass”], pdf=”../figures/confusion_rf_norm.pdf”

)

quat.ml.mlcore.print_trees(pipeline, feature_columns, name='trees')[source]

exports and creates pdf/dot files for trees that are part of the pipeline

Parameters
  • pipeline (scikit learn pipeline) – needs to have named_steps[“regressor”] and named_steps[“feature_selection”] storing all data

  • feature_columns (list of str) – name of feature_columns

  • name (str) – folder name where all trees are finally stored

quat.ml.mlcore.save_serialized(clf, filename_with_path)[source]

save model to a file

quat.ml.mlcore.train_dummy_class(x, y)[source]

trains a dummy classifier, x is feature matrix, y target classes

quat.ml.mlcore.train_gradboost_class(x, y, num_trees=10, threshold='0.001*mean')[source]

trains gradient boosting classifier with feature selection step

Returns

Return type

dictionary of gradboost –> ml pipeline, crossval –> crossvalidation results

quat.ml.mlcore.train_rf_multi_regression(x, y, num_trees=10, threshold='0.001*mean', columns=[])[source]

train multi instance regression, so Y is not a scalar, it is a vector

statistics

Collection of statistics methods to evauluate machine learning classification and regression.

quat.ml.statistics.calc_correlations(data, X, Y)[source]

Take a data frame as input and calculate ‘pearson’, ‘kendall’, ‘spearman’ correlations.

Parameters
  • data (pandas dataframe) – stores all data

  • X (str) – X column to be used

  • Y (str) – Y column to be used

Returns

dictionary with the following keys

Return type

pearson, kendall, spearman

quat.ml.statistics.calc_regression_metrics(data, X, Y)[source]

calculates several regression metrics: r2, rmse, cohen_d, mean_absolute_error, median_absolute_error

Parameters
  • data (pandas dataframe) – stores all data

  • X (str) – X column to be used

  • Y (str) – Y column to be used

Returns

Return type

dictionary of all metric values

quat.ml.statistics.cohen_d(data, X, Y)[source]

calculates cohen’s d measure

Parameters
  • data (pandas dataframe) – stores all data

  • X (str) – X column to be used

  • Y (str) – Y column to be used

quat.ml.statistics.cos_sim(x, y)[source]

calculates cosine similartiy between vector x and vector y

Parameters
  • x (list/np.array) –

  • y (list/np.array) –

quat.ml.statistics.mean_absolute_error(data, X, Y)[source]

calculates mean absolute error

Parameters
  • data (pandas dataframe) – stores all data

  • X (str) – X column to be used

  • Y (str) – Y column to be used

quat.ml.statistics.median_absolute_error(data, X, Y)[source]

calculates median absolute error

Parameters
  • data (pandas dataframe) – stores all data

  • X (str) – X column to be used

  • Y (str) – Y column to be used

quat.ml.statistics.r2(data, X, Y)[source]

calculates r2 measure

Parameters
  • data (pandas dataframe) – stores all data

  • X (str) – X column to be used

  • Y (str) – Y column to be used

quat.ml.statistics.rmse(data, X, Y)[source]

rmse caluclation

Parameters
  • data (pandas dataframe) – stores all data

  • X (str) – X column to be used

  • Y (str) – Y column to be used

module tools

some useful command line tools, that are mostly independent of quat.

do_parallel.py

tool for running scripts parallel

example usage: $ ./do_parallel.py *.gz –script ./whatever.sh -s

the script ./whatever.sh will be called with each of the *.gz files

do_parallel_by_file.py

tool for running scripts parallel

example usage: $ ./do_parallel_by_file.py commands.list

where in commands.list all commandas are stored

extract_cuts.py

Script for automatic detection of scene cuts in a video stream

Note: specifically tuned for big bucks bunny

Authors: Serge Molina, Steve Göring

quat.tools.extract_cuts.cuts_iterator(video_filename)[source]

Function that takes an opencv video stream and yields cuts timing when detected The cuts detection is based on detection of peaks in the standard deviation of two successive frames

TODO: some parts can be replaced by cuts-feature inside quat

quat.tools.extract_cuts.extract_cuts(video_filename, min_cut_duration, output_dir, cmd_filename, cpu_count)[source]

extract cuts for one video

quat.tools.extract_cuts.main(params=[])[source]

extracts cuts of a video file

psnr.py

measure psnr TODO/FIXME: use quat methods, maybe remove

quat.tools.psnr.file_open(filename, mode='r')[source]

Open a file, and if you add bz2 to filename a compressed file will be opened

quat.tools.psnr.iterate_by_frame(video_filename)[source]

iterator over all frames a video_filename

siti.py

tool to extract si ti values of a given video

Note: the extracted values are [0,1] normalized, due to a float conversion of the given video frames, if you need values in range [0,255], just multiply the extracted values by 255

quat.tools.siti.extract_siti(video)[source]

extracts siti values of a given video the resulting values are [0,1] scaled

Parameters

video (str) – filename of the video that should be processed

Returns

Return type

dict of per frame results and filename

Examples

>>> import quat.tools.siti extract_siti
>>> res = extract_siti("myvideo.mkv")

module utils

general utils, e.g. filesystem, os related

assertions.py

Collection of assertions helper.

quat.utils.assertions.assert_dir(directory, withassert=False)[source]

checks if a dir exists

quat.utils.assertions.assert_file(file, withassert=False)[source]

checks if a file is existing

quat.utils.assertions.json_assert(json, required_keys)[source]

checks if required_keys are present in json object

quat.utils.assertions.msg_assert(cond, message_error='', message_ok='')[source]

assert with a message for error or no error

Parameters
  • cond (bool) – condition to check

  • message_error (str) – message that is shown in case of error

  • message_ok (str) – message that is shown in case of ok, or if empty nothing is shown

fileutils.py

Some collected and hopefully usefule methods for file handling

quat.utils.fileutils.file_open(filename, mode='r')[source]

Open a file (depending on the mode), and if you add bz2 or gz to filename a compressed file will be opened, file_open can replace a typical with open(filename) statement

quat.utils.fileutils.get_filename_without_extension(full_filename)[source]

extract the plain filename without basename and extension of a given path and full filename

quat.utils.fileutils.get_files_by_extension(base_dir, extension)[source]

get list of files in a base_dir with specified extension

Parameters
  • base_dir (str) – dictionary to search

  • extension (str) – extension to check

Returns

Return type

list of files matching the extension

quat.utils.fileutils.get_files_by_extensions(base_dir, extensions=[''])[source]

get files by a list of extensions, see get_files_by_extension

quat.utils.fileutils.read_file(file_name)[source]

read a text file into a string

Parameters

file_name (str) – file to open

Returns

Return type

return content of the complete file as string

quat.utils.fileutils.read_json(filename)[source]

reads a json file

quat.utils.fileutils.write_json(j, filename, prettify=False)[source]

writes a json object j to a file

system

Collection of system helper functions.

TODO: unify documentation (e.g. parameters)

quat.utils.system.get_prog_name()[source]

return name of script, that was called on command line

quat.utils.system.get_shebang(file_name)[source]

read shebang of a file :file_name file to open :return shebang

quat.utils.system.lglob(path_pattern)[source]

returns list of glob results based on the given path_pattern

quat.utils.system.shell_call(call)[source]

Run a program via system call and return stdout + stderr. @param call programm and command line parameter list, e.g shell_call(“ls /”) @return stdout and stderr of programm call

module visual

collection of image and video features

base_features.py

Video and image no-reference based features. Base features can also be applied for full-ref calculations, using the calc_ref_dis method.

class quat.visual.base_features.BlockMotion[source]

calculates block motion of two following frames, block size is estimated by 5% of the height of the input frame, this is done to be resolution independent and faster

calc(frame)[source]

perform feature calculation for a single frame

class quat.visual.base_features.Blockiness[source]

calculate blockness of a video, assume that compression blocks have the same NxN size, where N = [8, 16, 32, 64, 128],

calculation performs the following steps, explained for N=8:

  • apply canny edge detection, K=[X,Y]-axis, normalized by num-rows/cols

  • calculate mean for all K summed values (A)

  • calculate for a shift (0,7) and for every 8th value of the K summed values the mean (B) - all shifts will be considered, and only the one with max_mean value is used

  • assume that the distribution should differe, if blocks are there

  • difference of A, and B is then the feature value

overall blockiness value – per frame:

  • value = \(\sqrt{(|x\_mean\_diff \cdot y\_mean\_diff | / 2^{(|max\_shift_x - max\_shift_y|/N)}}\)

calc(frame)[source]

perform feature calculation for a single frame

class quat.visual.base_features.CuboidCol(col)[source]

Motion estimation using a window of 60 frames and a cuboid video of the video, handles only columns of the frames

calc(frame)[source]

perform feature calculation for a single frame

class quat.visual.base_features.CuboidRow(row)[source]

Motion estimation using a window of 60 frames and a cuboid video of the video, handles only rows of the frames

calc(frame)[source]

perform feature calculation for a single frame

class quat.visual.base_features.CutDetectionFeatures[source]

Estimates scene cuts of a given video (approximation), implemented by Serge Molina

calc(frame)[source]

perform feature calculation for a single frame

class quat.visual.base_features.Feature[source]

abstract base class for all features, handles automatic storage and loading of calculated feature values

abstract calc(frame)[source]

perform feature calculation for a single frame

calc_dis_ref(dframe, rframe)[source]

fix for consistent naming scheme

calc_ref_dis(dframe, rframe)[source]

performs a full-ref style calculation, where the resulting features are calculated on both frames, and further difference values are stored,

Parameters
  • dframe (3d array) – distorted video frame

  • rframe (3d array) – reference video frame

Returns

  • a dict {“diff” (values, “ref”: values, “dis”: values} or)

  • dict {“diff_” + k (values, “ref_” + k: values, “dis_” + k: values} for all keys k in the underlying feature.)

fullref()[source]

used to check if it is a full reference feature

get_values()[source]

returns all stored feature values

load(folder, video, name='')[source]

loads a feature from a feature folder folder, feature filename is estimated using the _feature_filename

store(folder, video, name='')[source]

stores a feature to a feature folder folder, feature filename is estimated using the _feature_filename

class quat.visual.base_features.ImageFeature(img_f)[source]

a generic image feature class, ususally all methods implemented in quat.visual.images can be passes as argument in the constructor

calc(frame)[source]

perform feature calculation for a single frame

class quat.visual.base_features.MovementFeatures[source]

Calculates movement feature, using background removement, based on master thesis of julian zebelein

calc(frame, debug=False)[source]

perform feature calculation for a single frame

get_values()[source]

returns all stored feature values

class quat.visual.base_features.SiFeatures[source]

Calculates SI values of a video frame important: SI values are finally in a 0..1 range, due to float conversion

calc(frame)[source]

perform feature calculation for a single frame

class quat.visual.base_features.Staticness[source]

calculates how static the video is

calc(frame)[source]

perform feature calculation for a single frame

class quat.visual.base_features.StrredNoRefFeatures[source]

calculate entropy of subbands, with the feature that is used in strred, however, this feature does not consider a reference video, it justs calculates mean of spatial and temporal features of strred

calc(frame)[source]

perform feature calculation for a single frame

class quat.visual.base_features.TemporalFeatures[source]

A temporal feature, using RMSE of consecutive frames, somehow similar to TI, but not applied on gray frames

calc(frame)[source]

perform feature calculation for a single frame

class quat.visual.base_features.TiFeatures[source]

Calculates TI values important: TI values are finally in a 0..1 range, due to float conversion

calc(frame)[source]

perform feature calculation for a single frame

class quat.visual.base_features.UHDSIM2HD[source]

calculates similarity of UHD input resolution to HD, if input frame is not UHD resolution, it takes half of the height and width

calc(frame)[source]

perform feature calculation for a single frame

fullref.py

Full reference features.

All full-reference features share a common interface, e.g. in case of SSIM,

...
ssim = SSIM()
v = ssim.calc_ref_dis(dis_frame, ref_frame)
# will return the calculated ssim value in `v`

TODO: add references to metrics

class quat.visual.fullref.FramerateEstimator[source]

based on frame differences of src and distorted video estimate framerate of distorted video

TODO: check: could be also an no-reference feature

calc_ref_dis(dis, ref)[source]

tries to esimate fps

fullref()[source]

used to check if it is a full reference feature

get_values()[source]

returns all stored feature values

class quat.visual.fullref.PSNR[source]

Caclulate PSNR

calc_ref_dis(dis, ref)[source]

calculates psnr score

fullref()[source]

used to check if it is a full reference feature

class quat.visual.fullref.ResolutionSimilarities[source]

Tries to estimate resolution of the distorted video

calc_ref_dis(dis, ref)[source]

calculates resoltion based on similarity measurement

fullref()[source]

used to check if it is a full reference feature

class quat.visual.fullref.SSIM[source]

Calculate SSIM

calc_ref_dis(dis, ref)[source]

calculates ssim score

fullref()[source]

used to check if it is a full reference feature

class quat.visual.fullref.VIFP[source]

Caclulate multi scale (4 scales) VIFP

calc_ref_dis(dis, ref)[source]

calculates ms-vifp scores

fullref()[source]

used to check if it is a full reference feature

image

Purely image based features

quat.visual.image.calc_blur_features(frame, debug=False)[source]

estimates blurriness using Laplacian filter,

based on julian zebelein’s master thesis

quat.visual.image.calc_brisque_features(image, gray=False)[source]

calcualte brisque no-reference features,

References

  • scikit-video

  • Mittal, A. K. Moorthy and A. C. Bovik, “No-Reference Image Quality Assessment in the Spatial Domain” In: IEEE Transactions on Image Processing, 2012.

  • Mittal, A. K. Moorthy and A. C. Bovik, “Referenceless Image Spatial Quality Evaluation Engine,” In: 45th Asilomar Conference on Signals, Systems and Computers , November 2011.

quat.visual.image.calc_contrast_features(frame)[source]

calculates contrast based on histogram equalization,

based on julan zebelein’s master thesis

quat.visual.image.calc_fft_features(frame, debug=False)[source]

calculates fft feature,

based on julan zebelein’s master thesis

References

  • I. Katsavounidis et al. “Native resolution detection of video sequences”. In: Annual Technical Conference and Exhibition, SMPTE 2015. SMPTE. 2015, pp. 1–20.

quat.visual.image.calc_niqe_features(image, gray=False)[source]

calculate niqe features

References

  • scikit-video

  • Mittal, Anish, Rajiv Soundararajan, and Alan C. Bovik. “Making a ‘completely blind’ image quality analyzer.” In: IEEE Signal Processing Letters 20.3 (2013): 209-212.

quat.visual.image.calc_noise(frame)[source]

calcualtes noise std based on skimage.restoration.estimate_sigma “Robust wavelet-based estimator of the (Gaussian) noise standard deviation.”

Returns

Return type

mean value of all channels for std value of noise assuming that the noise has a Gaussian distribution

quat.visual.image.calc_saturation_features(frame, debug=True)[source]

calculates saturation of a given image,

re-implemented by Serge Molina

References

  • T. O. Aydın, A. Smolic, and M. Gross. “Automated aesthetic analysis of photographic images”. In: IEEE transactions on visualization and computer graphics 21.1 2015, pp. 31–42.””

quat.visual.image.calc_tone_features(image, gray=False)[source]

calculate tone feature,

re-implemented by Serge Molina

References

  • T. O. Aydın, A. Smolic, and M. Gross. “Automated aesthetic analysis of photographic images”. In: IEEE transactions on visualization and computer graphics 21.1 (2015), pp. 31–42.

quat.visual.image.ceiq(image, gray=False)[source]

re-implemented and extended version of https://github.com/mtobeiyf/CEIQ/blob/master/CEIQ.m features for “No-Reference Quality Assessment of Contrast-Distorted Images using Contrast Enhancement”

References

  • Jia Yan, Jie Li, Xin Fu: “No-Reference Quality Assessment of Contrast-Distorted Images using Contrast Enhancement”, In: Journal of Visual Communication and Image Representation, 2018

quat.visual.image.color_fulness_features(image_rgb)[source]

calculates color fullness

re-implementated by Serge Molina

References

  • Hasler, David, and Sabine E. Suesstrunk. “Measuring colorfulness in natural images.” In: Human vision and electronic imaging VIII. Vol. 5007. International Society for Optics and Photonics, 2003.

sseq

Re-implementation of sseq features based on matlab version and the research paper, see

References

  • Lixiong Liu, Bao Liu, Hua Huang, and Alan Conrad Bovik, “No-reference Image Quality Assessment Based on Spatial and Spectral Entropies”, In: Signal Processing: Image Communication, Vol. 29, No. 8, pp. 856-863, Sep. 2014.

  • Lixiong Liu, Bao Liu, Hua Huang, and Alan Conrad Bovik, “SSEQ Software Release”, URL: http://live.ece.utexas.edu/research/quality/SSEQ_release.zip, 2014

quat.visual.sseq.calc_sseq_features(image, scale=3, gray=False)[source]

calculate sseq features of an images with several scales

quat.visual.sseq.main(_)[source]

extract image features

quat.visual.sseq.per_block(image, function, block_shape=8, 8)[source]

truncate image size to multiple of block_shape, otherwise view_as_blocks will not work

quat.visual.sseq.sseq_features(image_filename, scale=3)[source]

sseq features of an image file

vifp – CHECK

Other Video Quality Metrics

For other video quality metrics or methods see scikit-video or sporco