# Finding the Least Motion-Blurred Image by Reusing Early Features of Object Detection Network
## 2 Materials and Methods
### Motivation and Method for Finding the Least Motion-Blurred Image
#### 2.1.2 Standard Methods  
Image Sharpness as Image Quality Proxy  
This method was used for the measurement of image sharpness, which was used as an estimate of image quality. The image quality evaluation was required in order to perform the selection of a suitable subset of frames to be passed to the 3D head reconstruction algorithm [86].  
The key steps of the image sharpness evaluation method were:  
1. Detection of the head region (BBox);
2. Determination of region of interest (RoI) parameters: RoI is a square and its size is the smaller edge of the head's BBox;
3. Cropping the RoI from the image and resizing it to 256 \(\times\) 256 px image patch;
4. Filtering the cropped and resized patch using a Laplacian of Gaussian (LoG) filter (\(3\times 3\) filter size, \(\sigma=0.5\));
5. Calculating the variance of the filtered patch;
6. Making a decision: a larger variance represents a higher image sharpness, hence less motion blur.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Layer ID/No.** & **Layer Name** & **Feature Map Shape** \\ \cline{3-3}  & & \([N\times M\times K]\)1  \\ \hline FM1 & Conv 1-1 & \(512\times 512\times 64\) \\ FM2 & Conv 1-2 & \(512\times 512\times 64\) \\ FM3 & Conv 2-1 & \(256\times 256\times 128\) \\ FM4 & Conv 2-2 & \(256\times 256\times 128\) \\ FM5 & Conv 3-1 & \(128\times 128\times 256\) \\ FM6 & Conv 3-2 & \(128\times 128\times 256\) \\ FM7 & Conv 3-3 & \(128\times 128\times 256\) \\ FM8 & Conv 4-1 & \(64\times 64\times 512\) \\ FM9 & Conv 4-2 & \(64\times 64\times 512\) \\ FM10 & Conv 4-3 & \(64\times 64\times 512\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Summary of the CNN’s first 10 feature maps that were investigated for suitability to provide useful information for prediction of image quality. The number of channels of the feature map determines the dimensionality of the sampled feature vector.  
No Reference Image Quality Metrics  
This group of image quality evaluation methods does not require a reference image to analyze the target image and is also called blind methods. Blind methods use statistical features of the image to assess the image quality. Three methods were included in the pool of image quality evaluators: BRISQUE [78], NIQE [79], and PIQE [80]. Matlab Image Processing Toolbox implementation of these methods was used in experiments [87].  
Each metric has its own strengths when analyzing different types of images. Comparing the performance of these different metrics on the validation image set could be the way of choosing the best metric for a particular dataset.  
A short description of the used blind image quality evaluation methods:  
* BRISQUE--Blind/Referenceless Image Spatial Quality Evaluator [78]. BRISQUE is a model that is trained on databases of distorted images, and it employs an \"opinion-aware\" approach that assigns subjective quality scores to the training sets.
* NIQE--Natural Image Quality Evaluator [79]. The NIQE model is trained on undistorted images, therefore it can assess the quality of images with arbitrary distortions and does not rely on human opinions when measuring image quality. However, this system does not score images based on the subjective quality scores of viewers; hence, the NIQE score might not be as accurate in predicting human perception of quality.
* PIQE--Perception-based Image Quality Evaluator [80]. The PIQE algorithm is unsupervised, meaning it does not require a trained model. It is also opinion unaware. PIQE is suitable for measuring the quality of images with arbitrary distortion. Mostly it performs similarly to NIQE.  
The key steps of the image quality evaluation using blind methods:  
1. Detection of the head region (BBox);
2. Determination of region of interest (RoI) parameters: RoI is a square and its size is the shorter edge of the head's BBox;
3. Cropping the RoI from the image and resizing it to 512 \(\times\) 512 px image patch;
4. Providing the patch as input for the BRISQUE, NIQE, or PIQE method;
5. Making a decision: a smaller score indicates better perceptual quality.