|
对应一组图像而言,图像分类应用较为广泛,如何选取特征很关键:
- FeatureVector := []
- * Compute features.
- gen_sobel_features (Image, FeatureVector, FeatureVector)
- * Downscale the image (image pyramid) and compute features.
- zoom_image_factor (Image, Zoomed1, 0.5, 0.5, 'constant')
- gen_sobel_features (Zoomed1, FeatureVector, FeatureVector)
- * Uncomment lines to use further pyramid levels:
- zoom_image_factor (Zoomed1, Zoomed2, 0.5, 0.5, 'constant')
- * gen_sobel_features (Zoomed2, FeatureVector, FeatureVector)
- * zoom_image_factor (Zoomed2, Zoomed3, 0.5, 0.5, 'constant')
- * gen_sobel_features (Zoomed3, FeatureVector, FeatureVector)
- * zoom_image_factor (Zoomed3, Zoomed4, 0.5, 0.5, 'constant')
- * gen_sobel_features (Zoomed4, FeatureVector, FeatureVector)
- FeatureVector := real(FeatureVector)
复制代码 gen_sobel_features如下:
- * Coocurrence matrix for 0 deg and 90 deg:
- cooc_feature_image (Image, Image, 6, 0, Energy, Correlation, Homogeneity, Contrast)
- cooc_feature_image (Image, Image, 6, 90, Energy, Correlation, Homogeneity, Contrast)
- * Absolute histogram of edge amplitudes:
- sobel_amp (Image, EdgeAmplitude, 'sum_abs', 3)
- gray_histo_abs (EdgeAmplitude, EdgeAmplitude, 8, AbsoluteHistoEdgeAmplitude)
- * Entropy and anisotropy:
- * entropy_gray (Image, Image, Entropy, Anisotropy)
- * Absolute histogram of gray values:
- * gray_histo_abs (Image, Image, 8, AbsoluteHistoImage)
- * Add features to feature vector:
- FeaturesExtended := [Features,Energy,Correlation,Homogeneity,Contrast]
- FeaturesExtended := [FeaturesExtended,AbsoluteHistoEdgeAmplitude]
- * FeaturesExtended := [FeaturesExtended,Entropy,Anisotropy]
- * FeaturesExtended := [FeaturesExtended,AbsoluteHistoImage]
复制代码 金字塔式的纹理特征求解;
|
|