# Interested Keyframe Extraction of Commodity Video Based on Adaptive Clustering Annotation
## 3 Keyframe Extraction by Adaptive Clustering Annotation Facing  
### 3.1. Keyframe Definition for User's Interest  
In commodity videos, users will concentrate on images that reflect the global and local information of commodities. In addition, the clarity and quality of images will also greatly affect user experience and decision-making. Therefore, we first provide quantitative descriptions of image quality and the information mentioned previously and then define the keyframe based on the descriptions. Figure 2 illustrates the global and local information of two frames. Visibly, the image containing global commodity information has many contour features and, oppositely, the other image lacks these features. Thus, we adopt the Laplace operator, which can embody contour features of images to define the global and local features of images that express user's interest. The pixel point matrix of the commodity video frame is denoted as \(f(u,v)\), where \(u\) and \(v\) represent the row and column of the image, and its Laplace transform is shown in Equation (1) [41]. \[ \begin{split}&\bigtriangledown^{2}f(u,v)=[f(u+1,v)+f(u-1,v)+f(u,v+1)+f(u,v-1)]-4f(u,v), \\ & u\in\{1,2,\dots,h\},v\in\{1,2,\dots,w\}\end{split}  \tag{1}\]  
In the Equation (1), \(h\) and \(w\) represent the sum of row and column, respectively. Further, we binarize the image after Laplace transform and then count the number of white points in the binary image to calculate the ratio denoted as \(\eta=\frac{N_{w}}{N_{t}}\), which reflects the  
Figure 2: (**a**) Local feature, (**b**) Global feature. Local features reflect commodity details including texture, material, workmanship, etc. and global features reflect the overall effect of the commodity on the model. richness of contour information, where \(N_{w}\) and \(N_{t}\) represent the number of white points and total pixels, respectively. When \(\eta\) is large, it indicates that the frame of commodity video contains more contour features and likely reflects the global feature of the commodity. On the contrary, the frame may only contain the local features of goods. For example, for two frames in Figure 2, the \(\eta\) is 0.0029 and 0.028, respectively, showing large differences. Mean value, standard deviation, and mean gradient are commonly used to measure image quality and describe the brightness, the color saturation, and the clarity of image, respectively. In commercial video frames, poor image quality is caused by blur and lack of the main object due to lens conversion, so the mean gradient can be used. Meanwhile, lack of the main object results in a large area of blank and the average gradient of blank part is 0, resulting in a small average mean of the whole image. For this reason, we adopt mean gradient to evaluate the quality of commodity video frames, as in Equation (2). In the equation, respectively, \(w\) and \(h\) represent the width and height of the picture; \(\frac{\partial f(u,v)}{\partial x}\) and \(\frac{\partial f(u,v)}{\partial y}\) represent horizontal gradient and vertical gradient. When the mean gradient of a frame is greater than the mean value of all frames' gradients, the image quality is higher. \[G=\frac{1}{w\times h}\sum_{u=1}^{h}\sum_{v=1}^{w}\sqrt{\frac{(\frac{\partial f (u,v)}{\partial x})^{2}+(\frac{\partial f(u,v)}{\partial y})^{2}}{2}} \tag{2}\]  
Nonetheless, we encounter two problems using the above quantitative description in practical application. That is, (1) when a commodity has many designs, its image has abundant local and global contour features. At this condition, the \(\eta\) of every frame are similar to each other, so the global and local features cannot be completely divided by \(\eta\). (2) When mean gradient is used to measure the image quality, the mean gradient of frames without complicated designs is similar to the value of frames that lack the main object, and these frames may be misclassified into low-quality.