Commit 2373c1db authored by Sushil BHATTACHARJEE's avatar Sushil BHATTACHARJEE

code update; returns numpy array instead of tuple

parent 8559a22f
......@@ -21,8 +21,9 @@
This package is part of the signal-processing and machine learning toolbox
Bob_. It provides functions for extracting image-quality features proposed
for PAD experiments by different research group.
for PAD experiments by different research groups. Image quality measures
proposed by Galbally et al (TIFS 2014) and by Wen et al. (TIFS 2015)
are implemented in this package.
Installation
------------
......
......@@ -188,7 +188,7 @@ def image_quality_measures(refImage, testImage):
#26 HLFI: high-low frequency index (implemented as done by Galbally in Matlab).
hlfi25=high_low_freq_index(fftRef, refImage.shape[1])
return (mse00, psnr01, ad02, sc03, nk04, md05, lmse06, nae07, snrv08, ramdv09, mas10, mams11, sme12, gme16, gpe17, ssim18, vif19, hlfi25)
return np.asarray((mse00, psnr01, ad02, sc03, nk04, md05, lmse06, nae07, snrv08, ramdv09, mas10, mams11, sme12, gme16, gpe17, ssim18, vif19, hlfi25), dtype=np.float32)
"""
......
......@@ -34,24 +34,24 @@ def computeVideoIQM(video4d):
print(rgbFrame.shape)
iqmSet = iqm.compute_quality_features(rgbFrame) #iqmSet = iqm.compute_quality_features(grayFrame)
numIQM = len(iqmSet)
print(numIQM)
iqaSet = iqa.compute_msu_iqa_features(rgbFrame)
numIQA = len(iqaSet)
print(numIQA)
print(iqaSet.shape)
print(iqmSet.shape)
#now initialize fset to store iqm features for all frames of input video.
bobfset = np.zeros([numframes, numIQM])
bobQFeats = np.asarray(iqmSet) # compute_quality_features() returns a tuple
bobfset[f] = bobQFeats
bobfset[f] = iqmSet
msufset = np.zeros([numframes, numIQA])
msuQFeats = np.asarray(iqaSet)
msufset[f] = msuQFeats
msufset[f] = iqaSet
for f in range(1,numframes):
print('frame #: %d' %f)
rgbFrame = video4d[f]
print(rgbFrame.shape)
# grayFrame = matlab_rgb2gray(rgbFrame) #compute gray-level image for input color-frame
# bobQFeats = np.asarray(iqm.compute_quality_features(grayFrame)) # computeQualityFeatures() returns a tuple
bobQFeats = np.asarray(iqm.compute_quality_features(rgbFrame)) # computeQualityFeatures() returns a tuple
bobQFeats = iqm.compute_quality_features(rgbFrame)
msuQFeats = iqa.compute_msu_iqa_features(rgbFrame)
bobfset[f] = bobQFeats
msufset[f] = msuQFeats
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment